Back up graph.html on both rebuild paths (CLI and skill) - #2512
Back up graph.html on both rebuild paths (CLI and skill)#2512GUGU75006 wants to merge 3 commits into
Conversation
backup_if_protected() snapshots a protected graph's artifacts into graphify-out/<date>/ before a rebuild overwrites them, but graph.html was missing from _BACKUP_ARTIFACTS. Every other output of the previous run was preserved while the interactive viewer — the one artifact a human actually opens — was destroyed on every run, and the dated folders could not be opened in a browser at all. The HTML is regenerable in principle, but only by re-running the build it belongs to, which for a semantic graph means paying the LLM cost again. That is exactly the property the backup exists to protect. Co-Authored-By: Claude Opus 5 <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 pull request removes several repository files and trims documentation/CI configuration. It deletes the publish.yml PyPI publishing workflow, the BENCHMARKS.md file, and the .DS_Store entry from .gitignore, edits a comment in the CI security-scan job, and truncates a large portion of the CHANGELOG.md. The changed-symbols list also indicates edits across many test fixtures, extraction modules, skill-generation templates, and translated docs. Note: the diff was truncated in the prompt, so the full surface area (particularly the changes reflected in the symbol list) is not entirely visible here.
No blocking issues surfaced.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 6277 functions depend on the 5912 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
main()— 55 callers, 109 callees - new:
extract_bash()— 19 callers, 8 callees - new:
to_html()— 14 callers, 9 callees - new:
install()— 12 callers, 10 callees - new:
_extract_generic()— 17 callers, 7 callees - new:
_resolve_js_module_path()— 28 callers, 4 callees - new:
codebuddy_install()— 21 callers, 5 callees - new:
extract_pascal()— 14 callers, 6 callees - …and 49 more
Verification — 6277 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: 6271 function(s) in the blast radius were not formally verified this run
· 57 more finding(s) on lines outside this diff (see the check run).
The CLI path (graphify update / watch._rebuild_code) already calls backup_if_protected before overwriting a protected graph. The AI-assistant skill path (Step 4 of the generated runbook) writes graph.json / GRAPH_REPORT.md / graph.html directly and never called it, so /graphify --update (doc/paper/image runs) silently destroyed the prior snapshot that the CLI path was fixed to preserve in the previous commit. Source of truth is tools/skillgen/fragments/core/core.md, shared by every "split"-bucket platform (claude, codex, windows, opencode, kilo, copilot, claw, droid, amp, trae, kiro, pi, vscode) — 13 platforms, one fragment. Left the aider/devin monoliths untouched; they're frozen hand-maintained files guarded by a separate round-trip validator against a pinned v8 blob, and this change isn't in that guard's sanctioned set. Regenerated with `python -m tools.skillgen && python -m tools.skillgen --bless`. All guards pass: --check, --monolith-roundtrip, --schema-singleton, --audit-coverage, --always-on-roundtrip. Co-Authored-By: Claude Opus 5 <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 pull request removes several repository files, including the PyPI publishing GitHub Actions workflow (.github/workflows/publish.yml), the BENCHMARKS.md document, and the .DS_Store/macOS Finder entry from .gitignore. It also trims the top CHANGELOG.md entries (removing the unreleased 0.9.35 section and other content) and adjusts a comment in the CI workflow's security-scan job to mention the safety tool. The changed-symbols list suggests wider edits across source and test files, though the truncated diff only shows the workflow, gitignore, benchmarks, and changelog changes.
No blocking issues surfaced. 1 lower-confidence candidate did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 6277 functions depend on the 5912 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
main()— 55 callers, 109 callees - new:
extract_bash()— 19 callers, 8 callees - new:
to_html()— 14 callers, 9 callees - new:
install()— 12 callers, 10 callees - new:
_extract_generic()— 17 callers, 7 callees - new:
_resolve_js_module_path()— 28 callers, 4 callees - new:
codebuddy_install()— 21 callers, 5 callees - new:
extract_pascal()— 14 callers, 6 callees - …and 49 more
Verification — 6277 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: 6271 function(s) in the blast radius were not formally verified this run
· 57 more finding(s) on lines outside this diff (see the check run).
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 adds graph.html to the list of artifacts (_BACKUP_ARTIFACTS) that backup_if_protected snapshots into the dated graphify-out/YYYY-MM-DD/ folder before a rebuild overwrites a protected graph. It also inserts a backup_if_protected(Path('graphify-out')) call (and the corresponding import) into the export/build step across the various agent skill markdown files (amp, claw, codex, copilot, droid, kilo, and others) so the skill code paths perform the same snapshotting the CLI does. Accompanying changes update the CHANGELOG and expected skill-generation fixtures/tests to match. The surface area spans the core export.py, many skill-*.md runbook files, generated test fixtures under tools/skillgen/expected/, and a couple of export tests.
No blocking issues surfaced. 3 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 1353 functions depend on the 1006 functions this change touches.
Health — grade B; 10 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):
_rebuild_code()— 93 callers, 51 callees (high)build_merge()— 41 callers, 14 callees (high)to_obsidian()— 24 callers, 11 callees (high)to_json()— 42 callers, 6 callees (high)dispatch_command()— 2 callers, 117 callees (high)_make_graph()— 30 callers, 6 callees (high)run_pipeline()— 8 callers, 13 callees (high)to_canvas()— 14 callers, 3 callees (high)- …and 2 more
Verification — 1353 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: 1213 function(s) in the blast radius were not formally verified this run
What
Two commits, one bug:
graph.htmlwas missing from the pre-overwrite snapshot thatbackup_if_protected()takes before a protected graph gets rebuilt.1.
graphify/export.py— addgraph.htmlto_BACKUP_ARTIFACTS. This covers the CLI path (graphify update,watch._rebuild_code), which already callsbackup_if_protected.2.
tools/skillgen/fragments/core/core.md— callbackup_if_protected(Path('graphify-out'))in Step 4 of the generated runbook, right beforeto_json. This covers the AI-assistant skill path (/graphify --updatefor docs/papers/images), which builds the graph inline and never calledbackup_if_protectedat all — not just missinggraph.html, missing the whole snapshot.Why
backup_if_protected()exists so a protected graph (semantic marker present, or curated community labels) survives a rebuild. Before this PR:graph.json,GRAPH_REPORT.md,manifest.json,cost.json, labels, analysis — but destroyed the interactive viewer on every run, and the datedgraphify-out/<date>/folders couldn't be opened in a browser at all.graph.json/GRAPH_REPORT.md/graph.htmldirectly via inline Python and never invoked the backup helper, so a semantic (/graphify --update) run silently overwrote the entire prior snapshot — including the LLM-derived output that's expensive to reproduce, which is the exact case the helper was built to protect.Both were found and reproduced on a real
graphify-out/(curated labels, no semantic marker) while investigating why a dated backup folder had nograph.htmland the CLI update ran clean while the skill update visibly lost data.Scope notes
core.mdis the shared fragment for every "split"-bucket platform (claude, codex, windows, opencode, kilo, copilot, claw, droid, amp, trae, kiro, pi, vscode) — 13 rendered skill files + theirexpected/snapshots, all regenerated from this one source change.aider.md/devin.mduntouched. Per the CHANGELOG, those are hand-maintained monoliths frozen against a pinned v8 blob by a round-trip guard with an explicit sanctioned-change allowlist; this change isn't in that allowlist and monkeying with it is out of scope here.to_json(so the snapshot captures the previous run'sgraph.html, which Step 6 rewrites later in the same runbook).Testing
tests/test_export.py::test_backup_includes_graph_html(new) — assertsgraph.htmlround-trips throughbackup_if_protected.graphify-out/with curated labels):graph.html,graph.json,GRAPH_REPORT.mdall present in the dated folder afterward.graphify update .on a real project):python -m tools.skillgen --check— OK, 125 artifacts match.python -m tools.skillgen --monolith-roundtrip— OK.python -m tools.skillgen --schema-singleton— OK.python -m tools.skillgen --audit-coverage— OK.python -m tools.skillgen --always-on-roundtrip— OK.I could not run the Python test suite itself in this environment (
pytestisn't installed against the interpreter the editable install uses) — please run CI on it.🤖 Generated with Claude Code