Commit graph

96 commits

Author SHA1 Message Date
ecd47fe3db revert fcb9c189e5
revert fix(agentic): harden TODO workspace write

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-18 11:22:27 +00:00
Codex
fcb9c189e5 fix(agentic): harden TODO workspace write
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-18 08:54:32 +01:00
Snider
651783e1f5 feat(agent): gpt-5.4-mini/mature pass 1
Commit:

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-18 08:32:10 +01:00
Snider
e837a284af feat(agent): RFC §9 agentic_auth_login MCP tool + dedupe tool registrations
Three load-bearing gaps between the agent RFC and the MCP surface:

- RFC §9 Fleet Mode describes the 6-digit pairing-code bootstrap as the
  primary way an unauthenticated node provisions its first AgentApiKey.
  `handleAuthLogin` existed as an Action but never surfaced as an MCP
  tool, so IDE/CLI callers had to shell out. Adds `agentic_auth_login`
  under `registerPlatformTools` with a thin wrapper over the existing
  handler so the platform contract stays single-sourced.
- `RegisterTools` was double-registering `agentic_scan` (bare
  `mcp.AddTool` before the CORE_MCP_FULL gate, then again via
  `AddToolRecorded` inside the gate). The second call silently replaced
  the first and bypassed tool-registry accounting, so REST bridging and
  metrics saw a zero for scan. Collapses both into a single recorded
  registration before the gate.
- `registerPlanTools` and `registerWatchTool` were also fired twice in
  the CORE_MCP_FULL branch. Removes the duplicates so the extended
  registration list mirrors the always-on list exactly once.
- Switches `agentic_prep_workspace` from bare `mcp.AddTool` to
  `AddToolRecorded` so prep-workspace participates in the same
  accounting as every other RFC §6 tool.

TestPrep_RegisterTools_Good_RegistersCompletionTool now asserts all
three `agentic_auth_*` tools surface, covering the new login registration
alongside provision/revoke.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-14 20:27:44 +01:00
Snider
eed2274746 feat(agent): pairing-code login per RFC §9 Fleet Mode
Implements `core login CODE` — exchanges a 6-digit pairing code generated
at app.lthn.ai/device for an AgentApiKey, persisted to ~/.claude/brain.key.
Pairing code is the proof, so the POST is unauthenticated.

- auth.go: AuthLoginInput/Output DTOs + handleAuthLogin handler
- commands_platform.go: login / auth/login / agentic:login CLI commands
  with cmdAuthLogin persisting the returned key
- prep.go: registered agentic.auth.login / agent.auth.login actions
- auth_test.go / commands_platform_test.go / prep_test.go: Good/Bad/Ugly
  triads per repo convention, including key persistence verification

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-14 12:51:17 +01:00
Snider
7a531d1112 perf(mcp): reduce tool count from 189 to 82
Gate non-essential MCP tools behind CORE_MCP_FULL=1 env var.
Core factory tools (dispatch, status, plan, issue, PR, scan, mirror,
watch, brain, files) always registered. Extended tools (session, sprint,
state, phase, task, template, message, content, platform, epic, remote,
review-queue, setup, metrics, RAG, webview) only when full mode enabled.

189 → 82 tools in default mode. Fixes slow MCP startup and tool
registration timeout in Claude Code.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-08 19:17:21 +01:00
Snider
9c6f10902e fix(agent): mcp.Register startup panic + test isolation + CLI test standard
- Replace broken registerMCPService with mcp.Register (fixes nil ServiceRuntime panic)
- Remove dead mcp_service.go, update tests to use mcp.Register directly
- Add setTestWorkspace() helper to clear workspaceRootOverride between tests
- Fix 40+ test files with workspace state poisoning from loadAgentConfig
- Fix forge.lthn.ai → dappco.re in findConsumersList test
- Fix BranchWorkspaceCount test to use isolated temp dir
- Add CLI test standard: 32 tests across 19 subsystems (tests/cli/)
- All 9 packages pass, 0 failures

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-08 16:15:14 +01:00
Snider
5f0878d93d fix(mcp): update Subsystem interface to match mcp v0.5.1 Service API
All RegisterTools and internal register*Tool methods updated from
*mcp.Server to *coremcp.Service. Tool registration calls updated to
use svc.Server() for SDK AddTool calls. Monitor subsystem updated
to store *coremcp.Service and access Server() for Sessions/ResourceUpdated.
Tests updated to create coremcp.Service via New() instead of raw SDK server.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-07 14:11:19 +01:00
Virgil
75fc9d4bf4 fix(agentic): add namespaced MCP aliases for core tools
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 07:11:13 +00:00
Virgil
e5472f6aa5 ax(agentic): add platform command aliases
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 06:58:12 +00:00
Virgil
7a034ccbe8 feat(agentic): expose setup action surface
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 06:39:02 +00:00
Virgil
613e1fc58e refactor(agentic): add namespaced action aliases
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 06:29:46 +00:00
Virgil
652548a60a feat(agentic): add phase cli commands
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 06:05:31 +00:00
Virgil
ace8cf4462 feat(agentic): add prompt command alias
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 05:22:43 +00:00
Virgil
f6e1e64a0c feat(agentic): add namespaced template action aliases
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 05:07:54 +00:00
Virgil
c32b4de28e feat(agentic): expose generate action alias
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 05:03:08 +00:00
Virgil
d5fb2dc50b feat(agentic): add missing issue comment alias
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 04:23:14 +00:00
Virgil
131607215f feat(agentic): add dispatch command aliases
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 02:56:21 +00:00
Virgil
2e9529c018 feat(agentic): expose commit command
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 02:45:26 +00:00
Virgil
f198db7c68 feat(agentic): expose dispatch control actions
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 01:47:17 +00:00
Virgil
f07ea569ba feat(agentic): add state command surface
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 00:42:55 +00:00
Virgil
6aebdc07b6 feat(agentic): expose epic command aliases
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-02 00:01:23 +00:00
Virgil
3d8a65c3d4 feat(agentic): expose setup command
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 23:43:08 +00:00
Virgil
d496057aeb feat(agentic): add MCP message tool aliases
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 23:18:13 +00:00
Virgil
bc21029ac5 feat(agentic): add prompt_version MCP alias
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 22:46:45 +00:00
Virgil
8e1c0c7c4e feat(agentic): add flow preview variables
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 22:36:39 +00:00
Virgil
d910814067 feat(agentic): add session end CLI command
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 22:19:22 +00:00
Virgil
43e2a14b82 feat(agentic): add completion journal commit stage
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 22:07:42 +00:00
Virgil
452c4a27c7 feat(agentic): expose prompt snapshot over MCP
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 21:57:55 +00:00
Virgil
bbb651797a feat(agentic): add session complete alias
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 21:50:36 +00:00
Virgil
43e2efe7cd feat(agentic): add prompt snapshot lookup
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 21:20:44 +00:00
Virgil
b0662c282b feat(agentic): add direct workspace messaging
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 21:04:39 +00:00
Virgil
02aea97b7d feat(agentic): expose workspace watch command
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 20:43:42 +00:00
Virgil
a84a610ae2 feat(agentic): add synchronous dispatch surface
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 20:34:04 +00:00
Virgil
2a7b8d2e25 feat(agentic): add review queue alias
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 20:25:39 +00:00
Virgil
dfd1640d37 feat(agentic): expose completion pipeline as MCP tool
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 20:22:00 +00:00
Virgil
44ae9bc4ec feat(agentic): add agentic:generate command alias
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 19:36:44 +00:00
Virgil
315326bdd6 feat(agentic): add agentic:plan alias
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 19:33:24 +00:00
Virgil
6e5f4c5d37 feat(agentic): add session command aliases
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 19:28:56 +00:00
Virgil
f4736bf759 feat(agentic): persist prompt snapshots
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 18:28:42 +00:00
Virgil
ce3039544e feat(agentic): add brain forget cli command
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 18:10:23 +00:00
Virgil
238be05fa8 feat(agentic): add issue report action
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 18:00:50 +00:00
Virgil
dfaf14f061 feat(agentic): add issue assignment action
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 16:50:26 +00:00
Virgil
ae910099c8 feat(agentic): add issue action aliases
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 16:43:47 +00:00
Virgil
ab0460da61 feat(agentic): add SetCore wiring
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 16:09:04 +00:00
Virgil
3c2ab16afb feat(agentic): add plan from issue command
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 15:42:26 +00:00
Virgil
28fbe8b988 feat(agentic): add SEO schema generation
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 15:34:37 +00:00
Virgil
00f37096fa feat(agentic): expose plan check action and tool
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 15:28:47 +00:00
Virgil
dc9a81e101 feat(agentic): add state delete action
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 13:58:16 +00:00
Virgil
c99a8d4d7e feat(agentic): add review-queue command alias
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-01 13:52:57 +00:00