Repository navigation
fix(lint)!: os build refuses a flow or hook condition that orders an injected column a stored row can hold null in, as the publish gate does - #34129
Conversation
…ed row can hold null in at os build, as the door does Claude-Session: https://claude.ai/code/session_01ADHkmS2qjQvEgMBSBQpeea Co-authored-by: Claude <noreply@anthropic.com>
…ured stamping; docs, ADR-0087 entry and changeset Claude-Session: https://claude.ai/code/session_01ADHkmS2qjQvEgMBSBQpeea Co-authored-by: Claude <noreply@anthropic.com>
…ed-keys meta-test Claude-Session: https://claude.ai/code/session_01ADHkmS2qjQvEgMBSBQpeea Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 21 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 3 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 173 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 9289119221ae3239f0d85e941727e0eefca32b3b && git checkout 9289119221ae3239f0d85e941727e0eefca32b3b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 2539ad9860a3e43323fcf35ac80ffee47c8dec3e 80b1edc6b4fffc19889c78faa4e86d754906c97e && git checkout -B drift-repro 2539ad9860a3e43323fcf35ac80ffee47c8dec3e && git merge --no-ff 80b1edc6b4fffc19889c78faa4e86d754906c97e
node scripts/docs-audit/affected-docs.mjs --json 2539ad9860a3e43323fcf35ac80ffee47c8dec3e
|
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head f1e07ba · 2026-11-15T20:38Z |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract reviewServed-tier: Inputs: card #33435 body and all six comments (claims 6899727412 and 6899772976, scope additions 6884889456, os-dev-report 6900991227, seat ruling 6901005939), the PR body and seven-file list, the net diff Check-runs on the head at review time (65 runs): 25 success, 10 skipped, 0 failed, 30 still in progress. In progress: ① Derived judgmentsAccept-set changes, read off the tree. All are narrowings; nothing widens.
Nothing outside the six columns plus the two timestamps is newly refused. The added set is An object that DECLARES one of the columns is treated as the author declared it. ② Semver level
③ Boundary flags
④ Design judgment
Agreement with the door, column by column. For the six columns under Where the build is still looser than the door: the timestamp residue listed in ③, and a hook or flow on an object the stack does not declare. Where it is stricter: the bare spelling in a flow (N1). Neither is new in kind. Producers in the live tree against the measured facts. S1 (should-fix) — The PR body, the changeset ( S2 (should-fix) — The Nits.
No must-fix. Implemented-by: VERDICT: PASS |
…nd scope the beforeInsert timestamp reason to hooks before the stamp (#33435) The MCP validate_expression tool at a flow condition and a publish-drafts batch carrying a draft of the flow's or hook's own object both judge the object as authored, so they now refuse the same unguarded ordering over an injected column the build does. The changeset and the ADR-0087 entry name both, and each gets a pin. The entry's reason, the changeset and the hooks page say a beforeInsert hook reads created_at / updated_at as null only when it runs before the stamp (priority below 10). The join's locals get names the #5017 meta-test cannot excuse elsewhere by accident. Claude-Session: https://claude.ai/code/session_01ADHkmS2qjQvEgMBSBQpeea Co-authored-by: Claude <noreply@anthropic.com>
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head 34790af · 2026-11-15T21:32Z |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract reviewServed-tier: VERDICT: PASS — delta review of Not run locally. The brief for this round asked for the two pin files and the ablation to be re-run; the container holds no installed dependencies, and a run needs a checkout, an install and a build, which the review's read-only shape rules out. The pins are judged by reading them and by the head's check-runs. The ablation is the author's reading, not mine. Check-runs on this head (72 runs): 57 success, 12 skipped, 2 failure, 1 in progress at first read ( ① Derived judgmentsThe accept set is what round 1 recorded: The two readers round 1 found unnamed are now named in the changeset's "What moves": MCP ② Semver levelUnchanged and still correct: ③ Boundary flags
④ Design judgment
S1 — closed. S2 — closed. Nit.
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (maintainer-limited fable quota, 2026-11-15T23:29Z) · head 80b1edc Merge-of-main review: origin/main ea6de74 merged into the reviewed head 34790af (r2 PASS 6901750290) under the K ≥ 15 landing rule. Per the card thread: no conflicts, no regen paths touched, the three-dot PR diff is byte-identical to 34790af (9 files, +413 −25, the same blob hashes), and the 111 derived gates all exit 0 (/mnt/project-files/spec-seat2/33435-gates-ran-r3.txt). |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 80b1edc · 2026-11-15T23:30Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-16T00:03Z. Merge delta review of this head against PASS 6901750290 at 34790af; claim: comment 6903210404; lane request 6903202361 on mailbox #33873. Independence: implemented in an os-steve project thread, dispatched by domain:spec#2 (os-steve); reviewed by os-tesla. Inputs: card #33435 body and its seven comments, the PR body and nine-path file list, the PR thread (records 6901107947 and 6901750290, hand-off 6903197702), ① Derived judgmentsNet-change equivalence, measured and not taken from the lane.
The accept set is therefore what records 6901107947 and 6901750290 derived, and I re-derived it from the tree at this head. All narrowings, nothing widens:
Unchanged, read in the code: the default of the new What
② Semver level
③ Boundary flags
④ Design judgmentIndependent reading, since both earlier records were rendered inside the implementing lane.
Nits. Neither changes a verdict of the code or the contract.
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC ACCEPT · PR #34129 (#33435) · head
|
Requested by Steve · project thread
Fixes #33435
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — no skill under
skills/**teaches a condition over an injected column or the null guard on one;content/docs/automation/flows.mdxandcontent/docs/automation/hooks.mdxgain the rule in this change.维护者速读
os build在 flow 条件和 hook 条件里,对平台注入列(负责人、创建人、修改人、业务单元、队列、组织)做大小比较或算术而没先判空时,现在会报错,和发布时的服务端检查给出同一条结论;beforeInsert钩子里的创建/修改时间也一样。validate-expressions.ts的这次改动。packages/lint/src/validate-expressions.ts(buildInjectedNullableIndex/buildPreStampIndex和checkNullGuards的nullable选项),packages/lint/src/validate-expressions.flow-null-guards.test.ts新增的对齐用例。pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-expressions.flow-null-guards.test.ts,应见 29 passed,其中 lint: an unguarded condition on owner_id, created_by, updated_by, owning_business_unit_id or queue is accepted though the column can be NULL on a stored row #33435 的用例逐列断言构建与发布检查结论相同。What changes
packages/lint/src/validate-expressions.ts: the flow condition sites (start, edge,decisionbranch;record.and bare spellings) and the hook condition site now judge the null guard over the declared fields plus the injected system columns the object as read does not carry (buildInjectedNullableIndex). Atos buildthat is every injected column the author did not declare; at a single-item runtime door the objects are served with those columns declared, so the index adds nothing there and its verdicts do not move. Two runtime readers hand the walk authored objects and so narrow with the build, inside the declared narrowing: the MCPvalidate_expressiontool at siteflow_condition(judgeAuthoredSiteExpressionstrips the injected columns and runs the walk as a flow write) now returns the null-guard finding for the six columns, and apublish-draftsbatch that carries a draft of the flow's or hook's own object (mergePendingDeclarationsreplaces the served object with the draft body, which holds no injected column) now refuses what it published before, as the single-item publish already refused it. A hook whoseeventsincludebeforeInsertalso judgescreated_at/updated_at(buildPreStampIndex), the card's S1 case. Validation rules andrequiredWhenkeep the declared-field index: both doors judge those over the authored object (measured below), so they already agree.PLATFORM_STAMPED_COLUMNSdocblock records the per-column measurement; the orphanedbuildNullableFieldIndexdocblock (it said leaving the injected columns out "costs coverage, never a false error") moves above its function and says what the index is now.packages/spec/src/migrations/entries/semantic/18.…reason: abeforeInserthook readscreated_at/updated_atas null only when it runs before the stamp (priority below 10); the rule stays the door's (fix(lint): the flow and hook publish doors stop requiring a null guard on the current row's created_at and updated_at in an ordering comparison #33434), a priority-aware rule at both doors is the seat's follow-up.content/docs/automation/flows.mdx(rule 5) andcontent/docs/automation/hooks.mdx(theconditiongate) state that the injected columns need the guard and the two timestamps do not, except atbeforeInsert.flow-hook-condition-injected-column-null-guard-at-build; root changeset33435-injected-column-null-guard-at-build.md(@objectstack/lintand@objectstack/specminor).Measurement (card step 1)
Per column, per ownership tier, per writer (showcase, real REST door + engine, driver-sqlite-wasm, single posture)
Throwaway probe (deleted): the showcase stack plus three objects, one per ownership tier (default/user,
business_unit,org), a RESTPOST /data/OBJECTas the platform admin and as a signed-up member, thenql.insertunder{ isSystem: true }with and withouttenantId, a system update and an admin REST update of each system row; hooks registered at priority 1 recorded what each event saw; three record-after-create flows on the user-tier object.showcase_taskorganization_idowner_id(user tier)queue(user tier)owning_business_unit_id(user, business_unit tiers)created_byupdated_bycreated_at,updated_atbeforeInserthook at priority 1 saw a payload with noorganization_id,created_at,updated_at,created_byfor every writer (REST and system);afterInsertsaw them stamped.organization_idis filled by the driver after the hook chain.record.owner_id > 'a'andrecord.created_by > 'a'start conditions: each system insert's runfailedwithcondition failed to evaluate as CEL: no such overload: dyn<null> > string; the REST create's runcompleted; the guardedrecord.owner_id != null && record.owner_id > 'a'flow never failed.posture-only(isolated) boot: a system-context insert with no organization is refused (SystemWriteOrganizationRequiredError, ADR-0131 D9), so no NULL row there.owner_idunset (ADR-0138 D1 item 5), a queue park or release writesowner_id: null(ADR-0142 D3,content/docs/automation/queues-and-assignment-rules.mdx), and driver-memory never stamps a tenant column (packages/drivers/driver-memory/src/memory-tenancy-guard.tsheader).Decision (card step 2): no column is stamped for some ownership tiers only, so no STOP.
owner_id,created_by,updated_by,owning_business_unit_id,queuehold NULL on reachable stored rows ⇒ nullable at both.organization_idis set on every stored row on the SQL family but read NULL atbeforeInsertand never stamped by driver-memory ⇒ not every reachable row, so it stays nullable at the door and is now nullable at the build (the door already judged it so).created_at/updated_atstay never-null except at abeforeInserthook (S1).Gate-level reading before/after (lint functions, same object, every tier): base
f81e4b6c— flow/hook sites door=1 build=0 for each of the six columns,beforeInserthook oncreated_at/updated_atdoor=1 build=0, validation rule door=0 build=0; head — build equals door in every cell.First-party exposure (card step 3)
objectstack buildat head inexamples/app-todo,app-crm,app-multi-package,app-showcase: exit 0 each, zero null-guard findings. Positive control:examples/app-todo'stodo_task_completionstart condition with&& record.created_by > "a"appended (viascripts/ablation-replace.mjs, restored,git diff HEADempty) ⇒ exit 1 withapplies \>` to `record.created_by`. Platform packages:git grepfinds no flow or hook condition ordering an injected column (examples/app-showcase/src/ui/actions/predicate-matrix.action.tsusesowner_id ==in an actionvisible`, not a judged site). No hit to guard.Tests
packages/lint/src/validate-expressions.flow-null-guards.test.ts: the A flow or hook condition ordering record.created_at with no guard is refused at the publish door while os build accepts it #33246 describe is renamed to cover both cards and gains seven cases: os build refuses each of the six columns at every flow slot and at a hook with the door's exact finding; a flow's bare spelling (judged as a declared nullable field's, the door judges no bare name of either kind); per ownership tier the build judges exactly the columns the tier carries; the S1beforeInsertcase and its afterInsert/flow controls; the guarded spelling; an author-declaredowner_idkeeps its own verdict; a validation rule keeps its verdict at both.packages/lint/src/authored-site-expression.test.ts: the MCPflow_conditionentry over a served object returns the gate's null-guard finding forrecord.owner_id > 'a', and nothing for the guarded spelling.packages/metadata-protocol/src/runtime-authoring-gate.injected-column-null-guard.test.ts(new):evaluateRuntimeAuthoringGatewith the object's draft inpending.objectsrefuses a flow overowner_idand abeforeInserthook overcreated_atexactly as the single-item publish does; the guarded spelling publishes. Ablation: with basevalidate-expressions.ts(lint rebuilt) both batch cases and the MCP case fail; restored, they pass.packages/lint/src/validate-expressions.test.ts— the validate-expressions / validate-security-posture 也有同形的 spec 不声明键的??别名读法(#5009 建议 3 的核对结果) #5017 declared-keys meta-test'sPLUMBINGtable gains the five new non-metadata receivers (flowHookNullableIndex,preStampIndex,carriedFieldNames,joinedNullable,joinedFields).Acceptance notes
record.owner_id.nmae != null) is judged at neither the build nor the door.created_at/updated_atto the S1 case): the door also refuses, and the build accepts, arithmetic onrecord.created_atin a flow, aprevious.created_atread, a read-event hook (beforeFind/afterFind) on the two timestamps, and every timestamp read on anexternalobject.requiredWhenover an injected column are judged at neither door (the object door judges the authored object); a stored row with NULL there faults the rule. Same class, not this card's sites.required: true, nodefaultValue)") for an injected column the author never declared; it is the door's existing wording, kept identical for parity.Verification
All readings at head
f1e07bac(the final commit), worktree onorigin/mainf81e4b6c.Tests, consumers, dogfood, gates
pnpm --filter @objectstack/lint test: Test Files 212 passed (212), Tests 9033 passed (9033);pnpm --filter @objectstack/lint typecheck: exit 0 (lock VERDICT command-exit 0).os build/os validate; the single-item door's verdicts do not move; the MCPflow_conditionentry andpublish-draftsbatches move as "What changes" says):pnpm --filter @objectstack/cli exec vitest run --project unit423/423 files, 6010/6010 tests;@objectstack/metadata-protocol342 passed, 9 skipped files, 22926 passed, 45 skipped tests;@objectstack/mcp65/65 files, 1185/1185;@objectstack/platform-objects122/122 files, 2007/2007. All exit 0.(narrowing)arm),pnpm --filter @objectstack/dogfood testunder the verify lock: VERDICT command-exit 0, Test Files 467 passed, 3 skipped (470), Tests 3962 passed, 42 skipped (4004).objectstack buildin the four examples: exit 0 each; positive control exit 1 (see First-party exposure).node scripts/pm/dispatch-gates.mjs --commands(no paths): 109 commands, each run with stdin closed and the exit captured before any pipe;--ran: 109 derived, 108 run, 1 NOT-MEASURED, 0 UNRUN. NOT MEASURED:pnpm check:dual-build-cjs-loads, reason: exit 3 PREREQUISITE NOT MET (not every package has adist/), CI runs it. Three first-pass exit 3 refusals re-run green after their prerequisite:check-plugin-teardown-shape.mjs --self-test(shallow clone;git fetch --depth=1 origin 621a4876, 48 cases),check:skill-examples(built@objectstack/client-react...; 346 prose examples),check:type-check-debt(lock wait behind the dogfood run; re-run with a slot, OK).Generated by Claude Code