feat(layer-101): cannibalize safishamsi/graphify → Graph Insights#24
Draft
slavazeph-coder wants to merge 1 commit into
Draft
feat(layer-101): cannibalize safishamsi/graphify → Graph Insights#24slavazeph-coder wants to merge 1 commit into
slavazeph-coder wants to merge 1 commit into
Conversation
Adds graphify's analytical layer on top of the existing Layer 20 code graph. Five additions, no new deps: 1. Edge provenance — codeParser.js tags every edge as EXTRACTED (1.0), INFERRED (0.8), or AMBIGUOUS (0.5). Unresolved imports now surface as `external:<module>` nodes with AMBIGUOUS edges instead of being silently dropped. 2. Leiden-lite — communities.js adds detectCommunitiesLeiden which runs Louvain then splits any community whose induced subgraph is disconnected. Captures Leiden's main guarantee at <100 LOC. 3. Graph analytics — new utils/graphAnalytics.js with god-node detection (cross-community hubs, artifact-filtered), surprising- connections scoring (cross-community + cross-filetype + peripheral→hub + optional semantic), and 7 suggested-question archetypes derived purely from graph structure (ambiguous edges, high-betweenness bridges via Brandes, isolated nodes, low-cohesion communities, tight-coupling pairs, external-load files, singletons). 4. Wiki bundle — wikiGenerator.js adds generateGraphWikiBundle and downloadGraphWikiBundle: index.md + community-N.md per community, graphify-style article navigation. 5. Graph Insights panel — new components/GraphInsightsPanel.jsx (Layer 101). Paste code → choose Leiden/Louvain → see provenance breakdown, god-nodes, surprising connections, suggested questions. Apply to brain maps insight density onto cognitive regions (PFC=questions, HPC=hubs, AMY=ambiguity). Wired into App.jsx, registered in layerCatalog.js as Layer 101 in the 'data' group. Build clean (vite v5.4.21, 912 modules transformed).
slavazeph-coder
pushed a commit
that referenced
this pull request
May 2, 2026
Roll the homepage repositioning across the in-product app, build the Brand Risk Scorecard layer, and replace the homepage gallery placeholders with real scan illustrations. brainsnn-r3f-app - index.html title + og + twitter meta now lead with "affective- intelligence engine" and the four-outcome positioning sentence. - OnboardingWalkthrough STEPS rewritten — step 1 leads with the positioning sentence, the Cognitive Firewall is framed as "the engine," the new Brand Risk Scorecard gets its own step, and the ordering puts the engine before the visualization layer. - MilestonePanel intro paragraph updated to the new framing. - Layer 106 (Brand Risk Scorecard) added to layerCatalog and mounted in App.jsx behind an ErrorBoundary, after the Milestone panel. L106 — Brand Risk Scorecard - src/utils/brandRisk.js: splitItems / scoreItem / computeBrandRisk / brandBriefMarkdown. Pure functions, no side effects. Aggregates Cognitive Firewall (L4) + Propaganda Templates (L39) + Ad Transparency archetypes (L48) into a single 0–100 score with a 4-tier classification (Clean / Watch / At risk / Critical). - src/components/BrandRiskPanel.jsx: brand input + items textarea + load-sample helper, headline score card, dominant archetypes, most-fired templates, top 5 worst items, copy-brief-as-Markdown. - Score formula: 60% mean pressure + 25% peak pressure + 15% high- risk archetype share. High-risk archetypes: abusive-domestic, phishing, conspiracy-hook, political-attack, cult-recruitment. - Number 106 picked to avoid colliding with the open L101 PRs (#22, #24, #25 — see PR #27 description for the suggested resolution). ui/brainsnn-site gallery - public/scan-fear-cascade.svg, scan-certainty-theater.svg, and scan-affective-trajectory.svg — three hand-rolled SVG cards that match the new gallery copy. 4-dim score bars, brain proxy with the appropriate region glowing, evidence chips. - GALLERY_ITEMS now carries an `image` field; App.jsx reads it with the demo-placeholder.svg as a fallback. Builds - npm run build --prefix ui/brainsnn-site — 624 modules, 8.03s, clean. - npm run build --prefix brainsnn-r3f-app — 912 modules, 6.19s, clean. https://claude.ai/code/session_brainsnn-ui-build-28ebr
Owner
Author
|
Heads up — there's a layer-number collision on
If #25 lands as the canonical L101–L105 thread, the cleanest resolution here is to renumber Graph Insights to L106 … wait, I just took L106 in #27 (Brand Risk Scorecard). So either:
Option 1 is the lower-conflict path. Happy to land the renumber on this branch if you want — just say the word. For reference, the layer numbers I'm aware of as in-flight on top of
Suggesting Graph Insights → L107 unless you'd rather have it land first as 101. Generated by Claude Code |
Draft
15 tasks
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.
Summary
Cannibalized safishamsi/graphify's analytical layer on top of the existing Layer 20 code graph. Five additions, no new deps.
The-brain already had the retrieval side (Layers 20/24/28/33/34) — embeddings, BM25, RRF fusion, Louvain. What graphify uniquely offered was the analytical layer: provenance honesty, cross-community insight extraction, and graph-derived questions. That's what shipped.
What's new
codeParser.jstags every edge asEXTRACTED(1.0) /INFERRED(0.8) /AMBIGUOUS(0.5). Unresolved imports now surface asexternal:<module>nodes with AMBIGUOUS edges instead of being dropped.communities.jsaddsdetectCommunitiesLeiden. Runs Louvain, then splits any community whose induced subgraph is disconnected. Captures Leiden's main guarantee (Traag et al. 2019) at <100 LOC.utils/graphAnalytics.js:wikiGenerator.jsaddsgenerateGraphWikiBundle/downloadGraphWikiBundle:index.md+community-N.mdper community.components/GraphInsightsPanel.jsx. Paste code → choose Leiden/Louvain → see provenance breakdown, god-nodes, surprising connections, suggested questions, export wiki. "Apply to brain" maps insight density onto cognitive regions (PFC=questions, HPC=hubs, AMY=ambiguity).Files
src/utils/codeParser.jssrc/utils/communities.jsdetectCommunitiesLeidensrc/utils/graphAnalytics.jssrc/utils/wikiGenerator.jsgenerateGraphWikiBundlesrc/components/GraphInsightsPanel.jsxsrc/utils/layerCatalog.jssrc/styles/global.csssrc/App.jsxTest plan
npm run build— vite v5.4.21, 912 modules, cleanLeiden splitsmetric appears=== path ===delimiters) and confirm graceful single-file pathTrade-offs / notes
graphology-communities-leiden— captures the connectedness guarantee without a new dep.external:nodes can inflate node count on import-heavy code; god-node detection excludes them by default.🤖 Generated with Claude Code
Generated by Claude Code