Repository navigation
Description
[Bug]: 4 defects in project-harness analysis — history windows collapse, instruction-surface misclassification, project gates invisible, Rules surface missing from asset inventory
Environment: better-harness 0.7.0-alpha2 (plugin cache, commit 34899f36)
Workspace: a Python repository with one root AGENTS.md (47,459 bytes), 49 ADRs, 117 markdown docs under docs/, 1,268 commits, 278 source files, 176 test files.
All four findings below were reproduced by running the CLI locally. Commands and raw counts are included so they can be verified without extra tooling.
1. The 30/90/180-day history windows are the same commit range
core-change-watch git-history-profile returns three windows labeled recent-hotspots, sustained-hotspots, and legacy-or-long-range-hotspots. Their hotFiles, supportingHotFiles, and hotPaths arrays are byte-identical across all three, yet reviewMatrix["history-window-coverage"] reports ready.
Reproduction:
better-harness core-change-watch git-history-profile --cwd <workspace> --jsonObserved:
"range": { "maxCommits": 500, "analyzedCommits": 500, "newest": "ea2317c", "oldest": "dfb75f7" }All three windows report analyzedCommits: 500 (at the cap). The repository has 1,268 commits; 774 predate the earliest window start. Concretely:
git rev-list --count HEAD # 1268
git rev-list --count --before=2026-09-10 HEAD # 779
git log -500 --format=%H | tail -1 # oldest scanned commit, dated 2026-09-09The window start dates (30-day = 2026-09-03, 90-day = 2026-07-05, 180-day = 2026-04-06) all fall before the bounded oldest commit (2026-09-09). The windows cannot diverge, because all three are truncated to the same 500 most recent commits.
Why this matters beyond cosmetics: three trend labels presented as independent corroboration let a reader conclude a hotspot is "sustained" or "legacy" when there is only one measurement. This affects every repository with more than maxCommits commits whose history extends past the shortest window.
Suggested fix: when the commit cap binds for a window, either report the actual covered range and mark the window as capped, or suppress the trend label rather than emitting one that the data does not support. reviewMatrix["history-window-coverage"] should not be ready when the windows are provably identical.
2. Instruction-coverage judgement counts only files literally named AGENTS.md
project-profile reports agentInstructions.status: "thin" with these reasons:
"root AGENTS.md present"
"AGENTS.md count 1 is below suggested minimum 2 for source scale"
"large source tree has no nested AGENTS.md coverage"
The second and third reasons are artifacts of matching on one filename. The repository's actual instruction surface:
wc -c AGENTS.md # 47459 bytes — architecture seams, gate protocol, human-review tiering
ls docs/adr | wc -l # 49 ADRs
ls docs/agents/ # domain.md, issue-tracker.md, triage-labels.mdNone of these is named AGENTS.md, so none is counted. The "no nested AGENTS.md coverage" claim is literally true and substantively empty.
The second consequence is more actionable: suggestedScopes on the unfiltered run proposes writing instruction coverage into data-product directories:
{"path": ".scratch/archive-2026-08-16", "sourceFiles": 27}
{"path": ".scratch/window-closeout-2026-10", "sourceFiles": 26}
{"path": ".scratch/archmap-closeout-2026-09", "sourceFiles": 23}
{"path": ".scratch/l2-cluster2-2026-09", "sourceFiles": 8}
Following that advice would place agent instructions inside scratch space.
Note that with data-product directories excluded via --ignore, status flips to adequate — but that is a side effect of a smaller corpus, not a better measurement, so it should not be read as the fix.
Suggested fix: treat a domain glossary, a docs/agents/ conventions directory, and an ADR/spec directory as instruction carriers for coverage accounting; and constrain suggestedScopes to source directories rather than whatever directories happen to hold many files.
3. Project-owned gates are invisible, so validation guidance is presented as authoritative but is narrow
followUpActions["validate-impact"] is titled "Run focused validation for changed core or hotspot areas" and lists 8 files (7 tests + 1 fixture) as the validation scope, with reason "Detected tests or fixtures can anchor validation."
This repository has four deterministic gates:
| Gate | Command |
|---|---|
| Delivery gate (full suite + dead-import scan + data gate) | python tools/verify-task.py |
| Scoped check routing | python -m tools.verify --affected <paths> / --affected-git |
| Pre-write source gate | PreToolUse hook requiring a fresh gate marker per edit |
| Test suite | 3,051 tests collected |
None appear anywhere in the analysis output. Substring counts over the serialized JSON:
verify-task 0
current-ticket 0
affected-git 0
pre-tool-gate 0
The generic behavior is understandable — a cross-project tool cannot know each project's gates. The defect is the framing: the tool emits a narrow list as the authoritative validation scope rather than declaring that project-owned gates are unknown. An agent following it runs a strict subset and silently skips the delivery gate and dead-import scan.
Suggested fix: when project-owned validation surfaces cannot be identified, validate-impact should state that explicitly instead of presenting detected tests as the scope. Consider emitting a "discovery" hint (check for a delivery/verify wrapper, CI config, or pre-commit hook) rather than a closed list.
4. Root AGENTS.md is not classified into any asset surface
The Claude asset inventory reports:
"assetInventory": { "summary": { "skills": 1, "mcps": 1, "rules": 0, "hooks": 0, "agents": 0, "commands": 0 } }and coverageRows contains exactly two surfaces:
[{"surface": "Skills", "scopes": ["Project"], "count": 1},
{"surface": "MCP", "scopes": ["Project"], "count": 1}]Meanwhile the file exists, is git-tracked, and is loaded as the project instruction file by the provider:
git ls-files | grep -E '(^|/)AGENTS\.md$' # AGENTS.md
wc -c AGENTS.md # 47459There are two readings, and the gap holds under both:
- If
rulesis intended to mean only~/.claude/rules/**-style directories, thenrules: 0is correct but the rootAGENTS.mdis classified into no surface at all. - If
rulesis meant to include rootAGENTS.md, then the count is wrong.
Either way, the practical consequence is the same: any omission / redundancy / rule-skill-overlap judgement made against this inventory silently ignores the workspace's largest instruction owner.
Suggested fix: classify a tracked root AGENTS.md into the Rules surface so it appears in coverageRows and in ownerRoutes. If the Rules surface is intentionally directory-only, a separate row for root instruction files would preserve the accounting.
Reproduction environment
better-harness 0.7.0-alpha2 (34899f36)
node v26.5.1, Windows 11
findings 1-2 reproduced unfiltered; 3-4 reproduced with --ignore excluding data-product dirs
No repository files were modified while producing this report.
Activity
liushuhao commentedon Oct 4, 2026
5. Lifecycle classification assigns
Highconfidence to an episode with zero acceptance evidenceIn
lanes.sessionEvidence.data.candidates[].lifecycle[], one episode carries two intent entries that both map to the same dimension/check pair withconfidence: "High":[ {"intent":"documentation-maintenance","family":"documentation-maintenance","dimensionId":"reliable-delivery","checkId":"acceptance-evidence","confidence":"High"}, {"intent":"release-delivery","family":"review-acceptance-delivery","dimensionId":"reliable-delivery","checkId":"acceptance-evidence","confidence":"High"} ]The same episode records:
So
acceptance-evidencereaches its highest confidence on an episode that observed no changes and whose only check has no change context. Any consumer filtering by confidence would count this no-op closeout as accepted.Likely mechanism (inferred, not observed): the confidence input reads the intent text without reading the change/relation facts. The
confidencefield's derivation is not exposed in the bundle, so this remains a hypothesis.Suggested fix: include change and check-relation facts in the confidence decision, or downgrade confidence when
closureisno-change-observed/acceptanceEvidenceCeilingis below the checked dimension. Surfacing contradictory rows explicitly would also help.Boundary: only 1 emitted episode carries lifecycle facts, so the contradiction rate cannot be estimated from this sample.
6. No Task Episode in the window binds a final change to a reviewed relevant check
Across 200 candidate episodes: 33 have changes, 72 have checks, 0 have a reviewed relevant check. The producer's own diagnostic flag names this. The three emitted episodes are all zero-change closeouts with
relation: "no-change-context".The important qualifier: this is a gap in the review pipeline's ability to bind check↔change, not a claim that the repository skipped validation. The repository does run a full suite and a delivery gate; the bundle cannot connect "which check judged which change".
Contributing factor worth noting in the same report — the episode portfolio is truncated by budget:
163 of 200 candidates were dropped by budget, and the
change-gapclass (33 available) emitted 0 episodes. The class most relevant to "changed but not closed" is precisely the one fully truncated, so any conclusion about change closure in this window is unavailable rather than clean.Suggested fix: preserve at least one episode per available class when truncating, or mark fully-truncated classes explicitly so downstream consumers do not read their absence as "no occurrences".
Reproduce with:
better-harness harness evidence-bundle --workspace <workspace> --platform claude --depth normal --format json, then readlanes.sessionEvidence.data.populationCoverageandcandidates[].lifecycle[].phodal commentedon Oct 8, 2026
@liushuhao welcome to PR
subaru-ye commentedon Oct 13, 2026
Hi @phodal, @liushuhao — I'd like to help fix this issue if it's still unclaimed.
What I've verified so far on current main (
a7d77fb):Defect 1 (history windows collapse): confirmed the mechanism.
git-history-profileruns a single boundedgit log -<maxCommits>and derives all three windows by filtering that one commit list by window start (commit.timestamp >= sinceSeconds). When the cap binds — as in the reported repo (1,268 commits, 774 older than the bounded range) — all three windows receive identical commit sets.historyConfidencealready recordsbounded at maxCommits=..., but that fact never propagates into the per-window trend labels orreviewMatrix["history-window-coverage"], which is why identical windows still reportready.Defects 2–4: I've located the owning modules (
project-profile.mjsfor instruction coverage,evidence-pack.mjsfor validate-impact framing,coding-agent-practices/inventory.mjsfor the asset surface) but haven't reproduced them yet — I'd re-verify each finding against this report before changing anything.Proposed plan:
history-window-coverageshould not stayreadywhen windows are provably identical.AGENTS.mdinto an asset surface /coverageRows). Defects 2 and 3 involve semantic calls — what counts as an instruction carrier, and howvalidate-impactshould frame unknown project gates — so I'd bring a concrete proposal there for review rather than deciding unilaterally.Scope note: the two follow-up defects from the comments (High confidence on zero-change episodes, budget truncation of
change-gapepisodes) look like a separate lane in sessionEvidence — I'd keep them out of this effort unless you want them tracked here.@liushuhao — if you're already preparing a PR, just say so and I'll take whichever defects you'd rather leave, or review yours instead.
phodal commentedon Oct 13, 2026
@subaru-ye welcome to PR
phodal commentedon Oct 13, 2026
@subaru-ye welcome to PR
phodal commentedon Oct 13, 2026
@subaru-ye welcome to PR
fix(analysis): address host discovery and evidence review
fix(analysis): repair host discovery and evidence coverage