Repository navigation
run events: chant run events replays a run and --follow tails one on this host (#4042) - #4060
Merged
Merged
Conversation
lex00
force-pushed
the
feat/4042-run-events-replay
branch
from
October 17, 2026 03:59
0533b79 to
30d86d2
Compare
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.
Closes #4042
chant run events <run> [--json] [--follow]replays a run's event stream, and--followtails a run in progress on this host.<git-common-dir>/chant/run-events/<run id>.jsonl, beside the in-flight records inchant/runs/, outside the working tree and offchant/lifecycle. The lines are byte for byte what the one writer produced. Nothing prunes them yet; the docs name retention: how long stored change sets, run events and releases are kept, and garbage collection #4036 for retention.chant run <op>keeps them whenever it records to the ledger, with or without--events-json(--no-recordkeeps nothing).run --components, promote, rollback, redeploy, fan-out, pr-plan and pr-apply keep them only under--events-json, writing each line to stdout and the file.<run>is a run id, or an Op or component name, which picks the newest kept run of that name. The exit code is the run's verdict (0 ok, 1 failed, 3 gated or waiting); replaying a run still going exits 0.--followpolls every 100 ms, ends atrun-settle, and waits up to 5 s for a file that isn't there yet. A run killed with SIGKILL never settles, so following it waits until interrupted (SIGINT and SIGTERM settle the runfailedfirst).eventsis reserved as achant runsubcommand rather than extendingrun log, becauserun loglists an Op's history from its runtime and takes--on, whilerun eventsreads one run's local stream.--onother thanlocalis refused, pointing at epic: workspace read contracts for behold's default view (runs, waves, events, drift, change sets, metrics, alerts) #3990 for remote--follow.CHANT_RUN_EVENTS_DIRoverrides the root, and the vitest per-run setup points it at a temp dir. (An earlier local run of this branch wrote test streams under the shared.git/chant/run-events/; those were removed, and a before-and-after snapshot shows the fix holds.)Level-0 output changes
On the exceptions page and #2525:
eventsis now a reservedchant runsubcommand, so an Op namedeventscan't be started aschant run events; a localchant run <op>that records to the ledger writes a file under.git/chant/run-events/(stdout, stderr, exit codes and the ledger are unchanged);--followis a recognised flag. No golden moved.Acceptance
run-event-store.test.ts"a run that records to the ledger keeps its stream, and it replays as the writer wrote it" and "replays what has been written so far, and not a half-written last line";run-events-cmd.test.ts"--json replays a settled run's lines and exits with its verdict" and "--json replays a run in progress up to now and exits 0").--followstreams each event of a run in progress, with a test ("--follow streams each event as it is written and ends at run-settle"; "--follow prints each event of a run in progress, then the verdict").--followleft to it (comment posted).Checks
npx tsx scripts/typecheck.ts: no regressions (26 baselined)npx tsx scripts/check-lexicons.ts: no untracked tier-1 failuresGITHUB_SHA,GITHUB_RUN_IDandCIset, after rebasing on main; the realchant/lifecycleand.git/chantwere unchanged by the runop/factory.e2e.test.tsfailures and load timeouts that pass alonelint-docs-sentences(no regressions),lint-prompts,check-docs-diataxis,./scripts/build-docs.sh: pass