Skip to content

fix(tier3): reuse a run's saved feedback when view regenerates its report - #419

Merged
rng1995 merged 11 commits into
mainfrom
naren/port-tier3-view-results-feedback-reuse
Nov 12, 2026
Merged

rng1995 merged 11 commits into
mainfrom
naren/port-tier3-view-results-feedback-reuse

Conversation

@rng1995

@rng1995 rng1995 commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

skillevaluator view regenerates report.html when a run's results exist but the file is missing. Today it calls render_agent_eval_html_report(skill_path, target) with the defaults, so the Insights judge and the what-to-fix writer run again. With this change, a run that saved its report feedback in result.json gets its report rebuilt from that feedback, with no LLM call.

  • view_results (tier3/commands.py) reads result.json with the existing _read_result_json helper and checks it with saved_feedback_for_run, the same helpers tier3 feedback uses. When the run saved all four feedback fields, it renders with engine_result=<result.json>, use_llm_judge=False and the saved feedback. Otherwise it makes the same call as before.
  • Passing result.json as engine_result matches load_agent_eval_payload (tier3 feedback) and the dashboard loader. On this path the rebuilt report therefore also carries the run's duration_seconds as its runtime (in the report data, not shown on the page) and shows Harbor log and analysis links when result.json records a harbor_viewer summary. The links still go through _safe_harbor_viewer_url. main's rebuild left both out, and a rebuild without saved feedback still does. The runner records duration_seconds only after it renders report.html, so the run's own report did not carry the runtime either.
  • render_agent_eval_html_report takes a new keyword, saved_feedback. When it is set, the judge is not called and the saved conclusions, recommendations, suggestions and suggestions_v2 replace the rebuilt ones.
  • The case-findings pass still runs on that path, but without the LLM. It reuses the run's what_to_fix.json through a new fixes keyword on _apply_case_findings, and does not write it again.
  • When the run has no usable what_to_fix.json, the pass writes the rule-based fixes, where main asked the LLM again when a provider is configured. On a run whose saved feedback carries the per-case verdict, the report keeps the saved recommendations, so what_to_fix.json (which the terminal case summary reads) can then differ from them. Such a run wrote what_to_fix.json when it rendered its report, so this happens only when that file was removed too.
  • When the saved conclusions carry the per-case verdict (the Skill effect conclusion, saved since 0.7.0), the saved fields win over the pass's verdict and fixes. Feedback saved by 0.6.0 or earlier has no verdict, so the report adds it and lists the case fixes as its recommendations and suggestions, as a new report does. The saved conclusions and suggestions_v2 stay.
  • Nothing is written to result.json: the renderer only updates the in-memory copy of tier3_feedback, and view never writes it back.
  • Docs: the view sections in docs/reports.mdx and docs/cli-reference.mdx. CHANGELOG entry under Unreleased > Fixed.

Why

A missing report.html (deleted, or not written because the report step failed) made view run the judge and the what-to-fix writer again. With a provider configured, that costs tokens and can change the advice the run produced. Without one, nothing fails, because build_insights falls back silently, but the rebuilt report drops the LLM advice the run saved. Either way, what_to_fix.json, which the terminal summary reads, was overwritten. For a completed run with saved feedback (the per-case verdict included) and no report.html, main makes one Insights judge call and one what-to-fix LLM call, shows none of the saved feedback, and rewrites what_to_fix.json. This branch makes no LLM call, shows the saved feedback, and leaves result.json and what_to_fix.json unchanged.

Kept from public

  • Public's own helpers do the run binding: saved_feedback_for_run accepts feedback only when result.json's run_id names the run directory and tier3_feedback.schema_version is 1.0. view also requires all four fields, which every release since 0.1.0 saves. Partial saved feedback is rebuilt as before. view already resolves only completed runs whose result.json names the directory.
  • Public's HTML reporter already sanitizes conclusions, recommendations, suggestions_v2 and suggestions, so saved items are not checked again here. A saved what_to_fix.json is read with the existing load_case_findings (no link following) and is used only when its text fields are strings.
  • The runner's render path (use_llm_judge=True, no saved_feedback) and the feedback-chat loader are unchanged. _apply_case_findings without fixes works as before.
  • An existing report.html is still opened as is. A run without usable saved feedback, including legacy runs without result.json, is still rebuilt with the judge as before.
  • The run next steps from feat(tier3): add run-level next steps to Tier 3 reports #377, now on main, are computed when the report payload is built and again at the end of _apply_case_findings, and neither copy is saved in result.json. Because the saved-feedback path still runs that pass and replaces only the four saved fields, a report rebuilt from saved feedback keeps its Next steps section. Without a saved what_to_fix.json the two copies can differ: the pass sees the rule-based fixes it writes, and next_steps reads the run-error and eval-case fixes among them. The report shows the pass's steps. test_saved_feedback_keeps_what_the_case_pass_adds checks both cases with main's next_steps.

Tests

  • New tests/tier3/test_view_results_feedback.py (16 tests):
    • a missing report is rebuilt from the saved verdict, conclusion, recommendation and suggestion with no judge or what-to-fix LLM call, the verdict is not repeated, the run's duration_seconds and recorded Harbor link come through, and result.json and what_to_fix.json are byte-identical afterwards
    • the same run without what_to_fix.json: no LLM call, the saved feedback still leads the report, and the rule-based fixes are written to what_to_fix.json
    • feedback saved without the per-case verdict gets the verdict with no LLM call and keeps its conclusions; the run's what_to_fix.json is reused, or the rule-based fixes are written when it is missing or unusable (3 cases)
    • no saved feedback, an unknown schema version, feedback without list fields, or only some of the fields: the judge and the what-to-fix writer run as before (4 cases)
    • feedback saved for another run is ignored (run selection is stubbed, since it already rejects such a run)
    • an existing report.html is opened without a rebuild
    • render_agent_eval_html_report(..., saved_feedback=...) skips the judge even with use_llm_judge=True and keeps the saved feedback in the in-memory tier3_feedback
    • on the saved-feedback path the case-findings pass runs with use_llm=False and the run's usable fixes, and the run next steps it computes stay in the report, for feedback with and without the per-case verdict, each with and without a saved what_to_fix.json (4 cases). Without the file, the steps the pass computes from the rule-based fixes replace the build-time ones.
  • Fail-before: with src/ from main (d717f22) and this PR's tests, 10 failed and 6 passed. The 6 that pass pin behavior this PR keeps (the rebuild without usable saved feedback, other-run feedback, an existing report).
  • Every test module that uses tier3.commands, tier3_report, tier3_feedback_chat or case_summary (73 modules) plus tests/test_ci_workflows.py, with -n 4: 5171 passed, 5 skipped.
  • Docs and CHANGELOG readers (tests/ci/test_image_build.py, tests/test_ci_change_classifier.py, tests/test_oss_packaging.py, tests/test_benchmark_rollout_docs.py, tests/test_harbor_claude_refusal_fallback.py, tests/test_accuracy_arithmetic.py, tests/reporting/test_report_logo.py, tests/test_harbor_runtime_skill_isolation.py, tests/validators/test_hygiene.py, tests/validators/test_markdown.py, tests/test_ci_workflows.py and the new module): 774 passed, 2 skipped.
  • The branch is merged with main at d717f22. Only CHANGELOG.md conflicted, and both entries are kept. git merge-tree of the branch and d717f22 is clean. This module and tests/test_tier3_next_steps.py give 32 passed.
  • Full suite with -n 6: 27382 passed, 35 skipped, 5 failed. The 5 are local-environment failures that also fail on main on the same machine (the CI bootstrap and feedback launcher path tests and two secure Docker sidecar tests). Earlier runs also failed one or two load-dependent tests, such as a Harbor process timeout test or a local proxy or port test, which pass when run alone. Which of these fails changes from run to run. None touches view or the Tier 3 report.
  • ruff check and ruff format --check are clean on the changed Python files, and scripts/check_oss_boundary.py passes.

🤖 Generated with Claude Code

rng1995 and others added 4 commits November 7, 2026 21:18
…port

`skillevaluator view` rebuilt a missing report.html with the default
renderer, so the Insights judge and the what-to-fix writer ran again. That
needed provider credentials, cost tokens, could change the advice the run
produced, and replaced the run's what_to_fix.json.

view_results now reads result.json and, when saved_feedback_for_run finds
feedback saved for that run, renders with use_llm_judge=False and the new
saved_feedback keyword. The saved conclusions, recommendations and
suggestions replace the rebuilt ones, and the case-findings pass is
skipped. A run without saved feedback is rebuilt as before.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With a provider configured, rebuilding a missing report calls the judge
again, which costs tokens and can change the advice; without one it
silently drops the run's saved LLM advice. Either way it overwrote
what_to_fix.json. The previous commit avoided that by skipping the
case-findings pass whenever saved feedback was present, which lost two
things:

- Feedback saved by 0.6.0 or earlier has no per-case verdict. The
  rebuilt report now gets the verdict and the case fixes from a
  deterministic pass, as a new report does, instead of dropping them.
- Anything the pass computes beyond the four saved fields now stays in
  the report, so a later addition to the pass (such as run next steps)
  is not lost on a rebuild.

The pass runs with use_llm=False and reuses the run's what_to_fix.json
through a new fixes keyword; it writes the rule-based fixes only when the
run has no usable file. Saved conclusions that carry the verdict still win
over the pass's verdict and fixes. view now reuses saved feedback only when
all four fields are present, as every release saves them.

Tests: legacy feedback gets the verdict (3 cases), partial feedback is
rebuilt, the pass output beyond the saved fields is kept; the other-run
test asserts behavior instead of the exact keyword set, and the module
docstring names `skillevaluator view`.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
….json

Rebuilding a report from saved feedback passes the run's result.json as
the engine result, as tier3 feedback and the dashboard already do. The
rebuilt report therefore also carries the run's recorded duration and
shows any Harbor log links recorded there, which the rebuild without
saved feedback still leaves out. Say so in the CHANGELOG entry and the
view docs, and pin it in the saved-feedback view test.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
When a run's what_to_fix.json is missing or unusable, view writes the
rule-based fixes without the LLM. On a run whose saved feedback carries
the per-case verdict, the report keeps the saved recommendations, so
that file can then differ from them. The docstring said "as before",
but the rebuild without saved feedback asks the LLM when a provider is
configured. Correct the docstring and the view docs, and pin the
verdict-run case: no LLM call, the saved feedback in the report, and
the rule-based fixes in what_to_fix.json.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rng1995
rng1995 marked this pull request as ready for review November 9, 2026 19:50
rng1995 and others added 4 commits November 10, 2026 14:11
Conflicts:
- CHANGELOG.md: both sides added an entry at the end of Unreleased >
  Fixed. Kept both: main's tier3 compare Overall lift entry first, then
  this branch's view entry. No released section changed.

Auto-merged without conflict: src/skillevaluator/evaluation/tier3_report.py
(main's run next steps now run at the end of _apply_case_findings, which the
saved-feedback path still calls), src/skillevaluator/tier3/commands.py,
docs/reports.mdx and docs/cli-reference.mdx.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… feedback

Run-level next steps are now on main and are computed at the end of
the case-findings pass, which the saved-feedback path still runs. Drop
the stand-in key and check that the rebuilt report carries the real
next steps and its Next steps section, for feedback saved with and
without the per-case verdict.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ebuild

main computes the run next steps both when it builds the report payload
and in the case-findings pass, and saves neither, so a rebuild from saved
feedback must keep them. With the run's what_to_fix.json saved, both
copies match, so the test could not tell which one the report showed.

Add cases without a saved what_to_fix.json. There the case pass sees the
rule-based fixes it writes, which drop the "more cases" step, so its
steps differ from the build-time ones, and the test checks that the
payload and the page show the case pass's steps. Reword the comment that
said only the case pass computes them.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The comment named `main`, which means nothing once this file is on main.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full production diff, callers, report/runner contracts and affected regression coverage; no actionable findings. Existing CI on reviewed head b0fac50: 20 successful checks, 2 skipped; no failed or pending checks. Fresh merge-tree verification against current main ce52a09 succeeds without conflicts. No code changes or local test rerun were needed.

Signed-off-by: Narendran Raghavan <[email protected]>

# Conflicts:
#	CHANGELOG.md

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved the new CHANGELOG conflict with main d55b240 by retaining both the saved-feedback fix and the landed verdict-precedence entry. The saved-feedback suite passed 16 tests; make lint and pinned Fern check passed. A fresh prepush merge-tree against newer main a0b65a9 was also clean, so no additional main-only refresh was pushed. Final head 76006d1.

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved the new CHANGELOG conflict with current main, preserving every PR and upstream entry. The complete feedback-reuse entry now starts Unreleased / Fixed to avoid repeated append conflicts. All other files match the automatic merge. Validation: 16 feedback-reuse tests passed; Ruff and pinned Fern checks passed. Immediately before the normal push, the candidate merged cleanly with latest main b38b71b. Current-head CI is running.

@rng1995
rng1995 enabled auto-merge (squash) November 12, 2026 20:03

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed external update f30ecdd. Its entire tree exactly equals the clean automatic merge of reviewed b0a270c and main b38b71b, preserving the feedback-reuse implementation and all upstream changes. Current-head validation: 25 feedback-reuse and completed-agent contract tests passed; Ruff and pinned Fern checks passed. The original Windows runner-loss failure has a successful same-head replacement (3981 passed, 77 skipped); the old Python 3.12 replacement was automatically superseded by the required main-conflict update while progressing through tests. Current-head CI has no failed checks and is waiting on Python 3.12.

@rng1995
rng1995 merged commit 4892db0 into main Nov 12, 2026
27 checks passed
@rng1995
rng1995 deleted the naren/port-tier3-view-results-feedback-reuse branch November 12, 2026 20:44
rng1995 added a commit that referenced this pull request Nov 12, 2026
Brings in #410, #412, #413, #419, #421, #425, #430 and #444. Conflicts: CHANGELOG.md (kept both Unreleased Fixed entries) and evaluation/options.py (kept main's tolerate_baseline_timeouts field and this PR's backend field).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant