Skip to content

pr-plan and pr-apply: progress events per wave and component, and the report where a viewer can read it #4007

Closed

Description

@lex00

Why

A viewer of a pull request's apply (a dashboard, behold's kiosk, a person reading the job log) cannot tell which component is applying, which wave it is in, or how each one ended until the job is over, and then only from the summary table. The report that says it all is written to .chant/pr in the job's workspace, which leaves the job only as a CI artifact. chant run --components already streams progress; pr-apply does not.

Current behaviour

  • packages/core/src/cli/handlers/pr.ts:478: pr-apply calls applyPrSet without onProgress, though applyPrSet takes one (packages/core/src/components/pr-run.ts:208, :232).
  • packages/core/src/cli/handlers/run.ts:1007-1016: chant run --components --progress-json streams one RunProgressEvent per line (packages/core/src/components/run-progress.ts).
  • packages/core/src/cli/handlers/pr.ts:233-239: the report, change set and note go to --output only; :273-277 prints one line per member at the end.

Acceptance criteria

  • pr-plan and pr-apply take --progress-json and stream the same events run --components does: run start with the waves, each wave and component start and end with its status, and the gate's decision (approved, refused with its reason).
  • Without the flag, pr-apply prints one line as each wave starts and as each component settles, so the job log shows the waves in order.
  • --report-url <s3 or file URL> (or an equivalent the generators can set) copies pr-<stage>.json and change-set.json where a reader outside the CI system can fetch them, keyed by pull request and commit.
  • The generated pull-request pipeline passes the flags when its generator option asks for them.
  • Tests for the events of a two-wave apply and of a refused gate.

Activity

  1. lex00 commented on Oct 17, 2026

    @lex00
    ContributorAuthor

    #4041 implements the events this issue asks for. chant components pr-plan and pr-apply take --events-json, which prints the run-event stream (run-event.schema.json, contract 1, chant 0.124.28 and newer) to stdout, one line per event. The stream opens with run-start carrying the waves. Planning is a plan phase with a plan step per component. The pull request's gate is a gate phase: gate-resolved names who approved, and gate-waiting carries the refusal's message. On pr-apply, each wave and component start and settle follow with their status, and a refused apply settles gated. --progress-json is not added here, since the RunProgressEvent shape is deprecated in favour of the run-event stream.

    Still open in this issue: the human line per wave start and component settle without the flag; --report-url for pr-<stage>.json and change-set.json; the generator option that passes these flags in the generated pull-request pipeline.

  2. lex00 commented on Oct 17, 2026

    @lex00
    ContributorAuthor

    From behold (INTENTIUS/behold#679, #711): with #4019, #4041 and #4042 closed, the events exist. The piece behold still needs for CI runs is where they land. In a CI job the store is under the checkout's git directory (run-event-store.ts), which the job discards, so pr-plan and pr-apply events are lost when the job ends.

    What would let a viewer follow and replay a pipeline run: CHANT_RUN_EVENTS_DIR documented for CI, and an upload of the run's events (and pr-plan.json / pr-apply.json) to a store a viewer can read, the way terragucci copies its reports to a bucket. The generated pr-loop workflow could set both.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions