Repository navigation
Commit 370833a
feat(spec): ApprovalRequestRow declares current_step_label, the sys_approval_request column's own name for the step label (#24329)
Fixes #24309
Clause-②: yes
## What this changes
`ApprovalRequestRow` (`packages/spec/src/contracts/approval-service.ts`)
now declares an optional `current_step_label?: string` in its
display-enrichment block, beside `step_label`. Its docblock says what it
is: the declared `sys_approval_request.current_step_label` column under
its own name, served so that a page bound to `sys_approval_request` can
list the step by its label. Such a page names the object's declared
fields, and `step_label` is not one of them, so today the request page's
strip can list only `current_step`, the node's machine id.
`step_label` stays, so no reader moves.
This is the spec half of the split that triage took on the consumer card
(option A). The services half serves the member from plugin-approvals'
`rowFromRequest` and lists it on the strip. That half is the consumer
card's own work: #24281 remains open, and this PR does not touch
`packages/plugins/plugin-approvals/**` or the request page.
## Files
- `packages/spec/src/contracts/approval-service.ts`: the member and its
docblock.
- `packages/spec/src/contracts/approval-service.test.ts`: four pins
beside the existing `acted_as` and `organization_id` pins:
- a `{} extends Pick` alias that turns red on a required member;
- an exact `string | undefined` alias;
- `step_label` at the same shape;
- a runtime read-back on a row without the member and on a row with it.
- `.changeset/24309-approval-current-step-label.md`: `minor` on
`@objectstack/spec`, `Clause-②: yes (widening)`.
No generated artefact moved. After a rebuild, `check:generated` reports
all 14 artefacts up to date. `api-surface/` records that the interface
exists, not its members.
## Premise, re-read on `origin/main` `52ff308b8`
- `ApprovalRequestRow` is at `approval-service.ts:138`, and
`step_label?: string` is at `:223`, with no `current_step_label`.
- `sys_approval_request` declares the column `current_step_label`
(`sys-approval-request.object.ts:330`, a readonly `Field.text`).
- plugin-approvals' `rowFromRequest` serves the label only as
`step_label` (`approval-service.ts:1183`).
## Who reads the type
- **This repo** (`git grep ApprovalRequestRow`):
- `@objectstack/spec`: the contract and its test;
- `@objectstack/client`;
- `@objectstack/plugin-approvals`: the producer, `action-link-pages.ts`,
and seven test files.
No `keyof ApprovalRequestRow` map or exhaustive `Record` over its keys
exists, so an optional member breaks no reader.
- **objectui**, read at both its pin before the merge (`5e15928b4631`)
and its pin after it (`0707b4ae3712`):
-
`packages/app-shell/src/views/approval-decision/ApprovalDecisionPanel.tsx`
imports the spec type, and only through a `Pick` of `payload` and
`payload_display`;
- the console inbox (`apps/console/src/services/approvalsApi.ts`)
declares its own local `ApprovalRequestRow` and reads `step_label` from
it.
Neither is affected.
## Verification
Final head `11acbc435` (the claim's commit `ef7bb1a93`, plus a merge of
`origin/main` `2ce2e3699` made with `os-regen-merge.sh`). Every build
and test ran through `os-verify-lock.sh`, except the one-file probe
`tsc` below.
- `pnpm --filter @objectstack/spec build`: VERDICT command-exit 0. The
member reaches only `dist/contracts/index.d.ts` and `index.d.mts`; no
emitted JS carries it.
- `pnpm --filter @objectstack/spec check:generated`: exit 0, "All 14
generated artifacts are up to date". Nothing was regenerated.
- `pnpm --filter @objectstack/spec typecheck`: VERDICT command-exit 0.
This includes `check:test-typecheck`, which compiles the new pin file
(counted with `--listFiles`): "52 file(s) / 242 error(s) / 132 pinned
signature(s) held", unchanged from the ledger.
- `pnpm --filter @objectstack/spec test`: VERDICT command-exit 0. "Test
Files 694 passed (694)", "Tests 21042 passed, 1 todo". The pin file
alone: 9 of 9 passed (8 before this PR).
- Consumers. First `turbo run build
--filter='@objectstack/plugin-approvals^...'
--filter='@objectstack/client^...' --concurrency=2`: "34 successful, 34
total". Then `pnpm --filter @objectstack/plugin-approvals --filter
@objectstack/client typecheck`: VERDICT command-exit 0, `tsc --noEmit`
plus `check:test-typecheck` OK for both. The build filter is the two
consumers' dependency closure, `@objectstack/spec` included.
- Reverse verification, at `ef7bb1a93`: a probe file in plugin-approvals
typed two rows as `ApprovalRequestRow`. With `current_step_label:
'Manager Review'` the row compiled clean. With `current_step_label: 42`,
`tsc` printed exactly one error, TS2322 "Type 'number' is not assignable
to type 'string'". A stale `.d.ts` would have answered TS2353 on both
rows, so the consumer reads the rebuilt declaration. The probe was
deleted, and `git status` is clean.
- Ablation, at `11acbc435`, through `scripts/ablation-replace.mjs`: the
anchor went from 1 hit to 0 and the blob from `e1e2e927` to `9515560b`.
The member deleted, `check:test-typecheck` went red:
"src/contracts/approval-service.test.ts: 7 type error(s)". Restored: the
blob equals the HEAD blob `e1e2e927`, and `git diff HEAD` is empty. The
pin is a compile-time pin: its teeth are `check:test-typecheck`, inside
the spec `typecheck` that the required `TypeScript Type Check` job runs.
- Gates: `dispatch-gates --commands` (no paths) derived 86 families at
`11acbc435`. All 86 ran with exit 0. `dispatch-gates --ran`: "86
derived, 86 run, 0 NOT-MEASURED, 0 UNRUN".
## Acceptance notes
- **Declared ahead of its producer.** Until #24281 lands, the approvals
get does not carry `current_step_label`. The member is optional, and its
docblock says it is served from #24281 on. That split and its order are
triage's ruling on the consumer card.
- **objectui typecheck: not run locally.** objectui resolves the
published `@objectstack/spec`, not this worktree, so a local run would
measure nothing about this diff. The one spec-type import is a `Pick` of
two members this PR does not change. The full battery's `Console Pin
Gate` builds objectui at its pin against `main`.
- **Not run locally, left to CI.** `test:repo` (the vitest `repo`
project): this diff touches none of its tests. The `check:dev-prereqs`
scan: its self-test is green, but its existence half needs the whole
workspace built, which this card does not need. `TypeScript Type Check`,
`Test Core` and `Lint & Repo Gates` run the full set on this PR.
- `origin/main` moved three commits after the merge (`2b7fc52c3`,
`889bf122e`, `85be049d5`). None of them touches `packages/spec` or these
files, so the branch was not merged again.
---
_Generated by [Claude
Code](https://claude.ai/code/session_019oFY6Hi35J7atvgVFnmoaK)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent ec749fb commit 370833a
3 files changed
Lines changed: 78 additions & 0 deletions
File tree
- .changeset
- packages/spec/src/contracts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
113 | 166 | | |
114 | 167 | | |
115 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
224 | 238 | | |
225 | 239 | | |
226 | 240 | | |
| |||
0 commit comments