fix(tools): emit repo-relative paths in the drift report, never absolute - #62
Merged
juemerson-at-purestorage merged 1 commit intoJul 28, 2026
Conversation
`confidence.unresolvedParameters[].file` passed the cmdlet's absolute path
straight through, while `target.file` was already repo-relative. Because these
artifacts are committed, that had two consequences:
1. It published the generating machine's home-directory path into the repo --
88 occurrences in each of Reports/PfbApiDriftReport.json and .md.
2. It made the committed content depend on WHERE it was generated.
Regenerating from a git worktree instead of the main checkout rewrote all
88 lines, producing 174 of 279 diff lines of pure churn that buried the
real changes under review.
Extracts the relativization Get-PfbGapTarget already performed into a shared
ConvertTo-PfbRepoRelativePath helper and applies it at both emission sites, so
there is one rule and one place to change it. The .md writer reads the same
structure, so it is fixed by the same change.
Adds three regression guards over the real generated artifacts asserting no
absolute path survives in unresolvedParameters, in enriched body-property
targets, or in the rendered markdown. All three were mutation-proved: with the
helper stubbed to a passthrough, all three fail. The target guard also asserts a
non-zero population -- its first draft read the path from the wrong nesting
level, always scanned nothing, and passed vacuously under that same mutation.
Regenerated artifacts are path-only: 88 changed lines per file, verified to
differ by nothing but the path prefix. No semantic change to the report.
Suite 632/4/2, up from 629/4/2 -- exactly the three new guards, same four
pre-existing pinned-figure failures.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Problem
Reports/PfbApiDriftReport.jsonand.mdare committed artifacts, but the generator emitted absolute filesystem paths into them — 88 occurrences in each file onmain.target.filewas always repo-relative.confidence.unresolvedParameters[].filewas not: it passed the cmdlet's absolute path straight through.Two concrete harms:
Fix
Extracts the relativization
Get-PfbGapTargetalready performed into a sharedConvertTo-PfbRepoRelativePathhelper, applied at both emission sites — one rule, one place to change it. The.mdwriter renders the same structure, so it is fixed by the same change.Regenerated artifacts are path-only
88 changed lines per file, verified programmatically to differ by nothing but the path prefix — no semantic change to the report. Both committed blobs now contain zero absolute paths.
Regression guards
Three new tests over the real generated artifacts assert no absolute path survives in
unresolvedParameters, in enriched body-propertytargets, or in the rendered markdown.All three were mutation-proved: with the helper stubbed to a passthrough, all three fail.
Worth noting — the mutation caught a bug in one of the guards. The
targettest originally read$g.target.fileat gap level, buttargethangs off each enrichedmissingBodyProperties[]entry, so it scanned nothing and passed vacuously. It now reads the correct nesting level and asserts a non-zero population (403 targets) so it cannot silently go hollow again.Testing
Suite 632 / 4 / 2, against a 629 / 4 / 2 baseline at
cd7e4a6— exactly the three new guards, zero regressions.The 4 pre-existing failures are stale pinned acceptance figures in
Tests/Build-PfbApiDriftReport.Tests.ps1(context_names,allow_errors,phantomFieldCount, high-confidence-13). They predate this branch and are deliberately untouched — no pinned figure was adjusted to make anything pass.Compliance-sensitive callout
This changes the content of two committed generated artifacts. It does not change any cmdlet, any wire behaviour, or the semantic content of the drift report.
🤖 Generated with Claude Code