Skip to content

Make Nod graph-aware: MCP server, plan to composite, forks, graph verbs, chat pane components - #588

Merged
scgopi merged 8 commits into
mainfrom
feat/nod-graph-layer
Oct 2, 2026
Merged

scgopi merged 8 commits into
mainfrom
feat/nod-graph-layer

Conversation

@scgopi

@scgopi scgopi commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Makes GraphCode Nod graph-aware: the built-in graphcode MCP server, the Swift graph logic behind plan → Composite, forks, /handoff /ask /promote and inbound mail, and the chat pane's graph components. Stacked on #583 (feat/nod-foundation); retarget to main once that merges.

Changes

  • MCP server (NodRuntime/src/mcp/, zero dependencies): siblings, edges, handoff_briefs, mailroom, mailroom_read (read-only, the cursor never moves), plus ask and handoff, gated per call by NodSettings.messagesOtherLoops. Draft for me emits mailDraft and sends nothing, Send sends messageNode as this loop, Never refuses. Reads and writes go through graphcoded's socket, the same RPC the CLI speaks, never the graph file. Also exports sendDraft (for the control socket's sendDraft) and classifyInbound.
  • Contract (NodProtocol.swift + PROTOCOL.md together, announced on the mailroom #1202): NodPlanStep.doneCheck (absent = false), NodBrief (--inherit <path>, fresh starts only), MCP section.
  • LoopLineage on LoopNode/NodeDraft (fork | compositeChild, source, brief path). It isn't an EdgeKind, so older apps still decode the graph (unknown kinds decode to nil). It survives reIdentified().
  • Plan → Composite (NodCompositePlan): steps are grouped by the area their files touch (first non-generic directory, FooTests folded onto Foo). Steps that share an area merge, and steps with no files follow the step before them. The done-check step becomes the composite's check, and each group becomes a Nod goal child briefed from the planning transcript.
  • Fork as sibling (NodFork): same type and goal, and its own worktree on <branch>-forkN, cut from the source's branch. The brief carries the fork point. The canvas draws a dotted "forked from" line (ForkLineView).
  • Graph verbs and inbound: NodGraphVerb, NodInboundMail and NodHandoffOffer are in IPC/NodGraphVerbs.swift, because they build GraphCommands and the portable Domain/ has no IPC. NodGraphContext and NodEditablePlan are in Domain/.
  • SwiftUI (Features/Nod/GraphLayer/): NodContextStrip (renders nothing with no neighbours), NodInlineMailCard (Send reply / Edit / Answer myself), NodHandoffOfferView, NodPlanCard (drag to reorder, a rewrite marks the step editedByHuman, a done-check toggle, Run here / Run as Composite · N loops), and NodGraphActions, which writes briefs, creates the worktree and sends commands, gated on FeatureRamps.nod.

Follow-ups owned elsewhere and agreed over the mailroom:

  • NodChatPane installs these through NodGraphSlots in whichever PR merges second.
  • NodLaunch passes inheritFile: node.lineage?.briefPath from arguments(forNode:) only.
  • NodRuntime mounts createGraphcodeTools in src/engine.ts.

Test plan

Gate on ecc5ce5 (= remote head), private DerivedData:

Step Result
xcodebuild test exit 0, 2043 tests / 225 suites, 0 failures (new: 9 suites, 36 tests)
graphcode-cli build exit 0
graphcoded build exit 0
CLI smoke exit 0
swiftlint 0 errors
swift-format clean
bun tests 20 pass
tsc clean
portable package (swift test --package-path investigation/spikes/swift-portable) exit 0

RED: xcodebuild test -only-testing:graphcodeTests/NodCompositeGroupingTests with the foundation's Domain sources and no GraphLayer folder -> exit 65, cannot find 'NodGraphActions' in scope, cannot find 'NodFork' in scope
GREEN: xcodebuild test -scheme graphcode (NodCompositeGroupingTests, NodForkTests, NodGraphVerbTests, NodInboundMailTests, NodGraphActionsTests and 4 more) -> pass
REGRESSION: xcodebuild test -scheme graphcode full suite, 2043 tests, plus bun test src/mcp 20 tests and tsc --noEmit -> pass

TypeScript RED: bun test src/mcp against the foundation's NodRuntime fails with Cannot find module './daemon'.

Checklist

  • I have read the Contributing Guidelines
  • I have signed off my commits (git commit -s) per the DCO
  • Tests pass locally
  • Code follows the existing style (make check)
  • I added the test/contract before the implementation (RED was observed afterwards by running the tests against the foundation sources)

scgopi and others added 6 commits October 1, 2026 21:31
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scgopi <scgopireddy@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scgopi <scgopireddy@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scgopi <scgopireddy@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scgopi <scgopireddy@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scgopi <scgopireddy@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scgopi <scgopireddy@gmail.com>
@scgopi
scgopi changed the base branch from feat/nod-foundation to main October 2, 2026 14:50
Signed-off-by: scgopi <scgopireddy@gmail.com>
@scgopi
scgopi force-pushed the feat/nod-graph-layer branch from fc3c952 to 6894ed5 Compare October 2, 2026 15:11
Signed-off-by: scgopi <scgopireddy@gmail.com>

# Conflicts:
#	NodRuntime/PROTOCOL.md
@scgopi
scgopi merged commit 9ff1442 into main Oct 2, 2026
22 of 23 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.

1 participant