Skip to content

Commit 61aba08

Browse files
committed
fix(spec)!: the automation resume contract's code type follows the rename
The resume result's `code` is a literal-union TYPE in the service contract, not just a value, and batch 2 renamed only the values plus the docstring beside it. Nothing in spec failed: `tsc --noEmit` on the declaring package is happy with a narrower union than its callers emit. The break surfaced two packages away — the dts build of every consumer of @objectstack/spec/integration, which is what took Build Core, Test Core and the dogfood shards red at once. Added to the ADR's sweep checklist as its own row, since it is the one form whose error appears in a package the sweep never touched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MaSQn77TT5fUgHK9CesaDK
1 parent 449a983 commit 61aba08

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

docs/adr/0112-error-code-vocabulary-and-ledger.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ A `code: 'x'` grep finds the easy half. Each of these forms was missed once and
6767
| Indirect / computed | `const code = intent === 'runtime-only' ? 'not_creatable' : 'not_overridable'` | the literal never sits next to the word `code:` |
6868
| Regex assertion | `expect.stringMatching(/^(not_overridable\|not_creatable)$/)` | literal is inside a pattern |
6969
| `toBe` assertion | `expect(caught.code).toBe('invalid_metadata')` | test-side spelling of the same contract |
70+
| Literal-union **type** | `code?: 'forbidden' \| 'invalid_signal'` in a contract interface | it's a type, not a value — `tsc --noEmit` on the *declaring* package still passes, and only a **consumer's** `dts` build fails, so the error surfaces in a package you did not touch |
7071
| Doc comment / contract docstring | ``* refused with `{ code: 'forbidden' }` `` | teaches the old spelling to the next author (and to AI) |
7172

7273
Also rebuild dependent packages before trusting a cross-package suite: a stale `dist/` makes the *old* code the one under test, which reads as "my rename broke it" (or, worse, as a false green).

packages/spec/src/contracts/automation-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export interface AutomationResult {
180180
* Both refuse before consuming the suspension: the run stays parked and the
181181
* legitimate continuation still lands.
182182
*/
183-
code?: 'forbidden' | 'invalid_signal';
183+
code?: 'PERMISSION_DENIED' | 'INVALID_SIGNAL';
184184
/**
185185
* Lifecycle status. `'paused'` means the run suspended at a node (e.g.
186186
* an Approval node awaiting a human decision, ADR-0019) and can be

0 commit comments

Comments
 (0)