Uh oh!
There was an error while loading. Please reload this page.
refactor(objectql,runtime): give the standalone-action owner-key ladder one spelling - #14667
Conversation
…er one spelling The `action.objectName` -> `action.object` -> object-less `'global'` ladder was written out three times — `standaloneActionOwnerKey` (objectql), the runtime's `standaloneActionObjectName`, and the private `ObjectQLPlugin.actionObjectKey` — held equal only by a sentence in each docblock. All three now resolve to the one implementation: the plugin calls it directly (same package), and the runtime re-exports it in the ADR-0110 block that already exists for that purpose, keeping `standaloneActionObjectName` as a delegating alias so its exported signature does not move. The plugin copy terminated on a bare `'global'` literal where the other two return `GLOBAL_ACTION_OBJECT_KEY`; equal today, silently different the day the constant moves. Its `isArtifactShippedAction` reader is converged with it. The lockstep docblocks are replaced by package-local welds (`action-owner-key-single-source.test.ts` in each package), because a docblock is not a check. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
…nverge-action-owner-key
The two lines added to `action-execution.ts`'s import and re-export blocks shifted every anchored line below them by exactly two, so `check:check-system-context-census` went red with pure line rot: the two real `isSystem` read sites moved to :138 and :401 with no row anchoring them, while the page still pointed at :136, :399 and :64. Repaired by the gate's own `--fix`, which rewrote the three citations and nothing else. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
📓 Docs Drift CheckThis PR changes 2 package(s): 6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 33 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 3b7acfba2285187f15d771da7dfb225af6d7ab4d && git checkout 3b7acfba2285187f15d771da7dfb225af6d7ab4d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 2aa8456cf2d66ec3825d262686fe4218e57cfd27 e9043cc36249eeebba10b50d416996dec98292b8 && git checkout -B drift-repro 2aa8456cf2d66ec3825d262686fe4218e57cfd27 && git merge --no-ff e9043cc36249eeebba10b50d416996dec98292b8
node scripts/docs-audit/affected-docs.mjs --json 2aa8456cf2d66ec3825d262686fe4218e57cfd27
|
Uh oh!
There was an error while loading. Please reload this page.
Fixes#14422
The
action.objectName->action.object-> object-less'global'ladder that decides which engine key a standaloneactiondeclaration is filed under was written out three times, held equal only by a sentence in each docblock promising lockstep. All three now resolve to one implementation.What changed
packages/objectql/src/plugin.ts— the privateactionObjectKeyis deleted and its callers now callstandaloneActionOwnerKeydirectly (same package, no dependency question).packages/runtime/src/action-execution.ts—standaloneActionOwnerKeyjoins the ADR-0110 re-export block that already exists in that file for exactly this purpose, andstandaloneActionObjectNamebecomes a delegating alias whose whole body isreturn standaloneActionOwnerKey(action);.packages/objectql/src/action-governance.ts— the docblock sentences naming the copies are gone, replaced by a statement of where the one implementation lives and a note not to re-inline it.The convergence, proved rather than asserted
Rungs 1 and 2 of the ladder, counted across
packages/objectql/srcandpackages/runtime/src:objectName)object)13bf05d3fThe one surviving carrier is
action-governance.ts:92-93.standaloneActionObjectNamekeeps no body of its own, and noactionObjectKeysymbol survives in either package.The divergence this removes, which the card did not name
Copy 3 did not merely spell the ladder again. Its terminal rung returned the bare string literal
'global'(plugin.ts:2242onorigin/main), while copies 1 and 2 both return the sharedGLOBAL_ACTION_OBJECT_KEYconstant. Re-measured here on13bf05d3f: the constant is declared'global'ataction-governance.ts:61, and all three ladders were driven over a twelve-row truth table (both rungs, the empty-string and wrong-type fall-throughs, null and undefined actions) and agreed on 12 of 12 inputs. So nothing was broken and this stayed a convergence card, not a defect card.What copy 3 was, was the one spelling that would have parted from the other two in silence the day that constant's value changed — equal in value, invisible to every test in the repo. The same bare literal in the plugin's
isArtifactShippedActionreader (objectKey !== 'global') is converged to the constant with it, so the file no longer carries a spelling that can drift from the constant it is supposed to track.Three dispatch assumptions that measured differently
plugin.ts:2260.actionObjectKeyactually had four call sites —:2260,:2612,:2615and:2653. The deletion is still right; all four now call the canonical helper.standaloneActionOwnerKeywas not on@objectstack/objectql's published entry, so the runtime could not import it from the package root at all. Adding it topackages/objectql/src/index.tsis a fourth file, mechanically forced by step 2, and it is what makes objectql the package whose surface grows.minorlands on objectql, not on runtime. Measured in the built artifacts with a positive control:standaloneActionOwnerKeyis declared and exported inpackages/objectql/dist/index.d.ts, whilestandaloneActionOwnerKey,standaloneActionObjectNameandGLOBAL_ACTION_OBJECT_KEYeach appear 0 times inpackages/runtime/dist/index.d.tsagainst a control of 32 forHttpDispatcher—action-execution.tsis not re-exported frompackages/runtime/src/index.tsand the package publishes only.. Hence@objectstack/objectql: minor,@objectstack/runtime: patch.The
_depsdecisionKept, as a delegating alias. The engine helper is
standaloneActionOwnerKey(action); the runtime name isstandaloneActionObjectName(_deps, action). Every caller was measured first: exactly two, both insideaction-execution.tsitself (:1524,:1699), no test importer, no other package. Dropping_depswould move an exported signature to save two characters at two internal call sites, so the alias keeps its arity and its meaning andownsRouteplus any out-of-repo importer compile and behave exactly as before.Reverse verification
The docblocks that promised lockstep are replaced by welds that enforce it —
action-owner-key-single-source.test.tsin each package, each scoped to its own package's source so neither becomes a cross-package test input. Both were ablated from the committed tree, each mutation confirmed on disk by grep counts before the run and each restore proved by hash equality with the HEAD blob plus an emptygit diff HEAD:['action-governance.ts', 'plugin.ts']and the returned private method.git status --porcelainempty.Also in this diff
content/docs/permissions/system-context.mdx— the two lines added to the import and re-export blocks shifted every anchored line inaction-execution.tsbelow them by exactly two, socheck:check-system-context-censuswent red on pure line rot. Repaired by the gate's own--fix, which re-anchored:64to:66,:136to:138and:399to:401and touched nothing else. Not a behaviour change; the cost of the diff, paid in the diff.packages/runtime/src/http-dispatcher.actions-global-key.test.ts— one clause of a docblock that namedObjectQLPlugin.actionObjectKeyas a live symbol.Verification, all at
e9043cc36pnpm --filter @objectstack/objectql exec vitest run— 264 files, 4550 tests, all passed.pnpm --filter @objectstack/runtime exec vitest run— 210 files, 3092 tests, all passed.pnpm --filter @objectstack/objectql --filter @objectstack/runtime run typecheck— clean, including objectql'scheck:test-typecheck(44 files / 242 errors / 69 pinned signatures, ratchet held). The new objectql test file is in that program, confirmed with--listFiles. The new runtime test file is read by no tsc program (runtime'stypecheckexcludes tests, TEST_DEBT ledger), so its enforcing runner is vitest alone — stated rather than implied.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands: 62 families, all green. The docs file above pulled in 24 families beyond the first derivation, which is why it was re-derived after the tree was final.check-test-completenessandpm/check-half-statesexit 3 by their own definition when run without CI's arguments and are recorded NOT MEASURED, not green.check:dual-build-cjs-loadsandcheck:type-check-debtalso exit 3 until the workspace is built; the full package closure was built and both then reported OK.pnpm lintover the whole repo exit 0 (no narrowing claimed),pnpm check:nul-bytesOK over 7,998 files,pnpm check:error-status-conformanceOK.No
package.jsonis touched, soValidate Package Dependenciesis not implicated by this branch.🤖 Generated with Claude Code
https://claude.ai/code/session_0112hMx9hjJ9BgB28X97DS68
Generated by Claude Code