Commit d4e0809
* feat(spec): ActionSession declares `positions` as canonical, `roles` as its deprecated alias (#5779)
The spec half of #5613 phase 2, under the maintainer's contract-first ruling
("C skeleton + A semantics"). Phase 1 (#5697) declared the action-body
`ctx.session` shape exactly as `buildActionSession()` built it and deliberately
withheld a `positions` key — "minting one before the migration would ship two
live spellings of one value". That prohibition existed to stop a two-spelling
window opening without a closing date; this change opens it WITH one, and
rewrites the docstring that carried the ban.
`positions` is now the canonical key: the ADR-0090 D3 vocabulary the execution
context, the sharing service and (since #5605 / PR #5722) the hook `ctx.session`
already speak. `roles` becomes a deprecated alias of it, removed after one
window on the path `session.tenantId` already walked (#3280 deprecated, #3290
removed in v11).
The ADR-0087 semantic migration `action-session-roles-to-positions` is the
reader-facing channel. It is a D3 semantic TODO rather than a D2 conversion on
two independent grounds: an action `ctx.session` is constructed per dispatch and
never persisted, so there is no source for the chain to rewrite; and the only
place the key is ever spelled is inside an action body, i.e. free-form
author-written code, which is why the ADR-0090 wave delegated
`current_user.roles` at step 13 instead of substituting text. The alias is
deliberately NOT tombstoned — a tombstone rejects the key, which is the removal
a deprecation window exists to defer.
Contract leads producer: `buildActionSession()` dual-emitting both keys, and the
two wrong sentences already tracked in its docblock, are #5613's runtime half
and are not in this change. `packages/runtime` is untouched. Both keys are
optional, so the runtime consistency pin
(`action-session-shape-contract.test.ts`) is unchanged and stays green — a
non-strict parse of a session without `positions` neither gains the key nor
rejects the object. Measured before and after: 10/10 passing both times.
Claude-Session: https://claude.ai/code/session_018fxLGQdatPbBUvCgiVxg6D
Co-authored-by: Claude <noreply@anthropic.com>
* fix(spec): keep the removed `session.tenantId` token out of published describe text (#5779)
`check:org-identifier` is a hard-fail guard, and it skips COMMENT lines but not
code — so naming the removed alias in a JSDoc note is documentation, while
naming it inside a `.describe()` string or a migration `reason` is a published
string the gate rightly refuses. Those strings are not incidental: a
`.describe()` lands verbatim in `content/docs/references/`, which is exactly the
author-facing prose an AI copies a hook or action body from, and the guard
exists because a `session.tenantId` read there resolves to `undefined` (#3290
removed it in v11).
Three occurrences reworded to "the v11 session-alias removal path", keeping the
#3280 → #3290 anchor that makes the precedent findable: two `.describe()`
strings on ActionSession (`positions`, `roles`) and the migration entry's
`reason`. The JSDoc mentions are left as they are — the gate permits them by
design, and the pre-existing `organizationId` docblock already names the alias
the same way.
`os-allow-tenant-id` was deliberately NOT used: it is documented for the rare
genuine driver-layer read, and spending it on prose would launder a
documentation reference past a guard that has zero baselined occurrences.
Generated artifacts regenerated from the reworded source; the `#3290` assertion
in the description pins still holds.
Claude-Session: https://claude.ai/code/session_018fxLGQdatPbBUvCgiVxg6D
Co-authored-by: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 72c3c86 commit d4e0809
8 files changed
Lines changed: 400 additions & 25 deletions
File tree
- .changeset
- content/docs/references/ui
- docs
- packages/spec
- src
- migrations
- ui
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
342 | 345 | | |
343 | 346 | | |
344 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6927 | 6927 | | |
6928 | 6928 | | |
6929 | 6929 | | |
| 6930 | + | |
6930 | 6931 | | |
6931 | 6932 | | |
6932 | 6933 | | |
| |||
0 commit comments