Commit Graph
1477 Commits
Author SHA1 Message Date
sam d3062cf8dd refactor: minimize config.docker.toml to Docker-specific overrides only 2026-07-24 12:34:01 +10:00
sam 8f8d0188b8 fix: host bind mounts for worktree to fix Docker container mount paths 2026-07-24 12:31:31 +10:00
sam c1f8760c5f chore: add collaboration/personas epics, close volume TTL issue 2026-07-24 12:27:09 +10:00
sam 242762b2fb refactor: archie:* → agent:* labels, remove stale archie label 2026-07-24 12:09:38 +10:00
sam b8ac644acd fix: sync docker config with inprocess — DeepSeek, 100M, diff cap 0 2026-07-24 11:44:04 +10:00
sam 920c56a14b fix: create branch on reuse if not found, add dolt+beads to Dockerfile 2026-07-24 11:31:27 +10:00
sam 1ce6489823 fix: bump branch slug limit to 60 chars 2026-07-24 11:22:34 +10:00
sam 006b4e8e54 feat: @mention detection, branch linking, stale worktree pull 2026-07-24 10:38:07 +10:00
sam e4368f70af feat: persistent volumes with TTL for container/worktree storage (archie-core-j7v)
Add [containers].volume_ttl (default 72h). Persistent-storage repos get a
per-repo bare Git cache (--reference-if-able --dissociate) so task
worktrees clone fast without repeated full network clones, while staying
fully independent of the cache's lifecycle — cache expiry can never
corrupt an active or parked task's worktree. Docker repo volumes are
labeled as Archie-owned and swept non-forced (a volume still attached to a
running container survives and retries next cycle); the repo cache
directory is swept by mtime. Both cleanups run at daemon startup and each
poll cycle.

Filed archie-core-756 (repo-wide golangci-lint baseline) and archie-core-340
(intermittent JetStream TempDir teardown flake) as separate follow-ups
rather than scope-creeping them into this change.
2026-07-24 10:22:11 +10:00
sam 827c108401 chore: supersede archie-core-358 with archie-core-5zh.8
archie-core-358 predates the whole-task-per-container model built in the
5zh epic. It envisioned a ContainerRunner implementing agentexec.Runner —
spawning a container per LLM stage call. The architecture that actually
landed spawns one container per task (daemon.process()'s ContainerPool)
and hands the entire workflow to archie-agent in one round trip; NATSRunner
already covers stage-level agentexec.Runner communication within that
model. A separate ContainerRunner would duplicate that boundary at the
wrong layer.
2026-07-24 09:31:39 +10:00
sam 75f237d1ad feat: daemon hands off tasks to archie-agent in sandboxed mode (archie-core-5zh.8)
daemon.process() branches on ContainerPool != nil: sandboxed tasks publish
a taskrun.Request to archie.taskrun.<id> and await the response via the
new runViaAgent method, instead of running workflow.Route/workflow.Run
locally. Non-container mode is unchanged. Every durable side effect
(Store, Forge, git push) already landed via the storerpc/forgerpc/
worktreerpc proxies during archie-agent's run by the time runViaAgent
returns — it only parks the task itself on transport/setup failure, never
duplicating a terminal state archie-agent's own workflow.Run already
recorded.

Also fixes a real correctness gap: with concurrent multi-task dispatch
(archie-core-u64/g1l) plus containerized archie-agent, a shared queue-group
subscription could let one container answer a sibling's taskrun message
while having a *different* task's worktree mounted. archie-agent now reads
its boot-time task.json and subscribes to its own exact per-task subject
when present, falling back to the shared queue group only in dev/pool mode
(no task.json).

Adds agentexec.ProvidersFromConfig, deduped from cmd/archied's former
executionProviders.

Closes the archie-core-5zh epic: archie-agent runs an entire task's
workflow per invocation instead of one stage per round trip, with all
credentials staying daemon-side throughout.
2026-07-24 09:14:56 +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
sam 81ce920434 feat: register storerpc/forgerpc/worktreerpc servers in archied (archie-core-5zh.9)
Add registerTaskRPCServers() in cmd/archied/main.go: subscribes all three
RPC servers on the daemon's NATS connection whenever [nats] is configured,
using the same Store/Forge/worktree.Manager instances the daemon already
owns. archie-agent containers now have a live responder for the Store,
Forge, and worktree Prepare/Push calls proxied in archie-core-5zh.1-3.

Test spins an embedded NATS server and round-trips real storerpc/forgerpc/
worktreerpc clients against the registered handlers.
2026-07-24 08:59:04 +10:00
sam b544af6e92 refactor: trim TaskContext.Forge/Store/Trees to interfaces (archie-core-5zh.6)
Add Forger/TaskStore/Trees interfaces in internal/workflow/workflow.go,
scoped to exactly the methods stages call mid-run: 4 Forge methods
(Comment, CloseIssue, CreatePR, SetStateLabel), 2 Store methods (Update,
Transition), 6 Trees methods (Prepare, CommitAll, Push, Diff, ChangedFiles,
ChangedLines). This lets storerpc.Client/forgerpc.Client/worktreerpc.Client
satisfy TaskContext from inside archie-agent.

Go's structural typing meant zero other changes were needed — forge.Forge,
*store.Store, and *worktree.Manager already satisfy the trimmed interfaces.
No behavior change for the daemon's existing inprocess/subprocess paths.

Also fixes a gofmt nit left over from the 5zh.2 commit.
2026-07-24 08:56:23 +10:00
sam 159fbce18f feat: curated TaskConfig payload for archie-agent (archie-core-5zh.5)
Add config.TaskConfig/TaskForge and Config.ForTask(): a non-secret,
explicit-allowlist snapshot (Models, Budgets, Dispatch, DiffCapLines,
Notify, Forge.Host) of the fields workflow stages read from tc.Cfg.
Forge.TokenEnv is excluded even though it's just a var name, not a secret.
Maps are deep-copied to avoid aliasing the daemon's live config. Duration
gains JSON marshaling (string form, matching TOML); config.Repo gets full
json tags.

Groundwork for archie-core-5zh — not yet wired into workflow.TaskContext.
2026-07-24 08:53:15 +10:00
sam 1369ab1c84 fix: proxy worktree Prepare too, not just Push (archie-core-5zh.3 follow-up)
Discovered while scoping archie-core-5zh.4: Trees.Prepare's fetch/checkout/
reset also run through the token-authenticated askpass helper, and workflow
stages call tc.Trees.Prepare directly (internal/workflow/steps.go), not
just the daemon's pre-container clone. So Prepare needs the same proxy
treatment as Push — both are network git ops requiring the credential;
CommitAll/Diff/ChangedFiles/ChangedLines stay local as originally scoped.
2026-07-24 08:27:35 +10:00
sam afa8c05ca7 feat: worktree push RPC proxy for archie-agent (archie-core-5zh.3)
Add internal/worktreerpc: core NATS request/reply so archie-agent can
request a git push without holding the forge push token. The server
resolves the worktree directory itself from owner/repo/issue rather than
trusting a path from the sandboxed agent, then calls the daemon's own
worktree.Manager.Push (which already holds the token). Prepare, CommitAll,
Diff, ChangedFiles, and ChangedLines stay local git ops the agent can run
directly against its bind-mounted worktree — only Push needed proxying.

All three RPC proxies for archie-core-5zh now exist (Store, Forge,
worktree push); archie-core-5zh.4 (the actual stage-loop move) is
unblocked.
2026-07-24 08:05:15 +10:00
sam 65eda765ab feat: Forge RPC proxy for archie-agent (archie-core-5zh.2)
Add internal/forgerpc: core NATS request/reply for the four forge.Forge
methods workflow stages call mid-run (Comment, CloseIssue, CreatePR,
SetStateLabel). archied stays the sole holder of forge API tokens. All
other Forge methods are daemon-only poll/reconcile-loop calls and don't
need proxying (confirmed by grep across internal/workflow).

Groundwork for archie-core-5zh — not yet wired into daemon.go or
workflow.TaskContext.
2026-07-24 08:02:46 +10:00
sam c9d0f015ca feat: Store RPC proxy for archie-agent (archie-core-5zh.1)
Add internal/storerpc: core NATS request/reply so archie-agent can call
Store.Update/Transition without a direct SQLite connection. archied stays
the sole DB owner and responds to update/transition subjects; store.Task
gains json tags to cross the wire.

Groundwork for archie-core-5zh — not yet wired into daemon.go or
workflow.TaskContext. Splitting 5zh into sub-issues (.1 Store RPC, .2 Forge
RPC, .3 worktree push RPC, .4 the actual stage-loop move) since the full
move needs all three proxies to keep secrets/DB ownership on the daemon.
2026-07-24 07:58:56 +10:00
sam 4be28e0e48 feat: optional NATS token authentication (archie-core-l1q)
Add token_env to [nats] config, resolved and validated at daemon startup
(fails early if configured but the named env var is unset). Container
workers get NATS_URL/NATS_TOKEN; archie-agent honors both while CLI-supplied
URL still takes precedence. Anonymous auth remains the default for
single-node deployments.

Unblocks archie-core-5zh (promote archie-agent to per-task process).
2026-07-24 07:51:06 +10:00
sam b6b23bbb59 feat: per-repo allow_concurrent override for same-repo dispatch (archie-core-g1l)
Add config.Repo.AllowConcurrent (allow_concurrent toml key). Repos opted in
skip the daemon's default FIFO same-repo task serialization while still
respecting [containers].max_concurrency globally. Worktrees are already keyed
per issue number, so opted-in repos don't collide on disk.
2026-07-24 07:47:10 +10:00
sam f8df051b19 feat: bounded concurrent task dispatch in daemon (archie-core-u64)
Daemon previously processed one task at a time. Add bounded concurrent
dispatch for SQLite and NATS agent modes, reusing [containers].max_concurrency
(0 = unlimited). Same-repository tasks stay FIFO-serialized to avoid worktree
conflicts; different repositories now run concurrently.

Unblocks archie-core-l1q (NATS transport) and archie-core-g1l
(per-repo allow_concurrent override).
2026-07-24 07:42:13 +10:00
sam bef10c3ede feat: add v2 architecture milestone issues 2026-07-24 07:25:57 +10:00
sam 3531314d71 feat: add daemon concurrency issue to issue tracker 2026-07-24 07:25:57 +10:00
sam 7247aa491a Merge pull request 'fix: agent context doubled up — conversation history duplicated in prompt (archie)' (#66) from feat/65-fix-agent-context-doubled-up-conversati into main
Reviewed-on: http://git.catlow.cloud/sam/archie-core/pulls/66
2026-07-23 21:23:11 +00:00
archie b164bcbb14 fix: agent context doubled up — conversation history duplicated in prompt (archie)
Implements #65
2026-07-23 23:47:23 +10:00
sam 368221b285 fix: pull latest instead of skipping when worktree exists 2026-07-23 23:00:43 +10:00
sam 739c3d5c46 fix: branch prefix from labels, default feat 2026-07-23 22:39:46 +10:00
sam 51ade3e503 fix: conventional commit prefix in branch names (feat/62-... not archie/issue-62) 2026-07-23 22:29:32 +10:00
sam 3898fd179c fix: descriptive branch names — archie/62-clear-finished-button instead of archie/issue-62 2026-07-23 20:25:38 +10:00
sam e1636df34b chore: close issue archie-core-rig after completing audit 2026-07-23 19:44:26 +10:00
sam f1b1b6f50e refactor: cleanup okf directories 2026-07-23 19:36:42 +10:00
sam d9923109e5 docs: record CreateIssue, Dolt, and Beads decisions 2026-07-23 19:12:38 +10:00
sam 423eb78fef feat: add CreateIssue to Forge interface with Gitea implementation 2026-07-23 19:12:12 +10:00
sam 1bf4f7668f fix: disable diff cap (0 = unlimited), let human review PRs 2026-07-23 18:57:23 +10:00
sam c17df29ce4 Merge pull request 'Archie/issue 61' (#64) from archie/issue-61 into main
Reviewed-on: http://git.catlow.cloud/sam/archie-core/pulls/64
2026-07-23 08:52:21 +00:00
archie d2b2f29096 Implement max_retries cap on maybeRetryParked to prevent infinite parked-task loops (archie)
Implements #61
2026-07-23 18:49:38 +10:00
sam 16ca05da04 docs: add design decisions log, uncap token budget to 100M 2026-07-23 18:40:21 +10:00
sam 72f8020529 Merge pull request 'Add "Clear Completed" button to web dashboard (archie)' (#63) from archie/issue-62 into main
Reviewed-on: http://git.catlow.cloud/sam/archie-core/pulls/63
2026-07-23 08:32:15 +00:00
sam 556edc3ea7 Merge branch 'main' into archie/issue-62 2026-07-23 08:31:07 +00:00
archie 11b6316c6b Add "Clear Completed" button to web dashboard (archie)
Implements #62
2026-07-23 18:04:33 +10:00
archie 02408d2085 fix: baseline gate repair (go test ./... -count=1) 2026-07-23 18:02:05 +10:00
sam 7ef9220032 fix: set Outcome on BuildNoChanges to stop workflow before open-pr 2026-07-23 17:43:15 +10:00
sam 212b48a0a0 fix: close issue when build passes with 0 changes (no-op detection) 2026-07-23 17:25:03 +10:00
sam 0d6b26244e fix: remove all hardcoded MaxSteps — inherit from config budget 2026-07-23 16:15:01 +10:00
sam 3264102ee2 fix: increase plan max_steps to 30 for large repos, bump token budget 2026-07-23 16:10:34 +10:00
sam 7581bcc896 test: update responsive feature test to match fixed CSS 2026-07-23 13:55:22 +10:00
archie 7534cbe2c4 fix: baseline gate repair (go test ./... -count=1) 2026-07-23 13:22:27 +10:00
sam 27157412d8 fix: set protocol version on baseline-fix agent request 2026-07-23 13:07:37 +10:00
sam 278e49fc2e feat: auto-fix pre-existing gate failures instead of parking on baseline red 2026-07-23 12:52:30 +10:00