reboot/lean-pty-core: cutover branch (HELD — do not merge until reboot moment) - #60
Draft
myobie wants to merge 2 commits into
Draft
reboot/lean-pty-core: cutover branch (HELD — do not merge until reboot moment)#60myobie wants to merge 2 commits into
myobie wants to merge 2 commits into
Conversation
Sub-batch 1/N of the reboot cutover branch. Foundation moves — convoy's reconcile loop needs identical shape for the wire-format freeze. - src/sessions.ts: commandFingerprint() flips from internal to export; docstring pins the wire-format contract (16-char lowercase hex of SHA-256 of command + \0 + args.join(\0)). - src/client-api.ts: re-exports commandFingerprint, DEFAULT_FAST_FAIL_WINDOW_SEC, DEFAULT_FAST_FAIL_LIMIT. Also exports commandWithEnvExports from ptyfile.ts (already had readPtyFile — convoy reads pty.toml verbatim per spec §4 and needs both). Cutover-branch commit; does NOT merge until the reboot moment. Corresponding pty-side deletes (classifyFlapping, respawnPermanent, gc STEP-2, --fast-fail-* flags, pty up/down) come in subsequent commits on this branch.
….12.0
Sub-batch 2/N of the reboot cutover branch. Executes §8 items 1–8 + 10
of notes/lean-pty-core-supervision-spec.md.
BREAKING — CLI surface:
- Removed `pty up` and `pty down`. Manifest processing moves to
`convoy up` / `convoy down`. `pty.toml` file name stays; convoy reads
it verbatim via `readPtyFile` + `commandWithEnvExports`, both still
exported from `@myobie/pty/client`.
- Removed `pty gc --fast-fail-window` and `--fast-fail-limit`.
- `pty gc` is clean-only: STEP 1 (orphan-kill), STEP 1.5 (abandoned-reap
cwd-gone + opt-in idle), STEP 3 (sweep exited non-permanent). STEP 2
(permanent respawn) is gone; permanent sessions that exit stay
in-place on disk for convoy's reconcile loop.
BREAKING — API surface:
- GcResult trimmed to `{ removed, killedOrphanChildren, abandoned }`.
- Deleted sessions.ts:respawnPermanent + classifyFlapping + the
FlappingDecision interface.
- Removed the `[flapping]` badge from strategyMarker / `pty list`
(convoy renders its own list if desired).
- SessionFlappingEvent + EventType.SESSION_FLAPPING stay exported for
convoy to import + emit via appendEventSync. Payload frozen per
spec §8.1.
Tests:
- Deleted: tests/gc-flapping.test.ts, tests/gc-permanent.test.ts,
tests/up-down.test.ts, tests/up-name-decouple.test.ts.
- Extracted PTY_ROOT length backstop tests into
tests/pty-root-length-backstop.test.ts (from the previous
gc-flap-clear-badge-root-len.test.ts, dropping the flap-clear +
badge cases).
- Updated tests/gc-abandoned.test.ts + gc-parent-child.test.ts to
assert post-reboot behavior.
- Full suite: 1158 passed + 1 flake (demos/agent-teams timestamp
timing, unrelated to §8), 21 skipped, 0 real failures.
Version bump 0.11.0 → 0.12.0. `flake.nix` npmDepsHash refreshed.
BREAKING — Storage format on 0.12.0:
- No tag or event REMOVED from the wire — pty stops writing the
`strategy.status` / `strategy.consecutive-fast-fails` /
`strategy.last-respawn-at` / `strategy.command-hash` tags, but they
remain reserved-shape for convoy to write. `session_flapping` event
stays defined.
Cutover-branch commit; does NOT merge until reboot moment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reboot-cutover branch executing
notes/lean-pty-core-supervision-spec.md§8. DRAFT + HELD — this branch does NOT merge until Nathan's reboot moment. Everything in it is a design-approved delete or move (cos ✅ walked, convoy-claude ✅ green on the shape) but shipping incrementally would break the network because pty-side respawn removal and convoy-side respawn adoption cut over TOGETHER.Design references
notes/lean-pty-core-supervision-spec.md(489 lines, 9 sections + §8.1 wire-format freeze).1783419050001-jdqtjz.md(approved + operator-restart concern; folded into §5.6).1783419181387-86ya0r.md(green on shape; test fork requested; wire-format freeze requested).notes/lean-pty-core-supervision-spec.md§8.1.What's on this branch so far
commandFingerprint,DEFAULT_FAST_FAIL_WINDOW_SEC,DEFAULT_FAST_FAIL_LIMIT,commandWithEnvExportsnow exported from@myobie/pty/client. Convoy imports these unchanged; wire-format hash stays byte-identical.What's still queued (subsequent commits on this branch)
sessions.ts:classifyFlapping(),respawnPermanent(), and gc STEP-2 respawn loop.GcResult— removerespawned,respawnFailed,flapped,flappingSkipped. Add asweptlist if needed for the sessions gc STEP-3 removes.pty gc --fast-fail-window,--fast-fail-limitCLI parsing +cmdGcoutput rows.pty up,pty down,cmdUp,cmdDown,hasPtyFile. (readPtyFilestays exported for convoy.)[flapping]badge fromstrategyMarker.tests/gc-flapping.test.ts.usage(), README, docs/disk-layout.md, completions.0.11.0 → 0.12.0.## 0.12.0.notes/cli-surface-audit.mdrefresh (post-reboot shape).Merge gate
DO NOT MERGE until all of:
convoy up's reconcile loop is drafted + Nathan-reviewed.pty gclaunchd plist unloaded).convoy upimmediately after merging.Once those hold, merge + Nathan runs
convoy up. Anything before that leaves the network with no respawn owner and a ghost gc that no longer respawns.