Skip to content

Commit 15f9906

Browse files
authored
Merge pull request #2360 from fixpoint-labs/epic/hard-gates
spec(epic): the public release installs, and holds its boundaries (FIX-1635)
2 parents ba29a29 + 510e241 commit 15f9906

12 files changed

Lines changed: 1065 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# FIX-1635 · Rules every issue in the set obeys
2+
3+
[Spec](SPEC.md) · [Decisions](DECISIONS.md) · **Rules** · [Plan](PLAN.md) · [Docs](DOCS.md) · [Evolution](EVOLUTION.md)
4+
5+
Each rule says who owns it and where it's checked. "Closure" means FIX-1636's goal check,
6+
run over real HTTP against installed tarballs.
7+
8+
## What a team gets, and what it doesn't
9+
10+
| # | Rule | Owner | Checked at |
11+
|---|---|---|---|
12+
| ER-1 | Every publishable package, packed and installed into an empty ESM project, imports | FIX-1431 | Leg a, a standing CI job FIX-1431 lands · the closure reuses it |
13+
| ER-2 | DevTool cannot be published without its client assets, and serves them from an installed copy | FIX-1334 | Leg a, which FIX-1334 extends · the release build |
14+
| ER-3 | A request id a caller supplies never reaches another user's request record or its items, on any path that writes it, attaches to its stream or resumes it. Reusing another user's id gets the caller its own request | FIX-1018 | Its HTTP case · host and SQLite tests · closure leg b |
15+
| ER-4 | Two users in one tenant with the same request id never share a run-scoped workspace or its resources | FIX-1286 (consumes ER-3) | Its HTTP case · closure leg b |
16+
| ER-5 | A session id reaches only its owner's session record; another user's id is not found | FIX-1022 | Its HTTP case · closure leg b |
17+
| ER-6 | Only an allow-listed source is re-entered from public HTTP by retry, continue or resume | FIX-1021 | Its HTTP case · closure leg b |
18+
| ER-7 | A session's stored flow never authorizes reading another flow's requests or items | FIX-1046 | Its HTTP case · closure leg b |
19+
| ER-8 | A cross-flow dispatch admits the target exactly as ingress would, organization included | FIX-1328 | Its HTTP case · closure leg b |
20+
| ER-9 | A schema-invalid resource write throws and leaves state as it was | FIX-1256 (shipped) | Closure re-runs its test |
21+
| ER-10 | `writable: false` on a collection refuses every write to an existing instance, `create` with `replace` included, and `delete`. Creating a key that does not exist stays open | FIX-1261 with FIX-1510 (shipped) | Closure re-runs its tests |
22+
| ER-11 | On a queue host, a delivery into an existing session runs the recipient under its concurrency policy and incarnation guard; what still can't be honoured is refused by name | FIX-1634 | Its HTTP case, real Redis · closure leg c |
23+
| ER-12 | A non-streaming multi-step turn returns the text the streamed turn would | FIX-1628 | Its HTTP case · closure leg b |
24+
25+
## What no child may do
26+
27+
| # | Rule | Owner · checked at | Because |
28+
|---|---|---|---|
29+
| ER-13 | No Workforce (Layer 2) concept in core, engine, client or react. FIX-1634 is generic; its Workforce adopt child is filed after its Layer 1 shape merges | FIX-1634, the one child near it · its spec review | The owner's layer rule |
30+
| ER-14 | No child reopens org-optional, or deletes a named refusal without restating the guarantee it protected | Every child · FIX-1634's spec names what FIX-1302's `external-dispatcher` refusal guarantees, since it narrows it; each PR review | FIX-1442 is settled; a deleted refusal trades a loud failure for a silent one |
31+
| ER-15 | No child widens: Tier B leftovers, first-hour DX and kitchen-sink polish stay out. Something noticed outside the goal is filed normally, not under this epic | The epic coordinator · each child's PR review against the set table | The set is locked by the owner |
32+
| ER-16 | Every fix lands a regression test that fails on the commit before the hole closed, and no test pins today's defect as a contract. A child named in ER-3 to ER-8, ER-11 or ER-12 lands it as its case in the shared HTTP suite: over HTTP, as the second user where there is one | Each child · its PR names the commit the case failed on | A test that can't fail proves nothing; a control proved at fix time needs no old commit rebuilt at closure |
33+
34+
## How the set is run
35+
36+
| # | Rule | Owner · checked at | Because |
37+
|---|---|---|---|
38+
| ER-17 | A direct-route worker reproduces on current `main` first, and records the result on its Linear issue: reproduces or not, on which commit. No reproduction: it closes with a regression test (ER-16) and the commit that closed the hole, not a rewrite | Each direct-route child · the Linear comment, before its PR opens | D2. The closure cites the record rather than re-deriving it |
39+
| ER-18 | A child's Linear state is mirrored the moment it changes; its route comes from its label | The epic coordinator · every wake | The wake derives blocked-by and route from Linear |
40+
41+
## The closure
42+
43+
| # | The epic is done when | Proved by |
44+
|---|---|---|
45+
| ER-19 | [The goal](SPEC.md#the-goal-and-how-well-know-its-met) is met on one `main` commit: leg a passes in its standing job and fails against the 0.1.1 tarball; the HTTP suite (legs b and c) passes against the installed tarballs; every finding is fixed and retested | FIX-1636's goal check |
46+
| ER-20 | The authentication guide says a caller-chosen id is an address, not an ownership, and the architecture's request-id section no longer calls a request id a capability | FIX-1018's docs change ([DOCS.md](DOCS.md)) |

‎specs/epics/FIX-1635/DECISIONS.md‎

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# FIX-1635 · Decisions
2+
3+
[Spec](SPEC.md) · **Decisions** · [Rules](BUSINESS-RULES.md) · [Plan](PLAN.md) · [Docs](DOCS.md) · [Evolution](EVOLUTION.md)
4+
5+
The calls that sit above any single child. The child set itself is not one of them: the owner
6+
locked it with the FSD Architect on 2026-09-29, including what is out of the epic. "Twelve"
7+
below is that locked set of child issues; FIX-1510 shipped as FIX-1261's sub-issue. Two cards
8+
are the sign-off; the third is an engineering call recorded so no child reopens it.
9+
10+
## The tree
11+
12+
```mermaid
13+
flowchart TD
14+
E["FIX-1635"] --> D1["D1 · one epic, one release-shaped proof"]
15+
D1 -.->|"rejected"| X1["twelve independent fixes, each proved from source"]
16+
E --> D2["D2 · reproduce first, close with a test"]
17+
D2 -.->|"rejected"| X2["implement each ticket as written"]
18+
E --> D3["D3 · FIX-1018 first, the id bound to its owner"]
19+
D3 -.->|"rejected"| X3["FIX-1286 decides first, or re-key the run workspace"]
20+
```
21+
22+
<a name="d1"></a>
23+
## D1 · These twelve are one epic with one release-shaped proof
24+
25+
| | |
26+
|---|---|
27+
| **Instead of** | Fixing each as ordinary backlog, each proved by its own test from source |
28+
| **Because** | What blocks a release is what a consumer meets, and no test in the repo runs as one: 0.1.1 passed `publint`, a dry-run publish and every source test, then failed on its first import. Each security fix is likewise proved one function at a time, never as two users over HTTP against an installed server |
29+
| **Locks in** | A closure run that packs, installs, serves over HTTP and needs a real Redis. It is the most expensive child and it repeats per finding |
30+
31+
**What would change my mind:** evidence that the release is not going to external users soon.
32+
Then these are ordinary bugs, and the closure harness can wait for the launch that needs it.
33+
34+
![D1, is this one epic with one proof: one epic with a release-shaped closure run, chosen, beside twelve independent fixes proved from source. Decides it: a package that fails on import passed every source test. Price: a closure run that packs, installs and needs Redis. Locks in the most expensive child; flips if the release is not going to external users soon.](figures/d1-one-proof.svg)
35+
36+
It comes down to 0.1.1: every source test passed and the first import failed.
37+
38+
<a name="d2"></a>
39+
## D2 · Reproduce on current `main` first; a hole already closed closes with a test
40+
41+
| | |
42+
|---|---|
43+
| **Instead of** | Implementing each ticket's fix as written |
44+
| **Because** | Most tickets were written in August against code that has moved since: the org-required pass (FIX-1442), the public re-entry allow-list (FIX-999), the ESM-extension build step and the release asset build. A fix for a hole that is gone rewrites working code |
45+
| **Locks in** | A direct-route child that no longer reproduces still lands a PR: a regression test through the ticket's own path that fails on the commit before the hole closed. Closing with a comment alone is not done |
46+
47+
![D2, what a worker does with an old ticket: reproduce on current main and close with a test, chosen, beside implementing the fix as written. Decides it: tickets written in August against code that has since moved. Price: a PR even when no code changes. Locks in a regression test for every hole; flips if the tickets were fresh.](figures/d2-reproduce-first.svg)
48+
49+
It comes down to age: an August ticket describes code that later passes may have fixed.
50+
51+
<a name="d3"></a>
52+
## D3 · FIX-1018 lands first; a caller-supplied request id is bound to its owner
53+
54+
| | |
55+
|---|---|
56+
| **Instead of** | FIX-1286 deciding the principal question first in a spec · or giving the run workspace its own user key |
57+
| **Because** | FIX-1018 is a confirmed cross-user read and should not wait on a design review. Its fix answers the question FIX-1286 asks: once no user can adopt another user's request record, two users with one request id already have two records, and the workspace key may need no change. FIX-1634 extends the queue branch where FIX-1018's unguarded write lives |
58+
| **Locks in** | FIX-1286 and FIX-1634 implement after FIX-1018 merges; both specs can start now. A caller-supplied request id stays accepted (callers use it for idempotency), scoped to its owner. FIX-1286 may close as proved by FIX-1018, with its own test |
59+
60+
**What would change my mind:** FIX-1018's reproduction showing the shared workspace survives
61+
per-owner request records. Then FIX-1286 decides independently and the edge comes out.
62+
63+
![D3, which principal fix goes first: FIX-1018 binds the request id to its owner first, chosen, beside FIX-1286 deciding first in a spec and beside a user key on the run workspace. Decides it: FIX-1018 is a confirmed disclosure and its fix answers FIX-1286's question. Price: FIX-1286 and FIX-1634 wait on it. Flips if the shared workspace survives per-owner records.](figures/d3-id-owner-first.svg)
64+
65+
It comes down to a confirmed leak: the design question should not hold the fix for it.
66+
67+
## Who owns what
68+
69+
![Who owns what: thirteen rules by the open children and the closure issue. Each security, integrity, packaging, queue and generator rule has one child that builds it; FIX-1286 and FIX-1634 consume FIX-1018's binding, and FIX-1334 builds on FIX-1431's leg a job; the closure issue runs the children's suite on installed tarballs and consumes every other rule.](figures/ownership.svg)
70+
71+
Every rule a child builds has one owner. A *consumes* cell is a place a child must not
72+
re-decide: FIX-1286 and FIX-1634 build on FIX-1018's binding rather than inventing their own.
73+
The fence and run rules bind every child, so they are not columns here; each names its owner
74+
and where it's checked in [BUSINESS-RULES.md](BUSINESS-RULES.md#what-no-child-may-do).
75+
76+
## Decided in review, recorded so no child reopens them
77+
78+
- **Routes.** Direct: FIX-1018, 1021, 1022, 1046, 1328, 1431, 1334, 1628. Spec: FIX-1634 (how
79+
concurrency is arbitrated across processes is a design question) and FIX-1286 (its issue
80+
asks for a decision). The closure issue is spec: its spec is the QA plan.
81+
- **FIX-1328's "always require an org" option is already the product's direction**
82+
(FIX-1442). Its worker reproduces against that, and does not re-open seam-side admission as
83+
a product fork.
84+
- **FIX-1634 is Layer 1 only.** Nothing in it names a channel, seat or specialist. The
85+
Workforce adopt child is filed after its Layer 1 shape merges, not before.
86+
- **FIX-1628 stays scoped** to the non-streaming step loop.
87+
- **The done rows are re-verified, not reopened.** The closure plan re-runs their tests; a
88+
failure is a new bug child.
89+
- **Leg a is a standing CI job, not a closure step** (round 1). FIX-1431 lands the pack,
90+
install and import job and FIX-1334 adds DevTool's assets to it; the closure reuses it. Its
91+
control is the 0.1.1 tarball, pinned, because "the latest release" stops failing once
92+
anything newer is published.
93+
- **Each child owns its HTTP case and its control** (round 1). The children with a hole or a
94+
behaviour to prove over HTTP add a case to one shared suite, and prove it fails on the commit
95+
before the hole closed. The closure runs the suite against installed tarballs and never
96+
rebuilds an old commit.
97+
- **No shared owner-check rule** (round 1). The principal children keep their parallel
98+
bindings and one not-found shape. A shared owner-scoped lookup is FIX-1018's to offer if its
99+
reproduction produces one; the others may use it, and nothing waits for it.
100+
- **FIX-1286's route stays spec** (round 1). D3 already lets it close as proved by FIX-1018.
101+
102+
## What the end-state POC showed
103+
104+
None built. The children are independent fixes with one ordering edge, and the closure run
105+
is the whole-set proof.
106+
107+
## How it got here
108+
109+
- **Drafted (Sep 29)** from the owner's locked set and the Architect's clusters; the closure
110+
issue FIX-1636 filed; FIX-1018 wired to block FIX-1286 and FIX-1634.
111+
- **Round 1 (Sep 29)** folded a second-look review, the Architect's stamp on it, and the Cursor
112+
and Codex inline comments: leg a moved into standing CI, the children own their HTTP cases,
113+
ER-3 names attach and resume, ER-10 matches the shipped create-if-absent contract, and the
114+
rules were trimmed to ones with an owner.
115+
116+
**Open: none.**

‎specs/epics/FIX-1635/DOCS.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# FIX-1635 · Documentation draft
2+
3+
[Spec](SPEC.md) · [Decisions](DECISIONS.md) · [Rules](BUSINESS-RULES.md) · [Plan](PLAN.md) · **Docs** · [Evolution](EVOLUTION.md)
4+
5+
One shared story changes: which ids a caller may choose, and what choosing one gives them.
6+
Most children change behaviour the docs already promise (a package imports, a guard refuses),
7+
so they publish nothing new. The specifics below belong to the child that ships them.
8+
9+
## The shared promise · UPDATE `apps/docs/docs/server/authentication.md`
10+
11+
A new subsection after "Addressed routes, and what they scope by", **"Ids you choose are
12+
addresses"**. What it has to tell a reader:
13+
14+
- A client may choose its own ids: a `requestId` on an action call, a session id on most
15+
routes. A retried call with the same `requestId` is the same request, not a second one.
16+
- An id is never proof of ownership. Another user's `requestId` gets the caller its own
17+
request; another user's session id is a `404`, the same as an id that doesn't exist.
18+
- So ids need not be unguessable to keep users apart. They leak in headers, URLs and logs,
19+
and nothing relies on them staying secret.
20+
21+
FIX-1018 writes the prose and its example routes, against the behaviour it ships, in its own
22+
PR. This document holds the intent and who publishes what, not a second copy of the draft.
23+
24+
## UPDATE · `docs/architecture/state-and-scopes.md` · "What `requestId` gates, not tenant"
25+
26+
The section calls a request id an unguessable capability that authorizes stream attach and
27+
resume alone. After FIX-1018 it is an address scoped to its owner, and the section says what
28+
attach and resume check instead ([EVOLUTION.md](EVOLUTION.md)).
29+
30+
## Ownership
31+
32+
| Material | Publisher | Specific draft |
33+
|---|---|---|
34+
| "Ids you choose are addresses", above | FIX-1018, once its behaviour is verified | FIX-1018's PR |
35+
| The request-id section of `state-and-scopes.md` | FIX-1018 | FIX-1018's PR |
36+
| The session-id half of the example, and legacy session keys | FIX-1022 | Its PR; links to FIX-1018's subsection |
37+
| A session's flow does not authorize another flow's history | FIX-1046 | Its PR; one sentence in "Addressed routes" |
38+
| The `external-dispatcher` row in `server/background-work.md`'s refusal table, narrowed to what a queue host still can't honour | FIX-1634 | Its `DOCS.md` |
39+
| `writable` on collections | Shipped with FIX-1510 | None |
40+
41+
FIX-1021, 1328, 1431, 1334, 1286 and 1628 restore behaviour the docs already describe, so they
42+
publish nothing. If a worker finds a page that promised the broken behaviour, it corrects that
43+
page in the same PR. No unchanged page is copied here.

‎specs/epics/FIX-1635/EVOLUTION.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# FIX-1635 · Evolution
2+
3+
[Spec](SPEC.md) · [Decisions](DECISIONS.md) · [Rules](BUSINESS-RULES.md) · [Plan](PLAN.md) · [Docs](DOCS.md) · **Evolution**
4+
5+
Only lineage that spans more than one child. Child-specific lineage belongs in FIX-1634's and
6+
FIX-1286's own specs.
7+
8+
| Prior intent and precise source | Treatment | Reason / evidence | Replacement | Compatibility |
9+
|---|---|---|---|---|
10+
| FIX-1442: every session and request carries an organization, owned by the verified principal. Source: its Linear spec document and review PR #1899 (no retained repository set) | **Retained** | Shipped (Done, 2026-09). FIX-1328's second option is this rule; the principal cluster builds on it | ER-8, ER-14 | Nothing changes for org identity |
11+
| FIX-682: session keys and re-entry scoped by tenant. Source: `packages/engine/src/stores/scope-keys.ts` → `resolveSessionStorageKey` | **Amended** by FIX-1022 | The tenant wall holds; users inside one tenant were never separated | ER-5 | Existing tenant-only keys are still read by their owner (BP-030) |
12+
| FIX-999: public re-entry admits an allow-list of sources. Source: `packages/engine/src/routes/public-reentry.ts` | **Retained**; FIX-1021 verifies against it | The allow-list landed after FIX-1021 was written | ER-6 | None |
13+
| The request-as-capability model: stream attach and suspension resume are authorized by `requestId` alone, as an unguessable token, with no tenant recheck. Source: `docs/architecture/state-and-scopes.md`, "What `requestId` gates, not tenant" | **Amended** by FIX-1018 | The premise fails: a request id is caller-supplied (`routes/action-routes.ts`), `generateId` is not a CSPRNG, and ids leak in the `x-request-id` header, URLs and logs (FIX-1018's evidence) | ER-3, ER-20; FIX-1018 updates the section | A request created before FIX-1018 still attaches and resumes for its owner (BP-030) |
14+
| FIX-1302: delivery into an existing session is refused `external-dispatcher` on a queue host. Source: `docs/architecture/inbound-transports.md`, the `external-dispatcher` paragraph | **Amended** by FIX-1634 | The refusal protected recipient concurrency and the incarnation guard; FIX-1634 restores both across the queue boundary instead of deleting it | ER-11, ER-14 | Anything still unhonourable keeps a named refusal |
15+
16+
Nothing is wholly superseded. Re-check each cited intent against current code before
17+
implementing (ER-17).

0 commit comments

Comments
 (0)