Commit Graph
4 Commits
Author SHA1 Message Date
sam dbb6550ab3 fix(worktree): bind publication to dispatch grants
Worktree RPC used to accept repository coordinates from the sandbox. It now accepts only an opaque per-dispatch grant, and the daemon derives the repository path and branch from grant-owned state.

Repository worktree paths also move from an ambiguous flattened key to encoded owner/repo components. Origin-matched legacy clones migrate safely; mismatched legacy paths are preserved.
2026-08-22 22:06:54 +10:00
sam 45345cdfb6 refactor(agent): move worker runtime into application layer
cmd/archie-agent used to own worker construction, NATS lifecycle, task execution, MCP setup, and workflow wiring. It now owns process input only and invokes internal/app/agentworker, while transport-specific NATS, boot-brief, and git-safety mechanics live under infrastructure.
2026-08-15 00:43:12 +10:00
sam 6ebbd3b2cf fix: add missing LinkBranch stubs to test doubles
Fix go vet/test failures by adding LinkBranch methods to stubForge, prCapturingForge, testForge, and fakeForge. Update test data from 'sam/archie' to 'acme/widget' and state label defaults from 'archie:*' to 'agent:*'. Add Taskfile.yml for project build automation. Implement container self-network detection so spawned agents join the daemon's Docker network.
2026-07-24 13:32:50 +10:00
sam 1eee983681 feat: archie-agent runs a full task's workflow itself (archie-core-5zh.7)
Add internal/taskrun (Request/Response wire types) and
cmd/archie-agent/taskrun.go: runTask builds a workflow.Registry from the
container's own bind-mounted worktree, routes and runs the task's entire
workflow via workflow.Route/workflow.Run, using storerpc.Client/
forgerpc.Client for Store/Forge and a new hybridTrees that splits
Prepare/Push (proxied over worktreerpc — network ops needing the daemon's
credential) from CommitAll/Diff/ChangedFiles/ChangedLines (local git
against the mount).

Add config.TaskConfig.ToConfig() to rebuild a usable Config from the
curated payload, and storage.WorktreeMountDir (/data/worktree) — critical
fix: hybridTrees.Prepare discards the RPC response's host-side directory
and returns the container's fixed local mount path instead, since archied
and archie-agent see the same files at different paths.

Wired a queue-grouped core-NATS subscription on archie.taskrun.> in
cmd/archie-agent/main.go alongside the existing per-stage consumer, so
this is reachable in the running binary. End-to-end test drives the real
"bootstrap" workflow (no LLM) through real storerpc/forgerpc/worktreerpc
servers and a real local git remote — registry build, route, prepare,
commit, push, PR creation, and confirms the authoritative task state
lands in archied's store via RPC, not just in-memory.

archie-core-5zh.8 (daemon.go handoff) is unblocked.
2026-07-24 09:08:19 +10:00