Repository navigation
fix(lint): warn when a context pack reads an injected column with no storage on an external object - #37699
Conversation
…storage on an external object ai-context-field-unprovisioned joins validateAiContext: a name in a pack's fields, body.field, or a related entry's fields, where, orderBy or link that resolves only as an injected system column of an ADR-0015 external object. Provenance is unprovisionedInjectedColumnsFor, the spec derivation every unprovisioned-anchor rule reads. os explain gains the new entry and ai-context-field-unknown's text says injected columns count as defined. The service-record-context injected-column executor pins move into the shared harness as a top-level describe, with a sys_* root related-list link pin beside them. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc
…al bound Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc
📓 Docs Drift Check5 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. 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 9440da95de44b93cbc1fa4ebd1b2fda27cbee22e && git checkout 9440da95de44b93cbc1fa4ebd1b2fda27cbee22e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9476092c7ee64915749c2146a9ecbe5e139a7126 3551f0736f8e2485e2bc6b3ac45f780d189a5380 && git checkout -B drift-repro 9476092c7ee64915749c2146a9ecbe5e139a7126 && git merge --no-ff 3551f0736f8e2485e2bc6b3ac45f780d189a5380
node scripts/docs-audit/affected-docs.mjs --json 9476092c7ee64915749c2146a9ecbe5e139a7126 |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc
|
repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc Test UI (2/16) on head This PR's tree does not reach that test. The diff is |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 3551f07 · 2026-11-26T22:27Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: Inputs read: card #37432 body and all 6 comments (claim 7202779669, amendment 7203965629, scope note 7182743879, os-dev-report 7203921910), the PR #37699 body and its 7-file list, ① Derived judgmentsThe diff makes these accept-set and public-surface changes:
Findings:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
|
repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc Landing: ACCEPT 7204800437 (contract record 7204792725, PASS) at head
Status: ready + auto-merge (merge queue). On MERGED, #37432 closes by |
Fixes #37432
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
validateAiContext(packages/lint/src/validate-ai-context.ts) gainsai-context-field-unprovisioned, awarning. It fires where a pack names an injected system column of an ADR-0015externalobject. It covers every place the rule reads a field map: the root'sfields,body.field, and eachrelatedentry'sfields,where,orderByand link field (named or implied). Each object is judged by its own provenance, throughunprovisionedInjectedColumnsFor(system-fields.ts), the spec derivation every other unprovisioned-anchor rule reads. No second copy of the predicate exists. The message is the shared short clause (unprovisionedAnchorVerdict) plus a consequence for the position, and the fix is the sharedunprovisionedAnchorFix. A column the author declares on the external object is never judged.body.fieldon an injected column keeps itsai-context-body-not-long-textfinding, and the new warning is added beside it. No injected column is long text, so both findings always appear together, and each one states an independent fact.os explain: a newai-context-field-unprovisionedentry (shared cause paragraph, cost by position, shared remedy). Theai-context-field-unknownentry is rewritten to say that injected columns count as defined, that a column the platform does not inject is still unknown, and that the external case belongs to the new id. The new id is exported from@objectstack/lintand joins the two anchor-id lists in theUNPROVISIONED_ANCHOR_*doc comments.service-record-context:injected-system-columns.test.tsis folded intorecord-context-tools.test.tsas a top-level describe. All three cases are kept, and the separate file is deleted. Per the card's scope note (comment 7182743879), one nested describe pins link resolution on asys_*root, where the child carries injectedsys_userreferences: a namedowner_idorcreated_byis the link and reads its own rows; with no name, the three injected references leave the list out silently; a door serving declared fields alone has no link.Tests
packages/lint/src/validate-ai-context.test.ts: a new describe with 7 cases. The warning appears at all five paths on an external root and child. The same pack on non-external objects is clean. An external child under a local root is judged per object. An author-declared column is not judged.body.fieldgets both findings. A related list linked through an external child's injectedowner_idis reported. The explain entry is checked for its named facts. There is also an explain check forai-context-field-unknown, and the new id joins the "every emitted id has an explain entry" list.packages/services/service-record-context/src/__tests__/record-context-tools.test.ts: the folded describe (3 original cases plus 4 link cases).Acceptance notes
validate-ai-context.ts, the link hunk (thelinkresolution rewritten from an earlyreturninto a value, the only reshaped control flow); (2) the same file, the body hunk (two findings on one path); (3)rule-explanations.ts, the two ai-context entries.skills/objectstack-ai/references/context-packs.mdhas a table of the ai-context rule ids. No gate reads that table, and it does not list the new id. Carrier: the area seat.where/orderBy/ link consequences in the messages ("no rows", "an arbitrary order") repeat the siblings' measured readings (page-field-unprovisioned,sort-field-unprovisioned). They were not measured again forget_record_contextover a remote table.Verification
Two-minute check:
pnpm --filter @objectstack/lint exec vitest run src/validate-ai-context.test.ts. Expected: 30 tests pass, including the describe "an injected column with no storage on an external object (ADR-0015)".Local runs at 30b09f6
pnpm --filter @objectstack/lint typecheckandvitest run --maxWorkers=2: Test Files 239 passed (239), Tests 9707 passed | 5 skipped (9712); lock VERDICT command-exit 0.pnpm --filter @objectstack/service-record-context testandtypecheck: Test Files 3 passed (3), Tests 178 passed (178); lock VERDICT command-exit 0.Ablation (one, on the provenance call)
node scripts/ablation-replace.mjsreplaced(anchors = unprovisionedInjectedColumnsFor(objects.get(object)))with(anchors = new Set...). The anchor count went from 1 to 0 and the blob from 67957ee3b5f5 to 7fa2a74d5075. Thenvitest run src/validate-ai-context.test.tsgave Tests 4 failed | 26 passed (30). The four red cases were the external-root warning, the per-object case, the body case and the link case, and the non-external clean case stayed green. After restore the blob equals HEAD (67957ee3b5f5) andgit diff HEADis empty. The test imports the source by a relative path, so no dist rebuild was needed.Generated by Claude Code