Repository navigation
Fix "House of Cards" report section and per-file repo_z_score (#370, #371) - #382
Merged
Merged
Conversation
…371) Two report-accuracy bugs in the same family: real data is computed somewhere in the pipeline, but never actually threaded through to the recorder that's supposed to display it. #370: llm_recorder.py's "House of Cards" markdown section read sys_bots.get("house_of_cards", []) -- but signal_processor.py's real bottleneck-detector key is "fragile_dependency_chain". The section's own field reads (h['close'], h['err']) already matched that key's real entry shape exactly, confirming this was purely a top-level key mismatch, not a deeper schema drift -- fixed by reading the right key. #371: record_keeper.py and llm_recorder.py both read a per-file telemetry["repo_z_score"], but the only real z-score signal_processor.py computes is repo-WIDE, at summary["repo_macro_species"]["z_score"] -- nothing ever copied it down into each file's own telemetry. Fixed by backfilling it in galaxyscope.py right after summary is computed, in both pipeline modes (the main orchestrate() path and the incremental "Delta Mode" path) -- summary can only exist after repository_graph is fully assembled, so this has to be a post-hoc backfill loop, not a per-file computation. Tests: - test_llm_recorder.py: new test driving _build_markdown() with a real fragile_dependency_chain bottleneck entry, proving the House of Cards section renders it. - test_galaxyscope.py: new end-to-end test running the real execute_pipeline() (mocking only the heavy engines, matching the existing SARIF sanitization test's harness) with a mocked summarize_galaxy_metrics() z-score, proving it survives into scope.parsed_files[0]["telemetry"]["repo_z_score"]. tests/dead_key_audit_baseline.json: "house_of_cards"/"repo_z_score" removed now that they're fixed (`python tests/dead_key_audit.py --ci` confirmed clean at 7 baselined keys, zero regressions). Full suite: 858 passed, 1 pre-existing xfail. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
1 task
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.
Summary
Closes #370, #371. Two report-accuracy bugs in the same family: real data is computed somewhere in the pipeline, but never actually threaded through to the recorder that's supposed to display it.
#370:
llm_recorder.py's "House of Cards" markdown section readsys_bots.get("house_of_cards", [])-- butsignal_processor.py's real bottleneck-detector key is"fragile_dependency_chain". The section's own field reads (h['close'],h['err']) already matched that key's real entry shape exactly, confirming this was purely a top-level key mismatch, not a deeper schema drift -- fixed by reading the right key.#371:
record_keeper.pyandllm_recorder.pyboth read a per-filetelemetry["repo_z_score"], but the only real z-scoresignal_processor.pycomputes is repo-wide, atsummary["repo_macro_species"]["z_score"]-- nothing ever copied it down into each file's own telemetry. Fixed by backfilling it ingalaxyscope.pyright aftersummaryis computed, in both pipeline modes (the mainorchestrate()path and the incremental "Delta Mode" path) --summarycan only exist afterrepository_graphis fully assembled, so this has to be a post-hoc backfill loop, not a per-file computation.Test plan
test_llm_recorder.py: new test driving_build_markdown()with a realfragile_dependency_chainbottleneck entry, proving the House of Cards section renders it.test_galaxyscope.py: new end-to-end test running the realexecute_pipeline()(mocking only the heavy engines, matching the existing SARIF sanitization test's harness) with a mockedsummarize_galaxy_metrics()z-score, proving it survives intoscope.parsed_files[0]["telemetry"]["repo_z_score"].tests/dead_key_audit_baseline.json:"house_of_cards"/"repo_z_score"removed now that they're fixed (python tests/dead_key_audit.py --ciconfirmed clean at 7 baselined keys, zero regressions).python -m pytest tests/ -q-- full suite, 858 passed, 1 pre-existing xfail.flake8 . --count --select=E9,F63,F7,F82-- 0.🤖 Generated with Claude Code