Repository navigation
feat(runtime): export the package disable door's dependent-rule verdict and its sentence on the package entry - #31157
Conversation
…ct and its sentence readPackageDisableDependents and formatPackageDisableDependents (with the DisableDependentRule type) on the @objectstack/runtime entry: the same two functions PATCH /packages/:id/disable and the install arm ask, so a host door that takes a package out of service another way answers the same 409. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2dLQEXWGsE2SZ3Qn5F
…erdict Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2dLQEXWGsE2SZ3Qn5F
…port-disable-verdict
📓 Docs Drift CheckThis PR changes 1 package(s): 4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 28 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 979d03929bd20487d813e839fcfc87198529a1f4 && git checkout 979d03929bd20487d813e839fcfc87198529a1f4
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin cbe20ab0c4d2b20d84db8a88a85698eadcd0a5b7 72296d6c61dd32ff7b45236b4f39c4f51c322a21 && git checkout -B drift-repro cbe20ab0c4d2b20d84db8a88a85698eadcd0a5b7 && git merge --no-ff 72296d6c61dd32ff7b45236b4f39c4f51c322a21
node scripts/docs-audit/affected-docs.mjs --json cbe20ab0c4d2b20d84db8a88a85698eadcd0a5b7
|
|
domain:server#4 · marchtian · session_017ihL2dLQEXWGsE2SZ3Qn5F Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
domain:server#4 · marchtian · session_017ihL2dLQEXWGsE2SZ3Qn5F 席位核对 — ACCEPT · domain:server#4 · Head-sha:
|
Requested by 田騏 · project thread
Fixes #31067
Clause-②: yes
Metadata-protocol: none
维护者速读
@objectstack/runtime的公开导出开放出来(readPackageDisableDependents、formatPackageDisableDependents、DisableDependentRule类型);平台自己的停用接口用的就是同一份。packages/runtime/src/index.ts(新增的三项导出)、packages/runtime/src/domains/packages.ts(两个函数加export和说明)、测试文件末尾新增的 describe。pnpm --filter @objectstack/runtime exec vitest run src/domains/packages-disable-module-extension-fields.test.ts,预期 33 个用例全部通过(其中 4 个是新增的)。What changes
packages/runtime/src/domains/packages.ts:readDisableDependentRulesanddisableDependentRulesMessagegainexportand a JSDoc paragraph naming their public spelling. No line of either body changes, and both call sites (PATCH /packages/:id/disableand thePOST /packagesenableOnInstall: falsearm) still call them directly.packages/runtime/src/index.ts: the package entry re-exports them asreadPackageDisableDependentsandformatPackageDisableDependents, named after what each answers, with theDisableDependentRuletype beside them. The door's function and the entry's export are the same function object, so there is one scan and one sentence. The test pins that identity..changeset/31067-runtime-export-disable-dependents.md:@objectstack/runtimepatch, carrying both declaration lines.Clause-②: the package entry's public surface widens by two functions and one type. The seat owes the contract review.
Tests
A new top-level describe in the existing harness file
packages/runtime/src/domains/packages-disable-module-extension-fields.test.ts,[#31067] the verdict the disable door asks is the package entry's export. It uses a bareSchemaRegistryplus the realHttpDispatcherand boots no kernel. It has four cases:runtime.readPackageDisableDependentsisreadDisableDependentRules, andruntime.formatPackageDisableDependentsisdisableDependentRulesMessage.[]for a package that withholds nothing and for a registry it cannot read.409 PACKAGE_DISABLE_RESTRICTED_BY_VALIDATION_RULEmessage equals exactly what the exported builder spells over the exported verdict. The sentence is also spelled out literally once.[]and the door answers200.The existing #30825 / #30379 / #30756 batteries in the same file are untouched and green.
Acceptance notes
PACKAGE_DISABLE_RESTRICTED_BY_VALIDATION_RULEis not exported from runtime. It is already in the@objectstack/specerror-code ledger (ApiError['code']), so a host door can spell it type-checked from there. Exporting the runtime wire pair as well would be a second public spelling of the same code.registrystays typedany, as the door passes it. The verdict probesgetObjectContributors/getAllObjectsand answers[]for anything without them. A narrower structural type would be a separate contract decision.DELETEdoor are not touched. runtime: uninstalling a package (DELETE /packages/:id) withdraws its extension fields with no scan, so another package's active validation rule that reads one breaks every write (#30379 follow-up) #30999 and packages: DELETE /api/v1/packages/:id deletes unattributed (no actor), and the in-process deletePackage leaves the per-environment disable record behind #31023 queue behind this card.Verification
Tree
objectstack-ai/objectstack. The runtime suite and the first gate sweep ran onaae146a8(merge base5f003744).origin/main(cadd6aa2) was then merged as72296d6c. Its incoming paths touchformula,plugin-auth,service-settingsandplatform-objects, and none touchesruntimeorobjectql. The delta against main is still exactly these 4 files. After a rebuild, the scoped re-checks and the whole derived gate sweep ran again on72296d6c.Runtime package
pnpm --filter @objectstack/runtime exec vitest run --project local --maxWorkers=2:: exit 0 (onaae146a8). Test Files 554 passed (554), Tests 8918 passed / 19 skipped.72296d6c:pnpm build(119/119)&& pnpm --filter @objectstack/runtime typecheck && vitest runof the three disable-door files (packages-disable-module-extension-fields,packages-disableable-verdict,packages-disable-app-module) :: exit 0. Test Files 3/3, Tests 82/82.pnpm --filter @objectstack/runtime typecheck:: exit 0. The test layer holds 27 files / 186 errors / 66 pinned signatures, unchanged.eslint packages/runtime --no-inline-config:: exit 0.Derived gates (dispatch-gates --commands)
On
72296d6c, all 62 derived commands exit 0, each exit code captured before any pipe (check:type-check-debtran under the verify lock).dispatch-gates --ran: 62 derived, 62 run, 0 NOT-MEASURED (a derived zero: every entry carries an exit code).On the first sweep (
aae146a8), three commands exited 3 and were rerun green.check-plugin-teardown-shape --self-testcould not reach its control commit on the shallow clone; that commit was fetched into a private ref.check:dual-build-cjs-loadsneeded a fullpnpm build.check:type-check-debttimed out in the lock queue.🤖 Generated with Claude Code