Commit acab609
fix(cli): key the runtime state file by project, not by environment alone (#15968)
* fix(cli): key the runtime state file by project, not by environment alone
`os serve` publishes `{ pid, port, url, environmentId, startedAt }` under the
ObjectStack home so a supervisor can answer "is my server running, and where?".
The file was `runtime.<environment>.json`, and both halves of where it lived are
machine-global: `resolveObjectStackHome()` takes no arguments, and an environment
id is not a project identity. Two projects on one machine, both in the ordinary
`local` environment, wrote one file.
Driven with two real boots, two project roots and one home — two failures, one
cause:
* project B's boot replaced project A's record, so a reader asking about A was
answered with B's pid/port/url while A's server was still alive elsewhere;
* project A's shutdown then deleted the file that by then described B, leaving
a running server with no supervision record at all.
The file is now `runtime.<environment>.<project>.json`, keyed on the served
app's root — the root `serve` already resolves for host-anchored loads. The
payload is unchanged: no new key, and no database path (issue 15374 ruled that
one out deliberately, because it would turn a best-effort supervision file into
an identity contract).
The three in-repo readers that spelled the old name out now ask the writer's own
naming function instead, so a second copy of the rule cannot drift from it.
`scripts/publish-smoke.sh` globs `runtime.*.json` in a home it pins itself and is
unaffected.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* test(cli): build the collision children's env through `childEnv`, not a bare spread
`check:cli-test-child-env` is the gate that keeps `packages/cli/test`'s spawners
off `{ ...process.env }`: vitest sets `TEST`, `VITEST` and the `VITEST_*` family
on its worker, and a child inheriting them boots with a different auth and
crypto posture than the one under test. The new collision pin spawned its
children with a bare spread and the gate's shrink-only ratchet named it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
* docs(cli): carry the runtime-state rename's breaking-ness in the changeset
The launch window refuses `major`, so the bump level is not the carrier: a
breaking change ships as `minor` and its only signals are the BREAKING banner
in the changeset body and the ADR-0087 disposition marker that
`check-adr-0087-registration.mjs` re-verifies. This diff retires a shipped
observable -- the on-disk name a supervisor opens -- and the changeset said so
in its own prose while carrying neither signal.
Adds both. The disposition is `not-required (no-migration-prescription)`,
derived from the gate's own `CATEGORIES` const rather than its prose header:
nothing authorable moves, `packages/spec` is untouched, and what is retired is
a path on disk rather than a metadata surface the ledger can project into
`spec-changes.json` or the upgrade guide. `unpublished` is false (the package
publishes), `already-registered` names no entry that covers this, and neither
`runtime-interface-only` nor `type-surface-only` has a `path#Symbol` to name.
Also ends the two names `serve.ts` was stating at once. The
`BoundPortChannels.writeRuntimeState` interface doc and the four other
current-tense sites named the retired file; they now name the shipped one,
while the measured ENOENT quote and the pre-repair collision diagram keep the
name they observed and say that is what it was. The anchoring boundary an
out-of-tree reader has to replicate -- the app root is the config's own
directory only when that config exists and that directory carries a
`package.json`, else the CWD -- is stated beside the symlink boundary.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D47qPfEWVPmhguWgBZCi5N
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 2e35765 commit acab609
7 files changed
Lines changed: 566 additions & 27 deletions
File tree
- .changeset
- packages/cli
- src/commands
- test
- helpers
| 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 | + | |
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
290 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
291 | 297 | | |
292 | 298 | | |
293 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
391 | 392 | | |
392 | 393 | | |
393 | 394 | | |
394 | | - | |
395 | | - | |
396 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
397 | 398 | | |
398 | 399 | | |
399 | 400 | | |
| |||
459 | 460 | | |
460 | 461 | | |
461 | 462 | | |
462 | | - | |
463 | | - | |
| 463 | + | |
| 464 | + | |
464 | 465 | | |
465 | 466 | | |
466 | 467 | | |
| |||
475 | 476 | | |
476 | 477 | | |
477 | 478 | | |
478 | | - | |
479 | | - | |
480 | | - | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
481 | 482 | | |
482 | 483 | | |
483 | 484 | | |
484 | 485 | | |
485 | | - | |
| 486 | + | |
486 | 487 | | |
487 | 488 | | |
488 | 489 | | |
| |||
491 | 492 | | |
492 | 493 | | |
493 | 494 | | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
498 | 500 | | |
499 | 501 | | |
500 | 502 | | |
| |||
521 | 523 | | |
522 | 524 | | |
523 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
524 | 612 | | |
525 | 613 | | |
526 | 614 | | |
| |||
534 | 622 | | |
535 | 623 | | |
536 | 624 | | |
537 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
538 | 634 | | |
539 | 635 | | |
540 | 636 | | |
| |||
4657 | 4753 | | |
4658 | 4754 | | |
4659 | 4755 | | |
4660 | | - | |
4661 | | - | |
4662 | | - | |
| 4756 | + | |
| 4757 | + | |
| 4758 | + | |
4663 | 4759 | | |
4664 | 4760 | | |
4665 | 4761 | | |
| |||
| 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 | + | |
0 commit comments