Commit Graph
4 Commits
Author SHA1 Message Date
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 e8ffa20b33 test: rewrite regression tests as behavioral (not structural)
Replaces field-existence checks with runtime behavior verification:

Gap 1 (per-task agent): FAILING
  TestHandleMessageReadsWorkflowField verifies HandleMessage produces
  different results when Workflow is set vs. unset. Currently identical
  — HandleMessage ignores the Workflow field. Must run full multi-stage
  workflow per PRD section 1.

Gap 3 (response/system split): PASSING
  TestHandleMessageRoutesSystemMessagesSeparately verifies Channel
  echoes from request to response. HandleMessage now reads input Channel
  and sets it on the response envelope. Subject functions verified
  distinct.

Gap 5 (daemon review): PASSING
  TestReviewResultBlocksOnResultWhenRejected verifies ReviewResult
  hook gates OnResult. Error blocks — OnResult never called. Nil
  allows — OnResult called normally.

Agent processing extracted into agentexec.HandleMessage for testability.
cmd/archie-agent delegates to it.
2026-07-22 03:13:57 +10:00
sam 13a01c4a37 test: add regression tests for remaining PRD gaps
Seven failing tests that must pass when gaps 1, 3, and 5 are closed:

Gap 1 (per-task agent):
  TestAgentRequestMessageHasWorkflowField — AgentRequestMessage needs
  a Workflow field so the agent runs full multi-stage workflows, not
  one stage at a time.

Gap 3 (response/system channel split):
  TestAgentResponseEnvelopeHasChannelField — envelope needs a Channel
  field ("response"|"system").
  TestSubjectForAgentResponseExists / TestSubjectForAgentSystemExists
  — subject functions for archie.agent.<id>.response and .system.

Gap 5 (daemon review step):
  TestAgentStageHasReviewHook — AgentStage needs a ReviewResult hook
  that gates agent output before OnResult forwards to humans.

All tests currently fail (compilation errors on missing fields).
2026-07-22 03:00:13 +10:00
sam a8d005a6f6 feat: extract agent execution boundary 2026-07-21 22:16:50 +10:00