feat(impact): hazard-aware blast radius + docs refresh - #121
Merged
Conversation
- ARCHITECTURE.md: add rank.js, collide.js, docs_render.js to repo
layout tree and component descriptions
- mintlify/cli/overview.mdx: add rank and collide to Labs card
- docs_render.js: widen trackedMarkdown glob to *.md + *.mdx so
normalizeMermaid auto-applies the branded theme to mintlify diagrams;
inject init line into bare mermaid blocks (was skip-only)
- docs_check.js: widen markdownFiles to *.md + *.mdx so diagram checks
cover mintlify files
- 6 mintlify mermaid diagrams now carry the branded %%{init theme
- Updated normalizeMermaid test for the new inject behavior
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LXmzxfRVDRVPU6LG8W39Rz
…a-driven threshold Replace hardcoded impact constants with data-driven enhancements that fuse the code graph with team memory: - SCC-aware propagation: when a file in a circular-dependency cluster is impacted, all co-members are impacted at the same confidence (via Tarjan SCC from rank.cycles()). A change to any file in a cycle effectively changes them all — ignoring this was the biggest source of false negatives. - Hazard-adjusted threshold: files that are both structurally critical AND have historically broken get a lower inclusion threshold: effectiveThreshold = base / (1 + hazard), where hazard is derived from PageRank centrality and ledger incident history. No new constants — every enhancement is computed from existing infrastructure. - buildSccIndex() helper in atlas.js, loadRankData() assembler in substrate.js, wired through cli.js (--basic flag), cortex_mcp.js, and imagine.js. consensus.js and gate.js left on basic impact (hot path). - 4 new tests: SCC propagation, hazard threshold, combined, fail-open backwards compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LXmzxfRVDRVPU6LG8W39Rz
Sort imports alphabetically (rank.js before reuse.js, loadRankData before predictFailingTests) and restore 100-column formatting that the environment hook had collapsed to 80 columns. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LXmzxfRVDRVPU6LG8W39Rz
CodeWithJuber
marked this pull request as ready for review
August 7, 2026 15:51
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.
What & why
Two commits delivering a docs refresh and a data-driven upgrade to
forge impact:Commit A — docs/diagrams refresh (fix):
rank.js,collide.js,docs_render.jsrankandcollide.mdxfiles (6 mintlify diagrams were rendering in default blue/grey instead of the branded palette)trackedMarkdown()andmarkdownFiles()widened from*.mdto*.md *.mdxnormalizeMermaid()now injects branded%%{initinto bare mermaid blocks (previously only replaced existing init lines)Commit B — hazard-aware impact analysis (feat):
Replace hardcoded impact constants with data-driven enhancements that fuse the code graph with team memory:
rank.cycles()). A change to any file in a cycle effectively changes them all.effectiveThreshold = base / (1 + hazard), where hazard is derived from PageRank centrality × ledger incident history. No new constants — purely data-driven from existing infrastructure.buildSccIndex()helper,loadRankData()assembler, wired through CLI (--basicflag), cortex_mcp, and imagine. consensus/gate left on basic impact (hot path).Checklist
npm testpasses (1115 pass, 2 skipped, 0 fail)npm run checkpasses (only pre-existing warnings in dash.html/init.js/gateway_model_map.js)buildSccIndex, enhancedimpact()with 4 new tests)fix:+feat:)CHANGELOG.mdupdated under## [Unreleased]Risk & rollback
sccIndex/hazardsdefault toundefinedand impact() behaves identically to pre-enhancement.--basicflag reverts to fixed-threshold mode.Extra checks (tick if applicable)
npm run typecheckpassesloadRankDatacatches all errors and returns undefined)Generated by Claude Code