fix(step): report diagnostic paths relative to the repository root for steps that run in a subdirectory #1638
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.48) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 528 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.375
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1638"
general
weight: 0.35
jdx
<!-- entire-trail-link-start -->
https://entire.io/gh/jdx/hk/trails/214
<!-- entire-trail-link-end -->
Problem
A step with
diagnostic_formatthat runs in a directory (dir = "{{workspace}}"or an explicitdir) reports the paths its tool printed, which are relative to that directory. In a repo with several modules, SARIF,--format jsonand MCP diagnostics then name the wrong file. This is why #1630 had to dropdiagnostic_formatfromgo_vetandgolangci_lint.Change
hk now records each check command's output together with the directory it ran in, parses each command separately, and rebases the parsed diagnostic paths (and fix paths) onto the repository root:
./and..segments are resolved\is treated as a separatordirare unchangedParsing per command also means a
batchor workspace step with several jobs no longer has to parse their concatenated output as one document.check/fixcommands are not changed. Thediagnostic_formatdocs inpkl/Config.pklmention the rebasing.Not included (follow-up)
go_vetandgolangci_lintdo not getdiagnostic_formathere. With the gcc parser on main,go vettype errors print asvet: ./main.go:3:8: ..., which parses withvet: ./main.goas the path, and the# pkgheader lines become parse warnings. Those builtins should follow once #1629/#1630 (the gcc shape work) land. I did not rungolangci-lintlocally (no version set in mise), so its output shape is unchecked.Validation
./,.., escaping the root, Windows separators, absolute/drive/URI paths, no-op for root and absolute dirs, fix paths, per-directory segments): pass.test/diagnostics.bats: two new tests (a two-module repo withdir = "{{workspace}}"whose SARIF URIs becomeservices/api/...,services/web/...andservices/shared/util.cfrom../shared; and an explicitdirvia--format json). All 17 of 17 planned tests ran and passed.cargo fmt --checkandcargo clippy --all-targets -- -D warningsare clean.cargo testhas 16 failures, all incli::init::detector, none touching diagnostics. I did not investigate them or confirm they also fail on main; my localpkl/Builtins.pklwas copied from the main checkout and may be stale.x86_64-pc-windows-gnucheck could not build here (the C dependencieslibz-sysandaws-lc-sysfail without a cross C toolchain), so Windows behavior is covered only by the unit tests.🤖 Generated with Claude Code
AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable.
<!-- CURSOR_SUMMARY -->
---
<!-- /CURSOR_SUMMARY -->