fix(report): portable basename in GRAPH_REPORT.md header, not the host absolute path (#2628) - #2682
fix(report): portable basename in GRAPH_REPORT.md header, not the host absolute path (#2628)#2682ousamabenyounes wants to merge 1 commit into
Conversation
…t absolute path (Graphify-Labs#2628) The generated header interpolated the scan root verbatim, so passing an absolute root baked the build machine's full path (e.g. /Users/<user>/...) into GRAPH_REPORT.md — a tracked artifact — making the same graph produce different bytes per machine and leaking the host directory layout into git history. Label the header with the project directory basename instead, so 'graphify update .', './proj', and '/abs/path/proj' all render 'proj'. Same class as the 0.9.40 graph.html title fix (Graphify-Labs#2598). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This PR modifies how the GRAPH_REPORT.md header is generated in graphify/report.py. It adds a new _portable_root_label helper that reduces the root argument to the project directory's basename (stripping absolute path prefixes, handling trailing slashes and degenerate cases like ./..), and uses it in the header line instead of the raw root value. A changelog entry and two new tests (covering the header behavior and the helper across POSIX/Windows/relative inputs) are also added.
No blocking issues surfaced. 2 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 475 functions depend on the 217 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
generate()— 30 callers, 6 callees - worse:
make_inputs()— 14 callers, 5 callees
Verification — 475 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 335 function(s) in the blast radius were not formally verified this run
· 2 more finding(s) on lines outside this diff (see the check run).
|
Shipped in v0.9.42 ( |
Summary
Fix #2628
GRAPH_REPORT.md's header interpolated the scanrootverbatim(
report.py:104), so passing an absolute root baked the build machine's fullpath into a tracked artifact:
The same graph then produces different bytes on different machines and the host
directory layout ends up in git history. This is the same class of defect as
#2598 (fixed for
graph.html's<title>in 0.9.40).The fix labels the header with the project directory basename via a small
_portable_root_label()helper, sographify update .,graphify update ./proj,and
graphify update /abs/path/projall renderproj— portable and stableacross machines, no filesystem access for absolute inputs.
Reproduces with
On unmodified
v8,report.generate(..., root="/Users/mike/dev/apps/secretproj")yields:
Test verification (RED → GREEN)
Two new tests in
tests/test_report.py(
test_report_header_does_not_embed_host_absolute_path,test_portable_root_label).RED — new tests on
v8with the fix reverted (report.pyonly):GREEN — with the fix:
Full suite (Python 3.13, local):
4330 passed, 3 skipped; the only failures are3 pre-existing, environment-dependent
test_ollama.pybackend-detection teststhat also fail on unmodified
v8(local ollama present) — no new failures, noregressions. skillgen
--check/--audit-coverage/--schema-singleton/--monolith-roundtrip/--always-on-roundtripand thegraphify --help/installsmoke all pass.
Files changed
graphify/report.py_portable_root_label(); use it in the headertests/test_report.pyCHANGELOG.md