Skip to content

Commit ed44fe2

Browse files
committed
docs(openspec): say what "reuse" means for each of the three
Review feedback on #235. D1 claimed `submitRule`, `pollRuleStatus` and `writeRuleFile` are "reused, not reimplemented", and for two of the three that is not true yet. Both requesters are hardcoded to the rule-family endpoints and take a required `token`, which `createApiClient` turns unconditionally into an `Authorization: Bearer` header. The demo is unauthenticated by requirement, so neither is usable as written. The path half resolves itself when the client adopts the renamed family; the token half does not, and is the durable part. The reason this is worth more than the wording: D1's failure test says "if the demo needs a new writer, the shapes have diverged, and the demo has done its job by failing". That test is a claim about PAYLOAD SHAPES, and it was already tripping — for the requester and the poller, where it means nothing of the kind. A requester needing a second argument says nothing about whether the demo and the mainline agree on what a rule looks like. So D1 now splits them. `writeRuleFile` is byte-for-byte reuse and is what the failure test is really about. The other two are two small changes to functions written when every caller was authenticated, and they are planned as task 1.2a rather than discovered mid-implementation, which is what the previous wording set up. 1.2b is the part nobody raised: an unauthenticated call must send no `Authorization` header rather than one carrying an empty token. A header the service then has to decide how to ignore is a worse contract than its absence.
1 parent 52d2b6c commit ed44fe2

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

‎openspec/changes/runtime-demo-path/design.md‎

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,32 @@ demo uses would demonstrate something no user is on. Mirroring also means the
5151
demo covers polling and the terminal `failed` and `unsupported` states for
5252
free, because it is the same client code reaching them.
5353

54-
Concretely: `submitRule`, `pollRuleStatus` and `writeRuleFile` are reused, not
55-
reimplemented. If the demo needs a new writer, that is evidence the shapes have
56-
diverged, and the demo has done its job by failing.
54+
Concretely, and the three are not equal — saying "reuse" without splitting them
55+
would make the failure test below fire for a reason it was not built to catch.
56+
57+
**`writeRuleFile` is reused byte for byte, and it is what the test is about.**
58+
It carries the path checks, the completeness rules, the layout validation and
59+
the refusal to write a runtime rule with no captures. **If the demo needs a
60+
different writer, the payload shapes have diverged**, and the demo has done its
61+
job by failing. That is the signal worth having, and it is the whole reason for
62+
mirroring the delivery variant.
63+
64+
**`submitRule` and `pollRuleStatus` need work first, and that is a task rather
65+
than a divergence signal.** Both are hardcoded to the rule-family endpoints and
66+
both take a required `token`, which `createApiClient` turns unconditionally into
67+
an `Authorization: Bearer` header. The demo is unauthenticated by requirement
68+
(D3), so neither is usable as it stands: the endpoint has to be a parameter, and
69+
the token has to be optional.
70+
71+
The path half of that resolves itself when the client adopts the renamed family,
72+
which is out of scope here. The token half does not, and is the durable part.
73+
Neither is evidence of anything having gone wrong — they are two small changes
74+
to functions written when every caller was authenticated, and they are planned
75+
in task 1.2a rather than discovered during implementation.
76+
77+
The distinction matters because D1's failure test is a **claim about payload
78+
shapes**. A requester that needs a second argument says nothing about whether
79+
the demo and the mainline agree on what a rule looks like.
5780

5881
### D2 — The demo tracks the mainline's naming, and follows rather than leads
5982

‎openspec/changes/runtime-demo-path/tasks.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ what produced the seam this change is closing.
3030

3131
- [ ] 1.1 Add the demo endpoints to `src/api/`, reusing the existing client rather than a second fetch layer
3232
- [ ] 1.2 Drive them through `submitRule`/`pollRuleStatus`, so polling and the terminal `failed`/`unsupported` states are the same code an ordinary generation uses
33+
- [ ] 1.2a Make that reuse possible first: `submitRule` and `pollRuleStatus` are hardcoded to the rule-family endpoints and take a required `token` that `createApiClient` turns into an `Authorization` header unconditionally. Parameterize the endpoint and make the token optional. **Not a divergence signal** — see D1; these were written when every caller was authenticated, and the demo is the first that is not
34+
- [ ] 1.2b Confirm an unauthenticated call sends no `Authorization` header at all, rather than one with an empty token. A header the service must then decide how to ignore is a worse contract than its absence
3335
- [ ] 1.3 Write through `writeRuleFile`. If the demo needs its own writer, stop: the shapes have diverged and that is the finding
3436
- [ ] 1.4 Report a terminal status by surfacing the service's reason, which `unsupportedMessage` already prefers over our own text
3537
- [ ] 1.5 Regenerate `src/generated/api.d.ts` once the endpoints are published

0 commit comments

Comments
 (0)