chore(beads): recover 5 carina-only beads during cross-machine sync

Reconciled the helix/carina beads divergence via the Dolt remote. Carina held
28 beads absent from helix, but 23 were the same GitHub issues re-pulled under
freshly-minted IDs -- importing by ID would have duplicated them. Imported the
5 genuinely unique beads (462t, fwvf, n5fz, tzzn, w1d5) with comments intact,
and closed fwvf/n5fz/w1d5 to match GitHub #703/#709/#710, whose fixes had
already merged.
This commit is contained in:
sam committed 2026-09-03 20:18:47 +10:00
1 parent ea7564c928
commit 54fc41c45e
2 files changed
+8

No files matched your search

+3
View File
@@ -208,3 +208,6 @@
{"id":"int-f308fd1259b3570d6fe3c3ac585b7757","kind":"field_change","created_at":"2026-09-02T20:57:28.723473462Z","actor":"Sam Catlow","issue_id":"archie-core-1786637500926-421-7c63bcd3","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Fixed in ui/src/dashboard/dashboard.css: .dash-top > div now flexes and .card grows to fill it, scoped to the HEALTH row only. Verified via a static HTML repro using the real project CSS (Playwright, computed geometry before/after) -- card heights and bottom edges now match. task check green, ui/dist rebuilt. Commit a9a056c."}}
{"id":"int-65c370a748af068c55f6a3046a8800b9","kind":"field_change","created_at":"2026-09-02T20:58:35.392948669Z","actor":"Sam Catlow","issue_id":"archie-core-1786637500900-420-335d8bbb","extra":{"field":"assignee","new_value":"Sam Catlow","old_value":"samcharles93"}}
{"id":"int-a4557ae17965484c7b2ea98496f6817f","kind":"field_change","created_at":"2026-09-02T20:58:41.680037166Z","actor":"Sam Catlow","issue_id":"archie-core-1786637500900-420-335d8bbb","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Superseded by the [[identities]] feature, not fixed via the originally-requested per-repo-within-one-[[repos]]-list forge override. Verified: IdentityConfig (internal/config/config.go:549) gives each identity its own Forge + Repos list, bootstrap.go:820 builds a per-identity runner with its own forge client, and deployments/multi-forge-github-gitea.toml is a documented, supported profile for exactly the carina/tau scenario this bug describes (GitHub + Gitea from one daemon). The bug's own workaround note anticipated this: 'tau gets no automated dispatch...until this is fixed or it gets a separate identity' -- separate identity is now the supported path. A single identity still cannot mix forges within one flat [[repos]] list; reopen if that finer granularity is specifically wanted."}}
{"id":"int-d5813fff6b635478862067006c1c3af0","kind":"field_change","created_at":"2026-09-03T10:16:04.825390136Z","actor":"Sam Catlow","issue_id":"archie-core-fwvf","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Resolved; GitHub #703 closed. Stale-open copy recovered from carina during machine sync."}}
{"id":"int-6e074ba6345cbb2197c7873ca6bb0780","kind":"field_change","created_at":"2026-09-03T10:16:05.296283836Z","actor":"Sam Catlow","issue_id":"archie-core-n5fz","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Resolved by commit 89f48a5 (PR #711); GitHub #709 closed. Stale-open copy recovered from carina during machine sync."}}
{"id":"int-871cbe9079c586a5d558d0d7fa8906c8","kind":"field_change","created_at":"2026-09-03T10:16:05.744041675Z","actor":"Sam Catlow","issue_id":"archie-core-w1d5","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Resolved by commit 5f2b253 (PR #712); GitHub #710 closed. Stale-open copy recovered from carina during machine sync."}}
+5
View File
@@ -14,6 +14,9 @@
{"_type":"issue","id":"archie-core-1ysw.1","title":"Bind worktree RPC operations to the dispatched task","description":"The sandboxed agent can currently choose owner, repo, issue, base, and branch on worktree RPC requests. The daemon then performs host deletion and credentialed forge operations without correlating the request to the dispatched task or enforcing WorkDir containment.","acceptance_criteria":"Reject traversal and unconfigured or task-mismatched coordinates before any filesystem or forge side effect; derive or validate the permitted branch; regression tests fail on the old behavior and pass on the fix.","status":"closed","priority":0,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:43Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:59:58Z","started_at":"2026-08-22T11:02:03Z","closed_at":"2026-08-24T06:59:58Z","close_reason":"Fixed on main: worktreerpc now exposes only Push, authorized by an opaque per-dispatch grant issued from the dispatched *store.Task (worktreerpc.go:71-83). Sandbox input no longer selects host path, repo or branch; ValidCoordinates rejects traversal. Package tests pass.","external_ref":"https://github.com/samcharles93/archie-core/issues/589","metadata":null,"dependencies":[{"issue_id":"archie-core-1ysw.1","depends_on_id":"archie-core-1ysw","type":"parent-child","created_at":"2026-08-22T21:01:42Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1ysw","title":"Repair internal/worktree correctness and trust-boundary defects","description":"Track the concrete worktree-package defects proven by the 2026-08-22 evidence-gated review. Child bugs cover RPC authority/path containment, repository-key isolation, retry/base/diff correctness, push lifecycle, terminal cleanup, cancellation, and branch naming. This epic groups implementation only; each child has its own observable acceptance criteria.","acceptance_criteria":"All child bugs are closed with red-green regression tests, scoped lint passes, and the repository quality gate is clean.","status":"closed","priority":0,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-22T11:01:18Z","created_by":"Sam Catlow","updated_at":"2026-08-24T08:16:00Z","closed_at":"2026-08-24T08:16:00Z","close_reason":"All 9 children complete. The P0/P1 trust-boundary and correctness defects (.1 RPC task binding, .2 colliding directory keys, .3 untracked cleanup, .4 fail-closed base resolution, .5 three-dot merge-base semantics) were already fixed on main and reconciled 2026-08-24. The remaining four (.6 push result, .7 no-change worktree leak, .8 commit cancellation, .9 branch naming contract) were implemented this session, merged as 474c31d and its two merge commits, task check green, with an independent adversarial review reporting zero findings.","external_ref":"https://github.com/samcharles93/archie-core/issues/590","dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-t2db.5","title":"Security: an unauthenticated endpoint must not be able to run an agent","description":"P0 within this epic because the feature's own pitch is the threat model: a public intake surface whose output is an agent with tool access and a repo. Get this wrong and a webhook URL is remote code execution with extra steps.\n\nNon-negotiables to design:\n\n- Per-source authentication. A source registers with a secret (HMAC, as internal/channels/webhook already does per route) before its events can trigger anything. Capture-only for unknown senders is acceptable; triggering is not.\n- Human approval before a binding goes live. An operator authoring a binding is a deliberate act; an event arriving is not. Nothing should self-arm.\n- Rate and volume limits per source, so capture cannot be used to exhaust disk or drown the inspector.\n- Payload content is untrusted input flowing into an agent prompt. Treat prompt injection as expected, not exceptional -- the sender controls that text, and the agent has tools. Bound what a playbook-triggered workflow may do.\n- Captured payloads may contain secrets from the sending system. Decide retention, redaction and who can view them; internal/memory/scrubber may already have applicable prior art.\n\nArchie's own principle applies: environmental enforcement over prompt rules. 'The agent should ignore instructions in the payload' is not a control.","acceptance_criteria":"An event from an unauthenticated source can be captured but cannot trigger a workflow; a new binding requires explicit human approval before it arms; per-source rate limits exist; the blast radius of a playbook-triggered workflow is bounded by code rather than by prompt text; retention and visibility of captured payloads is decided and documented.","notes":"2026-08-22: security design decided and documented in docs/prds/webhook-intake-security.md, covering all five non-negotiables from this bead's description:\n1. Per-source auth reuses internal/channels/webhook's existing HMAC-SHA256 scheme; capture accepts unsigned events (visible, marked unauthenticated), only authenticated events can ever match a binding.\n2. Bindings gain a draft -\u003e pending_approval -\u003e armed state machine; any edit to an armed binding drops it back to pending_approval so approval can't be bypassed by editing. Modeled on telegram's existing dangerousAction/pendingApproval flow (dangerous.go/approval.go).\n3. Per-source token-bucket rate limiting (precedent: pairing/store.go's MaxPendingPerPlatform); limit-exceeded is an observable 429, not a silent drop.\n4. Blast radius bounded by the SAME code-level controls every task already gets -- gate, diff_cap_lines, sandboxed container, worktree isolation -- no new relaxation for playbook-triggered work, and payload text is ordinary untrusted prompt input, never a trusted instruction.\n5. 7-day configurable retention on captured payloads; best-effort redaction reusing gateway/stream.go's sensitiveParameterKey heuristic before persisting; visibility gated by the same dashboard auth as every other webui surface.\n\nThis bead's code-level acceptance criteria (capture-can't-trigger, rate limits exist, blast-radius bounded, approval gate) cannot be implemented yet: they constrain t2db.1 (capture), 7d5u.3 (intake family) and t2db.4 (binding), none of which have landed. This document is the contract those beads build against -- do not build any of them without satisfying it. Leaving this bead in_progress rather than closing it; it closes when t2db.1/7d5u.3/t2db.4 land and demonstrably satisfy points 1-5, not before.","status":"closed","priority":0,"issue_type":"feature","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-21T13:45:46Z","created_by":"Sam Catlow","updated_at":"2026-09-02T13:09:39Z","started_at":"2026-08-21T14:51:26Z","closed_at":"2026-09-02T13:09:39Z","close_reason":"Closed","external_ref":"https://github.com/samcharles93/archie-core/issues/536","dependencies":[{"issue_id":"archie-core-t2db.5","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-08-21T23:45:45Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-w1d5","title":"Gateway-only release must not rebuild or publish archie-agent","description":"## Bug Description\n\nA gateway-only release (`archied v1.22.0`, runtime skipped) still runs the `Build and push archie-agent` job and pushes `ghcr.io/samcharles93/archie-agent:latest` with `RUNTIME_VERSION=dev` because no `archie/v1.22.0` tag exists. This violates the release process rule that an untouched component must not be rebuilt or published.\n\n## Evidence\n\n- Release target: `archied/v1.22.0` only; `archie-agent` was explicitly skipped.\n- Workflow: `.github/workflows/deploy.yml` unconditionally builds both images.\n- Version resolver uses `RUNTIME_VERSION=dev` when no runtime tag points at HEAD.\n- Tag workflow 33723604418 passed, but rebuilt/pushed the agent image anyway.\n\n## Expected Behavior\n\nA gateway-only release builds and publishes only the archied component. The existing agent image remains unchanged.\n\n## Acceptance Criteria\n\n- Make the deploy workflow component-aware: skip the agent build/push when no `archie/v*` release tag points at HEAD.\n- Preserve full dual-image builds when both component tags are present.\n- Add CI/workflow validation for gateway-only and dual-component releases.\n- Do not publish an agent image stamped `dev` from a gateway-only release.\n","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-03T06:40:43Z","created_by":"Sam Catlow","updated_at":"2026-09-03T10:16:06Z","closed_at":"2026-09-03T10:16:06Z","close_reason":"Resolved by commit 5f2b253 (PR #712); GitHub #710 closed. Stale-open copy recovered from carina during machine sync.","external_ref":"https://github.com/samcharles93/archie-core/issues/710","labels":["bug","ci","release"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-n5fz","title":"Migrate existing bindings table for owner and repo columns","description":"## Bug Description\n\nArchied v1.22.0 starts successfully against the existing production task database, but binding listing logs `SQL logic error: no such column: owner`. The database was created/migrated by an earlier release and its `bindings` table has no `owner` or `repo` columns, while current `internal/store/bindings.go` selects/inserts/updates both columns.\n\n## Steps to Reproduce\n\n1. Run archied v1.22.0 against an existing database upgraded from the previous release.\n2. Open the bindings dashboard or call the bindings listing path.\n3. Observe `list bindings failed: SQL logic error: no such column: owner`.\n\n## Expected Behavior\n\nExisting databases migrate forward without data loss, and binding listing/creation/update works after upgrade.\n\n## Actual Behavior\n\nThe daemon stays up, but binding listing fails because the migration does not add the owner/repo columns required by the current binding store.\n\n## Evidence\n\n- Release: archied v1.22.0\n- Production DB: `/home/sam/.local/share/archie/archie.db-tasks.sqlite`\n- `pragma user_version = 2`\n- Existing `bindings` table has columns through `updated_at`, but no `owner` or `repo`.\n- Current code in `internal/store/bindings.go` references `owner` and `repo`.\n\n## Acceptance Criteria\n\n- Add an idempotent migration for owner/repo columns with safe defaults.\n- Preserve existing bindings and make them readable after upgrade.\n- Add regression coverage starting from the pre-owner/repo schema.\n- Verify binding list/create/update paths against both fresh and upgraded databases.\n- Do not reset or delete the production database.\n","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-03T06:39:09Z","created_by":"Sam Catlow","updated_at":"2026-09-03T10:16:05Z","closed_at":"2026-09-03T10:16:05Z","close_reason":"Resolved by commit 89f48a5 (PR #711); GitHub #709 closed. Stale-open copy recovered from carina during machine sync.","external_ref":"https://github.com/samcharles93/archie-core/issues/709","labels":["bug","migration","release"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-fwvf","title":"v1.20.0 archied startup panic and schema-unsafe update rollback","description":"## Bug Description\n\nAfter `/update` installed `archied` v1.20.0, the service failed to start. The update watchdog reported `health_check: failed` and rolled the binary back to v1.19.10, but the v1.20.0 binary had already migrated the task database to schema version 2. The rollback binary then entered a restart loop because it only supports schema version 1.\n\nRestoring the matching v1.20.0 daemon did not recover the service: it panics during startup in `(*boot).connectNATS` at `bootstrap.go:366` while dereferencing `cfg.NATS.URL`.\n\n## Steps to Reproduce\n\n1. Run `/update` from the Telegram gateway, selecting archied v1.20.0.\n2. Observe the watchdog health check fail and rollback.\n3. Start the matching v1.20.0 binary against the existing config.\n\n## Expected Behavior\n\nThe released daemon starts successfully with the production config, or returns a clear configuration error. `/update` must not leave the installed binary and persisted task schema at incompatible versions.\n\n## Actual Behavior\n\nThe service is in a systemd restart loop. v1.19.10 reports `store: migrate: database schema version 2 is newer than supported version 1`; v1.20.0 panics with `runtime error: invalid memory address or nil pointer dereference` in `connectNATS` at `bootstrap.go:366`.\n\n## Evidence\n\n- Installed before recovery: `archied 1.19.10`, `archie-agent 1.19.9`\n- Update report: installed daemon/agent `1.20.0`, `health_check: failed`, `rolled_back: true`\n- Task DB: `/home/sam/.local/share/archie/archie.db-tasks.sqlite`, `PRAGMA user_version = 2`\n- v1.20.0 panic: `url := cfg.NATS.URL` in `internal/app/archied/bootstrap.go:366`\n- Current config contains `[nats] url = \"nats://172.19.0.1:4222\"`\n\n## Acceptance Criteria\n\n- Add a regression test covering startup with the production NATS configuration and nil/invalid NATS state.\n- Remove the nil dereference; startup must return a useful error or initialise the required NATS configuration.\n- Make update rollback schema-safe: either verify the candidate before migration, retain/restore compatible state, or prevent rollback to a binary that cannot read the candidate schema.\n- Exercise `/update` or an equivalent installer/restart path and verify `archied.service` reaches active, Telegram gateway starts, NATS connects, and `/version` reports the installed release.\n- Preserve the task database and existing tasks.\n\n## Environment\n\n- Host: carina.srv.catlow.cloud\n- OS: Debian/Linux 6.12.96+deb13-amd64\n- Service: systemd user unit `archied.service`\n- Update path: Telegram `/update`\n","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-03T04:19:21Z","created_by":"Sam Catlow","updated_at":"2026-09-03T10:16:05Z","closed_at":"2026-09-03T10:16:05Z","close_reason":"Resolved; GitHub #703 closed. Stale-open copy recovered from carina during machine sync.","external_ref":"https://github.com/samcharles93/archie-core/issues/703","labels":["bug","release","update"],"comments":[{"id":"01a06585-1d1b-76bf-833a-71ba15ab0d3d","issue_id":"archie-core-fwvf","author":"Sam Catlow","text":"## Investigation correction\n\nThe panic frame is `setupObservability`, not `connectNATS`. In the released/latest source, `setupObservability` assigns `b.d.Mappings = ms` while `b.d` is still nil; `buildDaemon` runs later in startup. The direct nil dereference is therefore the daemon wiring order, while the schema-unsafe rollback remains the separate update failure.\n\nThe implementation and regression test will cover both paths.","created_at":"2026-09-03T04:26:58Z"}],"dependency_count":0,"dependent_count":0,"comment_count":1}
{"_type":"issue","id":"archie-core-t2db.18","title":"eda: resolve mid-playbook action failure semantics (execution-time gap 1)","description":"Design-investigation ticket, same shape as the idempotency one above -- produces a design-doc resolution, not implementation. Gates multi-action playbooks (t2db.15 is deliberately single-action to avoid needing this). docs/prds/eda-playbook-engine.md's 'Execution-time gap 1' has no default yet and explicitly says a default must be a stated decision, not something nobody chose.\n\nGrounded by a crew investigation pass (2026-09-03, not committed -- content folded in here): read event-sources-and-reactions.md's producer-only/no-veto/no-mutation language, existing internal/domain/workflow stage-failure conventions (does a failing stage stop/wrap/resume?), and the load-collision report shape (drop+log+report to caller) from t2db.9-.12 as the precedent for how a run outcome should be reported.","design":"Decide and write the resolution into eda-playbook-engine.md:\n1. On action N of M failing: stop-on-first-failure (matches this doc's existing anti-clever-recovery bias) vs continue-to-independent-later-actions vs rollback. State which, and why the alternatives were rejected -- don't just restate the doc's existing hedge.\n2. What 'rollback' means (likely: nothing, since a posted forge comment isn't revocable) -- state this explicitly rather than leaving it implied.\n3. Producer-only interaction: decide whether a playbook reacting to its own action's failure by running compensating actions is in scope -- state the boundary explicitly against event-sources-and-reactions.md's producer-only rule.\n4. Condition-failure vs action-failure: J3 (CEL condition eval error -\u003e false, skip, log, continue) is already decided for conditions specifically. State cleanly how this differs from an actual action failure.\n\nSTRONG REUSABLE PRECEDENT FOUND IN THIS CODEBASE (verified directly, 2026-09-03) -- read internal/domain/workflow/workflow.go:294-352 (Run/finish/park) before designing anything new. The existing workflow engine already answers a structurally identical question for its own stages, and the answer is precise, not just 'stop on failure':\n- A real stage error: stop immediately, set ParkReason (which stage, what error), call park() -- status becomes store.StatusParked, requiring human/retry intervention. This IS this codebase's existing 'stop-on-first-failure, log the outcome, report to caller' pattern -- a playbook run failure should almost certainly reuse the SAME park/report shape (or a directly analogous one) rather than inventing new run-outcome semantics.\n- Context cancellation (ctx.Err() != nil, e.g. daemon shutdown mid-stage) is explicitly NOT treated as a failure: the task is left running so existing crash-recovery requeues it; parking here 'would publish a false failure and require manual intervention.' A playbook coordinator dispatching a Module/Workflow action needs the SAME distinction -- a daemon-shutdown interruption mid-action must not be recorded as an action failure, or every restart during a dispatch would falsely mark playbooks as broken.\n- A workflow ending without an explicit terminal outcome is itself parked as 'workflow ended without an outcome (definition bug)' -- i.e. an engine-level invariant violation gets its own distinct, honestly-labeled outcome rather than being silently treated as success. Consider whether a playbook run has an analogous 'must end with X' invariant.\n\nThis means gap 1 may reduce to: 'reuse park()'s three-way distinction (real failure / shutdown interruption / definition-bug) for playbook runs' rather than a from-scratch design -- read the actual code before deciding whether that reduction actually holds or where a playbook run's shape genuinely differs (e.g. playbooks may not have a Store.Transition-shaped persistence target the way a store.Task does -- confirm what a playbook run's own state, if any, actually gets recorded to).","acceptance_criteria":"eda-playbook-engine.md's Execution-time gap 1 section is marked resolved with a stated default (not a list of candidates) and explicit reasoning against event-sources-and-reactions.md's producer-only rule. No code changes required for this ticket to close.","notes":"Proposed resolution drafted 2026-09-03 in docs/prds/eda-playbook-engine.md, commit 99eaa7a -- reuses workflow.Run's existing three-way stage-failure distinction. Explicitly marked 'awaiting Sam's sign-off,' not settled.","status":"open","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T18:12:15Z","created_by":"Sam Catlow","updated_at":"2026-09-02T20:29:55Z","dependencies":[{"issue_id":"archie-core-t2db.18","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-02T18:12:15Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-t2db.17","title":"eda: resolve idempotency keying for Module/Channel/Forge actions (execution-time gap 2)","description":"Design-investigation ticket (like the CEL question, archie-core-t2db resolution in eda-playbook-engine.md) -- produces a design-doc resolution, NOT implementation. This is the sharper of the two unresolved execution-time gaps named in docs/prds/eda-playbook-engine.md's 'Execution-time gaps' section: workflow-kind actions inherit idempotency for free via TaskEnvelope; channel/forge/module actions with real side effects have no keying scheme, so a redelivered trigger event (internal/eventbus is at-least-once PublishUnique) would double-fire a comment, a message, or a billed image generation.\n\nGrounded by a crew investigation pass (2026-09-03, further-investigation.md, not committed -- content folded into this ticket): read internal/eventbus's PublishUnique key computation and existing dedup surface, TaskEnvelope's idempotency key minting/consumption path, event-sources-and-reactions.md's decided contract (extend it, don't contradict it), and the CEL context surface in internal/domain/eda/expr (event/actions fields available for key derivation).","design":"Design-decide and write into eda-playbook-engine.md:\n1. Granularity: one idempotency key per trigger-event + playbook (whole run dedups) vs per-action key derived from the run key. The doc's stated bias is the former unless a specific action needs finer dedup -- turn that bias into a stated decision.\n2. Where the key lives: does a playbook run get its own envelope/context carrying the key, and how does it reach the target position's invocation (Module.Invoke, a future Channel/Forge call)?\n3. What 'dedup' does on redelivery: is the whole run skipped, or just the already-fired action? What gets recorded?\n\nSTRONG REUSABLE PRECEDENT FOUND IN THIS CODEBASE (verified directly, 2026-09-03) -- do not design a new ledger without reading this first: internal/store/bindings.go already implements exactly this shape for playbook bindings. binding_dispatches table, unique on (binding_id, capture_id), written via RecordDispatch's 'INSERT OR IGNORE' -- a duplicate insert returns the sentinel ErrAlreadyDispatched, which dispatchBindings (internal/daemon/daemon.go:479) treats as a normal 'another cycle raced us' outcome, not an error. This is a proven, tested, at-most-once dispatch guarantee across cycles AND daemon restarts, for the exact same kind of problem (don't re-fire a binding for a capture it already dispatched). The playbook-run idempotency key almost certainly should reuse this exact pattern: a new ledger table (or a generalization of binding_dispatches) keyed on (playbook_id, event_id) or (playbook_id, trigger_event_identity), written with the same INSERT OR IGNORE + sentinel-error convention. Read internal/store/bindings.go:29-61,351-378 and internal/daemon/daemon.go:479-514 before designing anything -- this may reduce gap 2 to 'apply the existing pattern to a new key shape' rather than new design.\n4. Key derivation: a CEL-reachable expression over event fields, or a stable hash of event-identity+playbook-id -- pick one and justify it against the expr package's actual context surface, and against how capture identity is derived today (check what 'capture_id' actually is -- likely a stable hash or row id from the same capture pipeline a playbook trigger would also read).","acceptance_criteria":"eda-playbook-engine.md's Execution-time gap 2 section is marked resolved with a stated decision (not a survey of options) covering granularity, key storage/lookup, redelivery behavior, and key derivation. Consistent with event-sources-and-reactions.md's existing idempotency contract -- explicitly states how it extends rather than contradicts it. No code changes required for this ticket to close.","notes":"Proposed resolution drafted 2026-09-03 in docs/prds/eda-playbook-engine.md, commit 99eaa7a -- reuses internal/store/bindings.go's binding_dispatches ledger shape. Explicitly marked 'awaiting Sam's sign-off,' not settled. Surfaced two concrete prerequisites while drafting: t2db.15's Playbook struct needs an ID/Version (doesn't have one), and DispatchInput needs a task identity threaded through (doesn't have one either) -- both stated honestly as blockers for implementation, not glossed over.","status":"open","priority":1,"issue_type":"task","owner":"sam@catlow.tech","created_at":"2026-09-02T18:12:13Z","created_by":"Sam Catlow","updated_at":"2026-09-02T20:29:54Z","dependencies":[{"issue_id":"archie-core-t2db.17","depends_on_id":"archie-core-t2db","type":"parent-child","created_at":"2026-09-02T18:12:13Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0}
{"_type":"issue","id":"archie-core-e7bo","title":"fix stale wfextract go:generate directive; audit pluginextract/secretextract drift","description":"Discovered 2026-09-03 while scoping archie-core-t2db.13 (Module position). Two separate, pre-existing issues, unrelated to the playbook engine work -- do not fix as a drive-by inside that ticket.\n\n1. internal/domain/workflow/wfextract/wfextract.go's //go:generate directive still targets 'github.com/samcharles93/archie-core/internal/workflow', a path that has not existed since the domain migration (7e896c9, 2026-08-07 - the package moved to internal/domain/workflow). The committed generated file was hand-patched at some point to import the new path, but the directive itself was never fixed. Net effect: 'go generate ./...' has been broken repo-wide (at least for wfextract) since that migration, silently, for anyone who hasn't tried running it.\n\n2. Running 'go generate ./...' anyway (to see what breaks) also produced real, substantive diffs in internal/plugin/pluginextract and internal/secret/secretextract's generated symbol tables -- new wrapper types (Host, Module) appearing that are NOT in the currently-committed, in-production symbol tables. This means the Yaegi plugin and secret-engine extension surfaces have been running against stale, incomplete generated symbol tables for an unknown period: interpreted plugin/secret-engine code may be unable to reference types it should have access to. This is a latent correctness gap with real blast radius on two extension surfaces, not cosmetic drift.","design":"Two-part fix, do not conflate:\n1. Fix wfextract's directive to point at internal/domain/workflow (matching what the generated file already imports). Verify 'go generate ./internal/domain/workflow/wfextract/...' now succeeds and produces output identical (or intentionally different, documented why) to what's committed.\n2. For pluginextract/secretextract: do NOT blindly regenerate-and-commit. First determine why they're stale (when did plugin.go/secret's Engine gain the types the fresh generation adds -- git log on internal/plugin/plugin.go and internal/secret's engine files vs. when the generated files were last touched) and whether any existing test exercises a Yaegi plugin/secret-engine referencing the missing types (if none does, that's itself a coverage gap worth noting). Regenerate, gofumpt, and add/confirm a test that would have caught the drift, before committing the regenerated symbol tables -- this is a correctness-sensitive change to two live extension surfaces and needs real verification, not a mechanical re-run.","acceptance_criteria":"'go generate ./...' completes without error across the whole repo. wfextract's directive matches its actual package path. pluginextract/secretextract regeneration (if done) is backed by a test demonstrating the previously-missing types are now reachable from interpreted code, and task check passes. No behavior change to existing plugins/secret engines that were already working (regression-tested, not assumed).","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-09-02T17:17:42Z","created_by":"Sam Catlow","updated_at":"2026-09-02T17:30:34Z","closed_at":"2026-09-02T17:30:34Z","close_reason":"Fixed and gate-verified as e3a20f6 (pushed to main). wfextract directive now targets internal/domain/workflow; 'go generate ./...' completes repo-wide. All four extract surfaces regenerated; nil-guards re-applied on interface wrappers (documented IMPORTANT note restated in wfextract package doc). Previously-missing symbols proven reachable from interpreted code: wfextract (Forger/Reviewer/Trees/routing loaders) and pluginextract (Host/Module/Manifest/NewHost/HostAPIVersion) via new reachability tests; secretextract exports were current (nil-guard drift only). Red-then-green verified: fresh regen wipes guards -\u003e guard tests panic -\u003e re-apply -\u003e pass. task check clean (113/113 UI, exit 0).","dependency_count":0,"dependent_count":0,"comment_count":0}
@@ -40,6 +43,8 @@
{"_type":"issue","id":"archie-core-q15y.2","title":"Use full-task NATS handoff for every autonomous workflow","description":"daemon.process currently runs workflow.Run locally unless a container pool exists, and NATS mode without containers uses per-stage requests. Make full-task taskrun request/reply the only production workflow path for both embedded and external brokers.","acceptance_criteria":"daemon.process never calls workflow.Run; every workflow task is sent once through the taskrun subject to a dedicated managed worker; task state/RPC/event behavior remains correct; regression tests fail against the old local branch.","notes":"Implemented full-task-only autonomous dispatch: archied parks before worktree access when the managed container pool or task transport is unavailable, acquires exactly one task-scoped worker, and sends exactly one full-task request. Removed daemon-local workflow execution state and persisted daemon-side park details atomically as Task.ParkReason. task check passes; scoped lint is clean; fresh adversarial re-review has zero findings.","status":"closed","priority":1,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-24T03:03:37Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:58:29Z","started_at":"2026-08-24T03:32:18Z","closed_at":"2026-08-24T06:58:29Z","close_reason":"Implemented in 7d69001 (fix(daemon): require full-task worker handoff); daemon.process parks instead of running locally. Verified: no workflow.Run in internal/daemon non-test code, enforced by daemon/architecture_test.go:75.","external_ref":"https://github.com/samcharles93/archie-core/issues/618","metadata":null,"dependencies":[{"issue_id":"archie-core-q15y.2","depends_on_id":"archie-core-q15y","type":"parent-child","created_at":"2026-08-24T03:03:37Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-q15y.2","depends_on_id":"archie-core-q15y.1","type":"blocks","created_at":"2026-08-24T03:03:51Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":2,"comment_count":0}
{"_type":"issue","id":"archie-core-q15y.1","title":"Expose embedded NATS securely to managed task containers","description":"Embedded NATS currently binds unauthenticated loopback, so task containers cannot use it. Give the daemon and task containers distinct reachable URLs for the same embedded listener, require generated per-start credentials, and wire Docker host/network reachability without exposing credentials in logs or config files.","acceptance_criteria":"Native archied can connect to embedded JetStream; managed agent containers can connect to the same listener; all connections require a cryptographically generated token; the listener is not exposed on ordinary LAN interfaces; lifecycle and container environment tests pass.","notes":"Implemented authenticated embedded NATS reachability for native archied plus managed Docker workers. Embedded NATS now generates a crypto token per start, binds the resolved local Docker bridge gateway when a pool is available, and freezes URL/token into worker env. Added bridge validation, cleanup ordering, config acceptance/guardrails, Docker-create seam tests, lifecycle/auth tests, and amended the architecture decision. task check passed; focused race passed; new-code lint 0; fresh adversarial re-review 0 findings.","status":"closed","priority":1,"issue_type":"feature","owner":"sam@catlow.tech","created_at":"2026-08-24T03:03:36Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:58:29Z","started_at":"2026-08-24T03:03:54Z","closed_at":"2026-08-24T06:58:29Z","close_reason":"Implemented in 5c4b599 (feat(nats): expose embedded broker to managed workers); per-start token, Docker bridge binding, frozen worker env. Verified landed on main.","external_ref":"https://github.com/samcharles93/archie-core/issues/619","metadata":null,"dependencies":[{"issue_id":"archie-core-q15y.1","depends_on_id":"archie-core-q15y","type":"parent-child","created_at":"2026-08-24T03:03:36Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":2,"comment_count":0}
{"_type":"issue","id":"archie-core-q15y","title":"Make NATS the sole autonomous workflow execution path","description":"Keep archied native on the host (systemd in the operator deployment) so interactive chat retains operator-authorized server access. Autonomous durable workflows must never execute their agent loop inside archied: embedded and external NATS both hand the complete task to a task-scoped archie-agent container.","design":"One execution architecture, two broker deployments. archied owns orchestration, state, forge credentials, worktree preparation, and optionally the embedded broker. A task-scoped archie-agent container owns the complete workflow and model/tool loop. Embedded NATS is authenticated and reachable only through the managed Docker host/network boundary; external NATS preserves current behavior.","acceptance_criteria":"No production configuration runs workflow.Run or agentloop in archied; embedded and external NATS use the same full-task container handoff; host-native chat authority is unchanged; installer and supported deployment profiles select the new topology.","status":"closed","priority":1,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-24T01:56:43Z","created_by":"Sam Catlow","updated_at":"2026-08-24T06:58:42Z","started_at":"2026-08-24T01:56:52Z","closed_at":"2026-08-24T06:58:42Z","close_reason":"All four children landed across 5c4b599, 7d69001, 157e99b, c978f10. Autonomous workflows now have exactly one production path: full-task core-NATS handoff to a task-scoped archie-agent container.","external_ref":"https://github.com/samcharles93/archie-core/issues/620","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-462t","title":"Fix component-aware /update installation","description":"The approved update snapshot is discarded before CommandInstaller, causing scripts/archie-update-install to build, back up, install, and rebuild both components even for gateway-only releases. Implement component-specific plans and runtime release stamping.","design":"Flow the freshly revalidated approved Snapshot into the installer contract. CommandInstaller exports explicit requested versions. The shell adapter treats those variables as the complete plan and records only affected components in rollback/report metadata.","acceptance_criteria":"Gateway-only, runtime-only, both, and no-op harness cases pass; only selected components are fetched/built/backed up/installed; image builds only for runtime with an explicit non-dev release stamp; rollback/report metadata stays correct; task check passes.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-23T15:56:26Z","created_by":"Sam Catlow","updated_at":"2026-08-23T16:18:38Z","started_at":"2026-08-23T15:56:27Z","closed_at":"2026-08-23T16:18:38Z","close_reason":"Implemented and verified in commit 881bba2; linked GitHub issue #606.","external_ref":"https://github.com/samcharles93/archie-core/issues/606","labels":["bug","in-progress"],"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-tzzn","title":"Fix Telegram tool progress and project context UX","description":"Investigate and fix Telegram tool-call rendering so progress is compact, cleaned, bounded, and failure-aware without raw schema placeholders; ensure chat/task tool context roots at the actual configured project/worktree; add regression tests for rendering, truncation/offload, context root, and failures; run gates and deploy runtime changes.","acceptance_criteria":"Telegram progress is readable and Telegram-safe; oversized tool output is bounded or offloaded; task tools use the task worktree rather than unrelated home paths; malformed shell/input failures remain visible; targeted and full checks pass.","notes":"GitHub #604 reopened after PR #605. Building integration regression at the chat-stream → Telegram Bot API seam; tool-output budget is character/result-volume only, never token based.\nPR #608 (5d45633) on fix/604-telegram-tool-output-pipeline. Waiting on live Telegram verification after deploy; do not close until Sam confirms.","status":"in_progress","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-23T15:31:31Z","created_by":"Sam Catlow","updated_at":"2026-08-23T16:40:48Z","started_at":"2026-08-23T15:31:34Z","external_ref":"gh-604","comments":[{"id":"01a02f67-ae94-7c6b-95b2-2cfc761cbffc","issue_id":"archie-core-tzzn","author":"Sam Catlow","text":"Reopened after live deployment evidence: full source files and module-cache results are still exposed, output is quoted/escaped, repeated turn-budget failures continue, searches wander outside the active project, and failed shell probes remain noisy. The bounded wrapper alone did not meet acceptance criteria.","created_at":"2026-08-23T16:15:19Z"},{"id":"01a02f68-fdc9-7186-b054-6dd9ad18c576","issue_id":"archie-core-tzzn","author":"Sam Catlow","text":"Architecture correction from Sam: turn continuation must never be token-count based. The observed 200000-char failure is the aggregate tool-result character/output-volume cap. Fix via spill/offload/summarization and suppression of repeated oversized results; do not add token-based stopping.","created_at":"2026-08-23T16:16:45Z"},{"id":"01a02f7e-fcec-7d88-a36b-29bfbf9c161c","issue_id":"archie-core-tzzn","author":"Sam Catlow","text":"PR #608 opened at 5d45633. Telegram integration regression + turn-cap removal + workspace-only discovery. task check passed. Not deployed; live Telegram confirmation still needed.","created_at":"2026-08-23T16:40:47Z"}],"dependency_count":0,"dependent_count":0,"comment_count":3}
{"_type":"issue","id":"archie-core-1787489596754-17-3b1639d9","title":"[EPIC] Adversarial self-review before archie opens a PR","description":"Archie enforces gates on every PR it opens, but it does not run the adversarial review CLAUDE.md makes mandatory for every change in this repo: a fresh reviewer that did not write the code, told to assume every line is wrong, working a defined checklist, where a surviving finding blocks the work. It is the one discipline the project requires of its contributors and exempts itself from.\n\nWhy it matters, with evidence rather than assertion: on 2026-08-20/21 the update-verification change (PR #530) passed task check at every checkpoint -- exit 0, golangci-lint 0 issues, gofumpt clean -- and three adversarial passes still found six real defects, two of them blocking. A 'dev' version placeholder would have reported healthy updates as failures, and an 'unknown' install claim was still being worded as confirmed success. The gates were green throughout and would have stayed green. This is CLAUDE.md's own recorded lesson: tests catch behaviour that breaks, not behaviour that quietly starts meaning something else.\n\nArchie is unusually well placed to do this. It already runs each task in an isolated container and worktree, so it can spawn a reviewer that genuinely never saw the implementation -- not a second opinion from the same context pretending to be fresh, which is the failure mode of every single-context tool. The isolation boundary built for safety is what makes honest self-review possible.\n\nWhat the operator gets: a PR that arrives with a findings section -- what was checked, what was found, what was fixed, what survived. A surviving finding parks the task as waiting_human instead of opening a PR that looks ready and is not. Review shifts from hunting for bugs to adjudicating findings.\n\nThe risk that kills the feature is a reviewer that cries wolf. Findings must be adversarially confirmed before they surface, and the reviewer must be able to report zero findings on properties it checked and cleared. Calibration is the feature, not the finding count.","status":"closed","priority":1,"issue_type":"epic","created_at":"2026-08-23T12:22:20Z","updated_at":"2026-08-23T22:37:28Z","closed_at":"2026-08-23T22:37:28Z","close_reason":"Duplicate epic; canonical versions are archie-core-t2db (#541), archie-core-7d5u (#547), and archie-core-h019 (#552) with proper work breakdown","external_ref":"https://github.com/samcharles93/archie-core/issues/580","source_system":"github:https://github.com/samcharles93/archie-core/issues/580:580","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489596587-15-fdd1dcbd","title":"Findings contract: a structured review result the workflow can act on","description":"The reviewer's output must be data the workflow can branch on, not prose a human has to read to find out whether the PR is safe to open. Prose is what makes a review advisory; structure is what lets a finding block.\n\nDefine the finding type in the workflow domain (the domain declares the contract it needs; it never names who implements it). At minimum a finding carries: file and line, a one-sentence defect, a concrete failure scenario (inputs/state -\u003e wrong output), a verdict distinguishing CONFIRMED from PLAUSIBLE, and a disposition once acted on (fixed / skipped / no_change_needed).\n\nThe CONFIRMED/PLAUSIBLE split is load-bearing and must not be collapsed into a single boolean: only confirmed findings may block, or the feature degrades into crying wolf and the operator learns to skim past it.","status":"closed","priority":1,"issue_type":"feature","created_at":"2026-08-23T12:22:19Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/579","source_system":"github:https://github.com/samcharles93/archie-core/issues/579:579","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}
{"_type":"issue","id":"archie-core-1787489596676-16-d40037d5","title":"Design: adversarial self-review stage (one-page decision in docs/prds/)","description":"No settled design exists for this in docs/architecture/, so under the scope-discipline rule merged as PR #533 the design comes first -- briefly and decisively -- and is not finished until a diff follows it.\n\nDecide and record, in one page under docs/prds/: where the reviewer runs (reuse the per-task container pool, or a separate short-lived container); what it is given (diff plus originating issue, and explicitly what it must NOT be given); the findings contract and who owns the type; what a surviving finding does to the task lifecycle; and how the reviewer's model/effort is configured.\n\nConstraints from the repo that the design must respect: dependency direction is cmd -\u003e app -\u003e {domain, infrastructure}, so the reviewer contract belongs to the workflow domain and the execution to infrastructure/app. Agent execution is a data boundary. The model never runs git. Prefer environmental enforcement over prompt rules -- 'the reviewer cannot see the implementation' must be a property of how it is launched, not an instruction in its prompt.\n\nDo not write an architecture document, migration plan or review campaign. One page that decides.","status":"closed","priority":1,"issue_type":"decision","created_at":"2026-08-23T12:22:19Z","updated_at":"2026-08-23T22:39:29Z","closed_at":"2026-08-23T22:39:29Z","close_reason":"Duplicate; work tracked under canonical epic","external_ref":"https://github.com/samcharles93/archie-core/issues/578","source_system":"github:https://github.com/samcharles93/archie-core/issues/578:578","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}