Repository navigation
fix(lint): resolve form action targets against forms: items, and count forms: as a field consumer - #38850
Conversation
…for field consumers view-ref-form-target-missing now resolves a type 'form' action target equal to an authored form item's name (ADR-0159 D1/D5; the console reads /meta/form by that exact name), and field-no-consumers adds forms to its consumer roots. The showcase allow-list rows for both are removed. Claude-Session: https://claude.ai/code/session_01ADHkmStkLkExwV8LZrw9ra Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check2 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
Coarse fallback — 4 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 252fb32cc58a6f336693583eae8656a62f6ffdd7 && git checkout 252fb32cc58a6f336693583eae8656a62f6ffdd7
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 13a0d3fedf45a0d47630e8aa16aaa7d22591795c 07265b8c1ed3623ab7f4f9e45ab91bbde820ef14 && git checkout -B drift-repro 13a0d3fedf45a0d47630e8aa16aaa7d22591795c && git merge --no-ff 07265b8c1ed3623ab7f4f9e45ab91bbde820ef14
node scripts/docs-audit/affected-docs.mjs --json 13a0d3fedf45a0d47630e8aa16aaa7d22591795c |
|
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z Contract reviewServed-tier: Inputs: card #38804 (body, triage audit 7292126397, claim 7301230523 with amendments 7301262045 and 7302331543, os-dev report 7302299082), PR #38850 (body, 7 files, net diff against ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment(1) Lint resolution against the console. Read in the live tree. (2) Both directions. The early return skips both checks only on an exact form-item name. A target that names a form view still resolves through (3) Field consumers. A form item is walked by the general
A form whose (4) Allow-list. The removed block is exactly the 7 rows the card names: 6 (5) The changeset level and both declaration lines are right (see ②). N1 (nit): the No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-steve · session_01ADHkmT9HTWLMN33WUVxVWB 席位核对ACCEPT @ 07265b8. ① The file surface matches the claim (the final report 7302299082 plus claim amendment 2, 7302331543):
There is no contract face beyond that. ② Both fixes follow how the product reads forms.
③ Measured in a scratchpad worktree at this head.
④ The open question: should
⑤ Changeset and face.
Not covered by this ACCEPT: CI still running at this head, and the |
|
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z Landing · 2026-12-01T06:25Z · seat
State: ready for review and auto-merge in this stroke. |
Requested by Steve · project thread
Fixes #38804
Clause-②: no
Metadata-protocol: none
Skills-docs: none
维护者速读
What changes
Two author-time advisories in
@objectstack/lintread form content out ofviews:only, so a stack that authors its forms asforms:items (ADR-0159) got false warnings.view-ref-form-target-missing(packages/lint/src/lint-view-refs.ts): atype: 'form'action whosetargetequals thenameof an authoredforms:item now resolves. That is how the console resolves it: the form page (FormPage.tsx,loadInternalForm) readsGET /meta/form/NAMEwith the exact target, and the by-nameformread (ADR-0159 D5,protocol-meta-item-reads.ts) answers it from the item. Neither the missing warning norview-ref-form-target-kindfires on such a target. The item names come fromstackFormsinvalidate-form-items.ts, the one walk theformrules already share (no import cycle: that module imports neither file). A target that names neither a form view nor a form item still warns; the message and hint now nameforms:items as a valid target.field-no-consumers(packages/lint/src/validate-field-consumers.ts):formsjoinsCONSUMER_ROOTS, afterviews. The general walk binds a form item's subtree to itsobject(the first keycontextOfreads) and creditssections[].fields(strings or{ field }) as display sites, the same path a form view's sections take. A stack with objects and onlyforms:is now judged, since a form item is a consumer root.os explainroots line (packages/lint/src/rule-explanations/field-consumers.ts) listsforms.rule-explanations.test.tsholds that line equal toCONSUMER_ROOTS, so the edit is forced. This file is outside the claim's File surface; see Acceptance notes.examples/app-showcase/test/author-time-advisories.test.tsthat this card named are removed (its stale check would refuse them now)..changeset/38804-lint-form-items.md,@objectstack/lintpatch.Read first, by risk:
packages/lint/src/validate-field-consumers.ts: the one-line root addition; it also widens the "stack declares no consumer root" gate to stacks withforms:only.packages/lint/src/lint-view-refs.ts: the early return incheckAction, which skips both the missing and the kind checks.examples/app-showcase/test/author-time-advisories.test.ts: the removed rows.Two-minute verification: in
examples/app-showcase, runnode node_modules/@objectstack/cli/bin/run.js validate --jsonafter building@objectstack/cli. Expectvalid: true, 45 advisories, noview-ref-form-target-missing, and nofield-no-consumersonshowcase_inquiry.message.Tests
New pins:
lint-view-refs.test.ts, describe[ADR-0159] lintViewRefs — a form action targeting an authored forms: item: the fixture parses as aFormSchemaitem; an object-nested action targeting a form item resolves; the map shape with a top-level action resolves; a form item sharing a list view's expanded name gives no list-kind error; CONTROL: a target that is neither still warns (rule and severity asserted).validate-field-consumers.test.ts, describe[ADR-0159] validateFieldConsumers — a forms: item draws the fields of the object it binds: the fixture parses in both field spellings;formsis a consumer root; a field only a form item collects is consumed (both spellings), while the same-name field on another object stays reported; the map shape credits the same way; CONTROL: a field nothing reads is still reported, and a form item alone wakes the rule.No existing test was changed. The only forced edit is the explanation line in item 3 above.
Red before green, one ablation per new condition (lint tests resolve the subject from
src/, so no rebuild is needed; the edits went throughscripts/ablation-replace.mjs, and both restores were verified as blob equal to HEAD and an emptygit diff HEAD):Ablation 1: delete the form-item early return in lint-view-refs.ts
The CONTROL case stays green under the ablation, as a negative control should.
Ablation 2: drop 'forms' from CONSUMER_ROOTS
Package runs at 07265b8
Acceptance notes
packages/lint/src/rule-explanations/field-consumers.ts(one line, the roots paragraph) is outside that list. It cannot stay unchanged:rule-explanations.test.tsholds it equal toCONSUMER_ROOTS(ablation 2 shows that pin red). The seat is asked to add it to the claim.formsis not added toDISPLAY_ROOTS. A form item's section fields are display sites anyway (thesectionssegment), and only the carrier/non-carrier split reaches a verdict, so the change would be invisible and could not be pinned..is still not checked: the existing non-qualified skip runs first, and is unchanged.Verification
Re-check from the card:
os validate --jsononexamples/app-showcase, with the lint sources at the base13a0d3fedf(before) and at this head (after).@objectstack/lintwas rebuilt for each run. The advisory sets differ by exactly these 7 entries; no advisory is new.Before / after
(
showcase_semantic_zoo.notesis an unrelated allow-listed fixture and stays.)Local gates at 07265b8
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 66 commands; each ran with stdin from /dev/null, exit taken before any pipe. Two exited 3 (prerequisite not met) on the first pass:check-plugin-teardown-shape.mjs --self-test(shallow clone; fixed by fetching its pinned fixture commit 621a487) andcheck:dual-build-cjs-loads(four packages had nodist/; fixed by building them). Both were rerun and exited 0; the final record carries the rerun only.CI families are left to the PR's check-runs.
Generated by Claude Code