Skip to content

FE-785: M5 agent-graph-integration#163

Merged
lunelson merged 34 commits into
nextfrom
ln/fe-785-agent-graph-integration
Jun 3, 2026
Merged

FE-785: M5 agent-graph-integration#163
lunelson merged 34 commits into
nextfrom
ln/fe-785-agent-graph-integration

Conversation

@lunelson
Copy link
Copy Markdown
Contributor

@lunelson lunelson commented Jun 1, 2026

plan: add branch for M5 agent-graph-integration (FE-785)

Amp-Thread-ID: https://ampcode.com/threads/T-019e83f6-44c9-741a-a90a-9e9535774b3d
Co-authored-by: Amp amp@ampcode.com

move src/tui-client/.pi → src/.pi per D52-L source topology

Relocate Pi extension shell and all product extensions, components,
context builders, and tests from src/tui-client/ to src/.pi/ to
match the D52-L source topology: src/{.pi, agents, db, graph, session, rpc, web}.

Update all import paths, projectRoot() helpers, relative URL depths,
and the build:pi-assets script in package.json.

Amp-Thread-ID: https://ampcode.com/threads/T-019e840d-172b-736c-839e-e441f7308220
Co-authored-by: Amp amp@ampcode.com

wire commit_graph and read_graph Pi tools through CommandExecutor

M5 slice 1: A14-L proof-of-life — the agent can now call commit_graph
to atomically create nodes+edges and read_graph to inspect graph state.

  • command-adapter.ts: Pi tool params → CommandExecutor input translation
    and CommandResult → tool result text formatting
  • graph/index.ts registrar: registerBrunchGraph with TypeBox v1.x
    parameter schemas using StringEnum for enums
  • Pre-bound GraphSnapshotReaders so extensions never import db/ (I26-L)
  • Re-export enum const arrays from graph/index.ts for I26-L compliance
  • Extension shell wires graph tools when options.graph is provided
  • 9 integration tests: translate, format, end-to-end commit+read,
    I34-L all-or-nothing rollback, not-found handling

Amp-Thread-ID: https://ampcode.com/threads/T-019e840d-172b-736c-839e-e441f7308220
Co-authored-by: Amp amp@ampcode.com

reconcile SPEC.md and PLAN.md: path refs → src/.pi/, M5 in-progress

Update all src/tui-client/.pi/ path references to src/.pi/ in both
canonical planning docs. Mark agent-graph-integration as in-progress
with execution pointer noting the topology move and graph tool wiring.

Amp-Thread-ID: https://ampcode.com/threads/T-019e840d-172b-736c-839e-e441f7308220
Co-authored-by: Amp amp@ampcode.com

@lunelson lunelson changed the title plan: add branch for M5 agent-graph-integration (FE-785) FE-785: M5 agent-graph-integration Jun 2, 2026
@lunelson lunelson self-assigned this Jun 2, 2026
@lunelson lunelson requested a review from kostandinang June 2, 2026 13:35
@graphite-app graphite-app Bot changed the base branch from ln/fe-776-graph-layer-prep-profile to graphite-base/163 June 2, 2026 18:29
@lunelson lunelson marked this pull request as ready for review June 2, 2026 18:31
Copilot AI review requested due to automatic review settings June 2, 2026 18:31
@cursor
Copy link
Copy Markdown

cursor Bot commented Jun 2, 2026

PR Summary

Medium Risk
Touches the sole graph mutation surface (CommandExecutor) and agent tool wiring—bugs could corrupt graph state or bypass invariants—but the change is bounded by tests, atomic batch semantics, and explicit dependency injection.

Overview
M5 agent-graph-integration (FE-785) adds the first end-to-end agent path for durable graph truth: Pi tools commit_graph and read_graph register via registerBrunchGraph, translate tool params in command-adapter, and call CommandExecutor plus injected snapshot readers so src/.pi never imports db/ (I26-L). The extension shell optionally wires graph deps when options.graph-mentionSource is set; integration tests cover atomic rollback (I34-L) and formatting.

Source topology aligns with D52-L by moving the Pi product tree from src/tui-client/.pi to src/.pi (web entry now src/web/main.tsx). memory/SPEC.md / memory/PLAN.md are updated for the new paths and mark agent-graph-integration complete; superseded pre-POC memory/* copies land under archive/memory/.

Evidence & persistence: a checked-in .fixtures/runs/propose-graph-commit/ run documents successful A14-L structural legality (overview → single commit_graph batch). The diff also introduces drizzle.config.ts and initial migration 0000_jazzy_warbound for the graph/spec SQLite schema.

Housekeeping: AGENTS.md clarifies fix / check / verify ordering; oxfmt/oxlint ignore patterns expand; duplicate agentation MCP entries are removed from editor-specific configs while .mcp.json stays; doc links point archived architecture artifacts.

Reviewed by Cursor Bugbot for commit b1fed92. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 76ea7a8. Configure here.

> This note captures a design conclusion that emerged while pressure-testing the current `ln-*` workflow against the product direction in [`docs/architecture/prd.md`](file:///Users/lunelson/Code/hashintel/brunch-next/docs/architecture/prd.md), [`docs/architecture/pi-seam-extensions.md`](file:///Users/lunelson/Code/hashintel/brunch-next/docs/architecture/pi-seam-extensions.md), and [`memory/SPEC.md`](file:///Users/lunelson/Code/hashintel/brunch-next/memory/SPEC.md): a **single start-to-finish spec for the whole product** is a naive and impractical model.
>
> This document does not yet change the canonical architecture register. It is a design note intended to sharpen the next round of architecture and planning decisions.
> The spec-as-initiative identity and the spec↔claim vocabulary are now locked in [`memory/SPEC.md`](file:///Users/lunelson/Code/hashintel/brunch-next/memory/SPEC.md) (D61-L, plus Lexicon `Spec` / `Claim`). The richer model below — cross-spec claim survival/adoption, initiative-status lifecycle, spec-to-spec relationships, current-truth-as-projection — remains a deferred directional bet (SPEC §Future Direction → Spec initiative & claim model), not yet product contract.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolute local file path committed in documentation

Low Severity

The newly added line introduces a file:///Users/lunelson/Code/hashintel/brunch-next/memory/SPEC.md absolute local filesystem URL. This path is specific to one developer's machine and won't resolve for anyone else. While pre-existing lines in the file already have this anti-pattern, this commit adds a new instance of it.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 76ea7a8. Configure here.

lunelson and others added 14 commits June 2, 2026 20:35
Relocate Pi extension shell and all product extensions, components,
context builders, and tests from src/tui-client/ to src/.pi/ to
match the D52-L source topology: src/{.pi, agents, db, graph, session, rpc, web}.

Update all import paths, projectRoot() helpers, relative URL depths,
and the build:pi-assets script in package.json.

Amp-Thread-ID: https://ampcode.com/threads/T-019e840d-172b-736c-839e-e441f7308220
Co-authored-by: Amp <amp@ampcode.com>
M5 slice 1: A14-L proof-of-life — the agent can now call commit_graph
to atomically create nodes+edges and read_graph to inspect graph state.

- command-adapter.ts: Pi tool params → CommandExecutor input translation
  and CommandResult → tool result text formatting
- graph/index.ts registrar: registerBrunchGraph with TypeBox v1.x
  parameter schemas using StringEnum for enums
- Pre-bound GraphSnapshotReaders so extensions never import db/ (I26-L)
- Re-export enum const arrays from graph/index.ts for I26-L compliance
- Extension shell wires graph tools when options.graph is provided
- 9 integration tests: translate, format, end-to-end commit+read,
  I34-L all-or-nothing rollback, not-found handling

Amp-Thread-ID: https://ampcode.com/threads/T-019e840d-172b-736c-839e-e441f7308220
Co-authored-by: Amp <amp@ampcode.com>
Update all src/tui-client/.pi/ path references to src/.pi/ in both
canonical planning docs. Mark agent-graph-integration as in-progress
with execution pointer noting the topology move and graph tool wiring.

Amp-Thread-ID: https://ampcode.com/threads/T-019e840d-172b-736c-839e-e441f7308220
Co-authored-by: Amp <amp@ampcode.com>
- Move session-domain files to src/session/ (coordinator, binding, envelope,
  projection-reader, transcript, elicitation/structured-exchange, project-identity)
- Move web-host to src/rpc/, brunch-pi-profile to src/.pi/, web-client/ to
  src/web/, test-helpers to src/probes/; delete empty snapshot-{graph,nodes} stubs
- Fix imports (tsc-driven), web entry path, source-path test reads, and
  web-host dist-web resolution for the new locations
- Reconcile src/ and session/ READMEs; PLAN branch note; trim specTitle placeholder
SPEC: revise D25-L (orthogonal strategy/lens axes), D40-L (session-agent
record, role derived from op_mode); add D58-L (3-layer composition), D59-L
(goal axis), D60-L (snapshot pull/render/surface); rewrite §309/§311 to the
3-layer model; update I25-L; add Lexicon terms (Session agent, Goal, AUTO,
Capability/skill, Snapshot, Agent definition); retire legacy (lens-catalogue,
pinning posture, runtime bundle, flat composition prose).

PLAN: register agent-runtime-vocabulary (active) and agents-composition-layer
(next) frontiers with dependencies; sequence ahead of the M5 A14-L proof.
lunelson added 19 commits June 2, 2026 20:35
- D58-L: thin runtime header + gated prompt-resource manifest; methods
  (capability synonym retired); manifest {name,description,location}
  metadata code-owned in agents/state.ts, not filesystem-discovered.
- D52-L/lexicon: agents/ topology = methods/; contexts/ is the D60-L
  render layer, not a manifest resource family.
- SPEC: concrete agents/ topology (md/ts boundary); posture deferred.
- PLAN: rewrite agents-composition-layer to the manifest model;
  oracle design reconciled (already filed as I38-L), not owed.
D58-L manifest model (thin header + read-on-demand resources, not eager
packs), D40-L/D59-L state axes (op_mode + goal/strategy/lens, role derived),
D60-L contexts-as-render, and the concrete agents/ topology. Fixes stale
session.mode/agent vocab, modes/ dir, readiness-context, and the
.pi/context migration table.
@lunelson lunelson force-pushed the ln/fe-785-agent-graph-integration branch from 76ea7a8 to c77a3fd Compare June 2, 2026 18:37
@lunelson lunelson force-pushed the graphite-base/163 branch from f5780d0 to 227874c Compare June 2, 2026 18:37
@lunelson lunelson changed the base branch from graphite-base/163 to next June 2, 2026 18:37
Copilot AI review requested due to automatic review settings June 2, 2026 18:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@lunelson lunelson merged commit b0abf26 into next Jun 3, 2026
6 checks passed
@lunelson lunelson deleted the ln/fe-785-agent-graph-integration branch June 3, 2026 12:30
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.

2 participants