Uh oh!
There was an error while loading. Please reload this page.
refactor(cli): spell the multi-org runtime from ONE declaration, with the static keeping its name (#12579) - #12763
Conversation
…ing the static's name `Serve.ORGANIZATIONS_RUNTIME_PKG` is assigned from the shared `utils/tenancy-posture-hints.ts` const instead of spelling the package a second time. The static keeps its NAME — the roster pin, the host-anchoring sweep and the rendered-message pins all address it — so only the spelling moved. The host-anchoring sweep's import-alias hop resolves the load through that assignment, which gives the hop its first live consumer; the equality pin that held the two declarations together retires with its subject, and the four docblocks that pointed at an undecided question now state the decision taken. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjujZN219uFzBhSYfMykCd
📓 Docs Drift CheckThis PR changes 1 package(s): 17 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 4 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 23 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 2c536ac44ad9b03fca66d6dcb84f4251846e0efa && git checkout 2c536ac44ad9b03fca66d6dcb84f4251846e0efa
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5700d83b3c8b1c9396de96f87611c6f128f26528 3e08c48661f5d73ba2be85070277985317e18187 && git checkout -B drift-repro 5700d83b3c8b1c9396de96f87611c6f128f26528 && git merge --no-ff 3e08c48661f5d73ba2be85070277985317e18187
node scripts/docs-audit/affected-docs.mjs --json 5700d83b3c8b1c9396de96f87611c6f128f26528
|
Uh oh!
There was an error while loading. Please reload this page.
Fixes#12579
Fork (b) only — the half the maintainer ruled on (2026-08-27, Option A). Fork (a), the note repair, landed as PR #12636 and is not redone here.
Serve.ORGANIZATIONS_RUNTIME_PKGis now assigned from the shared const inpackages/cli/src/utils/tenancy-posture-hints.tsinstead of spelling@objectstack/organizationsa second time. One declaration, one spelling.The four things that had to move together
serve.tsimports the shared const under a renamed binding and assigns the static from it.serve-cluster-host-resolution.test.ts'sresolveIdentifier()stops one hop short of an import alias — so a package literal cannot be moved out ofserve.tswithout silently emptying the sweep #12533 left it alone.serve.ts,utils/tenancy-posture-hints.ts,serve-organizations-message-spelling.test.ts,doctor-organizations-message-spelling.test.ts.doctor.tsrepeats serve'sisolatedposture sentence verbatim with its own bare@objectstack/organizationsliteral — and single-sourcing it is a coupling decision, not a substitution #12464's coupling ruling —os doctormust never depend on aservecommand's export to spell a package name — and is kept byte-identical: that paragraph occurs once in the merge base and once here, unmodified. Its connective "instead" still has a referent, because the paragraph above it was repaired in place rather than deleted.A fifth file, named because it is not a drive-by
serve-cluster-host-resolution.test.tscarried "NOTHING IN THE TREE USES THIS HOP YET" and gave exactly that as the reason its fixture package exists. This change makes both sentences false, so repairing them belongs in this diff: leaving them is the same defect fork (a) just fixed, running the other way. Its executable content is untouched — transpiled withremoveComments, the emitted program is byte-identical to the merge base (56086b00415d946fboth sides), and the instrument is calibrated in both directions (one code token moves the hash; one comment token does not).That file is also where the ruling's accepted cost is written down once, where whoever narrows the hop will be standing: narrowing this hop is now a LIVE regression rather than a synthetic one.
The two criteria, falsified separately
The NAME did not move. Every non-comment read of the static, merge base vs this branch: 5 in
serve.ts, 4 intest/serve-capability-vocabulary.test.ts,const PKG = Serve.ORGANIZATIONS_RUNTIME_PKGin the spelling test, and the sweep's fixture strings — all unchanged. The only code lines that moved are the declaration's right-hand side, the import, and site 8's own four lines.The VALUE did not change — measured, not reasoned. A probe rendered every operator-facing string that names the runtime (both install-remedy branches, the ADR-0093 D5 fatal refusal, the degraded-boot warning, the stage-2 mount refusal, the posture fix-list, plus the static itself), on the pre-change tree and on this branch, in the same container and the same way:
The pre-change tree for that run was materialised with
git restore --sourceof the merge base (worktree only, index untouched), so both renders came out of the same build.Evidence that the hop's live consumer is real
Ruling 4 asked for evidence rather than an assertion. One ablation answers both halves: change ONLY the shared const's value and re-read the sweep and the renders.
serve.ts-derived named listserve.ts-derived host-anchoring pinpostureRefusalonlyRead together: before this change
serve.tsdid not consume the shared module at all (its own literal answered both the sweep and the messages) — that is the reproduction of "two live declarations", taken from the sweep's own resolution rather than from a grep count. After it, the sweep resolves serve's real organizations load through the real sibling module, and every operator-facing string is rendered from it.Ablation hygiene: the mutation was confirmed on disk before any verdict was read (anchored counts
injected=1,removed-form=0, plus the blob hash differing from the HEAD blob); restore isgit checkout HEAD --with absolute paths undertrap … EXIT INT TERM; and the restore is proven by an emptygit diff HEADplus blob hashes equal to the HEAD blobs, never by an exit code.Tests and gates — all on
3e08c4866, the final commitpnpm --filter @objectstack/cli exec vitest run --maxWorkers=2over the sweep, both spelling suites and the roster-vocabulary suite: Test Files 4 passed (4) / Tests 63 passed (63). 64 before, 63 after: exactly site 8.pnpm --filter @objectstack/cli typecheck(tsc --noEmit) exit 0, and not vacuous —tsc --noEmit --listFileslists all five edited files, 1 hit each out of 1284, so the green really covers the three edited.test.tsfiles undersrc/commands/.pnpm --filter '@objectstack/cli^...' build), thenpackages/cliitself.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(16 path-matched + the test-file convention kind + the 8 the changeset brings), exit codes captured before any pipe, each quoted from the gate's own verdict line — all exit 0:check:nul-bytes("OK (scanned 7092 text file(s) … no raw ASCII control bytes)"),check:cross-package-test-inputs,check:objectql-double-limit,check:page-declaration-shape,check:published-files,check:route-envelope,check:slot-lookup("ratchet holds: 107 unswept site(s) … none new"),check:test-source-alias,check:type-source-resolution,check:query-options-erasure("ratchet holds … none new"),check:type-check-coverage,check:engine-double-contract("OK — 691 pinned"),check:where-matcher("308 matcher(s) … correctly or refuse it loudly"),check:changeset-gate-self-tests,check:objectui-changeset,check:pm-half-states,check:i18n,check-ci-filter-parity,check-comment-mask-adoption,check-cross-package-test-inputs,check-plugin-teardown-shape,check-adr-0087-registration,check-changeset-no-major,check-empty-changeset,release-rehearsal-clone --self-test,docs-audit/check-affected-docs.pnpm lint(eslint . --no-inline-config) over the whole repo, exit 0 captured before any pipe. No narrowing is claimed for lint.check:i18n-coverageprints "COULD NOT MEASURE — 1 of 12 config(s) failed to lint" because@objectstack/connector-mcphas no build output in this worktree (it needs the full workspace built, which CI does);scripts/pm/check-half-states.mjsexits 3 ("Nothing was swept … it is no reading at all") for want of a credential this seat does not have;check:type-check-debt --re-measureneeds the whole workspace closure built and was not run.A
patchchangeset for@objectstack/cliis included.skip-changesetwould have been wrong here: unlike fork (a) this diff does change the emitted program, and the two sibling refactors in this same family (#12464, #12151) each shipped a patch changeset while stating "no behaviour change" — the same shape as this one.Generated by Claude Code