Skip to content

Commit 2ee5861

Browse files
docs(spec): the form.sharing and formViews liveness rows quote the code as it reads now (#24296)
Fixes #24063 Clause-②: no Two evidence strings in `packages/spec/liveness/view.json` quoted code that `main` no longer has. This PR rewrites them to cite the code as it reads now. Both verdicts were right and stay `live`. This is the dispatched card under claim `6248142626`, with `main` at `d537a318b3` (the base of this branch; `origin/main` was re-fetched before this PR and had not moved). ## What changes | row | quoted before (base `d537a318b3`) | cited now | |---|---|---| | `form.sharing` | `slugMatchesPublicLink(sharing.publicLink, slug)` | `packages/rest/src/form-routes.ts#findPublicFormView`, quoting `for (const c of anonymousFormIntakeCandidates(view))` and `if (c.slug !== slug) continue;` · `packages/spec/src/ui/anonymous-form-intake.ts#anonymousFormIntakeCandidates`, which hands each form's `sharing` to `anonymousFormIntakeSlug` (the nested `form`, every `formViews` entry, and the flattened `config` of a `viewKind: 'form'` item) · `packages/spec/src/ui/anonymous-form-intake.ts#anonymousFormIntakeSlug`, quoting the three key reads `if (s.enabled !== true) return null;`, `if (s.allowAnonymous !== true) return null;`, `if (typeof s.publicLink !== 'string' \|\| !s.publicLink) return null;` · `packages/rest/src/form-routes.ts#resolveFormBySlug` (kept) | | `formViews` | `const formViews = view.formViews` | `packages/spec/src/ui/anonymous-form-intake.ts#anonymousFormIntakeCandidates`, quoting `for (const [key, fv] of Object.entries(v.formViews)) forms.push({ form: fv, key });` · `packages/spec/src/ui/view.zod.ts#expandViewContainerWithDiagnostics` (kept, unchanged) | - The `sharing` text names all three keys the slug rule reads: `enabled`, `allowAnonymous` and `publicLink`. - **Rewording inside the rewritten `sharing` string, declared here:** the old `resolveFormBySlug` clause said that function "grants `publicFormGrant`". On `main`, `resolveFormBySlug` (form-routes.ts `:174`) only resolves the match. The grant is set in the submit door, `publicFormGrant: { object: match.object }` (`:549`), for the match `resolveFormBySlug` returns. The clause now says that. Its anchor and its identifiers are the same as before. - `formViews` does not cite `form-routes.ts`. That file names `formViews` 0 times at HEAD, so the liveness key-mention check would flag the citation. That is also why #24054 moved this row to `anonymous-form-intake.ts`. - `.changeset/24063-view-liveness-evidence.md`: a `patch` on `@objectstack/spec`. `liveness` is in that package's `files[]`, and #23621 / #24054 carried the same kind of changeset. ⛔ No verdict, key, note or other row changes. Checked on the parsed JSON: base `d537a318b3` and HEAD differ at exactly two paths, `.props.form.children.sharing.evidence` and `.props.formViews.evidence`. Both `verifiedAt` values stay as they are, because the card forbids key changes. ## Readings (each a count plus the tree it was taken against) Repository `objectstack-ai/objectstack`. Base `d537a318b3`, HEAD `e8dd32685`. - The two stale quotes, `git grep -n -F` over `packages`: at the base, each has exactly 1 hit, `view.json:356` (`slugMatchesPublicLink`) and `view.json:392` (`const formViews = view.formViews`). At HEAD there are 0 hits (exit 1). Positive control at HEAD: `findPublicFormView` in `packages/rest/src/form-routes.ts` gives 2 lines (exit 0). - A caution on this reading: the pathspec `packages/*/src` also answers 0 for `findPublicFormView`, which exists. A git pathspec glob has to match the whole path, so `packages/*/src` matches no file. The zero readings above use `-- packages`, with the control beside them. - The positions in E1 hold at HEAD: `const findPublicFormView = (` at `packages/rest/src/form-routes.ts:132`, `export function anonymousFormIntakeSlug(` at `packages/spec/src/ui/anonymous-form-intake.ts:74`, and `export function anonymousFormIntakeCandidates(` at `:84`. - Every anchor and every backticked fragment in the two rewritten strings was checked against the file its clause names, read with `git show HEAD:PATH`, by substring count. All 6 anchors are present. All 13 fragments occur at least once: each of the 7 quoted code lines occurs exactly once, and the 6 single words occur several times (`sharing` 10, `formViews` 6, `viewKind: 'form'` 2). Result: 0 misses. ## Which gate reads these citations (E2) `pnpm --filter @objectstack/spec check:liveness` (`packages/spec/scripts/liveness/evidence.mts#checkEvidenceAnchors`, plus `key-mention.mts`) resolves each repo-local `path#symbol` token. It checks that the cited file names the symbol as a word, and that every cited file names the row's key. It does **not** read backticked quotes. Those are checked only by the readings above, which is how both stale quotes survived a green gate. `check:spec-docblock-symbol-anchors` covers `packages/spec/src/**` doc prose only, not the ledger JSON. - Base `d537a318b3`: exit 0. `symbol anchors: 947 pointer(s) written path#symbol, 947 naming a symbol the cited file contains.` `key-mention anchoring: 737 (entry, cited file) pair(s) asked, 736 anchored, 1 exempt.` - HEAD `e8dd32685`: exit 0. `symbol anchors: 949 ..., 949 naming a symbol the cited file contains.` `key-mention anchoring: 738 ... pair(s) asked, 737 anchored, 1 exempt.` The deltas are +2 anchors and +1 pair: the `sharing` row now anchors two symbols in `anonymous-form-intake.ts`. - One-shot mutation, to prove the gate reads the new anchors. The fix was committed first. With `node scripts/ablation-replace.mjs` (wrap mode, trap-armed, absolute path), `#anonymousFormIntakeSlug (the slug rule` became `#anonymousFormIntakeSlugGone (the slug rule`. Result: `check:liveness` exit 1, with `949 pointer(s) ..., 948 naming a symbol ..., 1 UNRESOLVED` and `view/form.sharing → packages/spec/src/ui/anonymous-form-intake.ts#anonymousFormIntakeSlugGone`. Restore: the blob after restore equals the HEAD blob (`60737e436b96`), `git diff HEAD` is empty and `git status --porcelain` is clean. No permanent test was added. ## Tests and gates (all after the final commit, HEAD `e8dd32685`) - `pnpm --filter @objectstack/spec build` (verify lock): exit 0. - `@objectstack/spec` `vitest run --project local --maxWorkers=2` (verify lock): `Test Files 694 passed (694)`, `Tests 21027 passed | 1 todo`, exit 0. - `pnpm --filter @objectstack/spec typecheck` (verify lock): exit 0. No TS file imports a liveness ledger (`git grep` exit 1, with a positive control), and `tsconfig.json` includes `src/**` only. - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 62 commands from the merge base `d537a318b`. Of those, 60 exited 0. Two exited 3 with `PREREQUISITE NOT MET`, so they are **NOT MEASURED**: `pnpm check:dual-build-cjs-loads` needs every package's `dist/` (69 of 70 are absent in this worktree) and `pnpm check:lean-entry-closure` needs `packages/objectql/dist`. This narrowing is declared: the diff changes no build input of any package, and CI's `Lint & Repo Gates` runs both. `--ran` printed `62 derived famil(ies) accounted for — 60 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)`. - `check:nul-bytes`: exit 0. `check:skill-frame-freshness` (local-only): exit 0. `check:dev-prereqs` (local-only): exit 1, `The workspace is not built`. That is a reading of this worktree's state (only `packages/spec` is built), not of the diff. - No ablation: the diff changes ledger data and no tested behaviour. - The whole farm is CI's. The check-runs on this PR are the verdict of record. ## Acceptance notes - The `check:liveness` anchor check reads `path#symbol` and the key-mention check reads file-level mentions, but nothing reads a row's backticked quoted code. Both stale quotes here passed a green gate because the anchors still resolved. This is an observation only. Nothing is filed, and no gate is proposed. Carrier: none. - Both rows' `note` fields still carry superseded `rest-server.ts:NNNN` line pointers. Each note marks them itself as "superseded by the anchors". The card forbids note changes, so they stay. Carrier: none. - Both rows keep `verifiedAt: 2026-08-28`, although their evidence was re-read for this PR. The card forbids key changes. Carrier: none. --- _Generated by [Claude Code](https://claude.ai/code/session_019oFY6Hi35J7atvgVFnmoaK)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 21070a2 commit 2ee5861

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
The liveness ledger's `form.sharing` and `formViews` rows quote the code that reads their keys as it now reads
6+
7+
Clause-②: no (only the two rows' evidence text changes and both statuses stay `live`: `ViewSchema` accepts `form.sharing` and `formViews` exactly as before, and no state count moves)
8+
9+
- `liveness/view.json`, row `form.sharing`: the evidence quoted a `slugMatchesPublicLink(sharing.publicLink, slug)` call that no longer exists. It now cites `packages/rest/src/form-routes.ts#findPublicFormView`, which loops over `anonymousFormIntakeCandidates(view)`, and the two rules in `packages/spec/src/ui/anonymous-form-intake.ts` it reads: `anonymousFormIntakeCandidates`, which hands each form's `sharing` to the slug rule, and `anonymousFormIntakeSlug`, which reads all three keys (`enabled`, `allowAnonymous` and `publicLink`). The `resolveFormBySlug` clause now says where `publicFormGrant` is set: in the submit door, for the match that `resolveFormBySlug` returns.
10+
- `liveness/view.json`, row `formViews`: the evidence quoted `const formViews = view.formViews`, which no longer exists. It now quotes the line of `anonymousFormIntakeCandidates` that makes every `formViews` entry a candidate.
11+
- The verdicts, the notes and every other row are unchanged.

‎packages/spec/liveness/view.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@
353353
"sharing": {
354354
"status": "live",
355355
"verifiedAt": "2026-08-28",
356-
"evidence": "packages/rest/src/form-routes.ts#findPublicFormView (`slugMatchesPublicLink(sharing.publicLink, slug)` — scanned across `form` and every `formViews` entry); packages/rest/src/form-routes.ts#resolveFormBySlug (grants `publicFormGrant` for the matched form's object)",
356+
"evidence": "packages/rest/src/form-routes.ts#findPublicFormView (`for (const c of anonymousFormIntakeCandidates(view))` then `if (c.slug !== slug) continue;` — the public form doors serve only a candidate whose slug matches); packages/spec/src/ui/anonymous-form-intake.ts#anonymousFormIntakeCandidates (hands each form's `sharing` to `anonymousFormIntakeSlug`, across the nested `form`, every `formViews` entry and the flattened `config` of a `viewKind: 'form'` item); packages/spec/src/ui/anonymous-form-intake.ts#anonymousFormIntakeSlug (the slug rule reads all three keys: `if (s.enabled !== true) return null;`, `if (s.allowAnonymous !== true) return null;`, `if (typeof s.publicLink !== 'string' || !s.publicLink) return null;`); packages/rest/src/form-routes.ts#resolveFormBySlug (both doors resolve the match through it, and the submit door grants `publicFormGrant: { object: match.object }` for the matched form's object)",
357357
"note": "Framework-side consumer: public (anonymous) form endpoints opt in via FormView.sharing — /forms/:slug resolves sharing.publicLink across form + formViews (rest-server.ts:1716, :4366-4405) and grants publicFormGrant. Renderer-side the config is not read (audit L20) — the public form is served, not re-parsed client-side. 2026-08-28: RE-ANCHORED (commit 8f10a79f7) and REPOINTED — `:4384` had rotted onto a comment about `api`-only route enumeration, ~4,020 lines above the form endpoints; the note's own inline pointers (`:1716`, `:4366-4405`) had gone with it and are superseded by the anchors. Re-closed by hand against 8cb96ec41."
358358
},
359359
"submitBehavior": {
@@ -389,7 +389,7 @@
389389
"formViews": {
390390
"status": "live",
391391
"verifiedAt": "2026-08-28",
392-
"evidence": "packages/spec/src/ui/anonymous-form-intake.ts#anonymousFormIntakeCandidates (`const formViews = view.formViews` — every named form view is a public-link candidate); packages/spec/src/ui/view.zod.ts#expandViewContainerWithDiagnostics (flattens them into independent ViewItems)",
392+
"evidence": "packages/spec/src/ui/anonymous-form-intake.ts#anonymousFormIntakeCandidates (`for (const [key, fv] of Object.entries(v.formViews)) forms.push({ form: fv, key });` — every named form view is a public-link candidate); packages/spec/src/ui/view.zod.ts#expandViewContainerWithDiagnostics (flattens them into independent ViewItems)",
393393
"note": "Named form views. Framework: public-form slug resolution scans form + every formViews entry (rest-server.ts:4384-4405); expandViewContainer flattens them. objectui: MetadataProvider routes viewKind:'form' items into objectDef.formViews (never into the list switcher). Same inner shape as `form`; per-key classification lives under form.children. 2026-08-28: RE-ANCHORED (commit 8f10a79f7) and REPOINTED — `:4384` had rotted onto the same `api`-only comment its sibling `form.sharing` cited; the note's `rest-server.ts:4384-4405` range went with it. Re-closed by hand against 8cb96ec41."
394394
}
395395
}

0 commit comments

Comments
 (0)