Skip to content

docs(spec): RuntimeAuthoringIssueSchema.path states the name-keying rule for every collection-resident write type - #22784

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-22759-issue-path-name-keyed
Oct 11, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-22759-issue-path-name-keyed

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #22759
Clause-②: no

What changed

RuntimeAuthoringIssueSchema.path (packages/spec/src/api/protocol.zod.ts) is the describe of the path on a runtime publish-gate finding, on both the 422 issues[] and the 2xx advisories[]. It named object / permission / book as the only collection-resident write types and called every other write type positional. A dataset write's findings have been name-keyed too since #19143.

The describe now states the rule instead of a list, per triage's grade 6105640249 under ruling 6104584601 on #22636:

  • a collection-resident write type is one whose collection the gate's private per-write snapshot fills with the tenant's other stored items beside the written one, and there the top-level entry is keyed by NAME;
  • every other write type is the sole member of its own collection in that snapshot, so its [0] stays positional;
  • the members are derived, not listed. The text names where they are derived: @objectstack/lint's runtime gate, NAME_KEYED_STACK_KEYS, the collections it carries as resolution context that a gated write type also lands in. There is no import of lint into spec. The only members the text names are two examples marked for example (object, dataset).

The true sentences are kept: the submitted-body framing, the empty path, and nested positions staying positional. One sentence is added because "never by an array index" was not true without it: nameKeyFindingPath keeps the index when the entry's name cannot be spliced into a dotted path.

Describe text only. No schema shape, accepted value, default or type moves. content/docs/references/api/protocol.mdx is regenerated by gen:docs, the one artifact check:generated proved stale. The changeset .changeset/22759-runtime-authoring-issue-path-rule.md is a patch for @objectstack/spec.

Readings (at origin/main e84aeb36ce, the merge base; origin/main has not moved since)

The old text. protocol.zod.ts:560–:571: "For the collection-resident write types (object / permission / book) the TOP-LEVEL collection entry is keyed by NAME … Every other write type is the sole member of its own collection, so its [0] is trivially stable and stays positional (flows[0]...)".

The derived set. packages/lint/src/runtime-gate.ts:905 derives NAME_KEYED_STACK_KEYS = deriveNameKeyedStackKeys(CONTEXT_STACK_KEYS, WRITTEN_STACK_KEYS) (:796, :550, :845). At e84aeb36ce it is objects, permissions, books, datasets. The write types that map into those keys (TYPE_TO_STACK_KEY, :94; dataset: 'datasets' at :146) are object, permission, book and dataset.

  • page is NOT in the set today. The packages/lint changelog (CHANGELOG.md:5287) records pages joining it, but it left again when pages left the context with validateViewPageRefs. runtime-gate.derived-name-keys.test.ts:53–:68 pins ['objects', 'permissions', 'books', 'datasets'], and its comment records the pages exit.
  • Pins: runtime-gate.dataset-writes.test.ts:310 expects datasets.acme_invoice_metrics.dimensions[0].field, and :313 refuses datasets[N]. runtime-gate.derived-name-keys.test.ts:85 asks, for each context collection, that it is name-keyed exactly when a write type maps into it. Both files ran green here: 2 files, 29 tests.

Is "every other write type is the sole member of its own collection" still true? Yes, for all 17 gated write types. They are the union of runtimeTypes over AUTHORING_RULES. Measured by driving buildRuntimeWriteSnapshots and nameKeyFindingPath from packages/lint/src, with every context collection filled:

write type stack key members in the candidate wire spelling
object objects 3 name-keyed
permission permissions 2 name-keyed
book books 2 name-keyed
dataset datasets 2 name-keyed
action, app, dashboard, datasource, email_template, flow, hook, mapping, page, position, report, seed (key data), view own key 1 positional

agent is mapped in TYPE_TO_STACK_KEY but no rule declares it in runtimeTypes, so the gate dispatches nothing for it. Its snapshot collection would also hold one member.

The family (Zone 2 item 4)

git grep over packages/spec and content/docs for the closed list (object / permission / book), the "sole member" sentence, "collection-resident", "trivially stable" and the objects.acme_invoice example:

  • In packages/spec, edited: one hit, this describe (protocol.zod.ts:560–:571).
  • In packages/spec, not edited: packages/spec/CHANGELOG.md:31982, the released entry for commit def0d3e. It is release-owned and accurate about what shipped then.
  • Generated: content/docs/references/api/protocol.mdx. The describe appears three times (:2371, :2597, :2651), all regenerated.
  • Outside packages/spec, reported only, nothing wrong:
    • packages/lint/src/runtime-gate.ts:612–:617 already names dataset beside the other three.
    • packages/lint/src/validate-security-posture.runtime-surface.test.ts:168 is a historical note about the card that declared those three types for that rule block.
    • authoring-rules.ts:202, data-model-rules.ts:66 and scripts/bench/runtime-publish-gate.bench.mts:495 use objects.… as an example, not a list.

The pin: not added

No spec test holds the describe free of a closed list. The new text carries no enumeration whose membership can drift. Its two members are marked examples, and both stay true while objects and datasets are context collections a write lands in. The set itself is already pinned where it is derived (runtime-gate.derived-name-keys.test.ts). A spec-side test could only assert that one particular string is absent, which guards against re-adding exactly this list and nothing else. A cross-package pin would have to enumerate the members, which is the closed list the ruling refuses.

Verification (head 498abe794e)

  • pnpm --filter @objectstack/spec build: exit 0. Then check:generated named check:docs stale. gen:docs rewrote only api/protocol.mdx (+3/−3).
  • pnpm --filter @objectstack/spec check:generated: "✓ All 14 generated artifacts are up to date". check:docs: "✅ 225 generated files in sync with packages/spec".
  • vitest run --project local on @objectstack/spec: 645 files passed, 19222 tests passed, 1 todo.
  • pnpm --filter @objectstack/spec typecheck: exit 0. check:test-typecheck OK.
  • dispatch-gates --commands --repo objectstack-ai/objectstack (3 paths) printed 103 commands. The full tally is in the report on the card.
    • Not run: check:dual-build-cjs-loads, by dispatch (no whole-workspace build).
    • NOT MEASURED, prerequisite builds outside this diff's closure, left to CI:
      • check:skill-examples needs client-react built;
      • check:lean-entry-closure needs objectql built.

Acceptance notes

  • At-tier review: the accept set does not move. The diff touches one .describe() string, its generated rendering and a changeset. No governed surface is touched.

Generated by Claude Code

The path describe named object / permission / book as the only
collection-resident write types and called every other write type
positional; a dataset write's findings are name-keyed as well. State the
rule (a write type whose collection the gate's per-write snapshot fills
with the tenant's other stored items is keyed by name) and name where the
derived set lives, instead of a closed list that drifts.

Describe text only; the accept set does not move.

Claude-Session: https://claude.ai/code/session_01KNKBCRDJCu5tGy3TEbvtrF
Co-authored-by: Claude <noreply@anthropic.com>
Generated by `pnpm --filter @objectstack/spec gen:docs`, the one artifact
`check:generated` proved stale.

Claude-Session: https://claude.ai/code/session_01KNKBCRDJCu5tGy3TEbvtrF
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling labels Oct 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • the SDK route bridge reached 54 of 206 client-bound route-ledger rows — the other 152 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 152: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 97 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 139 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json e84aeb36ce14169a633670f14ce8280fc998e2b9 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 4a7f92f9982ba78ea95d439e6161626bb17ce1f8 — the merge of head 498abe794e4e7f51645c75737cc9716e6d67c126 into base e84aeb36ce14169a633670f14ce8280fc998e2b9, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 4a7f92f9982ba78ea95d439e6161626bb17ce1f8 && git checkout 4a7f92f9982ba78ea95d439e6161626bb17ce1f8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e84aeb36ce14169a633670f14ce8280fc998e2b9 498abe794e4e7f51645c75737cc9716e6d67c126 && git checkout -B drift-repro e84aeb36ce14169a633670f14ce8280fc998e2b9 && git merge --no-ff 498abe794e4e7f51645c75737cc9716e6d67c126

node scripts/docs-audit/affected-docs.mjs --json e84aeb36ce14169a633670f14ce8280fc998e2b9

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 498abe794e4e7f51645c75737cc9716e6d67c126
Local-runs: none

Read-only review of PR #22784 at the head above, for card #22759 (filed under ruling 6104584601 on #22636). Inputs: the card body and its comments (6105640249, 6106102177, 6106333502, 6106348302), that ruling, the PR body, the net diff origin/main...498abe794e (merge base e84aeb36ce), packages/lint/src/runtime-gate.ts and packages/lint/src/runtime-gate.derived-name-keys.test.ts on origin/main (a2e94c2a05; runtime-gate.ts is byte-identical at the merge base and at origin/main), and the head's check-runs. Nothing was built, run or re-run; git reads and REST GETs only. The seat's own conclusions were not used as inputs. Line numbers below are runtime-gate.ts on origin/main unless another file is named.

① Derived judgments

1. Describe only — holds. The net diff is 3 files, +35 / −12. In packages/spec/src/api/protocol.zod.ts every changed line is a string-continuation line (+ '…') inside the .describe( call of RuntimeAuthoringIssueSchema.path (:560–:582 at the head); filtering those lines out of the hunk leaves nothing, the non-string lines of the schema window are identical on both sides, and the file's export count is unchanged. No shape, type, default, refinement or export moves. content/docs/references/api/protocol.mdx is +3 / −3: the three path rows of the RuntimeAuthoringIssue tables (:2371, :2597, :2651) and nothing else. Rebuilding the describe string from the head's source (concatenating the literals, unescaping the quotes) gives 1320 characters that equal each of the three rows byte for byte. git grep for the old sentence on origin/main hits exactly one checked-in file besides the source, that .mdx; on the head it hits none, and the new sentence hits only the .mdx. So the generated reference is the whole checked-in release-text surface here, and it is regenerated. origin/main moved two commits past the merge base (.changeset/22658-skills-package.md, .changeset/config.json); neither touches a file this PR touches.

2. The text is true against the gate on origin/main, sentence by sentence.

  • Unchanged sentences (the submitted-body framing, the empty path): carried over verbatim from the old text.
  • "The gate evaluates against a private per-write snapshot whose indexes no caller can resolve": buildRuntimeWriteSnapshotSet (:677–:722) builds in-memory baseline / candidate records per write; nothing hands them to the caller.
  • The derivation — "a collection-resident write type is one whose collection that snapshot fills with the tenant's other stored items beside the written one, and there the entry is keyed by NAME": the snapshot loop (:692–:716) iterates CONTEXT_STACK_KEYS (:550, derived from CONTEXT_STACK_KEY_ORDER :529–:534: objects, permissions, books, datasets); when the written type's stack key is one of them, baseline[key] is the stored collection minus the written name (:711) and candidate[key] is those siblings plus the item (:718). The name-keyed set is NAME_KEYED_STACK_KEYS (:905) = deriveNameKeyedStackKeys(CONTEXT_STACK_KEYS, WRITTEN_STACK_KEYS) (:796–:802: the context keys that some written key equals), with WRITTEN_STACK_KEYS (:845) the values of TYPE_TO_STACK_KEY (:94–:267). The test pins the result to ['objects', 'permissions', 'books', 'datasets'] (derived-name-keys.test.ts:63–:68) and, per context collection, that the top-level index is rewritten exactly when a write type maps into it (:84–:100). "A collection the context fills AND a write lands in" is both the code's derivation and the describe's definition.
  • The two marked examples: object maps to objects (:96) and dataset to datasets (:146); both keys are in CONTEXT_STACK_KEY_ORDER, so both are name-keyed. nameKeyFindingPath (:945–:955) rewrites only the top-level key[N] (TOP_LEVEL_INDEX :918, built anchored at the start of the path, :831) and appends the remainder unchanged, so datasets.acme_invoice_metrics.dimensions[0].field is the shape a datasets[N].dimensions[0].field finding leaves with. Both examples carry "for example".
  • "Every other write type is the sole member of its own collection in that snapshot, so its [0] IS the written item and stays positional": for a stack key outside CONTEXT_STACK_KEYS the loop never fills it, siblings is [] (:717) and candidate[stackKey] is [item] (:718), so index 0 is the item; nameKeyFindingPath returns such a path unchanged (:949). An unmapped type yields no snapshot at all (:680–:681), so no path leaves the gate for it. The test pins flows[0].name as positional (:106–:113). True for every write type the gate can emit a path for.
  • "derived, never listed: @objectstack/lint's runtime gate computes the set (NAME_KEYED_STACK_KEYS) as the collections it carries as resolution context that a gated write type also lands in": the constant and the derivation are as read above; ③ carries the one precision note ("gated" versus "mapped").
  • The fallback — "An entry whose name cannot be spliced into a dotted path keeps its index": nameKeyFindingPath returns the path unchanged when the entry's name is not a string or fails PATH_SAFE_NAME (:916, :953); a missing or unnamed entry has no name to splice, so the sentence covers the gate's own docblock cases (:937–:938). The rewrite is applied to every finding that leaves the gate, errors and advisories alike (:1147–:1154), which is the 422 issues[] and the 2xx advisories[] the PR body names.
  • The nested positions — "stay positional (objects.acme_invoice.indexes[1])": the rewrite touches the top-level index only and carries the rest verbatim (:954), and the pattern is anchored at the start of the path, so a nested [N] is never rewritten.

No sentence is false and none claims more than the code does for any path a caller can receive. The old text's unqualified "never by an array index" was false (the fallback existed and was undocumented); the new text states the fallback.

3. No new closed list — holds. The four members are never enumerated. The only write types named are object and dataset, each inside a "for example" parenthetical, and flows[0]... is marked the same way. The set is pointed at by its derivation and its constant, not copied. page is not named and is not a member (the test's comment :54–:59 records its exit with validateViewPageRefs), so the card's "every write type NAME_KEYED_STACK_KEYS makes name-keyed" is met by the rule statement, not by a list.

4. The changeset — holds. .changeset/22759-runtime-authoring-issue-path-rule.md: '@objectstack/spec': patch, Clause-②: no, a body stating description-text-only, the derivation, the fallback and the regenerated reference — each sentence matches the diff. The PR body carries the same Clause-②: no. No tracker number in the describe text. No model identifier in the two commits, the PR body or the changeset; the commit trailers are the model-free pair.

5. CI on the head. Read at 2026-10-11T06:47:57Z: 32 check-runs, none failed, none cancelled. Against the seven required contexts of the main ruleset: Governed Surface Queue Guard success; Build Core success; Lint & Repo Gates still running; Temporal Conformance (live PG + MySQL) still running; Test Core is the aggregate of six shards (all six still running; the aggregate's check-run not yet created); Dogfood Regression Gate is the aggregate of three shards (1/3 and 2/3 success, 3/3 still running; aggregate not yet created); TypeScript Type Check is the aggregate of four lanes (source gates, debt ledger, consumer gates success; workspace still running; aggregate not yet created). Expected skips: Console Pin Gate, Packed-tarball smoke (opt-in). Every other advisory check is green. The queue re-runs the required set on the rebuilt generation, so the running ones are named here, not waited on.

② Semver level

patch for @objectstack/spec, Clause-②: no — correct. The accept set does not move: path stays z.string() with no refinement, default or type change; only .describe() text changes, which reaches the JSON schema's description and the generated reference and nothing a validator reads. Not a widening, not a narrowing.

③ Boundary flags

  • Governance: none of the three paths is a governed surface (packages/spec/src/**, content/docs/references/**, .changeset/**); head repo equals base repo; 3 files, +35 / −12. An ordinary queue landing once the required set is green; this record is the at-tier review the claim 6106102177 promised before enqueue. The PR is a draft with auto-merge unarmed — neither state is this review's act.
  • "gated" versus "mapped" — precision, not falsity: the derivation reads the VALUES of TYPE_TO_STACK_KEY, i.e. every mapped type, while the describe says "a gated write type". agent (:101) is mapped and ungated. The two readings coincide today (each of the four context keys is mapped from a gated type) and can part only if an ungated type were mapped onto a context collection, which the table's own rows refuse (:138, :154); an ungated write dispatches no rule and emits no path, so no reader of this field can observe the difference. Tolerable as written; a future edit to the gate's table should re-read this sentence.
  • objects is closure-narrowed: "the tenant's other stored items" is, for objects, the subset inside the written package's closure when a scope is supplied (narrowObjectsToPackageClosure, :693–:709). The sentence defines a category, not a collection's membership, and the narrowing changes no category. Noted, not held against the text.
  • A private identifier in public text: NAME_KEYED_STACK_KEYS is a non-exported const of @objectstack/lint (:905), named in a @objectstack/spec describe that ships to consumers. A rename in lint would stale this text and no gate would notice. The card asked for the derivation to be named and this is the cheapest true spelling; flagged so the next lint edit knows the text exists.
  • No spec-side pin for the describe, as the PR body states; the set itself is pinned where it is derived (derived-name-keys.test.ts). Accepted: a string-absence pin would guard against re-adding one literal and nothing else.

Implemented-by: claude/issue-22759-issue-path-name-keyed
Reviewed-by: session_01KNKBCRDJCu5tGy3TEbvtrF

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Landing pre-checks at 498abe794e, by the owning seat: all green, queued

domain:spec seat 3 (#18883) · zhuangjianguo · session session_01KNKBCRDJCu5tGy3TEbvtrF · 2026-10-11T07:35Z · holder of claim 6106102177 on #22759.

  • The review: contract review PASS 6106409844 names this head. It judges:

    • describe text only, with the accept set unmoved;
    • every sentence true against origin/main's runtime gate (deriveNameKeyedStackKeys, nameKeyFindingPath);
    • no new closed list;
    • the @objectstack/spec patch changeset with Clause-②: no.

    The seat's ACCEPT is 6106348302.

  • CI: 35 check-runs, 33 success and 2 skipped. check-expected-skips --pr 22784 reads both skips in the roster.

  • Governed: check-governed-merges --pr objectstack-ai/objectstack#22784 reads NOT governed, +35 / −12.

  • Closing keywords: the body carries Fixes #22759 alone, and no commit message carries one.

  • main drift since the merge base e84aeb36ce: main (now 9f5eca52b3) moved none of the PR's 3 paths. Its one regenerated reference page is api/automation-api.mdx, not this PR's api/protocol.mdx, and it does not touch protocol.zod.ts. So there is no generated drift, and landing rule A owes no sync. GitHub reports mergeable: true, clean.

pr_ready and automerge_enable follow.


Generated by Claude Code

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

Labels

documentation Improvements or additions to documentation size/s tooling

Projects

None yet

2 participants