Skip to content

feat(objectql, core, spec): the engine seam for the fixed-read leaf and its driver declaration (ADR-0155, step 2 of 6) - #35839

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-9jgzzp
Nov 20, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-9jgzzp

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread
Fixes #35786

Clause-②: yes
Metadata-protocol: added
Skills-docs: none — DriverCapabilities keys are declared by driver code, not taught under skills/** (zero readableIdsLeaf hits in skills/ at origin/main); the generated references (content/docs/references/data/driver*.mdx) carry the describe text

维护者速读

  • 用户无感:这一步只在引擎内部装上"共享授权"读取凭据的放行与拒收关口,目前没有任何功能写出这种凭据,线上行为前后一致。
  • 属于"共享授权读取不再截断、每条授权都算数"系列的第二步(共六步),为后续让数据库直接按共享表过滤、不再拼一长串编号铺路。
  • 关口判错时,带这种凭据的查询会被拒收并报内部错误,不会多放出任何数据;眼下没有写入方,直接撤回本次合并即可复原。
  • 无。

What changes

ADR-0155 step 2 of 6: the engine seam for a fixed-read leaf (SharedRecordIds) and the driver declaration that gates it. Nothing on main writes the leaf yet (step 6) and no driver declares it (steps 3 and 4), so no observable behaviour on main changes.

  • Driver declaration (@objectstack/spec, data/driver.zod.ts). DriverCapabilities.fixedReadLeaves: a list of leaf names (z.enum(FIXED_READ_LEAF_NAMES)), today ['SharedRecordIds']; absence = none. It stays separate from readableIdsLeaf. A ReadableIds leaf is not a fixed-read leaf, and a fixed-read leaf inside a composed ReadableIds scope needs both bits, because a driver without readableIdsLeaf refuses the composed leaf (ADR-0139 D3). Both describes now point at each other. The name vocabulary (FIXED_READ_LEAF_NAMES, FixedReadLeafName, fixedReadLeafNameOf) lives in data/fixed-read-leaf.ts, beside the brands.

  • Door (@objectstack/objectql, filter-comparand-shape.ts and the array branch in engine-top-level.ts). A branded leaf is admitted as a $in comparand. The position walk runs before the list-shape door, so a misplaced branded leaf ($nin, $eq, a list member, a filter node, a nested-relation condition) answers the D4 refusal rather than a non-list 400. An unbranded JSON copy is still INVALID_FILTER / 400 at the door.

  • Seam (fixed-read-leaf-position.ts for the walk, fixed-read-leaf-seam.ts for the pass-through). It runs at the executor boundary after the security scope is composed, and on the predicate update / delete paths. The leaf is handed to the driver by reference only when all of these hold:

    • position: on id of the object the leaf names, directly or inside a composed scope over that object;
    • verb and form: a read verb with the read form, or a predicate update's where with the write form (③ A). Otherwise it is refused;
    • recipient: the context's user or its delegator; a system context is exempt;
    • class: outside both D4 classes, i.e. the object is on the same datasource as sys_record_share, and no middleware and no beforeFind / afterFind hook is registered for sys_record_share by name;
    • driver: the target driver's fixedReadLeaves names the leaf.

    Anything else is refused before any driver is asked.

  • Refusal (@objectstack/core, utils/fixed-read-leaf-refusal.ts). fixedReadLeafRefusal / refuseFixedReadLeafOnce / describeFixedReadLeaf build the one envelope: INTERNAL_ERROR / 500, naming the evaluator, the leaf (its name and its inner-read table, never the recipient) and the remedy, logged at error once per evaluator. logRefusalOnce is factored out of refuseReadableIdsOnce, whose behaviour is unchanged.

  • Filter tokens (@objectstack/core, utils/filter-tokens.ts). resolveFilterTokens returns a fixed-read leaf by reference, as it already does a ReadableIds leaf.

  • Conformance (@objectstack/spec, data/fixed-read-leaf-conformance.ts).

    • The open-question sentence is dropped.
    • 11 seam cases are added (32 in all): the write form on each read verb and inside a composed scope, and the leaf outside $in in five positions.
    • objectql now runs every seam case against the real seam.

Compile surfaces (one conclusion each)

Surface Conclusion
driver-sql filter compiler Out of scope (step 3). On this step the seam refuses before the driver is called, since no driver declares fixedReadLeaves.
Turso remote Out of scope (step 3), for the same reason.
analytics compileScopedFilterToSql Out of scope (step 5). The analytics merges do not admit the brand, so a leaf there is still a non-list 400.
lowerAnalyticsWhere Out of scope (step 5).
formula matchesFilterCondition Already compliant on this step. The seam refuses a leaf in having and in aggregations[].filter at both the door and the boundary, so the in-memory matcher never sees one. Its other callers are step 5's.
driver-memory Out of scope (step 4).
driver-mongodb Out of scope (step 5).

Zone 2 measurements (A to G)

  • A. No driver declares the leaf: zero fixedReadLeaves hits under packages/drivers, packages/plugins and packages/services. Control: readableIdsLeaf: true hits packages/drivers/driver-memory/src/memory-driver.ts:605 and packages/drivers/driver-sql/src/sql-driver.ts:415. D-0 holds. The pass-through is proven against a recording driver in engine-fixed-read-leaf-seam.test.ts.
  • B. Step 1 shipped brands (FixedReadLeafBrand, fixedReadLeafBrandOf) but no names. The names were added in packages/spec/src/data/fixed-read-leaf.ts, so the declaration is a list of names, not symbols.
  • C. Door call sites:
    • engine-top-level.ts:1061 (array branch);
    • the filter-comparand-shape.ts:137 wrapper (object branch, having, aggregation filters).
    • The write-path collectors sit beside it at engine-update.ts:530 and engine-delete-and-aggregate.ts:245.
  • D. composeReadableIdsChain (engine-readable-ids-permission-formula.ts:183) composes the security scope by reference. composeReadableIdsLeaves (filter-comparand-shape.ts:263) returns an unchanged subtree by reference, so a nested leaf survives composition. The seam descends every composed scope (fixed-read-leaf-position.ts, the $in composed branch).
  • E.
    • ① resolveDatasourceBinding (engine.ts:3436), already on the security host.
    • ② hasObjectMiddleware (engine.ts:1914).
    • There was no by-name find-hook reader, because hasHooksFor counts global hooks. hookNamesObject is added at engine-top-level.ts:3755, and hooks is exposed on the security host (engine.ts:6148, +1 line).
  • F. The recipient is compared against userId and onBehalfOf.userId (packages/spec/src/kernel/execution-context.zod.ts:298); isSystem is exempt. The seam only reads them and never writes.
  • G. The seam reads IDataEngine.getDriverForObject (packages/spec/src/contracts/data-engine.ts:535) plus driverEvaluatesFixedReadLeaf (fixed-read-leaf-seam.ts). No new public engine method is added.

Tests

Code readings are at 7473e42d46, except the patch round 2 block, which is at head 9e745a0607.

All readings are local, under the shared verify lock (VERDICT command-exit lines quoted). test:repo is not run locally; CI's Test Core owns it.

Patch round 2: a door refusal is logged on the boundary's flag (head 9e745a0)
  • Every verb's door calls now run through atFixedReadLeafDoor (fixed-read-leaf-seam.ts): the where lowering of find, findOne, count, aggregate, update and delete, plus the aggregate's having and per-aggregation filter doors. The helper logs the seam's refusal at error on the same per-engine flag passFixedReadLeaves uses, then re-throws it unchanged.
  • pnpm --filter @objectstack/objectql typecheck: exit 0. The seam test: Tests 64 passed (64), VERDICT command-exit 0.
  • New pins in describe('[ADR-0155 D4] a refusal at the door is logged on the boundary\'s flag, once per engine'):
    • two misplaced-leaf refusals log one line;
    • a door refusal and a boundary refusal share one log, in either order;
    • one per door site, nine in all;
    • an unbranded copy stays INVALID_FILTER / 400, is not logged and does not spend the flag.
  • Ablations, committed first and restored to the HEAD blob 24ffa64865d4 with git diff HEAD empty:
    • M1, the door logs nothing: Tests 11 failed | 53 passed (64), the per-site and two-refusal pins;
    • M2, the door logs on its own flag: Tests 1 failed | 63 passed (64), the share-one-log pin.
  • Derived gates for the round's paths: 59 families, all run on 9e745a0607 and every one exited 0. --ran reports 59 run, 0 NOT-MEASURED. check:facade-delegation-only reports engine.ts: 6854 lines, ceiling 6854 (0 left).
objectql: full local suite, typecheck, seam test
  • pnpm --filter @objectstack/objectql exec vitest run --project local --maxWorkers=2 at 1726a5644b: Test Files 620 passed (620), Tests 14038 passed (14038), VERDICT command-exit 0.
  • pnpm --filter @objectstack/objectql typecheck plus the seam test, at b40270ee52 (after the test's options were typed): Tests 52 passed (52), VERDICT command-exit 0.
  • After that, the only commit is 7473e42d46, a docs-only census row.
spec and core: typecheck and full local suites
  • pnpm --filter @objectstack/spec typecheck: exit 0.
  • pnpm --filter @objectstack/spec exec vitest run --project local --maxWorkers=2: Test Files 865 passed (865), Tests 27732 passed | 1 todo (27733).
  • pnpm --filter @objectstack/core exec vitest run --project local --maxWorkers=2: Test Files 155 passed (155), Tests 3676 passed (3676).
  • One locked run, VERDICT command-exit 0. Core typecheck: exit 0. Spec build: VERDICT command-exit 0. The closure build --filter '@objectstack/objectql^...': VERDICT command-exit 0.
Ablation: the recipient rule (one behaviour, one run)
  • Mutation: principalAdmitted in fixed-read-leaf-position.ts short-circuited to true, through scripts/ablation-replace.mjs. On disk: anchor 1 -> 0, blob 8caf15107ba9 -> 4a7c5bd39384. The objectql test imports this source relatively, so no dist rebuild was involved.
  • Predicted direction: red on the recipient refusals. Observed: Tests 5 failed | 47 passed (52). The five are:
    • any other recipient is refused;
    • the recipient rule holds on the write form;
    • the recipient rule holds inside a composed scope;
    • a delegated operation carrying a third identity's leaf is refused;
    • a context with no user and no system flag is refused.
  • Restore: git checkout HEAD -- PATH. The blob is back to 8caf15107ba9… (the HEAD blob), git diff HEAD is 0 bytes, and the tree is clean.
Reverse type verification (cross-package)
  • Run against the rebuilt packages/spec/dist/data declarations: const ok: DriverCapabilities = { fixedReadLeaves: ['SharedRecordIds'] } compiles (exit 0).
  • { fixedReadLeaves: ['ReadableIds'] } is red: error TS2322: Type '"ReadableIds"' is not assignable to type '"SharedRecordIds"' (exit 2).
Derived gate families (local, final head 7473e42)
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derives 131 families.
  • All 131 were run on 7473e42d46, and every one exited 0.
  • --ran answers: 131 derived famil(ies) accounted for — 131 run, 0 NOT-MEASURED (a DERIVED zero — all 131 recorded an exit code and none of them is 3).
  • The first pass (at 1726a5644b) went red on two ratchets, both fixed in this PR:
    • check:query-options-erasure: the test surface grew 236 to 243. The seven option bags in the new test are now typed, and the surface is back to 236.
    • check:system-context-census: passFixedReadLeaves reads isSystem with no row for it. Row 18f was added and the register regenerated.

Acceptance notes

  • Metadata-protocol: added, @objectstack/spec at minor (patch round 1). The claim spelled none, but the diff moves packages/spec/authorable-surface/data.json (data/DriverCapabilities:fixedReadLeaves enters). Under AGENTS.md's Post-Task step 3, a new key is added, as the readableIdsLeaf precedent (feat(objectql): refuse a nested-relation condition and a lookup dimension up front on a driver without the readableIdsLeaf capability #34565) declared. @objectstack/core and @objectstack/objectql stay patch, following the gate's remedy: raise the package that carries the protocol change. Under none, check-changeset-no-major measured exit 1 (none-baseline-moved).
  • Deviations from the dispatch's suggested route:
    1. Leaf names (FIXED_READ_LEAF_NAMES, FixedReadLeafName, fixedReadLeafNameOf) are added to spec. Step 1 shipped brands only, and the declaration is a list of names.
    2. There are two seam modules, not one. The door walk lives in fixed-read-leaf-position.ts because engine-top-level.ts imports the door, and a single module would close an import cycle.
    3. engine-update.ts and engine-delete-and-aggregate.ts import securityResolversHost, the first importers besides engine.ts. engine.ts is at 6854 of its 6854-line ceiling (scripts/facade-delegation-registry.json, 0 left): +1 for the security host's hooks, and +1 in patch round 2 for count's host, which gains facade and logger.
    4. A misplaced leaf refused at the door is logged at error on the same once-per-engine flag as a boundary refusal (patch round 2, atFixedReadLeafDoor). judgeFilter is not logged: it returns the refusal as a judgement and runs nothing.
    5. An array-form in / nin carrying a leaf stays a 400 from the authoring lowering (parseFilterAST); only = lowers it by reference, and that is refused by name (500).
    6. logRefusalOnce is factored out of refuseReadableIdsOnce; that function's behaviour is unchanged.
  • Holds respected: no boot refusal; no producer writes the leaf; ADR-0147 anchor cases are not pinned; no driver declares fixedReadLeaves.
  • Changeset: @objectstack/spec at minor; @objectstack/core and @objectstack/objectql at patch. No skip-changeset.
  • Liveness row: n/a. DriverCapabilities is not a registered metadata type, and check:liveness exits 0.

Verification

Files to read first (by risk)

  1. packages/objectql/src/fixed-read-leaf-position.ts, the judge hunk. The position, verb and form rules decide what reaches a driver; a wrong admission here is the only way a leaf passes.
  2. packages/objectql/src/fixed-read-leaf-seam.ts, passFixedReadLeaves. The recipient, the two classes and the declaration consult, and the once-per-evaluator log.
  3. packages/objectql/src/filter-comparand-shape.ts, the wrapper. The position walk now runs before the list-shape door; this ordering is what turns a misplaced branded leaf into a 500 instead of a 400.

Two-minute verification

pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/engine-fixed-read-leaf-seam.test.ts should report Tests 64 passed (64). That covers all 33 conformance seam cases against the real seam, plus the recipient, declaration, class, pipeline-written, door and door-log cases.

L2: this PR owes a contract review (CONTRACT_REVIEW_TIER).


Generated by Claude Code

…nd driver declaration

Claude-Session: https://claude.ai/code/session_01L9qibvQwUyVQ6n8wEMcUgF
Co-authored-by: Claude <noreply@anthropic.com>
… them

The query-options erasure ratchet counted seven new test sites; the options
bags are on-contract, so they are typed rather than cast.

Claude-Session: https://claude.ai/code/session_01L9qibvQwUyVQ6n8wEMcUgF
Co-authored-by: Claude <noreply@anthropic.com>
…d in the census

The seam's recipient check exempts a system context; the census page gains
row 18f for it and the regenerated site register.

Claude-Session: https://claude.ai/code/session_01L9qibvQwUyVQ6n8wEMcUgF
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/core, @objectstack/objectql, @objectstack/spec, touching 74 documentable anchor(s). ⚠️ 4 changed file(s) yielded no anchor (packages/core/src/index.ts, packages/spec/api-surface/data.json, packages/spec/authorable-surface/data.json, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

37 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 2ad42b5d056322b179fbf7decb68731831e3b4f2.

⛔ 12 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 4 changed file(s) yielded no anchor (packages/core/src/index.ts, packages/spec/api-surface/data.json, packages/spec/authorable-surface/data.json, …) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: ObjectQL (symbol, 81 pages)
  • 14 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 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 — 183 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 2ad42b5d056322b179fbf7decb68731831e3b4f2 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 7d9e184ab6d83c5160bab0f2b01635517e838ae5 — the merge of head 9e745a06078553d2d8410f3b6af52b68f21bf307 into base 2ad42b5d056322b179fbf7decb68731831e3b4f2, 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 7d9e184ab6d83c5160bab0f2b01635517e838ae5 && git checkout 7d9e184ab6d83c5160bab0f2b01635517e838ae5
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 2ad42b5d056322b179fbf7decb68731831e3b4f2 9e745a06078553d2d8410f3b6af52b68f21bf307 && git checkout -B drift-repro 2ad42b5d056322b179fbf7decb68731831e3b4f2 && git merge --no-ff 9e745a06078553d2d8410f3b6af52b68f21bf307

node scripts/docs-audit/affected-docs.mjs --json 2ad42b5d056322b179fbf7decb68731831e3b4f2

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 2ad42b5d056322b179fbf7decb68731831e3b4f2 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…as added, spec at minor

The diff adds DriverCapabilities.fixedReadLeaves, an authorable key, so the
authorable-surface shard moved: Metadata-protocol is `added`, and the package
that carries it, @objectstack/spec, is graded minor.

Claude-Session: https://claude.ai/code/session_01L9qibvQwUyVQ6n8wEMcUgF
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH

Seat check

L1: REWORK, one item (L1-a, for the #35786 card thread) at head 683dd62a94441c8bcfd597cdfa2dfe677ef91232, read 2026-11-20T11:57Z. Everything else below is accepted as read. After the fix, a delta L1 and a CONTRACT_REVIEW_TIER L2 PASS on the final head are owed. The L2 is at that tier because packages/spec/src/** is touched; a Clause-② TIER_DEFAULT review is not enough.

Owed: a fixed-read leaf refused at the door is not logged

ADR-0155, on the refusal (line 468): "The refusal is ADR-0139 D3's envelope wherever it occurs: status 500, INTERNAL_ERROR, a message naming the evaluator, the leaf and the remedy, logged at error once per evaluator". The changeset repeats it: "Anything else is refused before any driver is asked, INTERNAL_ERROR / 500, logged at error once per evaluator."

On this head that holds only at the executor boundary:

  • passFixedReadLeaves wraps collectFixedReadLeaves in a try and calls logRefusalOnce(…, flagOf(host.facade), 'evaluator') on an isFixedReadLeafSeamRefusal.
  • The two door calls throw the same refusal with no log: collectFixedReadLeaves(object, operation, node, path) in filter-comparand-shape.ts, and in engine-top-level.ts's lowering ("refused here by name, before the doors below").
  • git grep isFixedReadLeafSeamRefusal finds the one catch, in the seam.

The door runs first, so a leaf out of position or on the wrong verb in a caller's where (wrong field or object, $nin, a list member, having, a delete) is refused unlogged. Only a leaf that reaches the boundary, such as one a beforeFind hook wrote, which your pin at engine-fixed-read-leaf-seam.test.ts:318 covers, is logged. You flagged this yourselves, and it is a gap against the ADR and the changeset, not a style point: the log is how an operator finds a composition fault that the caller only sees as a 500.

Fix. Route the door's throws through the same once-per-evaluator log, with the same flag keyed on the engine (flagOf(facade)), so a door refusal and a boundary refusal together log once. For example, catch and log around the two door calls, as the seam does, or move that catch into collectFixedReadLeaves' callers through one helper. Then add a pin: a caller's where with a misplaced branded leaf is refused 500 and logged once at error across two calls.

Narrowing the changeset sentence instead would leave the code out of line with ADR-0155's "wherever it occurs", which changing would need an ADR amendment. Don't take that route.

Accepted as read

  • Declarations.

    • Clause-②: yes (widening only): new DriverCapabilities.fixedReadLeaves, new spec and core exports, and the door admitting a branded leaf.
    • Metadata-protocol: added, per claim amendment 7037678092: the driver capability is on the authorable surface (authorable-surface/data.json +1). @objectstack/spec minor follows.
    • core and objectql are patch.
    • Nothing narrows: an unbranded copy is still refused at the door as a non-list, INVALID_FILTER / 400, as before.
  • The seam (fixed-read-leaf-seam.ts). In order:

    1. the principal check (isSystem exempt, else the user or the delegator);
    2. D4's two classes: the object and sys_record_share on different datasources, or middleware or a beforeFind / afterFind registered for the table by name;
    3. the driver's supports.fixedReadLeaves.

    Each refusal states the remedy. hookNamesObject requires both a literal name and dispatch (hookMatchesObject), so a global or '*' registration stays outside, on ADR-0155's recorded line ("a registration that names no object stays outside the class, and the host is told").

  • Call sites.

    • The read boundary covers where, having and each aggregations[i].filter, and the composed scopes after composition.
    • A predicate update is judged once, in its write form, for its prior-row read and its write alike (③ ruled A).
    • A delete refuses any leaf ("a share widens edit, never delete", D1).
  • Smaller pieces.

    • resolveFilterTokens returns the leaf by reference, so the brand survives.
    • The two seam modules break the import cycle.
    • engine.ts gains +1 at its facade ceiling.
    • engine-update.ts and engine-delete-and-aggregate.ts reach the host through securityResolversHost.
  • Prose.

    • The changeset's other sentences match the code: "No visible change on its own", the declaration paragraph, the seam's conditions list and the core exports.
    • system-context.mdx and the three regenerated driver pages match.

Routing

The card thread lands it itself under Clause-②: yes after the delta L1 and the CONTRACT_REVIEW_TIER PASS on the final head, with CI green there. check-governed-merges.mjs --pr 35839 decides the route.


Generated by Claude Code

…ary's once-per-engine flag

ADR-0155 D4 logs the refusal at error once per evaluator wherever it occurs.
The door calls of every verb (the where lowering, and the aggregate's having
and per-aggregation filter doors) now run through atFixedReadLeafDoor, which
logs the seam's refusal on the same per-engine flag passFixedReadLeaves uses,
so a door refusal and a boundary refusal log one line between them. An
unbranded copy's INVALID_FILTER / 400 is not this log's.

Claude-Session: https://claude.ai/code/session_01L9qibvQwUyVQ6n8wEMcUgF
Co-authored-by: Claude <noreply@anthropic.com>
…hunk in engine-find

Claude-Session: https://claude.ai/code/session_01L9qibvQwUyVQ6n8wEMcUgF
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibyQBB3KuDoNobNq9LH

L1 delta: ACCEPT at 9e745a06078553d2d8410f3b6af52b68f21bf307 (2026-11-20T13:27Z)

This delta goes from 683dd62a94 to 9e745a0607. It has two commits:

My REWORK 7038939850 is addressed.

What I checked

  • The device. atFixedReadLeafDoor(host, door) (fixed-read-leaf-seam.ts) runs one door call.
    • If the call throws the seam's refusal, it logs through logSeamRefusalOnce, then re-throws unchanged.
    • logSeamRefusalOnce calls logRefusalOnce(err, host.logger, flagOf(host.facade), 'evaluator'). passFixedReadLeaves now calls the same helper, so the door and the boundary key one flag on one engine object.
    • Any other error is not logged by this device. That includes the unbranded copy's INVALID_FILTER / 400. ✔
  • Every door call is covered.
    • The door's two collectFixedReadLeaves calls are both inside lowerWhereFilterArray:
      • the object branch, through assertListComparandShapes at engine-top-level.ts:930;
      • the array branch, direct, at :1061.
    • At the head, every lowerWhereFilterArray call in packages/**/src outside tests is wrapped:
      • find (engine-find.ts:440) and findOne (:809);
      • count (engine-count-aggregate.ts:116);
      • aggregate where (engine-delete-and-aggregate.ts:1040) and delete (:188);
      • update (engine-update.ts:207).
    • The only unwrapped call is judgeWhereAdmission (engine-top-level.ts:1287), behind ObjectQL#judgeFilter.
    • The two direct assertListComparandShapes calls are wrapped too: aggregate having (:1307) and the per-aggregation filter (:1164).
    • The driver-memory function with the same name is a local one in another module. ✔
  • The flag is the same object.
    • The facets' facade is the engine, through the #30020 host member.
    • count's host is built per call with facade: this (engine.ts:5325).
    • passFixedReadLeaves reads securityResolversHost.of(this.facade).
    • The shared-log pin is the positive control: a door refusal and a boundary refusal produce one error line between them, in either order. ✔
  • The pin is describe('[ADR-0155 D4] a refusal at the door is logged on the boundary's flag, once per engine'). It covers:
    • two refusals giving one log;
    • door and boundary sharing one log, in either order;
    • nine sites, each asserting the 500 envelope, calls empty (no driver asked) and exactly one error line;
    • an unbranded copy that stays 400, is not logged, and does not spend the flag. The next misplaced leaf still logs.
  • The dev's ablations are reported as: door logs nothing ⇒ 11 red; own flag ⇒ 1 red. Each one names the face it guards. ✔
  • Prose.
    • The seam docblock's "## The log" now says the refusal is logged "wherever it occurs" and explains why the door has no logger of its own.
    • The filter-comparand-shape.ts docblock names the device.
    • The changeset sentence is unchanged ("refused before any driver is asked, INTERNAL_ERROR / 500, logged at error once per evaluator"). It is now true at the door too. ✔
  • CI at 9e745a0607: 64 success, 14 skipped, 0 red. ✔

For the L2 (the dev's two notes; I do not block on either)

  1. ObjectQL#judgeFilter. It goes through judgeWhereAdmission, which returns the door's refusal as a judgement, runs nothing and logs nothing.
    • ADR-0155 says the refusal is logged "wherever it occurs".
    • The L2 should rule whether a judgement that serves no 500 counts as an occurrence.
    • My reading is that it does not: no request was refused and nothing was served.
  2. engine.ts facade ceiling. It is now at 6854 of 6854. The next card that touches engine.ts has no headroom left. That is not a finding on this diff.

L2 owed

  • CONTRACT_REVIEW_TIER PASS on 9e745a0607 (ADR-0155 step 2). It should judge the device and both notes above.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvQwUyVQ6n8wEMcUgF

Contract-review-claim: session_01L9qibvQwUyVQ6n8wEMcUgF · head 9e745a0 · 2026-11-20T13:29Z

L1 ACCEPT 7040740660 on this head; the CONTRACT_REVIEW_TIER review runs as an isolated sub-agent of the #35786 card thread (face schema: hits packages/spec/src/data/driver.zod.ts, packages/spec/src/data/fixed-read-leaf-conformance.ts, packages/spec/src/data/fixed-read-leaf.ts).

@objectstack-fleet objectstack-fleet Bot added the needs:contract-review Marker only — PR awaits its at-tier Contract review PASS; no check reads it, the record decides label Nov 20, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvQwUyVQ6n8wEMcUgF

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 9e745a06078553d2d8410f3b6af52b68f21bf307
Local-runs: none
Scope: packages/spec/src/data/driver.zod.ts, packages/spec/src/data/fixed-read-leaf-conformance.ts, packages/spec/src/data/fixed-read-leaf.ts + packages/objectql/src/fixed-read-leaf-position.ts, packages/objectql/src/fixed-read-leaf-seam.ts, packages/objectql/src/filter-comparand-shape.ts, packages/objectql/src/engine-top-level.ts, packages/objectql/src/engine-security-resolvers.ts, packages/objectql/src/engine-find.ts, packages/objectql/src/engine-count-aggregate.ts, packages/objectql/src/engine-delete-and-aggregate.ts, packages/objectql/src/engine-update.ts, packages/objectql/src/engine.ts, packages/core/src/utils/fixed-read-leaf-refusal.ts, packages/core/src/utils/readable-ids-driver-refusal.ts, packages/core/src/utils/filter-tokens.ts, packages/core/src/index.ts
Security-touching: yes
Rule-change-verified: none

PR #35839 for card #35786 (ADR-0155 plan step 2, the engine seam and the driver declaration). First contract-review round on this PR: no earlier record names it, so nothing is closed by id here.

Read: the card body and every comment on it (the three dev reports and the claim amendment 7037678092 included), the PR body, the 32-file list, the net diff against main at the head, ADR-0155 D1, D4 and the execution plan as the card cites them, and the 83 check-runs on the head: 65 success, 18 skipped by their selectors, none red, none pending. Check Changeset (four runs), Governed Surface Queue Guard, Spec property liveness, Lint & Repo Gates, Build Core, Build Docs, Test Core with shards 1 to 10, and the Type Check jobs are among the green ones. Nothing was built, run or re-run locally; code outside the diff was read at the head to judge the files in scope.

The rest of the diff is the lane seat's at TIER_DEFAULT: four test files, the three generated driver reference pages, the system-context census row 18f, the three spec baselines, the two ADR-anchor files and the changeset. Row 18f was read because it states the system exemption; it agrees with passFixedReadLeaves.

On the two header lines the template carries for other arms: no hits path sits under skills/**, ui/skills/** or .claude/**, so neither arm reads them on this PR and no security label duty arises from this record. They are answered truthfully all the same. The changed hunks do govern sharing and permission behaviour (whose share-grant scope an engine read may carry, and when it is refused), so the first reads yes. No hunk alters what an agent may do without the maintainer, what is done in what order, or what must go to him, and the PR body declares no rule change, so the second reads none.

① Derived judgments

Every accept-set and public-surface change the diff implies, each judged.

  1. DriverCapabilities.fixedReadLeaves, a new optional key (@objectstack/spec): a list whose members are the closed set FIXED_READ_LEAF_NAMES, one name today. The accept set widens by one optional list; every existing declaration parses as before; a name outside the set is refused by the schema. The authorable-surface baseline gains exactly data/DriverCapabilities:fixedReadLeaves. Right. The key's name, the list-of-names shape, absence meaning none, and its landing on this card beside its reader are what the card states as the seat's O1 ruling, and the reader (driverEvaluatesFixedReadLeaf) is in the same diff, as ADR-0078 asks.
  2. Three new exports from @objectstack/spec/data: FIXED_READ_LEAF_NAMES, FixedReadLeafName, fixedReadLeafNameOf. The api-surface and export-origins baselines gain these three and nothing else. Right. A capability is declared data and a unique symbol cannot be a schema value, so the declaration needs names; the name sits on the one private row that already holds the brand, the guard and the description.
  3. readableIdsLeaf: its describe text gains one sentence on how it relates to the new key; the accept set is unchanged. Right, and it is the relation the card asked the two spellings to state.
  4. The conformance case-set: FixedReadLeafCaseSet.leaf is retyped from the literal 'SharedRecordIds' to FixedReadLeafName, the same one-member union today; the seam list grows by 11 cases, all refusals, to 32 (the 13 evaluator cases are untouched). Right. The published set only gains cases, and each added case is judged in ④.
  5. @objectstack/core gains public exports: fixedReadLeafRefusal, refuseFixedReadLeafOnce, describeFixedReadLeaf, the type FixedReadLeafRefusalError, and logRefusalOnce. refuseReadableIdsOnce keeps its signature, its line text, its once-only flag and its error-else-warn sink. Right. One envelope and one log device for both leaves is ADR-0155 D4's "built once" row.
  6. resolveFilterTokens, hasFilterToken, isFilterObject (@objectstack/core) now treat a fixed-read leaf as they treat a ReadableIds leaf: returned by reference, never walked as a filter object. Before, a token rebuild copied the leaf and dropped its brand. A widening, and the card's first carry-forward. Right.
  7. The engine's comparand door (@objectstack/objectql) admits a branded leaf whose brand is in ENGINE_FIXED_READ_LEAF_BRANDS as a $in comparand. Before this diff every such value was refused as a non-list, INVALID_FILTER / 400. Now a legally placed leaf goes on to the boundary's checks; a branded leaf out of position, on the wrong verb or in the wrong form is refused by name, INTERNAL_ERROR / 500; an unbranded copy is refused at 400 exactly as before. Right: D1 and D4 make a misplaced branded leaf a composition fault, never an author's.
  8. ObjectQL#judgeFilter runs the verbs' own door functions, so its answers move with item 7: ok for a legally placed leaf, INTERNAL_ERROR / 500 for a misplaced one, where it answered INVALID_FILTER / 400. Right. No author-written or wire filter can carry the brand, and what the boundary decides (recipient, classes, declaration) needs a context and a driver, which the judge never had.
  9. No new package export, public engine method or error code in @objectstack/objectql: index.ts is untouched and both new modules say so. Right for this step. Steps 5 and 6 will need a public face for the class recognition and the declaration reader; that is theirs to add and to grade (carry-forward below).
  10. Nothing narrows. No key is removed, no value accepted before is refused now: the branded leaf was refused before this diff, and where it is still refused only the code moves from 400 to 500.
  11. Holds kept, each checked in the tree: no boot refusal; nothing outside spec and tests builds a leaf; no driver, plugin or service declares fixedReadLeaves; no ADR-0147 anchor case is pinned. At this head every operation carrying a leaf ends in the declaration refusal, and nothing writes one, so there is no visible change. Right, and it is what plan step 2 and the card's two holds require.

② Semver level

  • The changeset grades @objectstack/spec at minor and @objectstack/core and @objectstack/objectql at patch. The diff moves the authorable-surface baseline by one new key, which is the kind added, and AGENTS.md Post-Task step 3 gives that kind at least minor on the package the diff moves. Core and objectql carry no protocol change, and the same step ships a non-protocol change, widening included, at patch. The levels match what the diff publishes.
  • The PR body and the changeset body both carry, line-initial, Clause-②: yes and Metadata-protocol: added. yes with no arm is right: the diff changes a published contract and every change in ① is a widening or a code move on a value that stays refused, so no (narrowing) arm is owed. The PR body's third line, Skills-docs: none with its reason, is owed by the added kind and its reason holds: no page under skills/** teaches driver capability keys.
  • Check Changeset is green on all four of its runs on this head.
  • The changeset's prose agrees with the tree except for one sentence that is wider than the tree in one spelling (N3 below).

③ Boundary flags

SQL push-down (Prime Directive 5). The diff materialises no ids and adds no in-app join. The seam hands the leaf to the driver by reference or refuses the operation; nothing in the diff substitutes an id list for a leaf, and the declaration's own text forbids it. No finding.

The open question (first dev report): which Metadata-protocol value the PR carries, since the claim spelled none and the authorable-surface baseline moved. Answered A by the rule, in the claim amendment 7037678092 and patch round 1: added, spec at minor. Right, for the reason in ②. Option B, taking driver capabilities out of the authorable surface, is a shape decision of its own and is not owed by this card.

The dev's flags, each answered:

  1. Leaf names added to spec. Right, ① item 2.
  2. Two seam modules instead of one. Right. The door sits below engine-top-level.ts, which the class recognition imports for hookNamesObject; splitting the filter-only walk out lets the door and the boundary ask one function, with no cycle and no second copy of the position rule.
  3. The update and delete facets import securityResolversHost, and engine.ts grows by two lines to its 6854-line ceiling. The facade gate is green on this head. The arithmetic against fix(objectql)!: a multi-row insert reads a parent's formula fields over the roll-ups its rows move; fold follow-ups #35773 and fix(audit): a search the server widens never names a column the caller may not query #34817 is the seat's sequencing and no contract matter; note that merging main or either sibling into this branch moves the head, and this record covers 9e745a06 only.
  4. A refusal at the door is logged (patch round 2). Right. atFixedReadLeafDoor wraps every verb's door call and logs on the same per-engine flag passFixedReadLeaves uses, so a refusal at the door and one at the boundary write one line between them. The reading of D4's "once per evaluator" is the driver for a declaration it lacks and the engine for every fault that is the seam's own. Accepted; N4 notes its one cost.
  5. judgeFilter is not logged; the last report leaves this for this review to rule. Ruled: no log is owed. A judgement refuses no operation: judgeWhereAdmission returns every door's diagnostic as data and logs none of them, this one included. Its in-tree consumers were read at the head. The CLI authoring judge and the metadata-protocol authoring gate judge author-written filters, which cannot carry a brand. The analytics merges judge a read scope under aggregate and wrap a not-ok answer in their own READ_SCOPE_COMPILE_FAILED error, whose message is kept for the operator's log; and at this head the analytics merge's own comparand door names no fixed-read brand, so it refuses such a leaf closed whatever the judge answers. The card's Order section gives the analytics entry to step 5, which owns what is logged there.
  6. An array-form in / nin carrying a leaf stays INVALID_FILTER / 400 from parseFilterAST. Accepted deviation. D4's Admission paragraph lets no caller but the engine's door and the analytics merges admit the brand, and parseFilterAST is the spec's standalone lowering, which names none; the ReadableIds leaf has the same answer in the same spelling; the array form is request sugar no producer writes a leaf in; the operation is refused either way; and the one array spelling that does lower a leaf by reference (=) is refused by name at 500 by the walk this diff adds to the array branch. See N3 for the changeset sentence.
  7. logRefusalOnce factored out of refuseReadableIdsOnce. Checked against the removed lines: the same line text for the default who, the same flag set before the write, error with the warn fallback. Behaviour unchanged.
  8. Process items (the PR opened after local verification, the commit trailer pair, the killed and restarted local runs, the relay writes, one rerun of an unrelated flaky shard on an earlier head): no bearing on the contract; the lane seat's.

Nothing is escalated.

④ Design judgment

The three hits files.

  • packages/spec/src/data/driver.zod.ts, against the O1 ruling, ADR-0155 D4 and its first consumer, driverEvaluatesFixedReadLeaf. Each sentence of the key's doc was read against the seam. The leaf reaches the driver only when the list holds its name: true, the consult is the last check and reads getDriverForObject(object).supports on every operation, nothing cached, which is the doc's "read at dispatch time". Otherwise the operation is refused before any driver is called, 500, naming the driver, the leaf and the remedy: true of the message passFixedReadLeaves builds. Absence means none: true, and so does every malformed value (null, a string, a non-array), because the reader takes only an array that includes the name. A leaf inside a composed ReadableIds scope needs both declarations: true, the nested sites are consulted against the outer driver's list and the composed leaf around them is ADR-0139 D3's. The schema is a closed enum over the frozen name list, so ['ReadableIds'] neither type-checks nor parses. The change holds.
  • packages/spec/src/data/fixed-read-leaf.ts. The name lives on the one private row that holds the brand, the guard and the description, so the four cannot drift, and fixedReadLeafNameOf answers undefined exactly where fixedReadLeafBrandOf does: the same search over the same guards. The change holds.
  • packages/spec/src/data/fixed-read-leaf-conformance.ts. The 11 added seam cases, each against D1 and ③ ruled A: the write form on find, findOne, count and aggregate, refused; the write form inside a composed scope, refused, since a composed scope is the where of a read of its parent; the leaf as an implicit-equality value, a $eq comparand, a $nin comparand, a member of a $in list, a filter node of its own, and inside a nested-relation condition, each refused as D1's "any other position". All eleven are right. The docblock's new sentence, that the prior-row read of a predicate update is that update's and is judged once, was checked in engine-update.ts: the seam runs at the executor's entry, and the prior-row reads and the updateMany go to the driver directly with the same AST, never back through find's door, which would refuse the write form. The set's first consumer, the objectql seam test, runs every case against a real engine with a recording driver, and Test Core is green on this head. The change holds.

The implementing files, read sentence by sentence against D1 and D4.

  • fixed-read-leaf-position.ts. Position: admitted only at field.$in where the field is id and the scope's object is the one the leaf names, directly or inside the scope of a composed ReadableIds leaf whose parent is that object, at any depth of nesting; $and, $or and $not are descended; every other key, operator and container is scanned and any leaf found there is refused. Verb and form: read form on the four read verbs and inside every composed scope, write form only directly in an update's where, neither on delete; having and an aggregation's filter are refused before anything else is read. This is D1 as written, with ③ ruled A.
  • fixed-read-leaf-seam.ts. The recipient rule compares and never replaces; a system context is exempt only when isSystem is strictly true, and from that rule alone: the position, class and declaration checks run for it too. The two classes: datasource of the leaf's object against the datasource of its inner table, through resolveDatasourceBinding; an object-scoped middleware or a beforeFind / afterFind hook that names the table. Both answer the refusal at this step: for the first class it is the R1 that stands behind R2, for the second the refusal that stands behind the boot check, and R2 and the boot check themselves land with the producer at plan step 6. The refusals are core's envelope, 500, naming the seam, the leaf and the remedy.
  • filter-comparand-shape.ts. The wrapper is the only caller that names the brands, and it runs the position walk first, so a branded leaf in a $nin or a list is refused by name before the list-shape door could read it as a caller's 400. Right order, and it is what turns D4's "never INVALID_FILTER" into fact at the door.
  • engine-top-level.ts. The array branch of lowerWhereFilterArray runs the same walk on the lowered condition. hookNamesObject requires the registration to name the object literally and to dispatch for it, so a global or '*' registration is outside the class and excludeObjects takes an object out, which is D4's boundary.
  • engine-security-resolvers.ts. composeReadableIdsAtBoundary passes having, each aggregation's filter, and the where, and on a read that composes ReadableIds it passes the composed where, so the leaves a security-answered scope carries are judged before the driver sees them. D4's "every occurrence, nested ones included".
  • engine-find.ts, engine-count-aggregate.ts, engine-delete-and-aggregate.ts, engine-update.ts, engine.ts. Door calls wrapped for the log; the seam at the executor's entry of update and delete; two host members added. They agree with the contract.
  • fixed-read-leaf-refusal.ts, readable-ids-driver-refusal.ts, filter-tokens.ts, index.ts (@objectstack/core). The envelope is INTERNAL_ERROR / 500 with the evaluator in the message; describeFixedReadLeaf names the leaf and its inner table and never its inputs. They agree with the contract.

Tried against the design, and held.

  1. A driver call that skips the seam. At the head the door's callers are the six verbs and the judge, nothing else. Each read verb's driver call, the aggregate's in-memory fallback read included, takes the AST composeReadableIdsAtBoundary returned; update and delete run the seam at the executor's entry, before their prior-row reads.
  2. A leaf written after the door, by a middleware or a before-hook. The boundary runs the same walk and every other check on the final AST.
  3. Another principal's scope. The leaf guard admits only a non-empty string recipient, so an absent context or a context with no user never compares equal; a third identity under a delegated context is refused; a nested leaf is compared with the same reading context as a direct one.
  4. A leaf smuggled inside a composed scope a caller forged. ADR-0139's walk refuses any composed leaf at the door; the only composed scopes the seam descends are the ones the engine built at the boundary, and there the leaf must name the scope's parent and be the read form.
  5. Class recognition on an unbound object. resolveDatasourceBinding answers the default binding, so two unbound objects compare equal and an object bound elsewhere does not: the compare ADR-0139 D5.3 already makes.
  6. A malformed or partial declaration. It reads as none and the operation is refused; no shape of supports lets a leaf through unnamed.
  7. The brand lost on the way to the driver. The copy-on-write walkers between the door and the driver (the token resolver, the ReadableIds composer) return the frozen leaf itself; the pass-through edits nothing.
  8. An unbranded copy. Still 400 at the door, not logged by this device and not spending its flag.
  9. A principal's id leaking through a refusal. No message built here includes the recipient.
  10. Cost on ordinary traffic. The walk throws only on a branded value and answers a shared empty list for a filter with no leaf; it is one more read-only pass per door and boundary call, the same shape as ADR-0139's walk beside it.
  11. A silent drop on an update by scalar id that also carries a predicate. The combination is already refused before the seam, so no leaf is skipped there.

Findings.

No must-fix, no should-fix.

Nits only; none has an effect on correctness or on the contract at this head, and none is to be fixed in a commit that moves a reviewed file.

  • N1 (nit, the two-leaf shape; follow-up on the card that adds ADR-0147's leaf to the seam). The seam is built once, as D4 asks, but in three places it fixes the shape of this leaf's answer where the second leaf's differs. The row type FixedReadLeafRules.position can only answer one field on the object the leaf itself names; fixedReadLeafClassOf takes the class-1 object from that answer; and what the seam answers for the first class and for a driver that does not name the leaf is the refusal, in the body of passFixedReadLeaves, for every name. driver.zod.ts states that refusal, and "no list fallback", as the key's rule for every fixed-read leaf. D4's "built once" table keeps what an evaluator that cannot run a leaf answers per leaf, and ADR-0147 as it stands (Proposed; its D-a and D-d) puts its leaf on any field of any object and answers both cases with its exact-array floor. Every statement in the tree is true for the one name the list holds today, and ADR-0155's Sequencing note leaves ADR-0147's answer to that record. The card that adds the second leaf widens the row, moves the two answers into it and rewords the describe.
  • N2 (nit, prose face: the PR body). The body says twice that 12 seam cases are added, 33 in all, and the first dev report says the same. The tree adds 11 and holds 32. The seat corrects the body; the head does not move.
  • N3 (nit, accepted deviation: the changeset). "Anything else is refused before any driver is asked, INTERNAL_ERROR / 500" is wider than the tree in one spelling: an array-form in / nin carrying a leaf is refused at 400 (③ flag 6). Left as written; a changeset edit moves the head.
  • N4 (nit, follow-up for the switch card, plan step 6). One per-engine flag covers every fault the seam itself answers. After the first such refusal on an engine, a later refusal of another kind or for another object writes no line: a host with a second object on another datasource, or a hook added later, is told by the refusal alone. D4's "once per evaluator" is met to the letter and every caller still receives every refusal. Worth weighing where R1 at boot lands, since the class refusals are per object and per host.
  • N5 (nit, doc residue in two hits files; fold into the next card that edits them). The jsdoc of fixedReadLeaves names the position, verb and recipient checks ahead of the declaration consult and leaves out the two classes, which the seam also answers first. The header of fixed-read-leaf.ts still says the module declares two shared halves, and it now also holds the leaf names.

Carried forward, not graded.

  • Steps 5 and 6 need to reach fixedReadLeafClassOf and driverEvaluatesFixedReadLeaf from outside the package, and @objectstack/objectql exports neither. The card that needs the face adds it and grades it.
  • Step 5 owns the analytics entry: which merges name the brand, and what is logged when their judge call answers a refusal.
  • This record covers 9e745a06 only. A merge of main or of a sibling that touches engine.ts moves the head.

Implemented-by: claude/project-thread-9jgzzp
Reviewed-by: session_01L9qibvQwUyVQ6n8wEMcUgF

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvQwUyVQ6n8wEMcUgF

The brief handed to the isolated CONTRACT_REVIEW_TIER sub-agent that wrote record 7041395515 (contract-review.md: a card thread posts the filled brief beside the record). Verdict PASS, nits N1–N5 only; the card thread adopts it.

Contract review brief — PR #35839 @ 9e745a06078553d2d8410f3b6af52b68f21bf307 (card #35786)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #35786: its body and EVERY comment (rulings and earlier records included)
· PR #35839: its body, its file list, and the net diff against main at 9e745a06078553d2d8410f3b6af52b68f21bf307
· the check-runs on 9e745a06078553d2d8410f3b6af52b68f21bf307: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: packages/spec/src/data/driver.zod.ts, packages/spec/src/data/fixed-read-leaf-conformance.ts, packages/spec/src/data/fixed-read-leaf.ts;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

Security — if a hits path is under skills/** or ui/skills/** and the change teaches security, auth or permission
behaviour the path name doesn't show, the record says so and the seat adopting the record adds the security label.
The record says so on its Security-touching: line, and the arm lands on no alone: write no ONLY when no changed
hunk teaches permission, sharing, credential, token, authentication or other security behaviour, else yes.

Rule change — if a hits path is under .claude/**: the PR body declares Rule-change: and you verify it against the diff.
Write Rule-change-verified: none ONLY when no changed hunk alters what an agent may do without the maintainer
(merge, bypass a check, change repository settings), what gets done and in what order (grading, dispatch, scope), or
what must go to him (decisions, maintainer actions); process steps, scripts, wording, slimming and file moves are not rule
changes. Write ruled ONLY when every such hunk copies the ruling the PR body quotes on its Ruling-ref: line — check the
copy against the quoted words, do not re-rule it. Otherwise yes: the pull request then waits for the maintainer.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/9161fc59-ee27-567b-910b-b72a428aae83/scratchpad/pr-35839/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet objectstack-fleet Bot removed the needs:contract-review Marker only — PR awaits its at-tier Contract review PASS; no check reads it, the record decides label Nov 20, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-tesla · session_01L9qibvQwUyVQ6n8wEMcUgF

Landing: ready + auto-merge on head 9e745a0607 · 2026-11-20T14:03Z

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 protocol:data size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant