Repository navigation
Commit ed5a1e7
feat(cli): announce seed settlement on serve's ipc channel and forward it from os dev (#17892)
Fixes #17329
Clause-②: yes
`os serve` now announces **`objectstack:seed-settled`** on its existing
ipc channel when this boot's seeding has come to rest, and `os dev`
forwards it to its own parent when one holds the channel. Implements
decision batch #118 item 5 (**D1**) as ruled at
[`5642795097`](#17329 (comment)),
plus its banner rider.
⭐ **The producer already existed.** `@objectstack/runtime` declares
every seed source and settles it the moment its boot-time write is done,
publishing the tally under `@objectstack/spec`'s `seed-settlement`
contract. This PR is **the hop outward** — it registers no service,
mutates no tally, and changes nothing in `packages/runtime` or
`packages/spec`. It subscribes to two hooks the kernel already fires and
reads a snapshot it already publishes.
## Every site was re-derived from its SYMBOL
Every line number on the card was stale twice over, so nothing was
carried forward. Re-read on `origin/main` at `272c04b46`:
| thing | site today |
|---|---|
| the existing ipc message | `publishBoundPort` /
`runtimeBoundPortChannels` in `packages/cli/src/commands/serve.ts` |
| the banner | `printServerReady` in `packages/cli/src/utils/format.ts`,
called through a thunk from `serve.ts` |
| `os dev`'s role | spawns `serve --dev` over `stdio:
['inherit','inherit','inherit','ipc']`; consumes the listening message,
emits no banner |
| the producer | `emitSeedSettled` in
`packages/runtime/src/app-plugin.ts`, `declareSeedSource` in
`packages/runtime/src/seed-settlement.ts` — **read only, both
untouched** |
## ⭐ Ruled item 3, MEASURED on a real boot
The gate: multi-tenant replay and `skipSeedData` report `pending > 0`
for the whole boot, so a consumer waiting on the new message must not
hang forever there.
⛔ **The predicate is `inFlight === 0`, not `pending === 0`.**
`suppress()` moves a source out of the in-flight tally and records why,
so both modes reach `inFlight === 0` inside Phase 2 `start()` while
`pending` stays above zero forever. A `pending`-keyed message would
never be sent on those boots, and its absence would be indistinguishable
from a boot still writing — the same ambiguity this card exists to end,
one level up.
**Measured**, `os dev` under `OS_TENANCY_POSTURE=group` with the org
runtime declared by the host app, a real ipc parent recording with the
clock:
```text
[child] Tenancy: group
[child] Seeds: not run this boot (multi-tenant-replay)
[PARENT +9.954s] BANNER SEEN
[PARENT +9.955s] IPC {"type":"objectstack:seed-settled","ok":true,
"suppressed":["multi-tenant-replay"],"sources":[]}
```
The message arrived 1 ms after the banner on a boot whose `pending`
never reaches zero. **The consumer does not hang.** Reaching that boot
needed three refusals satisfied in order — the host app must *declare*
`@objectstack/organizations` (#4719: merely reachable is rejected),
`OS_PLATFORM_OWNER_EMAIL`, and `OS_AUTH_MEMBERSHIP_POLICY`. The
app-manifest declaration was made **temporarily for the measurement and
reverted**; `package.json` and `pnpm-lock.yaml` were both restored to
their `HEAD` blob hashes with a clean whole-tree `git status`, and this
PR carries neither file.
1 parent a61ae59 commit ed5a1e7
8 files changed
Lines changed: 1045 additions & 0 deletions
File tree
- .changeset
- content/docs/deployment
- packages/cli/src
- commands
- utils
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
237 | 298 | | |
238 | 299 | | |
239 | 300 | | |
| |||
Lines changed: 106 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 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 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 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
134 | 178 | | |
135 | 179 | | |
136 | 180 | | |
| |||
566 | 610 | | |
567 | 611 | | |
568 | 612 | | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
569 | 617 | | |
570 | 618 | | |
571 | 619 | | |
| |||
0 commit comments