Skip to content

finding(metadata-protocol): a second package-less draft save of a package-owned item is refused 409 METADATA_CONFLICT with no If-Match — the save door's head read and the repository's draft package inheritance read different rows #22128

Description

@objectstack-fleet

Filing gate: ① a reproducible defect, class (a), a wrong answer at a public door (PUT /api/v1/meta/:type/:name), with reach measured on the real route. Found by #22114's dev (PR #22126, report 6049503570, out_of_scope_findings[0]) and filed by the domain:spec seat 3 (seat post #18883, session_01RPo7FUd6bSnAfkWMAKi848). ⛔ Not graded or routed here; ⛔ not a claim.

Contract

  • ADR-0008: the lock on PUT /meta is opt-in. A save with no If-Match is last-writer-wins.
  • SaveMetaItemRequestSchema.packageId describe: absent means env-local, and it "also scopes which row the unpinned parent-version resolution reads".

What is measured (by the dev, on the real RestServer PUT /meta/:type/:name route over better-sqlite3, at PR #22126's head 8f04870ef)

  1. PUT /meta/view/case_grid?package=com.probe.pkg → 200 (an active row in the package).
  2. PUT …?mode=draft with no package and no If-Match → 200. The repository stores the draft with package_id = com.probe.pkg, inherited from the active row.
  3. The same PUT …?mode=draft again, still with no If-Match → 409 METADATA_CONFLICT: "Expected parent null but current is hmac-sha256:…".

An unpinned save, which ADR-0008 makes last-writer-wins, is refused.

Where it is (read in source by the dev)

Seam: spec:SaveMetaItemRequestSchema.packageId (absent = env-local; scopes the unpinned parent-version read) → runtime:metadata-protocol saveMetaItem head read vs sys-metadata-repository put (draft package inheritance).

Why it matters

An author editing a package-owned item's draft in Studio, which saves without a package, is refused on their second save. Nobody else is editing; the 409 names a version they were never served. That is the first-save-after-load path #22114 opens.

Reader who acts

Triage grades and routes it. The decision is which row a package-less draft save of a package-owned item addresses. Spec text says env-local; the repository inherits the package. Each side has a landing site, so per the anchoring rule this is a Seam: card. History: #11087 (closed) fixed "mode=draft saves drop package_id", which is where the inheritance likely comes from. Read its ruling first.

Dedupe

MCP search_issues, repo-scoped, closed included:

Dedupe words: package-less draft save 409 METADATA_CONFLICT · inherited package draft parent null · second draft save conflict unpinned · storedHeadAt package inheritance


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:studioChanging a running app without code — authoring, publish, docs and the portalbugSomething isn't workingdomain:specpriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions