feat(run): summarize multi-iteration stability - #163
Conversation
roark47
left a comment
There was a problem hiding this comment.
Thanks for adding a per-case stability summary. The underlying problem is real: the existing final totals cannot show which case changed status across iterations, and the proposed aggregation is small, deterministic, and correctly excludes without_skill baseline results.
I am requesting changes before merge for the following reasons:
-
Restore the Markdown report documentation. This PR removes
skill-up report --format markdownfromdocs/guide/cli-reference.md, including its examples and format table entry. Markdown reporting is still supported by the code and was already present in the base commit, so this is an unrelated documentation regression. Please restore those lines. -
Test the actual terminal behavior.
TestRunner_Evaluate_MultipleIterationsDoNotWriteStabilityFilescreates the usefulPASS/FAIL/PASSpluswithout_skill ERRORscenario, but only asserts that no stability files are written. Please captureui.Outputand assert that the summary containscase_a: 3 trials, 2 PASS, 1 FAIL -> flakyand does not include the baseline errors. It would also be valuable to cover an all-stable case and confirm that a single iteration prints no stability summary. -
Add a changelog entry. This is a user-visible CLI behavior change, and the repository contribution guidance asks for
CHANGELOG.mdupdates for such changes.
Non-blocking suggestion: use map[judge.Status]int and the existing judge.Status* constants instead of string keys and string literals for stronger type safety.
Local verification: make verify passed with zero lint issues, and go test -race ./internal/runner ./internal/cli passed. Once the unrelated documentation deletion and coverage gaps are fixed, the implementation should be low risk to merge.
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds a terminal-only cross-iteration stability/flakiness summary to skill-up run when multiple iterations are executed, and updates CLI/docs to frame --iteration as sampling rather than “rounds”.
Changes:
- Print a per-case stability summary after multi-iteration runs (
PASS/FAIL/ERROR/SKIP, plus a “flaky” marker on mixed outcomes). - Update
--iterationhelp text and documentation (EN + ZH) to clarify “sampling” semantics and default0auto-append behavior. - Add Go tests for summary formatting and to ensure stability report files are not written.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/skill-upper/references/cli.md | Clarifies --iteration meaning and adds example terminal summary line. |
| skills/skill-upper/SKILL.md | Rewords --iteration as stability/flakiness sampling and documents terminal summary output. |
| internal/runner/workspace_options_test.go | Adds tests for summary formatting and “no stability files written”. |
| internal/runner/runner.go | Implements summary aggregation/formatting and prints it after multi-iteration runs. |
| internal/cli/run.go | Updates --iteration flag help text to match new behavior. |
| docs/zh/guide/cli-reference.md | Updates ZH CLI docs for new --iteration semantics and example. |
| docs/guide/cli-reference.md | Updates EN CLI docs for --iteration semantics; also updates skill-up report format docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed the review feedback in
Verification:
|
|
The requested terminal-behavior coverage is still missing in ad6eaa7. |
|
The requested changelog update is still missing in ad6eaa7: |
zpzjzj
left a comment
There was a problem hiding this comment.
Scope clarification: current-invocation sampling vs accumulated iterations
The existing --iteration flag has two distinct behaviors:
- A positive
--iteration Nruns N samples in the current invocation. - The default
--iteration 0appends one run after the latest existingiteration-N/directory.
The current implementation only summarizes the in-memory allResults from the current invocation. In auto mode it explicitly sets runCount = 1, and the summary is only printed when runCount > 1 (auto-mode setup, summary gate). As a result, the default auto-append workflow never prints a stability summary, and existing iteration-*/result.json files are never included.
This is internally consistent if the feature is intentionally limited to an explicit positive --iteration N in one command. However, the CLI help and several documentation surfaces now describe --iteration more broadly as stability/flakiness sampling, which makes the contract ambiguous.
Please clarify and implement one of these contracts:
- Current invocation only: keep the implementation, but explicitly document that the summary is produced only for a positive
--iteration N, covers only samples executed by that command, and does not summarize auto-appended history. Add coverage for the auto-mode behavior. - Accumulated workspace iterations: load compatible prior
iteration-*/result.jsonartifacts and include them in the summary, with a clear rule for excluding iterations produced from different case sets or Skill versions.
The second option is not automatically preferable because historical iterations may represent different Skill revisions. The important part is to choose and document the intended product contract before merging; otherwise the default workflow and the newly advertised stability behavior do not line up.
01a3afb to
29f97e1
Compare
|
Updated the PR branch with a clean diff based on current upstream Addressed the latest review items:
|
|
The terminal-output test is closer, but it still does not exercise the actual UI output path requested in the review. The production code now adds mutable |
|
The current-invocation-only contract is now documented clearly, but the requested auto-mode coverage is not present yet. |
29f97e1 to
984ea63
Compare
|
Updated the PR branch to Changes in this update:
|
zpzjzj
left a comment
There was a problem hiding this comment.
Re-reviewed 984ea63. The two previously outstanding behavior items are now addressed: the tests capture the real UI output path, and auto mode covers an existing iteration-1/, appends iteration-2/result.json, and prints no historical summary. The stability implementation and documented current-command-only contract otherwise look consistent.
I left one focused inline request: replace the new //go:linkname + unsafe access with a normal import of the already-exported internal/ui.Output. The direct-import version passes go test -race ./internal/runner.
Local verification on this HEAD: make verify, make test, and the focused runner race test all pass. Remote CI/Docs/CodeQL remain action_required with no jobs started, so they still need maintainer approval before their results can be evaluated.
Overall:
Summary
case_a: 3 trials, 2 PASS, 1 FAIL -> flaky.--iterationhelp/docs as stability/flakiness sampling.Test Plan
Note: plain
make testcan inherit local Git GPG signing config in temporary test repositories; the isolated global Git config avoids that unrelated local setting.