Skip to content

feat: integrate coderlm adapter and graph-driven computeWaves into nf:solve#63

Merged
jobordu merged 147 commits intomainfrom
feature/issue-58-integrate-coderlm-adapter
Apr 10, 2026
Merged

feat: integrate coderlm adapter and graph-driven computeWaves into nf:solve#63
jobordu merged 147 commits intomainfrom
feature/issue-58-integrate-coderlm-adapter

Conversation

@jobordu
Copy link
Copy Markdown

@jobordu jobordu commented Apr 7, 2026

Summary

Closes #58 — coderlm adapter + graph-driven computeWaves + TLA+ formal model

Test plan

  • All tests pass locally (1377/1392, 15 pre-existing)
  • TLC model checker verified (0 errors)

🤖 Generated with Claude Code

jobordu and others added 30 commits April 8, 2026 19:51
…puteWaves integration

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… adapter integration

- Implement coderlm graph-driven wave computation path in nf-solve
- Collect active residual layers and build dependency graph
- Call computeWavesFromGraph when coderlm server is healthy
- Fall back to existing computeWaves when coderlm unavailable or graph empty
- Remove TODO comment and implement complete integration flow
- Preserve fail-open pattern with graceful fallback handling
Automated commit from /nf:solve — includes layer manifests, gate results,
evidence snapshots, model registry, and requirements coverage updates.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- GitHub Actions workflow for releasing coderlm binaries for 4 platforms
- Targets: darwin-arm64, darwin-x64, linux-x64, linux-arm64
- Uses appropriate runners and toolchains (cross-rs for arm64 Linux)
- Generates SHA256 checksums for all binaries
- Post-release verification step checks all 4 binaries and checksums present
- Artifacts use retention-days: 1 for temporary cleanup
- Handles idempotent release creation/upload
…documentation

- Created DEPLOY-INSTRUCTIONS.md with step-by-step guide to push workflow to coderlm repo
- Updated docs/coderlm-integration.md with Binary Distribution section
- Documented 4-platform binary assets, SHA256 checksums, and download instructions
- Preserved all existing documentation content
Summary: Cross-platform GitHub Actions workflow for automated coderlm binary
distribution with SHA256 checksum verification and post-release asset validation.

- 2 tasks completed (Task 1: workflow creation, Task 2: deployment docs)
- Commits: 351bb4ea (workflow), 0f515fa2 (docs)
- Formal coverage: No intersections detected
- Quorum improvements: SHA256 checksums, post-release verification, retention-days
- State.md updated with quick task 382 completion record
jobordu and others added 25 commits April 10, 2026 10:47
Both riverIndicator and coderlmPart were still being appended to the
main status line after buildToolsLine() was added to the second line,
causing River and coderlm to appear twice. Strip them from the main
line — the tools second line is now the single source for all three
tool indicators.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Pass _hookCwd as indexPath so coderlm indexes the user's project dir,
  not the lifecycle script's process.cwd()
- Add two tests: binary absent (skip silently) and binary present (exits
  0, stdout stays valid JSON)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- computePriority() now accepts calleeCount as 4th parameter (default 0)
- Uses Math.log1p for sublinear weighting (avoids explosion for high-caller files)
- buildUncoveredHotZones() initializes callee_count: 0 for all hot-zone entries
- sweepGitHeatmap() will enrich these values from coderlm queries

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- sweepGitHeatmap() now accepts optional adapter parameter
- Added module-level _activeAdapter for sweepGitHeatmap() access
- CREM-03 enrichment block queries getCallersSync per hot-zone file
- Re-computes priority using updated callee_count after enrichment
- Re-sorts hot-zones by updated priority when adapter is healthy
- Fail-open: returns original ranking if adapter unavailable/unhealthy
- All tests still passing (1417 tests, 0 failures)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- SUMMARY.md documents heatmap callee-count integration with Math.log1p weighting
- STATE.md updated: Phase 056-01 marked complete, decisions recorded
- ROADMAP.md: 056-01 checked as complete
- REQUIREMENTS.md: CREM-03 marked shipped, coverage updated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t and dead_code_flag

- Added CREM-04 enrichment block in sweepCtoR() after embedding fallback
- Enriches each untraced candidate with caller_count from coderlm.getCallersSync()
- Sets dead_code_flag=true when caller_count===0 (likely dead code)
- Uses fail-open pattern: health check before per-entry queries, graceful degradation when coderlm unavailable
- Stderr logging for enrichment completion and fallback behavior
… annotations

- Added CREM-04 enrichment block in sweepTtoR() to enrich orphan test candidates with caller counts
- Sets caller_count and dead_code_flag (true when caller_count===0) on each orphan test
- Updated solve report formatting for C->R candidates to show dead code annotation
- Updated solve report formatting for T->R candidates to show dead code annotation
- Report shows '(0 callers — likely dead code)' for zero-caller candidates or '(N callers)' for other counts
- Fail-open pattern: gracefully degrades when coderlm unavailable, stderr logging for enrichment status
- Added SUMMARY.md documenting plan 02 execution (caller-count enrichment for C->R and T->R)
- Updated STATE.md with plan completion, phase metrics, and decision entries
- Updated ROADMAP.md to mark phase 56 complete (2/2 plans finished)
- Updated REQUIREMENTS.md to mark CREM-04 as shipped
- All tasks executed atomically with proper enrichment and fail-open behavior
…G-02)

Inserts discoverViaCallGraph() between Layer 2 (proximity index) and Layer 3
(semantic fallback). Uses coderlm getCallersSync to find formal modules
affected by transitive caller relationships that file-name matching misses.
Fail-open: returns [] when coderlm unhealthy or any per-file error occurs.

- Layer 2.5 runs after enrichWithProximityIndex(), before semantic fallback
- New matches carry matched_by: 'call_graph' + discovered_via tracing
- discoverViaCallGraph() exported and tested with 8 test cases (23 pass, 0 fail)
- EventualConvergence preserved: only adds matches, never removes

Requirements: CDIAG-02
…expansion (CDIAG-03)

Adds expandWithCallGraph() post-processing step to computeAffectedLayers().
When coderlm is available, queries getCallers for each changed file and runs
callers through DOMAIN_MAP to catch layers that would otherwise be incorrectly
skipped. Prevents stale residuals from missed re-sweeps.

- computeAffectedLayers() gains optional second argument: adapter (null = same behavior)
- CLI entrypoint accepts --adapter-host flag and NF_CODERLM_HOST env var
- expandWithCallGraph() exported and tested with 8 test cases (19 pass total, 0 fail)
- Monotone safety guaranteed: affected set can only grow, never shrink
- EventualConvergence preserved per formal model invariants

Requirements: CDIAG-03
Documents Layer 2.5 call-graph backward walk (CDIAG-02) and
expandWithCallGraph() incremental filter enrichment (CDIAG-03).
Both plans complete with 1417 passing, 0 failing tests.
- CHANGELOG.md: add v0.42.0 entry (11 requirements: CADP-01/02/03/04, CREM-01/02/03/04, CDIAG-01/02/03)
- package.json / package-lock.json: bump to 0.42.0-rc.1
- docs/assets/terminal.svg: regenerated for v0.42.0-rc.1
- .planning: milestone artifacts, formal model updates, v0.42 audit
- test/golden: updated TUI snapshots for coderlm/River statusline changes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…CDIAG-03

Gap 1 (CDIAG-03): wire expandWithCallGraph into solve loop for incremental mode.
After autoClose + reindex, when --skip-layers is active, uses git diff to find
files written by remediation, calls computeAffectedLayers to discover call-graph
transitive dependencies, and un-skips any affected layers for the next iteration.

Gap 2 (pre-flight): healthSync() before first sweep emits 'healthy' or
'fail-open mode' to stderr so coderlm availability is known before queries start.

Gap 3 (circuit-breaker): _coderlmConsecutiveFailures counter in sweepGitHeatmap.
Breaks out of the hot-zone enrichment loop after 3 consecutive getCallersSync
failures, preventing 5 s timeout × N files overhead on an unavailable server.
Resets to 0 on each successful query.

Gap 4 (null-safety): sweepCtoR and sweepTtoR already guard via `if (_activeAdapter &&
...)` — confirmed present, no change needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tasks verified (code already committed, confirmed complete via git show):
- gsd-build#380 Trim packaged skills (807f0c5)
- gsd-build#381 Create checklist registry (0c51503)
- gsd-build#382 Set up coderlm cross-compilation CI (0f515fa2)
- gsd-build#383 Implement coderlm lazy lifecycle (67302123)
- gsd-build#384 Fix nf:mcp-repair direct calls (758b4b32)
- gsd-build#385 River ML statusline indicator (32ca7b5)
- gsd-build#393 Rewrite nf:mcp-status dynamic (3dcaabf)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… python env

TC15, TC16, TC19, TC21, TC22, TC23 wrote a River state file but didn't mock
~/.claude/nf-python-env/bin/python. The hook gates the River indicator behind
a `python -c 'import river'` check — in CI where nf-python-env doesn't exist,
riverImportable=false and the state file is never read, so output is '· River'
instead of '● River'.

Add makeRiverHome() helper (mirrors the correct pattern from TC18) and update
all 6 affected tests to create a fake executable python + pass HOME: tempHome.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jobordu and others added 3 commits April 10, 2026 19:58
Resolves conflicts:
- CHANGELOG.md: keep v0.42 entries + add v0.41.18 from main
- package.json / package-lock.json: keep 0.42.2-rc.1
- .planning/formal/*: keep our v0.42 milestone data
- commands/nf/mcp-restart.md: keep ours (dynamic slot names)
- docs/assets/terminal.svg: keep ours (v0.42.2-rc.1)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… ETIMEDOUT

bin/install.js now skips River ML and @huggingface/transformers network
installs when NF_INSTALL_SKIP_OPTIONAL=1. The install test sets this env
var to prevent the 30s execFileSync timeout firing while npm downloads a
large package. Also updates detect-secrets baseline for line number drift.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ONAL guard

ensureBinary() does a git clone with a 60s timeout; in CI the test's
30s execFileSync timeout fires before it completes. Gate the coderlm
download the same way as River/transformers installs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jobordu jobordu merged commit 45693b6 into main Apr 10, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate coderlm adapter and graph-driven computeWaves into nf:solve

1 participant