refactor(spec,plugin-sharing)!: retire the exported SharingExecutionContext type (#7218) - #7325
refactor(spec,plugin-sharing)!: retire the exported SharingExecutionContext type (#7218)#7325os-zhuang wants to merge 4 commits into
SharingExecutionContext type (#7218)#7325Conversation
…Context` type (#7218) The deferred deletion recorded when #7070 split the convergence in two. #6523 / PR #7068 converged 36 contract signatures onto the full `resolveAuthzContext` envelope (the #6206 ruling: enforcement adjudicates on the whole envelope, never a per-site subset); PR #7140 (identity: plugin-sharing, plugin-audit) and PR #7206 (services: plugin-approvals, plugin-reports) re-annotated the implementations. Both halves landed with the type still exported because it is DEFINED in `packages/spec`, whose retirement is the spec seat's to make. Nothing declares it any more, so it goes — from `@objectstack/spec` and from `@objectstack/plugin-sharing`, which re-exported it. Public-surface removal on two packages, so both generated snapshots are regenerated (`api-surface/contracts.json`, `export-origins/contracts.json`), and the changeset carries the callout plus an ADR-0087 D3 semantic entry (`sharing-execution-context-retired`): a published TypeScript surface with no spec schema has no `retiredKey()` tombstone and no parse rejection, so the ledger is the only channel that reaches an upgrader. The pins needed the deliberate pass, not a find-and-delete. All three `exec-context-annotation.pin.ts` files told their failure story as "the parameter narrows back to `SharingExecutionContext`" — a type the deletion removes, while the failure mode it named survives: the six fields can be re-declared under any name, and the fresh-literal excess-property checks fire only on the fields a given literal happens to spell. Each pin now keeps the retired shape as a local, non-exported SPECIMEN and refutes every enforcement parameter against it by type identity, so a re-narrowing is red twice over and neither check depends on the retired export coming back. `packages/spec/src/contracts/sharing-service.test.ts` is re-anchored the same way, and its "twin unchanged in shape" case becomes "twin stays retired". The narrative the retired type's doc block carried — the measured `(context as any).posture` specimen, and why tsc cannot police narrowing at all — moves to the module doc of `contracts/sharing-service`, which the contracts and all three pins now point at. No runtime behaviour changes: the type was erased at compile time and no signature's accepted shape moved. Claude-Session: https://claude.ai/code/session_01ArkxxyvoyPaDhHiX5KhQBi Co-authored-by: os-zhuang <steve@objectstack.ai> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
📓 Docs Drift CheckThis PR changes 4 package(s): 106 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
⛔ 7 release-owned page(s) also reference the affected code. These are read-only:
|
|
PM landing instruction (spec-lane seat #6017, session PR #7322 (#6888 global_nav retirement) merged to Please:
If the merge comes back clean with no conflict, just verify CI green on a refreshed base state and say so. Do NOT enable auto-merge — the PM lands this serially (it gates the #7297 registry-split dispatch). Generated by Claude Code |
…ire-sharing-execution-context
The textual merge kept this branch's side of `spec-changes.json` and `docs/protocol-upgrade-guide.md`, which predate PR #7322's `action-global-nav-location-removed` conversion. Regenerated from the merged registry so both that entry and this branch's `sharing-execution-context-retired` semantic entry project into the artifacts. Generated files, never hand-merged. Claude-Session: https://claude.ai/code/session_01ArkxxyvoyPaDhHiX5KhQBi Co-authored-by: os-zhuang <steve@objectstack.ai> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
Base refreshed and re-verified — new head Merged 1. The predicted conflict did not materialise — but the artifact drift did. The real damage was one layer down, exactly where the note said not to hand-merge: Had I only run 2. Regen order followed: 3. Gate set re-run on the merged tree:
Pushed as two commits — the merge ( Auto-merge not armed — still a draft for your serial landing. Generated by Claude Code |
…ire-sharing-execution-context # Conflicts: # packages/spec/src/migrations/registry.ts
|
Conflict resolved, base refreshed again — new head This time the step-17 conflict the earlier note predicted did fire: PR #7332/#7095's Resolved as a union, both entries kept verbatim, main's in its landed position and this branch's appended after it — so the diff against main stays a pure append and future step-17 landings conflict against my entry alone rather than reordering theirs. Step-17 semantic entries: 47 → 48. Generated artifacts were again deferred by the Re-verified after the regen rather than assumed:
Net diff against main is unchanged at 15 files, +406 / −128 — the merge carried nothing extra. Remote CI on Auto-merge not armed — still draft for your serial landing. Generated by Claude Code |
The #7070 split's deferred deletion. Both consumer halves have landed (PR #7140 identity, PR #7206 services), so the type that #6523 / PR #7068 left behind is removed from the contract surface.
Closes #7218Premise check (on fresh
origin/main@5777b1a)ExecutionContext(#7135) #7206 merged (f40c5b415in history, and the services-half changesetapprovals-reports-exec-context-annotations.mdis in stock) ✅SharingExecutionContextstill defined atpackages/spec/src/contracts/sharing-service.ts:191✅ — nothing had already deleted it.Consumer re-grep (contract-first caution)
Repo-wide grep before touching anything. Only
objectstackis checked out in this session — noobjectui/cloudsibling worktrees exist here, so the cross-repo sweep is the one the card's earlier verification already recorded, not re-run.packages/spec/src/contracts/sharing-service.tspackages/spec/src/contracts/sharing-service.test.tskeyof, 1 value, prosepackages/spec/src/contracts/approval-service.tspackages/spec/src/contracts/report-service.tspackages/plugins/plugin-sharing/src/index.tspackages/plugins/plugin-sharing/src/exec-context-annotation.pin.tsplugin-approvals/src/{approval-node,approval-service}.tspackages/spec/CHANGELOG.md,.changeset/*(3) ,docs/audits/…content/docs/kernel/runtime-services/sharing-service.mdxExecutionContextNo live consumer outside the converged plugins imports the type — every remaining hit was a declaration, a re-export, prose, or a generated artifact. The docs page was the one site not tabled on the card: it spelled
SharingExecutionContextin the published method signatures (already stale since #7068), which a deletion would have turned into a dangling reference, so it is corrected here with a short note on why the whole envelope is what these methods take.Changes
spec/src/contracts/sharing-service.ts(context as any).posturespecimen; why tsc cannot police narrowing) moves into module-doc item 3, which the contracts and all three pins now point atspec/src/contracts/{approval,report}-service.tsspec/src/contracts/sharing-service.test.tsplugins/plugin-sharing/src/index.tsplugins/plugin-{sharing,approvals,reports}/src/exec-context-annotation.pin.tsspec/src/migrations/registry.tssharing-execution-context-retiredspec/{api-surface,export-origins}/contracts.json,spec/spec-changes.json,docs/protocol-upgrade-guide.mdcontent/docs/kernel/runtime-services/sharing-service.mdx.changeset/retire-sharing-execution-context.mdPin rework — the mechanics (the card's judgment item)
The three
exec-context-annotation.pin.tsfiles told their failure story as "the parameter narrows back toSharingExecutionContext". Deleting the type deletes the name in that sentence but not the failure mode: the six fields can be re-declared under any name, and the pins' fresh-literal excess-property checks only fire on the fields a given literal happens to spell (a re-narrowing to a shape that happens to carryposturewould slip past). A blind find-and-delete would have quietly weakened all three.Each pin now:
RetiredSharingContextSpecimen— a deliberate copy, not an import, so nothing depends on the retired name again and the copy is what makes the deletion permanent;Eq/Refute<T extends false>helpers, one tuple slot per parameter (4 in plugin-sharing, 6 in plugin-approvals, 6 in plugin-reports — the reports one includesOwnerContextResolver's return type, since a scheduled run adjudicates on whatever that resolves);@ts-expect-errornegatives untouched, so a parameter erased toanystill fails.Same treatment in
spec/src/contracts/sharing-service.test.ts: the threeRefute<Eq<Ctx, SharingExecutionContext>>pins now measure against the specimen, and the shape-unchanged assertion moved onto the specimen so widening it field-by-field — the per-site subset the #6206 ruling removed — is still refused.Header prose in all three pins gained a "HOW IT BITES, part 2" paragraph stating exactly this, so the mechanism is readable where it is enforced.
Gates — direction predicted first, then measured
check:api-surface/check:export-origins, before regen./contracts − SharingExecutionContext (interface), "1 breaking (removed/narrowed), 0 added"gen:api-surface+gen:export-originscheck:generatedReadFilterContextto the specimenRefuteconstraint violated and the literal checks fireTS2344 Type 'true' does not satisfy the constraint 'false'+TS2353 'posture' does not exist in type 'RetiredSharingContextSpecimen'+TS2322; file restored, green againpnpm typecheckExecutionContext)spec/plugin-sharing/plugin-approvals/plugin-reportstestscheck-changeset-no-major,check-empty-changeset,check-adr-0087-registrationcheck:spec-changes,check:upgrade-guidegen:*Four-step os-regen order followed:
buildfirst (the #7122 stale-dist trap), thenapi-surface/andexport-origins/, thencheck:generated.Deviations from the dispatch card, stated
SharingExecutionContextis the disposition class AGENTS.md names: a published TypeScript surface with no spec schema, so there is noretiredKey()tombstone and no parse rejection that could carry the prescription, and the ledger is the only channel that reaches an upgrader (same call asexport-field-meta-constraints-retiredandhook-context-session-roles-retired). The changeset therefore declares**BREAKING**and carries<!-- adr-0087: registered sharing-execution-context-retired -->. Bump levels stay non-major (specminor,plugin-sharingminor, the two consumers patch) per the launch-window conventioncheck-changeset-no-majorenforces — notecheck:api-surface's advice text asks for a major, which that gate forbids during the window.content/docs/kernel/runtime-services/sharing-service.mdxupdated — not on the card's file-face table, but it named the type in seven live signatures; a hand-written doc (notcontent/docs/references/**, notreleases/).check:generatedflaggedapi-surface/as stale-with-older-dist. Rebuilt and re-checked — snapshots unchanged, so the flag was the guard working, not a real drift.content/docs/releases/anddocs/adr/**: untouched.No auto-merge — the PM lands this serially.
Generated by Claude Code