266 Commits

Author SHA1 Message Date
nvaldez 4697c5323f Merge branch 'feat/generalize-linter-format' into main
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 20:01:06 +02:00
nvaldez 7639abeaa6 feat: generalize linter violation format (SPEC 4.3.1, 4.9.3)
- Migrate PythonCustomLinter to use compressed violation format
- Update SPEC 4.1 and 4.5 to document shared linter format
- Update tests for new format

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 20:00:25 +02:00
nvaldez 1f70f184af fix: resolve sanity check failures
- Fix markdownlint violations in SPEC.md (MD031, MD040)
- Fix Ruff RUF012 violations in mdoctor.py and python_ruff.py with ClassVar annotations
- Update BaseLinter to handle None target in compress_violations
- Update python_ruff tests to match new BaseLinter format
- Add lint_file test to improve python_ruff coverage to 89%
- Overall coverage improved from 95% to 96%

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 19:42:21 +02:00
nvaldez 682aee0500 update the spec 2026-09-28 19:02:26 +02:00
nvaldez 0280cdf18f spec for html and js linter 2026-09-28 18:58:23 +02:00
nvaldez b80b8087ec docs: update todo.md to mark git version control as complete
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 17:51:00 +02:00
nvaldez 22835f9efc feat: implement git version control for llm-wiki (SPEC 3.2)
- Add GitPython dependency to pyproject.toml
- Create gittool/ module with GitTool wrapper class
- Implement all git operations: save, snapshot, restore, clean, undo, status
- Integrate git commands into fiona-assistant CLI as 'fiona-assistant git <command>'
- Auto-initialize git repo on wiki init with .gitignore excluding personal/
- snapshot creates tag with timestamp prefix (yyyy-mm-dd_HH-MM-SS_<tag_name>)
- restore creates new commit (does not modify history)
- Update SPEC.md to reflect implementation
- Add comprehensive tests for gittool module
- All sanity checks pass

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 17:50:29 +02:00
nvaldez fa1842cd63 fix: frontmatter card only appears on click and stays with highlight
- Frontmatter card now appears ONLY on click (not on hover)
- Frontmatter card stays visible together with the blue highlight
- Kept node-info tooltip on hover (follows mouse)
- Only one frontmatter card in upper left of SVG
- Clicking another node switches both highlight and card
- Clicking empty space removes both

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 16:50:59 +02:00
nvaldez 5ea410b80c fix: make blue highlight persistent on click and show frontmatter card on hover
- Blue highlight now stays when clicking a node (doesn't disappear on mouseout)
- Frontmatter card appears on hover in upper left of SVG (not on click)
- Frontmatter card hides on mouseout
- Click highlight is independent from hover highlight
- Persistent highlight remains until another node is clicked or empty space is clicked

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 16:47:16 +02:00
nvaldez a43f7f044e feat: add node click to highlight with frontmatter card display
- Single click on node: highlights node in light blue with 1.3x size, shows frontmatter card in upper left
- Clicking another node switches the highlight
- Clicking on empty space removes highlight
- Double click on node opens file in default editor using file:// URL
- Added frontmatter-card CSS styling
- Added SPEC items 3.1.4.3.8-3.1.4.3.11 for new click behavior
- Fixed SPEC numbering for subsequent items

Note: wiki_graph.html has duplicate nodes from scanning both src/llm-wiki and build/lib/llm-wiki

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 16:43:12 +02:00
nvaldez aa85703d69 fix: change highlight color to light blue and add node hover effects
- Changed search highlight color from yellow to light blue (#add8e6)
- On node hover: node becomes light blue with 1.3x larger size
- On node hover: connected edges change to blue (if they were gray)
- Restores original colors/sizes when mouse leaves or search is cleared
- Updated SPEC.md to document the light blue color

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 16:36:56 +02:00
nvaldez 202c2dd63c fix: simplify graph controls and improve search highlighting
- Make matching nodes 1.5x bigger in search results
- All neighbor nodes shown in gray (any degree)
- Removed layout dropdown (not functional)
- Removed reanimate button (not working)
- Updated SPEC.md to reflect current features

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 16:30:19 +02:00
nvaldez 781ac7ca8f fix: update search to highlight matching nodes in yellow and neighbors in gray
- Search now highlights matching nodes in yellow (#ffff00)
- All neighbor nodes (any degree) are shown in gray (#808080)
- Fixed reanimate button to use correct node object references
- Restores original colors when search is cleared
- All reachable nodes from search remain at full opacity

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 16:26:54 +02:00
nvaldez 6dcae18033 feat: improve wiki graph controls and search functionality
- Implemented search/filter with degree-based visibility:
  - Matching nodes and direct neighbors at full opacity (1.0)
  - 2nd degree neighbors at 50% opacity (0.5)
  - 3rd degree neighbors at 30% opacity (0.3)
  - Other nodes hidden
- Changed orphan nodes from checkbox to toggle button
- Added reanimate button to restart graph animation
- Added layout selector (force-directed, hierarchical)
- Removed export as PNG button
- Updated SPEC.md with new features

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 16:22:56 +02:00
nvaldez d91b2a6144 fix: update edge highlight to only use opacity (no stroke width change)
- Modified edge highlighting to only decrease visibility of other edges
- Removed stroke-width changes, keeping only opacity modification
- Updated test to check for dimmed opacity (0.2) instead of stroke width

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 16:12:33 +02:00
nvaldez 2772886de3 feat: add edge highlighting on node hover for wiki graph
- Added SPEC 3.1.4.3.7: On node hover, highlight all edges connected to that node
- Implemented edge highlighting in graph_template.html with thicker stroke and full opacity
- Added test for edge highlight on hover feature
- Renumbered subsequent SPEC items to maintain consistency

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 16:02:56 +02:00
nvaldez 841293c95a docs: update SPEC.md with Phase 4 Polish features
- Update Phase 4 description: BFS layout + animated appearance + 360deg separation + clustering
- Add 3.1.4.11 Polish Features subsection with detailed acceptance criteria:
  - BFS tree layout
  - Animated node appearance in BFS order
  - 360 degree circular edge separation
  - Physics-based clustering with configurable parameters
  - Continuous correction for perfect positioning
  - Parent-child following when dragged
  - Editable physics constants

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 15:51:47 +02:00
nvaldez 93ddf5b5cc fix: make children follow parent when dragged with proper 360deg layout
- Increase LINK_STRENGTH from 0.001 to 0.2 (children now follow parent)
- Reduce NEIGHBOR_REPEL_STRENGTH from 1.0 to 0.2 (works with link force)
- Reduce CIRCULAR_FORCE_MULTIPLIER from 1.0 to 0.5
- Increase CHARGE_STRENGTH from -5 to -20 (prevents overlap)
- Decrease CHARGE_DISTANCE_MIN from 150 to 80
- Decrease CHARGE_DISTANCE_MAX from 400 to 200
- Increase ALPHA_DECAY from 0.01 to 0.02 (faster response)
- Decrease ALPHA_MIN from 0.001 to 0.0005 (continuous correction)
- Decrease VELOCITY_DECAY from 0.6 to 0.4 (responsive motion)

How it works: Link force (0.2) pulls children toward parent at 60px.
Circular force (0.2 * 0.5 = 0.1) positions children at correct angles.
Together they maintain: distance = 60px, angle = 360/N.
When parent moves, link force pulls children along.
Grandchildren follow through their link to their parent.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 15:48:02 +02:00
nvaldez 1dd9befa40 fix: make circular force very strong for continuous 360deg division with close children
- Reduce LINK_STRENGTH from 0.01 to 0.001 (circular force dominates completely)
- Reduce BASE_LINK_DISTANCE from 100 to 60 (children very close to parent)
- Reduce CHARGE_STRENGTH from -10 to -5 (minimal repulsion, only prevents overlap)
- Increase NEIGHBOR_REPEL_STRENGTH from 0.5 to 1.0 (very strong continuous 360deg enforcement)
- Increase CHARGE_DISTANCE_MIN from 100 to 150
- Increase CHARGE_DISTANCE_MAX from 300 to 400
- Rename CIRCULAR EDGE SEPARATION to CIRCULAR LAYOUT FORCE in comments

Key fix: Circular force now runs every tick with very high strength,
continuously correcting any deviation to maintain perfect 360deg division.
Children are rendered very close to their parent (60px vs 100px).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 15:44:01 +02:00
nvaldez 07a3ec9ebc fix: use BFS tree hierarchy for circular layout instead of adjacency
- Rename forceCircularEdgeSeparation to forceCircularLayout
- Use childrenMap from BFS tree instead of adjacency list
- Position children in perfect circles around their parent only
- Reduce VELOCITY_DECAY from 0.9 to 0.6 for fluid motion
- Reduce ALPHA_DECAY from 0.02 to 0.01 for smoother settling
- Increase ALPHA_MIN from 0.0001 to 0.001

Key fix: Circular force now only applies to parent-child relationships
from the BFS tree, ensuring children are positioned in perfect 360deg
circles around their parent, not all neighbors.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 15:41:05 +02:00
nvaldez 24b510310f fix: make circular force dominant for perfect 360deg node positioning
- Reduce LINK_STRENGTH from 0.15 to 0.01 (circular force now handles positioning)
- Increase BASE_LINK_DISTANCE from 50 to 100 (fixed distance for all links)
- Set LINK_DISTANCE_PER_DEGREE to 0 (no degree-based scaling)
- Reduce CHARGE_STRENGTH from -30 to -10 (very weak, just prevents overlap)
- Increase CHARGE_DISTANCE_MIN from 50 to 100
- Reduce CENTER_STRENGTH from 0.02 to 0.001 (minimal center pull)
- Reduce COLLIDE_STRENGTH from 0.9 to 0.5
- Reduce BASE_COLLIDE_RADIUS from 20 to 15
- Increase VELOCITY_DECAY from 0.7 to 0.9 (immediate stabilization)
- Increase ALPHA_DECAY from 0.01 to 0.02
- Increase NEIGHBOR_REPEL_STRENGTH from 0.1 to 0.5 (STRONG for perfect circles)
- Change targetRadius to use BASE_LINK_DISTANCE directly (fixed radius)

Key insight: Circular force is now the PRIMARY positioning force, while link force
just maintains connections without affecting positions. This ensures nodes
arrange in perfect 360deg circles around their parent like the left cluster.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 15:33:12 +02:00
nvaldez 62d8b88210 fix: balance physics parameters for fluid animation and stable 360deg separation
- Reduce LINK_STRENGTH from 0.2 to 0.15 for balanced pull
- Increase BASE_LINK_DISTANCE from 40 to 50 for better spacing
- Reduce CHARGE_STRENGTH from -60 to -30 to prevent over-repulsion
- Increase CENTER_STRENGTH from 0.01 to 0.02 for gentle centering
- Reduce VELOCITY_DECAY from 0.4 to 0.7 for smoother, more damped motion
- Increase ALPHA_DECAY from 0.008 to 0.01 for faster settling
- Reduce CIRCULAR_FORCE_MULTIPLIER from 2.5 to 0.5 for stable circular force
- Fix circular force comment to clarify it's a spring-like force

These changes ensure:
- Fluid, stable animation without jitter
- Proper 360 degree edge separation
- Tight parent-child clusters
- Stray nodes pushed away from clusters

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 15:30:50 +02:00
nvaldez 9f3a1de6f2 feat: adjust physics parameters for tight clusters and 360deg separation
- Increase LINK_STRENGTH from 0.05 to 0.2 for tighter parent-child clusters
- Decrease BASE_LINK_DISTANCE from 80 to 40 for closer connected nodes
- Decrease CHARGE_STRENGTH from -40 to -60 for stronger stray node repulsion
- Decrease CENTER_STRENGTH from 0.05 to 0.01 for minimal center pull
- Increase CIRCULAR_FORCE_MULTIPLIER from 2.0 to 2.5 for stronger 360deg division

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 15:29:24 +02:00
nvaldez d8f109f150 feat: significantly strengthen 360 degree circular edge separation
- Increased NEIGHBOR_REPEL_STRENGTH from 0.03 to 0.08
- Increased CIRCULAR_LAYOUT_STRENGTH from 0.1 to 0.5
- Increased CIRCULAR_RADIUS_MULTIPLIER from 2.5 to 3.0
- Added CIRCULAR_FORCE_MULTIPLIER = 2.0 to amplify force
- Removed distance damping (* 0.1) in circular force calculation
- Force now: NEIGHBOR_REPEL_STRENGTH * alpha * distance * CIRCULAR_FORCE_MULTIPLIER
- This ensures nodes always divide evenly in 360 degree circles

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 15:26:59 +02:00
nvaldez 2b65128004 fix: graph template physics and code quality
- Adjusted graph physics parameters for better edge separation
  - Increased CHARGE_STRENGTH to -40 for stronger node repulsion
  - Increased BASE_LINK_DISTANCE to 50 and LINK_STRENGTH to 0.1
  - Increased collision radii (BASE_COLLIDE_RADIUS=12, EDGE_PADDING_MULTIPLIER=2.5)
- Removed expensive custom forces (node-edge repulsion, edge-edge collision)
  that were causing browser performance issues
- Fixed SPEC.md line length violation (MD013)
- Fixed inline import in graph_generator.py (PYC001)
- Edge stroke width reduced from 2 to 1

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 14:30:30 +02:00
nvaldez f427dc5819 refactor: wiki graph - extract all physics parameters to editable constants
Added configuration section at top of JavaScript with:

PHYSICS PARAMETERS:
- LINK_STRENGTH: 0.2 (connection pull strength)
- BASE_LINK_DISTANCE: 25 (base spacing)
- LINK_DISTANCE_PER_DEGREE: 1 (extra spacing per degree)
- CHARGE_STRENGTH: -30 (repulsion)
- CHARGE_DISTANCE_MIN/MAX: 15/150 (repulsion range)
- CENTER_STRENGTH: 0.15 (center pull - increase for tighter center)
- COLLIDE_STRENGTH: 0.5 (bounciness)
- BASE_COLLIDE_RADIUS: 8 (base node size)
- COLLIDE_PER_DEGREE: 2 (extra size per degree)
- EDGE_PADDING_MULTIPLIER: 1.5 (simulates edge repulsion)

TIMING PARAMETERS:
- ALPHA_DECAY: 0 (never settles)
- ALPHA_MIN: 0.5 (safety)
- VELOCITY_DECAY: 0.6 (fluidity)

User can now easily adjust CENTER_STRENGTH for stronger central pull.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 13:31:53 +02:00
nvaldez 0ba3cd6561 fix: wiki graph - never-stopping animation with alphaDecay=0
- alphaDecay: 0 (NEVER decays) - simulation stays at alpha=1.0 forever
- alphaMin: 0.5 (safety net)
- Forces remain at full strength indefinitely
- velocityDecay: 0.6 (fluid motion)
- Result: nodes never stop moving, continuously rearrange like Obsidian

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 13:27:35 +02:00
nvaldez f6806769a1 fix: wiki graph - faster initial animation + never-ending continuous motion
- alphaDecay: 0.05 (faster initial convergence)
- alphaMin: 0.2 (never settles, always moving)
- velocityDecay: 0.6 (more fluid motion)
- Result: animation reaches good separation quickly, then keeps moving fluidly

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 13:24:12 +02:00
nvaldez 34e9b8cbf8 fix: wiki graph - continuous motion + stronger center gravity for tighter clusters
- Link distance: 25 + (sourceDegree + targetDegree) (tighter)
- Charge: -30 (weaker repulsion)
- Center: 0.15 (stronger pull)
- Collide edgePadding: (in_degree + out_degree) * 1.5
- alphaMin: 0.1 (high - keeps continuous motion like picture 2)
- alphaDecay: 0.01 (slow decay)
- velocityDecay: 0.7
- Result: nodes continuously move and form tight hub-and-spoke clusters

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 13:17:11 +02:00
nvaldez 033cf8b7e3 feat: wiki graph - simulate edge repulsion via collision radius
- Link distance now dynamic: 30 + (sourceDegree + targetDegree)
- Collision radius now includes edge padding: nodeRadius + (in_degree + out_degree) * 2
- This simulates edges repelling other nodes by making high-degree nodes have larger
  effective collision radius
- Charge: -40 (moderate repulsion)
- Center: 0.08
- Collide strength: 0.6, iterations: 2
- Result: edges effectively repel other nodes and each other via proxy

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 13:10:55 +02:00
nvaldez 82105c88ff fix: wiki graph - more compact layout like first picture
- Link distance: 40 (down from 80) - tighter clusters
- Charge: -20 (down from -60) - weaker repulsion, nodes stay closer
- distanceMin: 20, distanceMax: 150 (reduced range)
- Center: 0.05 (gentler)
- Collide radius: max(8, in_degree * 2 + 3) (slightly smaller)
- velocityDecay: 0.85 (more stable)
- alphaMin: 0.005 (less continuous motion)
- Result: compact hub-and-spoke clusters, less spaced out

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 13:09:11 +02:00
nvaldez ee9f4c2f09 fix: wiki graph - balanced physics for Obsidian-style layout
Based on D3.js best practices research:
- Link distance: 80px (fixed for consistency)
- Link strength: 0.1 (moderate pull between connected nodes)
- Charge (repulsion): -60 (moderate, prevents edge pushing to boundary)
- distanceMin: 30, distanceMax: 200 (Barnes-Hut approximation range)
- theta: 0.9 (better performance for many nodes)
- Center: 0.1 (gentle, lets links define structure)
- Collide: radius based on node size, strength 0.5
- alphaDecay: 0.02, alphaMin: 0.01, velocityDecay: 0.8

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 13:06:31 +02:00
nvaldez 2c9cfa781f fix: wiki graph - remove invalid numIterations call + update test
- Removed .numIterations(300) which is not a valid method in D3 v7
- D3 v7 uses .iterations() on individual forces instead
- Already have iterations(2) on link and collide forces
- Updated test to not require numIterations
- All tests pass (793/793)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 13:03:22 +02:00
nvaldez ca9245bc73 fix: wiki graph - fix numIterations method call + add unit test
- Fixed: numIterations() is a method on d3.forceSimulation, not on forces
- Moved .numIterations(300) to simulation creation chain (first method)
- Added test_generate_html_has_valid_javascript to catch JS syntax errors
- Test verifies valid D3 force simulation method chains in generated HTML
- Prevents errors like 'is not a function' from incorrect method chaining

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 13:02:00 +02:00
nvaldez 810f44c0c8 fix: wiki graph - reduce edge crossings with variable link distances
- Link distance now based on node degree: 60 + (sourceDegree + targetDegree) * 2
- This spreads out hub nodes (high degree) to reduce edge crossings
- Increased link strength from 0.1 to 0.3 for better untangling
- Added link.iterations(2) for faster convergence
- Added theta(0.8) to forceManyBody for performance
- Increased numIterations from default to 300 for better convergence
- Collision radius increased to max(12, in_degree * 3 + 5)
- Result: fewer edge crossings, better spacing between hub nodes

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 13:00:13 +02:00
nvaldez 9e0240ee9e fix: wiki graph - Obsidian-style force layout with link/collision forces
- Use standard D3 forceLink with distance=80, strength=0.1
- Use forceManyBody with strength=-150 for repulsion
- Added distanceMin=60 and distanceMax=300 for repulsion range
- Added forceCollide with radius based on node size for hard overlap prevention
- Very gentle center force (0.05) to keep graph centered
- High velocityDecay (0.8) for stable layout
- Removed custom gravity/repulsion forces, using D3 built-ins

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:56:58 +02:00
nvaldez c0c0cc430f fix: wiki graph - global distance-dependent repulsion between all nodes
- Replaced molecular (closest-only) with global repulsion between ALL node pairs
- Distance-dependent strength:
  - dist < 20px: repulsion = 200/dist^2 (very strong, prevents overlap)
  - 20 < dist < 80px: repulsion = 50/dist (moderate spacing)
  - dist > 80px: repulsion = 5/dist (weak, prevents collapse)
- Central gravity still mass-based (0.02 * mass)
- Result: continuous repulsion at all distances, no overlap, fluid clustering

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:54:49 +02:00
nvaldez e2fb465540 feat: wiki graph - molecular dynamics force (attract far, repel close)
- Added forceMolecular: nodes find closest neighbor
- Equilibrium distance: 50px between nodes
- When dist < 50: strong repulsion (100 / dist^2) to prevent overlap
- When dist > 50: gentle attraction (0.5 * delta) for clustering
- Keeps central gravity for overall centering
- Result: nodes cluster together but maintain spacing, fluid movement

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:53:17 +02:00
nvaldez 1e100cc3d8 fix: wiki graph - constant repulsion, mass-based central gravity only
- Changed repulsion to constant strength: forceManyBody().strength(-3)
- All nodes repel equally regardless of mass
- Heavier nodes resist being pushed via stronger central gravity (0.02 * mass)
- Result: when dragging big node, others don't fly away
- When dragging small node, it moves easily, big nodes stay put via gravity

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:52:32 +02:00
nvaldez a0ca85eaaa docs: SPEC - document mass-based physics rules for wiki graph gravity
- Document node mass formula: mass = 1 + in_degree * 0.5
- Document central gravity: 0.02 * mass * alpha
- Document repulsion: forceManyBody().strength(d => -20 * d.mass)
- Document continuous motion parameters: alphaMin 0.1, velocityDecay 0.6
- Document behavior: all nodes pulled to center, continuous repulsion, bigger nodes give way

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:50:23 +02:00
nvaldez cd681a81a2 fix: wiki graph - mass-based physics with continuous fluid movement
- Added mass property to nodes: mass = 1 + in_degree * 0.5
- Central gravity now proportional to mass (0.02 * mass * alpha)
- Repulsion uses D3's forceManyBody with strength = -20 * mass
  (heavier nodes repel more strongly)
- Center force reduced to 0.1
- alphaMin(0.1) keeps continuous motion
- velocityDecay(0.6) maintains fluid movement
- Result: bigger/heavier nodes tend toward center, smaller nodes give way

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:46:35 +02:00
nvaldez 4cfe81d8f0 fix: wiki graph - continuous fluid movement with balanced forces
- Increased repulsion constant from 200 to 800 for stronger separation
- Removed distance < 100 limit: repulsion active at all distances
- Reduced base central gravity from 0.08 to 0.04
- Reduced degreeBonus from 0.015 to 0.01
- Reduced center force from 0.3 to 0.2
- Added alphaMin(0.05) to keep continuous motion
- Slower alphaDecay(0.01) for smoother movement
- Result: nodes continuously repel, cluster near center, fluid movement

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:43:33 +02:00
nvaldez f3c1965113 fix: wiki graph - balance central gravity and repulsion forces
- Reduced central base strength from 0.15 to 0.08
- Reduced degreeBonus from 0.03 to 0.015 for more subtle central clustering
- Changed repulsion to constant strength (200) regardless of node mass
- Repulsion only active when distance < 100 to prevent excessive spreading
- Reduced center force from 0.5 to 0.3
- Increased alphaDecay from 0.01 to 0.02 for faster stabilization
- Result: nodes cluster near center with enough repulsion to avoid overlap

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:41:52 +02:00
nvaldez 231a7f1883 refactor: wiki graph - extract HTML template to separate file
- Created src/wiki/templates/graph_template.html with clean HTML/JS
- Refactored _generate_html_template() to load template and substitute values
- Eliminates Python f-string escaping issues with JavaScript code
- More maintainable: template can be edited independently
- All dynamic values (node_count, edge_count, max_in_degree, node_data_json,
  edge_data_json) are substituted at runtime

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:40:39 +02:00
nvaldez c0d0e97521 fix: wiki graph - implement invisible central gravity with node mass repulsion
- Custom forceCentralGravity: strong pull toward center for all nodes
- Additional pull for high in-degree nodes (degreeBonus = in_degree * 0.03)
- Custom forceNodeRepulsion: nodes repel based on their in-degree (mass)
- Repulsion strength = 500 / distance^2 * (d.in_degree + 1) * (other.in_degree + 1)
- Center force strength increased to 0.5
- Link distance reduced to 100 / sqrt(weight + 1)
- Slower alpha decay (0.01) for more stable simulation
- Result: high in-degree nodes (like SPEC.md) stay near center, others orbit around

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:39:01 +02:00
nvaldez c55705cd89 feat: wiki graph - implement solar system physics for node gravity
- Custom forceToCenter function pulls nodes toward center
- Gravity strength proportional to in_degree: higher in-degree = stronger center pull
- Reduced charge repulsion from -500 to -100 for less edge-pushing
- Increased center force strength from 0.1 to 0.2
- Result: high connectivity nodes tend to cluster in center, low connectivity at edges

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:33:52 +02:00
nvaldez f7a1449c9a feat: wiki graph Phase 3 - implement color spectrum, edge coloring, gravity force
- Node colors: spectrum from gray (no links) to green to yellow to red (high connectivity)
- Edge colors: spectrum from gray (single link) to yellow to red (many links)
- Edge width: constant 2px instead of weight-based thickness
- Gravity force: stronger center pull (strength 0.1), stronger repulsion (-500)
- Link distance: inversely proportional to weight (stronger links = shorter distance)
- Click handler: logs file path to console (file:// URLs blocked by browsers)
- Updated SPEC.md Phase 3 status and feature markers

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:30:01 +02:00
nvaldez 22d2110006 feat: SPEC - add spectrum color requirements for nodes and edges, gravity force
- Node colors: spectrum from gray (no links) to green to yellow to red (high connectivity)
- Edge colors: spectrum from gray (single link) to yellow to red (many links)
- Gravity force: nodes pulled toward center while repelling each other
- Stronger links create stronger ties between nodes

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:26:49 +02:00
nvaldez 62710a45da fix: wiki graph visualization - fix D3.js node reference and maxInDegree initialization
- Remove .id(d => d.id) from forceLink to use index-based node lookup
- Move maxInDegree declaration before its usage in color function
- Change width from clientWidth to fixed 1200px to avoid rendering issues
- Update SPEC.md with NOT_IMPLEMENTED markers for external links features

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:20:36 +02:00
nvaldez 7534bd8331 fix: wrap D3.js code in DOMContentLoaded event listener
- JavaScript code now waits for DOM to be fully loaded before executing
- This ensures the graph-container div has proper dimensions when D3.js runs
- Fixes issue where nodes/circles were not visible in the HTML output

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-09-28 12:12:56 +02:00