Commit Graph
1703 Commits
Author SHA1 Message Date
sam c603b3596d Merge branch 'main' into feat/55-esc-misses-single-quotes-enabling-attribute-js-breakout-in-t 2026-07-25 01:29:59 +00:00
sam af9203bbd4 Merge branch 'main' into feat/50-metadataarchieplugins-frontmatter-list-is-parsed-but-unused 2026-07-25 01:29:41 +00:00
sam 9c731710b3 Merge branch 'main' into fix/49-gofmt-fix-misaligned-taskref-struct-fields-in-storagego 2026-07-25 01:29:13 +00:00
archie f83380e1bf clip() can truncate strings mid-rune, producing invalid UTF-8 (archie)
Implements #47
2026-07-24 18:06:37 +00:00
archie 6f72f38f5e fix: baseline gate repair (go vet ./...) 2026-07-24 18:04:15 +00:00
archie 8e76e5c7b3 fix: gofmt: fix misaligned TaskRef struct fields in storage.go (archie)
Fixes #49
2026-07-24 17:52:33 +00:00
archie af17f4cd66 test: failing repro for #49 2026-07-24 17:51:39 +00:00
archie ca92e24008 fix: baseline gate repair (go vet ./...) 2026-07-24 17:47:19 +00:00
archie 69b317a7c2 metadata.archie.plugins frontmatter list is parsed but unused (archie)
Implements #50
2026-07-24 17:42:17 +00:00
archie b4efcf84ba fix: baseline gate repair (go vet ./...) 2026-07-24 17:36:29 +00:00
archie 7632cba8e5 esc() misses single quotes, enabling attribute JS breakout in task row onclick (archie)
Implements #55
2026-07-24 17:33:22 +00:00
archie e4d1f728d7 fix: baseline gate repair (go vet ./...) 2026-07-24 17:28:19 +00:00
archie cc98d66bf2 Duplicate-workflow warning fires on normal builtin overrides too (archie)
Implements #56
2026-07-24 17:25:43 +00:00
archie c742e4243d fix: baseline gate repair (go vet ./...) 2026-07-24 17:12:17 +00:00
sam 918b198258 fix: resolve merge conflicts with main 2026-07-24 23:12:25 +10:00
sam d8379ecf22 Merge branch 'main' into fix/58-add-tests-for-prepares-idempotent-fast-path-and-git-error-pa 2026-07-24 07:44:55 +00:00
sam bb784297ae feat: fix webui task table and add merge-to-deploy automation
- webui: task rows referenced Go-style field names but store.Task
  JSON-marshals with lowercase tags, so every task row rendered blank
- add .gitea/workflows/deploy.yml: build+push archied and archie-agent
  images to the registry on merge to main
- docker-compose.yml: add a watchtower service so carina picks up new
  images and restarts the daemons without needing CI to SSH in
2026-07-24 17:22:19 +10:00
archie d2d10685e7 Prepare() treats worktree as ready from .git dir existence alone (archie)
Implements #57
2026-07-24 05:32:41 +00:00
archie cd2da34c39 fix: Add tests for Prepare's idempotent fast path and git error paths (archie)
Fixes #58
2026-07-24 05:28:19 +00:00
archie 7e723b47a0 test: failing repro for #58 2026-07-24 05:27:26 +00:00
archie e780596bf9 askpass helper rewritten on every git call despite "(once)" comment (archie)
Implements #59
2026-07-24 05:16:57 +00: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 d80401d595 feat: add config overlay and shared RPC/Yaegi packages
- Introduce `-config-overlay` flag and `config.LoadOverlay()` to merge a base config with an overlay file, only overriding fields the overlay sets. This enables docker-compose to mount the base config from the host and apply only deployment-specific overrides.
- Create `internal/natsrpc` package with reusable NATS request/reply primitives (Envelope, Client, Call, RegisterAll, Respond). Migrate storerpc, worktreerpc, and forgerpc to use it, eliminating duplicated marshal/unmarshal and error handling.
- Create `internal/yaegiutil` package with shared interpreter construction (stdlib + extra symbols), generic export resolution (Resolve), and panic recovery (Safe). Migrate all Yaegi-based surfaces (gate scripts, daemon plugins, skill plugins, workflow stages, skill scripts) to use it, reducing boilerplate and centralizing panic safety.
- Simplify `config.docker.toml` to contain only overlay fields (paths, container config) and remove the duplicated repos list – the base config is now the single source of truth.
- Update docker-compose.yml to pass both -config and -config-overlay flags and mount the base config from the host.
- Add tests for LoadOverlay, DockerConfigOverlaysExampleConfig, Envelope, and yaegiutil utilities.
2026-07-24 12:57:10 +10:00
sam 242762b2fb refactor: archie:* → agent:* labels, remove stale archie label 2026-07-24 12:09:38 +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 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 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
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 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 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