Repository navigation
fix(tier3): reuse a run's saved feedback when view regenerates its report - #419
Conversation
…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]>
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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
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]>
Summary
skillevaluator viewregeneratesreport.htmlwhen a run's results exist but the file is missing. Today it callsrender_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 inresult.jsongets its report rebuilt from that feedback, with no LLM call.view_results(tier3/commands.py) readsresult.jsonwith the existing_read_result_jsonhelper and checks it withsaved_feedback_for_run, the same helperstier3 feedbackuses. When the run saved all four feedback fields, it renders withengine_result=<result.json>,use_llm_judge=Falseand the saved feedback. Otherwise it makes the same call as before.result.jsonasengine_resultmatchesload_agent_eval_payload(tier3 feedback) and the dashboard loader. On this path the rebuilt report therefore also carries the run'sduration_secondsas its runtime (in the report data, not shown on the page) and shows Harbor log and analysis links whenresult.jsonrecords aharbor_viewersummary. 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 recordsduration_secondsonly after it rendersreport.html, so the run's own report did not carry the runtime either.render_agent_eval_html_reporttakes a new keyword,saved_feedback. When it is set, the judge is not called and the savedconclusions,recommendations,suggestionsandsuggestions_v2replace the rebuilt ones.what_to_fix.jsonthrough a newfixeskeyword on_apply_case_findings, and does not write it again.what_to_fix.json, the pass writes the rule-based fixes, wheremainasked 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, sowhat_to_fix.json(which the terminal case summary reads) can then differ from them. Such a run wrotewhat_to_fix.jsonwhen it rendered its report, so this happens only when that file was removed too.Skill effectconclusion, 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 andsuggestions_v2stay.result.json: the renderer only updates the in-memory copy oftier3_feedback, andviewnever writes it back.viewsections indocs/reports.mdxanddocs/cli-reference.mdx. CHANGELOG entry under Unreleased > Fixed.Why
A missing
report.html(deleted, or not written because the report step failed) madeviewrun 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, becausebuild_insightsfalls 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 noreport.html,mainmakes one Insights judge call and one what-to-fix LLM call, shows none of the saved feedback, and rewriteswhat_to_fix.json. This branch makes no LLM call, shows the saved feedback, and leavesresult.jsonandwhat_to_fix.jsonunchanged.Kept from public
saved_feedback_for_runaccepts feedback only whenresult.json'srun_idnames the run directory andtier3_feedback.schema_versionis1.0.viewalso requires all four fields, which every release since 0.1.0 saves. Partial saved feedback is rebuilt as before.viewalready resolves only completed runs whoseresult.jsonnames the directory.conclusions,recommendations,suggestions_v2andsuggestions, so saved items are not checked again here. A savedwhat_to_fix.jsonis read with the existingload_case_findings(no link following) and is used only when its text fields are strings.use_llm_judge=True, nosaved_feedback) and the feedback-chat loader are unchanged._apply_case_findingswithoutfixesworks as before.report.htmlis still opened as is. A run without usable saved feedback, including legacy runs withoutresult.json, is still rebuilt with the judge as before.main, are computed when the report payload is built and again at the end of_apply_case_findings, and neither copy is saved inresult.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 savedwhat_to_fix.jsonthe two copies can differ: the pass sees the rule-based fixes it writes, andnext_stepsreads the run-error and eval-case fixes among them. The report shows the pass's steps.test_saved_feedback_keeps_what_the_case_pass_addschecks both cases withmain'snext_steps.Tests
tests/tier3/test_view_results_feedback.py(16 tests):duration_secondsand recorded Harbor link come through, andresult.jsonandwhat_to_fix.jsonare byte-identical afterwardswhat_to_fix.json: no LLM call, the saved feedback still leads the report, and the rule-based fixes are written towhat_to_fix.jsonwhat_to_fix.jsonis reused, or the rule-based fixes are written when it is missing or unusable (3 cases)report.htmlis opened without a rebuildrender_agent_eval_html_report(..., saved_feedback=...)skips the judge even withuse_llm_judge=Trueand keeps the saved feedback in the in-memorytier3_feedbackuse_llm=Falseand 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 savedwhat_to_fix.json(4 cases). Without the file, the steps the pass computes from the rule-based fixes replace the build-time ones.src/frommain(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).tier3.commands,tier3_report,tier3_feedback_chatorcase_summary(73 modules) plustests/test_ci_workflows.py, with-n 4: 5171 passed, 5 skipped.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.pyand the new module): 774 passed, 2 skipped.mainat d717f22. OnlyCHANGELOG.mdconflicted, and both entries are kept.git merge-treeof the branch and d717f22 is clean. This module andtests/test_tier3_next_steps.pygive 32 passed.-n 6: 27382 passed, 35 skipped, 5 failed. The 5 are local-environment failures that also fail onmainon 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 touchesviewor the Tier 3 report.ruff checkandruff format --checkare clean on the changed Python files, andscripts/check_oss_boundary.pypasses.🤖 Generated with Claude Code