From 618e4c6dd18f3a2dece2899233452f63fa06fd4a Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sun, 23 Aug 2026 23:38:55 +1000 Subject: [PATCH] chore(beads): sync interaction log --- .beads/interactions.jsonl | 6 ++++++ .beads/issues.jsonl | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.beads/interactions.jsonl b/.beads/interactions.jsonl index 7e135bed6..6cc44c677 100644 --- a/.beads/interactions.jsonl +++ b/.beads/interactions.jsonl @@ -50,3 +50,9 @@ {"id":"int-5dbcbfe3c8952f34e98764ab2cbd8385","kind":"field_change","created_at":"2026-08-22T18:14:27.90016743Z","actor":"Sam Catlow","issue_id":"archie-core-mzok","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Release blockers fixed and pushed to main: ea76432 restored the media delivery result without reviving BasePlatformAdapter; ef2abd1 and bf72384 made the ClaimTurn regression isolate its intended race and yield between bounded SQLITE_BUSY retries. Full task check and fresh adversarial reviews passed."}} {"id":"int-c0a168ef2d814e50f8a7da0977803cf9","kind":"field_change","created_at":"2026-08-23T12:16:00.770399554Z","actor":"Sam Catlow","issue_id":"archie-core-1786748942540-18-9af78536","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Deprioritized: prompt-level fix landed in fba80e3 (archie-core-3jag/GH#524) covers the general overconfidence pattern. Not worth mechanical enforcement (postcondition checks, tool-result verification) unless this recurs — revisit with stronger prompting first if it does."}} {"id":"int-995acdba52b55d8b0e6672f6992776ae","kind":"field_change","created_at":"2026-08-23T12:23:14.012827011Z","actor":"Sam Catlow","issue_id":"archie-core-w35v","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Fixed: themed .wf-form input/select/textarea in workflows.css to match the dark theme."}} +{"id":"int-4efd5606f47f481644632143278c7467","kind":"field_change","created_at":"2026-08-23T12:58:06.612102627Z","actor":"Sam Catlow","issue_id":"archie-core-nln7","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Fixed: dashboard installs now get a ReportPath, and Server.Run relays/verifies/clears the phase-2 report on boot via a new KindUpdateReport SSE event. Adversarial review clean."}} +{"id":"int-8c5d7ad3a23429d7067aa61abb1663d8","kind":"field_change","created_at":"2026-08-23T13:18:03.290726019Z","actor":"Sam Catlow","issue_id":"archie-core-1786751948782-3-837a8fd0.1","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Fixed: archie-agent's build is now stamped (installtype + agentworker.Version), and it reports both back to the daemon in every taskrun.Response. daemon.AgentStatus records the latest observation; daemonRunningVersions includes the agent component once one lands. Adversarial review clean (one nice-to-have comment added)."}} +{"id":"int-ef61375b05a90bf9dd2556180d1415f8","kind":"field_change","created_at":"2026-08-23T13:28:53.602582269Z","actor":"Sam Catlow","issue_id":"archie-core-1786751948782-3-837a8fd0.2","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Fixed: Component gained InstallType/Reference, populated via Service.Enrich from installtype.Type() (daemon), observed AgentStatus (agent), and [nats] config (third-party). Adversarial review clean (one lint-consistency nit fixed: use config.NATSMode* constants instead of raw strings)."}} +{"id":"int-781cec687e88474013c495d0540b6cdd","kind":"field_change","created_at":"2026-08-23T13:33:21.1202539Z","actor":"Sam Catlow","issue_id":"archie-core-1786637490815-39-45528ea3","extra":{"field":"status","new_value":"closed","old_value":"open","reason":"Closed"}} +{"id":"int-00d1661f1d257b2236cbd4465f4c39ab","kind":"field_change","created_at":"2026-08-23T13:36:51.728538277Z","actor":"Sam Catlow","issue_id":"archie-core-1786751948782-3-837a8fd0.3","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"Fixed: GET /api/version + Configuration-page 'Update status' card, sourced from the InstallType/Reference/RunningVersions plumbing landed in .1/.2. Adversarial review found one real bug (Installed=='' with Available set incorrectly returned update_available instead of unknown) and one test gap (present-but-empty running-version map entry) -- both fixed, tests added, all green."}} +{"id":"int-3692dd90f21567b32a55aeea992fc247","kind":"field_change","created_at":"2026-08-23T13:36:52.845688289Z","actor":"Sam Catlow","issue_id":"archie-core-1786751948782-3-837a8fd0","extra":{"field":"status","new_value":"closed","old_value":"in_progress","reason":"All 5 design points landed: installtype package + fail-closed dispatcher + post-install Verify (3fb4857/c25799e, prior work), archie-agent build stamping + NATS status self-report (.1), Component.InstallType/Reference enrichment (.2), and GET /api/version + Configuration status block (.3). Each sub-issue passed an independent adversarial review pass."}} diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 334e71155..176da1cd6 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -40,7 +40,7 @@ {"_type":"issue","id":"archie-core-h019","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.","acceptance_criteria":"An implement-workflow task runs an adversarial review after gates pass and before the PR is opened; the reviewer provably cannot see the implementer's context; a surviving confirmed finding blocks PR creation and parks the task; findings and their disposition are visible on the PR and the dashboard.","status":"open","priority":1,"issue_type":"epic","owner":"sam@catlow.tech","created_at":"2026-08-21T13:02:17Z","created_by":"Sam Catlow","updated_at":"2026-08-22T09:25:15Z","external_ref":"https://github.com/samcharles93/archie-core/issues/552","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-3jag","title":"Chat/task agent persona is overconfident: presents unverified claims as verified, fabricates infrastructure details","description":"The chat assistant (archie, running via the Telegram/webui gateway) repeatedly\npresents unverified or fabricated information with false confidence, and only\nretracts it when directly challenged. This is a persona/system-prompt problem,\nnot a model quality problem -- reproduced on more than one underlying model.\n\nTwo concrete instances from a live Telegram transcript (2026-08-15):\n\n1. Fabricated infrastructure: asked \"are logs going anywhere else?\", the\n assistant invented an entire second log-shipping subsystem (\"Hermes\n gateway\") with specific fake file paths\n (/home/sam/.hermes/profiles/local-agent/logs/) that do not exist anywhere\n in archie-core, and stated it as verified fact (\"I confirmed the web UI\n token and task lifecycle messages are there\"). When challenged (\"Is there\n something in the codebase which tells you you're Hermes?\"), it admitted\n the paths were invented and carried forward from unrelated, unverified\n context.\n\n2. Overclaimed verification: asked \"Why did that last task fail?\", the\n assistant answered with a bulleted list explicitly labelled \"Verified\n details\" (attempt count, iteration count, token count, exact model name).\n When pressed with \"You checked it?\", it admitted the model name and\n change count were \"overstated\" -- i.e. it labelled unverified specifics as\n verified the first time, and only corrected itself under direct\n challenge.\n\nThe common shape: confident, specific claims presented as fact/verified\nfirst; a walked-back, hedged correction only appears after the user\nexplicitly challenges it. This erodes trust in every claim the assistant\nmakes about system state, since the default posture is confident assertion\nrather than \"I have/haven't actually checked this.\"","notes":"Root cause is believed to be the persona/system-prompt layer (internal/gateway/ BuildSystemPrompt + persona templates), not model selection -- reproduced across models per the reporter. Needs a system-prompt-level fix enforcing 'never label something verified unless it was actually checked this turn' and 'never state unconfirmed system details as fact.' Sam is reviewing the persona/prompt separately; this bead tracks the finding so it isn't lost.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-15T02:25:37Z","created_by":"Sam Catlow","updated_at":"2026-08-20T12:55:18Z","started_at":"2026-08-20T12:50:34Z","closed_at":"2026-08-20T12:55:18Z","close_reason":"Fixed in fix/persona-overconfidence (fba80e3): reworded core rule 1 and added rules 8/9 to the chat agent system prompt enforcing this-turn verification before labelling claims verified/confirmed.","external_ref":"https://github.com/samcharles93/archie-core/issues/524","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786756970855-1-72466b33","title":"worktree: retry fails on a dirty worktree left by an interrupted prior attempt","description":"## Problem\n\n`Manager.refresh` (`internal/worktree/worktree.go`) checks out the task's branch without `Force` before hard-resetting to base. If a prior attempt left uncommitted local changes in the worktree — a killed container, or a stage that edits files before ever reaching a commit — go-git's default checkout (`MergeReset` mode) can refuse to reconcile them, even when HEAD is already on the correct branch and the target commit hasn't moved.\n\nThat failure was then compounded by the fallback: the code assumed any checkout failure meant \"the branch doesn't exist yet in this worktree\" and retried with `Create: true`, which fails differently (and much more confusingly) since the branch *does* exist:\n\n```\ncheckout branch feat/1000000000000000-fix-github-issue-514-telegram-response-formatting-concatenat:\na branch named \"refs/heads/feat/1000000000000000-fix-github-issue-514-telegram-response-formatting-concatenat\" already exists\n```\n\n## Evidence\n\nReproduced directly against the actual broken worktree on a live deployment: `git status` showed a modified tracked file and an untracked file left over from an interrupted attempt, HEAD already correctly on the task branch. Retrying the task hit exactly the error above and parked again with the same unhelpful message, on every retry, since nothing about the state changes between attempts.\n\n## Fix\n\nAdd `Force: true` to both checkout attempts in `refresh`. This is safe unconditionally: `refresh` hard-resets to the base commit a few lines later regardless of what checkout leaves behind, so there is no scenario where discarding the working tree's local state here is wrong.\n\nRegression test: `TestPrepareRecoversFromADirtyWorktreeOnRetry` reproduces the exact production error (modified tracked file + untracked file, branch already checked out) and confirms retry now succeeds and correctly restores the tracked file to its base content.","status":"closed","priority":1,"issue_type":"bug","created_at":"2026-08-15T01:22:16Z","updated_at":"2026-08-15T01:22:38Z","closed_at":"2026-08-15T01:22:39Z","external_ref":"https://github.com/samcharles93/archie-core/issues/523","source_system":"github:https://github.com/samcharles93/archie-core/issues/523:523","metadata":null,"labels":["bug"],"dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0","title":"Embed install-type at build time; verify updates against actual running state, not installer exit code","description":"## Problem\n\n`/update` and `/version` currently trust whatever the operator's external `update_check_command`/`update_install_command` reports (`internal/releaseupdate/command.go`). Nothing verifies that the reported version actually matches what's running. This already produced a false success: `/update` reported `archied`/`archie-agent` both updated to `v1.9.0` (the release containing the #468 fix), and a task run immediately after still hit the exact pre-fix failure — see #468 and #511 for the full evidence trail.\n\nSeparately, Archie ships in multiple install shapes (systemd-managed binary, Docker container via compose, possibly others). Nothing today tells the update mechanism which shape a given running component actually is, so a wrong-path update (e.g. attempting a container-style update against a systemd-managed process) is possible and would currently fail silently or claim success incorrectly.\n\n## Design (researched against prior art: restic, Tailscale, Docker/kubectl version output)\n\n**1. Stamp install type at build/release time — never probe for it at runtime.**\nAdd a small cross-cutting `internal/installtype` package: `var channel = \"unknown\"`, read via `Channel() string`. Stamp the real value per release artifact with `-ldflags \"-X .../installtype.channel=systemd\"` (native binary build) or `=container` (Docker image build) — one line per build target in the existing release pipeline, since `archied` and `archie-agent` are already built as separate artifacts for their respective channels.\n\nPrecedent: restic strips its `self-update` subcommand entirely via a build tag for distro-packaged builds — the wrong path isn't just mislabeled, it's absent. Tailscale, despite runtime-detecting almost everything else, treats Docker as an unconditional \"no self-update, manage via image tag\" — even the most sophisticated self-updater in this survey doesn't try to be clever about containers.\n\n**2. Fail closed, never guess.** The `/update` dispatcher must refuse to proceed if `installtype.Channel() == \"unknown\"` or doesn't match what the install/check command expects, with a clear operator-facing message. No fallback path.\n\n**3. Verify after, don't trust the exit code.** After `Installer.Install` returns success, re-check the *actual* running reference (binary path + hash, or container image digest) against the target version, and only then report success to the user. This is the concrete fix for the false-success bug. Tailscale's `confirm()` does the equivalent version comparison before/after in its own updater.\n\n**4. Extend `releaseupdate.Component`** (`internal/releaseupdate/service.go`) with `InstallType string` and `Reference string` fields (e.g. `\"container\"`, `\"ghcr.io/samcharles93/archie-agent:1.9.0@sha256:...\"`), populated by each component: `archied` reads its own compiled-in value; `archie-agent` reports its own the same way (already has a channel back to the daemon over NATS for logs — extend for a status/version response); third-party dependencies Archie doesn't build (e.g. NATS) can't self-report, so their `InstallType`/`Reference` comes from the deployment profile (`deployments/*.toml`) rather than detection.\n\n**5. Surface per-component status** on the Configuration page and in `/version`, structured as one block per component: `{install_type, running_version, reference, latest_available, status}`, where `status` is an enum (`ok` / `update_available` / `drift` / `unknown`) — not a bare color, with the actual comparison (e.g. running digest vs. latest digest) visible on hover/expand. Modeled on `docker version`'s Client/Server nested-block convention, which `kubectl version` independently converged on too.\n\n## Relates to\n\n- #468 (the fix this update-verification gap let slip through undetected)\n- #511 (update command UX — this issue is the underlying mechanism that makes accurate progress/success reporting possible; #511 shouldn't report a nicer-looking version of a still-unverified claim)","notes":"2026-08-21: design point 3 committed as c25799e on branch fix/522-verify-update-took-effect (not pushed).\n\nReport.Verify(running) partitions every claimed component into Confirmed/Drift/Unverified. Ground truth is the relaying process's own compiled-in gatewayVersion. Telegram now has three wordings: confirmed, 'could not confirm which version is actually running', and 'Update did NOT take effect' with per-component detail. Placeholders 'unknown' (watchdog default) and 'dev' (unstamped build) are unverifiable, never versions. Agent stays Unverified by design and is named as unchecked in the success message.\n\nGate: task check exit 0, golangci-lint 0 issues, gofumpt clean. Three adversarial review passes; all findings fixed. Regression tests proven to fail against pre-fix code; every new guard mutation-tested.\n\nSTILL OPEN on this issue:\n- point 4: Component.InstallType + Reference fields on releaseupdate.Component\n- point 5: per-component status block {install_type, running_version, reference, latest_available, status} on the Configuration page and in /version\n\nSplit out: archie-core-nln7 (dashboard updates get no phase-2 report, so the new verification never runs for them).\n--notes=2026-08-21: design point 3 MERGED to main as 3fb4857 (PR #530, squash of c25799e). Verified merged main passes task check exit 0.\n\nReport.Verify(running) partitions each claimed component into Confirmed/Drift/Unverified against the relaying process's own compiled-in gatewayVersion. Telegram has three wordings: confirmed, 'could not confirm which version is actually running', and 'Update did NOT take effect' with per-component detail. 'unknown' (watchdog default) and 'dev' (unstamped build) are unverifiable, never versions. Agent is Unverified by design and named as unchecked in the success message.\n\nSTILL OPEN, this issue stays in_progress:\n- point 4: Component.InstallType + Reference fields on releaseupdate.Component\n- point 5: per-component status block {install_type, running_version, reference, latest_available, status} on the Configuration page and in /version\n\nDependency note: archie-core-nln7 no longer depends on this issue. Its real prerequisite was the verification machinery, which landed in 3fb4857; it does not need points 4 or 5, so the blocking edge was removed to stop it sitting out of bd ready for no reason.","status":"in_progress","priority":1,"issue_type":"feature","assignee":"Sam Catlow","created_at":"2026-08-14T23:55:31Z","updated_at":"2026-08-21T11:55:37Z","started_at":"2026-08-15T00:03:05Z","lease_expires_at":"2026-08-15T00:08:05Z","heartbeat_at":"2026-08-15T00:03:05Z","external_ref":"https://github.com/samcharles93/archie-core/issues/522","source_system":"github:https://github.com/samcharles93/archie-core/issues/522:522","metadata":null,"labels":["enhancement","webui"],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0","title":"Embed install-type at build time; verify updates against actual running state, not installer exit code","description":"## Problem\n\n`/update` and `/version` currently trust whatever the operator's external `update_check_command`/`update_install_command` reports (`internal/releaseupdate/command.go`). Nothing verifies that the reported version actually matches what's running. This already produced a false success: `/update` reported `archied`/`archie-agent` both updated to `v1.9.0` (the release containing the #468 fix), and a task run immediately after still hit the exact pre-fix failure — see #468 and #511 for the full evidence trail.\n\nSeparately, Archie ships in multiple install shapes (systemd-managed binary, Docker container via compose, possibly others). Nothing today tells the update mechanism which shape a given running component actually is, so a wrong-path update (e.g. attempting a container-style update against a systemd-managed process) is possible and would currently fail silently or claim success incorrectly.\n\n## Design (researched against prior art: restic, Tailscale, Docker/kubectl version output)\n\n**1. Stamp install type at build/release time — never probe for it at runtime.**\nAdd a small cross-cutting `internal/installtype` package: `var channel = \"unknown\"`, read via `Channel() string`. Stamp the real value per release artifact with `-ldflags \"-X .../installtype.channel=systemd\"` (native binary build) or `=container` (Docker image build) — one line per build target in the existing release pipeline, since `archied` and `archie-agent` are already built as separate artifacts for their respective channels.\n\nPrecedent: restic strips its `self-update` subcommand entirely via a build tag for distro-packaged builds — the wrong path isn't just mislabeled, it's absent. Tailscale, despite runtime-detecting almost everything else, treats Docker as an unconditional \"no self-update, manage via image tag\" — even the most sophisticated self-updater in this survey doesn't try to be clever about containers.\n\n**2. Fail closed, never guess.** The `/update` dispatcher must refuse to proceed if `installtype.Channel() == \"unknown\"` or doesn't match what the install/check command expects, with a clear operator-facing message. No fallback path.\n\n**3. Verify after, don't trust the exit code.** After `Installer.Install` returns success, re-check the *actual* running reference (binary path + hash, or container image digest) against the target version, and only then report success to the user. This is the concrete fix for the false-success bug. Tailscale's `confirm()` does the equivalent version comparison before/after in its own updater.\n\n**4. Extend `releaseupdate.Component`** (`internal/releaseupdate/service.go`) with `InstallType string` and `Reference string` fields (e.g. `\"container\"`, `\"ghcr.io/samcharles93/archie-agent:1.9.0@sha256:...\"`), populated by each component: `archied` reads its own compiled-in value; `archie-agent` reports its own the same way (already has a channel back to the daemon over NATS for logs — extend for a status/version response); third-party dependencies Archie doesn't build (e.g. NATS) can't self-report, so their `InstallType`/`Reference` comes from the deployment profile (`deployments/*.toml`) rather than detection.\n\n**5. Surface per-component status** on the Configuration page and in `/version`, structured as one block per component: `{install_type, running_version, reference, latest_available, status}`, where `status` is an enum (`ok` / `update_available` / `drift` / `unknown`) — not a bare color, with the actual comparison (e.g. running digest vs. latest digest) visible on hover/expand. Modeled on `docker version`'s Client/Server nested-block convention, which `kubectl version` independently converged on too.\n\n## Relates to\n\n- #468 (the fix this update-verification gap let slip through undetected)\n- #511 (update command UX — this issue is the underlying mechanism that makes accurate progress/success reporting possible; #511 shouldn't report a nicer-looking version of a still-unverified claim)","notes":"2026-08-21: design point 3 committed as c25799e on branch fix/522-verify-update-took-effect (not pushed).\n\nReport.Verify(running) partitions every claimed component into Confirmed/Drift/Unverified. Ground truth is the relaying process's own compiled-in gatewayVersion. Telegram now has three wordings: confirmed, 'could not confirm which version is actually running', and 'Update did NOT take effect' with per-component detail. Placeholders 'unknown' (watchdog default) and 'dev' (unstamped build) are unverifiable, never versions. Agent stays Unverified by design and is named as unchecked in the success message.\n\nGate: task check exit 0, golangci-lint 0 issues, gofumpt clean. Three adversarial review passes; all findings fixed. Regression tests proven to fail against pre-fix code; every new guard mutation-tested.\n\nSTILL OPEN on this issue:\n- point 4: Component.InstallType + Reference fields on releaseupdate.Component\n- point 5: per-component status block {install_type, running_version, reference, latest_available, status} on the Configuration page and in /version\n\nSplit out: archie-core-nln7 (dashboard updates get no phase-2 report, so the new verification never runs for them).\n--notes=2026-08-21: design point 3 MERGED to main as 3fb4857 (PR #530, squash of c25799e). Verified merged main passes task check exit 0.\n\nReport.Verify(running) partitions each claimed component into Confirmed/Drift/Unverified against the relaying process's own compiled-in gatewayVersion. Telegram has three wordings: confirmed, 'could not confirm which version is actually running', and 'Update did NOT take effect' with per-component detail. 'unknown' (watchdog default) and 'dev' (unstamped build) are unverifiable, never versions. Agent is Unverified by design and named as unchecked in the success message.\n\nSTILL OPEN, this issue stays in_progress:\n- point 4: Component.InstallType + Reference fields on releaseupdate.Component\n- point 5: per-component status block {install_type, running_version, reference, latest_available, status} on the Configuration page and in /version\n\nDependency note: archie-core-nln7 no longer depends on this issue. Its real prerequisite was the verification machinery, which landed in 3fb4857; it does not need points 4 or 5, so the blocking edge was removed to stop it sitting out of bd ready for no reason.","status":"closed","priority":1,"issue_type":"feature","assignee":"Sam Catlow","created_at":"2026-08-14T23:55:31Z","updated_at":"2026-08-23T13:36:53Z","started_at":"2026-08-15T00:03:05Z","closed_at":"2026-08-23T13:36:53Z","close_reason":"All 5 design points landed: installtype package + fail-closed dispatcher + post-install Verify (3fb4857/c25799e, prior work), archie-agent build stamping + NATS status self-report (.1), Component.InstallType/Reference enrichment (.2), and GET /api/version + Configuration status block (.3). Each sub-issue passed an independent adversarial review pass.","external_ref":"https://github.com/samcharles93/archie-core/issues/522","source_system":"github:https://github.com/samcharles93/archie-core/issues/522:522","metadata":null,"labels":["enhancement","webui"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786749700606-6-bf6aa32d","title":"agent containers: push fails with 'permission denied' reading .git/objects, distinct from #468","description":"## Problem\n\nTask `#445` (daemon: label dispatch trigger) parked at the `commit-push` stage with:\n\n```\npush fix/445-daemon-label-dispatch-trigger-with-empty-label-matches-every:\ngetting wanted object 295b030cc6face20f8a377e94076922c460576c1:\nopenat objects/29/5b030cc6face20f8a377e94076922c460576c1: permission denied\n```\n\nThis is a different failure mode than #468 (git's \"dubious ownership\" ownership *check*, resolved by `safe.directory`). Here git gets *past* whatever ownership check applies and fails on an actual filesystem permission bit when reading a loose object from the bind-mounted worktree's `.git/objects/`.\n\n## Why this is probably not fixed by #468\n\n`safe.directory` only tells git to trust a repo it doesn't own — it does not change the actual read/write permission bits on the files. If the object file was written by a process running as a different UID than the archie-agent container's process (e.g. daemon-side `worktree` package operations running as the host user, vs. the container process), a straightforward `openat ... permission denied` on a specific loose object is consistent with a UID mismatch on the bind mount that `safe.directory` does nothing for.\n\nNeither `Dockerfile` nor `docker-compose.yml` sets a `USER`/`user:` for the agent image, so the container should be running as root by default — worth confirming whether the deployment actually runs it as root (Docker `userns-remap` would explain root-inside behaving as an unprivileged UID on the host, which would produce exactly this symptom).\n\n## Ask\n\nConfirm the UID the archie-agent process actually runs as versus the UID that owns files under the worktree's `.git/objects/` on the host, and fix the mismatch (consistent UID, or `chown`/`chmod` the bind mount appropriately before handing it to the container).","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","created_at":"2026-08-14T23:18:58Z","updated_at":"2026-08-17T22:40:02Z","started_at":"2026-08-17T22:27:08Z","closed_at":"2026-08-17T22:40:02Z","close_reason":"Confirmed root cause: agent containers run as root (no USER in Dockerfile, no userns-remap anywhere in docker-compose.yml/internal/container/pool.go), so a commit the agent writes to the bind-mounted worktree lands owned by UID 0 on the host. The daemon later reads those same loose objects to push, running as its own non-root host user -- 'openat objects/../..: permission denied'. Fixed: containerEnv() now passes the daemon's own os.Getuid()/os.Getgid() as WORKTREE_UID/WORKTREE_GID; hybridTrees.Push (the single choke point before the push RPC) chowns the worktree back to that owner first. Adversarial review (fresh subagent) found one real bug in the first pass -- chownTree used os.Chown, which follows symlinks and fails on a legitimately-tracked-but-dangling symlink, which would have aborted a push that would otherwise have succeeded (worse than the original bug). Fixed with os.Lchown plus a regression test proving it against a dangling symlink. Full task check clean; all other review findings (full-tree walk cost, minor test-hygiene notes) were judged non-blocking by the reviewer.","external_ref":"https://github.com/samcharles93/archie-core/issues/520","source_system":"github:https://github.com/samcharles93/archie-core/issues/520:520","metadata":null,"labels":["bug"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786749700580-5-e3878224","title":"/stop does not kill an in-flight archie-agent NATS worker or its container — task keeps running","description":"## This is the most important finding from today's investigation.\n\n`/stop` is meant to be an emergency brake. It is not one: it reported success (\"🛑 Stopped task(s) #5\") while the task kept running, kept burning tokens, and kept flooding the logs with errors for at least the next 20+ minutes.\n\n## Root cause\n\n`/stop` → `Gateway.stopRunningTasks` → `router.Controller.StopRunning` (`internal/gateway/tasks.go:227`) → `Daemon.CancelRunningTasks` (`internal/daemon/running.go:114`) → `runningTasks.stopAll`, which cancels a `context.CancelFunc` registered in an in-process map (`internal/daemon/running.go:36-52`, populated by `Daemon.process` at `internal/daemon/daemon.go:800`).\n\nThat context governs only `archied`'s own orchestration goroutine for the task. In the NATS-dispatched execution model (`internal/app/agentworker`), the actual work happens in a **separate process** — the archie-agent worker — that pulled a stage request off NATS and is running it inside `handleSingleStageRequest` / `runMainLoopWithDelay` (`internal/app/agentworker/stage_loop.go`), driven by its own top-level context that has no connection whatsoever to the daemon's per-task cancel registry. Cancelling the daemon-side context does not reach it. There is currently no signal, subject, or mechanism by which `archied` can tell an already-dispatched archie-agent worker to stop.\n\nThis matches what was observed live: task `#1000000000000001` was reported stopped, remained `Working` in the dashboard 20+ minutes later, and its log showed 996 `handle failed err={}` entries in the minutes after the stop request — the worker was still very much alive and looping.\n\n## Expected behavior\n\n`/stop` (and task Cancel generally) should be a hard kill for both halves of the execution:\n1. `archied`'s own orchestration (already works, via the existing context cancellation).\n2. The archie-agent worker actually doing the work for that task.\n\n## Suggested fix\n\nContainers are per-task and Docker-managed by the daemon regardless of deployment shape (`internal/container/pool.go`). The most reliable \"dead in its tracks\" mechanism is for `/stop`/`Cancel` to kill the task's container directly via the Docker client the pool already holds, rather than relying on context propagation across a process boundary that current code has no way to cross. A NATS-side alternative (publish a cancellation event on a per-task subject that `stage_loop.go`'s loop checks between fetch and ack, or have the daemon revoke the task lease so the worker's next `Ack`/`Respond` fails) is a secondary/defense-in-depth improvement, but killing the container is what actually guarantees the work stops.\n\n## Related\n\nThe redelivery-storm behavior after a stop/nak (#517) and the swallowed error detail (#516) both make this worse in practice — an operator watching the logs after `/stop` sees hundreds of contentless error lines with no way to tell whether the stop is taking effect.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","created_at":"2026-08-14T23:18:46Z","updated_at":"2026-08-17T22:38:57Z","started_at":"2026-08-17T14:31:11Z","closed_at":"2026-08-17T22:38:57Z","close_reason":"Root cause found after Sam confirmed live testing still showed the task's in-flight tool calls/generation continuing tens of seconds to ~2 minutes after /stop reported success. internal/container/pool.go Release() always slept the configured GracePeriod and always used Docker's default ~10s graceful SIGTERM-then-SIGKILL timeout, even when the release was happening because the task's context had just been cancelled by /stop -- so a cancelled task's container (and the in-flight work inside it) could sit doing nothing for up to GracePeriod+~10s before actually dying. Fixed with a new releaseDecision(ctx, grace) helper: a cancelled ctx now skips the grace sleep entirely and requests an immediate SIGKILL (ContainerStopOptions.Timeout=0) instead of a graceful wait; a live ctx (normal completion) keeps the original behaviour byte-for-byte. Red-then-green with 3 new unit tests (internal/container/pool_test.go), task check clean, adversarially reviewed by a fresh subagent with zero blocking findings -- context-chain trace, Docker Timeout=0 semantics, and struct-equivalence for the unchanged path were all independently verified against the moby client source.","external_ref":"https://github.com/samcharles93/archie-core/issues/519","source_system":"github:https://github.com/samcharles93/archie-core/issues/519:519","metadata":null,"labels":["bug","gateway"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786749700549-4-d2331d9d","title":"dashboard: task timeline shows 'No events yet' for every task regardless of status or stage","description":"## Problem\n\nEvery task's expanded timeline on `/tasks` reads \"No events yet — This task has not recorded any transitions,\" regardless of status or how far the task progressed. Confirmed live across a `Working` task and multiple `Parked` tasks at different stages:\n\n- `#1000000000000001` — Working, implement/baseline, 20+ minutes in\n- `#1000000000000000` — Parked at implement/baseline (go build/VCS-stamp failure)\n- `#445` — Parked at tdd/commit-push (git push permission error)\n\nAll three show the identical empty-timeline message. This isn't isolated to the currently-stuck task — the timeline feature appears non-functional for the whole deployment, which means the dashboard's per-task \"what actually happened\" view (the thing an operator reaches for first when a task needs attention) carries no information at all.\n\n## Impact\n\nCombined with the logging defect in #516 (errors serialize to `{}`), this leaves an operator with almost no way to diagnose a stuck or parked task from the dashboard — no timeline, and the log detail that does exist is empty.\n\n## Ask\n\nFind where task transition events are supposed to be written (`store.Transition`, `d.emit(events.Event{...})`, etc.) versus what the timeline UI/API actually queries, and reconcile — either events aren't being persisted for these tasks, or the timeline endpoint is querying the wrong key/table.","status":"closed","priority":1,"issue_type":"bug","created_at":"2026-08-14T23:17:17Z","updated_at":"2026-08-15T00:35:51Z","started_at":"2026-08-15T00:03:04Z","closed_at":"2026-08-15T00:35:51Z","external_ref":"https://github.com/samcharles93/archie-core/issues/518","source_system":"github:https://github.com/samcharles93/archie-core/issues/518:518","metadata":null,"labels":["bug","webui"],"dependency_count":0,"dependent_count":0,"comment_count":0} @@ -60,7 +60,7 @@ {"_type":"issue","id":"archie-core-tb3a","title":"Fix streaming review blockers for inline tool calls","description":"Resolve the four evidence-gated findings in merged inline tool-call streaming: preserve the authoritative Telegram reply when final edits fail; keep Telegram network I/O off the model FullStream consumer and cancellable; correlate tool inputs with results and render a bounded redacted parameter summary; snapshot show_tool_calls per live reply to avoid reload races. Add regression tests for every path and run task check plus lint/race validation.","acceptance_criteria":"Regression tests fail on the merged implementation and pass after the fix. Final edit failure falls back to normal split delivery. Delta and ToolCall callbacks do not wait on Telegram HTTP and stop cancels in-flight rendering. Completed tool events include bounded redacted parameters correlated by tool-call ID. Reload cannot race an in-flight reply's show_tool_calls setting. task check passes, golangci-lint reports no new findings, and focused race tests pass.","notes":"Implemented in worktree /tmp/archie-core-tb3a on branch fix/archie-core-tb3a. Added cancellable async Telegram rendering, final edit failure fallback through normal split delivery, call-ID-correlated bounded conservative parameter summaries, atomic per-reply show_tool_calls snapshots, SSE/UI parameter rendering, rebuilt ui/dist, and regression tests. Validation: GOFLAGS=-buildvcs=false task check passed; golangci-lint --new-from-rev=HEAD ./... reported 0 issues; focused race suite passed; fresh adversarial reviewer reported PASS with zero findings. Plain task check is blocked in linked worktrees by Go VCS stamping exit 128, hence buildvcs override.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T18:05:35Z","created_by":"Sam Catlow","updated_at":"2026-08-14T15:07:36Z","started_at":"2026-08-13T18:05:39Z","closed_at":"2026-08-13T18:35:26Z","close_reason":"Completed and independently reviewed; worktree left uncommitted per conservative repository policy.","external_ref":"https://github.com/samcharles93/archie-core/issues/485","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-dzx","title":"Remove duplicate archie-agent safe.directory setup","description":"## Problem\\ncmd/archie-agent/main.go configures git safe.directory inline and then calls markWorktreeSafe, so startup writes the same global git configuration twice.\\n\\n## Scope\\nKeep markWorktreeSafe as the single tested production path and remove the older inline exec.Command block/import. Add regression coverage proving startup wiring has exactly one authoritative safe-directory call.\\n\\n## Acceptance\\n- archie-agent startup invokes markWorktreeSafe exactly once\\n- no second inline safe.directory command remains in main.go\\n- cmd/archie-agent tests and repository quality gate pass","acceptance_criteria":"Single tested safe.directory setup path remains; duplicate inline command is removed; tests and task check pass","notes":"Red proof: TestMainConfiguresWorktreeSafetyOnce failed with 2 setup paths before implementation. Green proof: go test/vet/build ./cmd/archie-agent/... passed; golangci-lint --new-from-rev=HEAD reported 0 issues. Fresh adversarial review found no blockers. Full task check was not run because the working tree contains unrelated in-progress changes and task check rewrites files; scoped package gate used per repository protocol.","status":"closed","priority":1,"issue_type":"bug","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-13T16:10:09Z","created_by":"Sam Catlow","updated_at":"2026-08-13T16:13:48Z","started_at":"2026-08-13T16:10:24Z","closed_at":"2026-08-13T16:13:48Z","close_reason":"Removed duplicate inline safe.directory setup; markWorktreeSafe is now the single tested production path","external_ref":"https://github.com/samcharles93/archie-core/issues/470","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0.2","title":"Add InstallType/Reference fields to releaseupdate.Component, populate from daemon/agent/deployment profile","description":"Part 2/3 of point 4 in archie-core-1786751948782-3-837a8fd0's design. releaseupdate.Component (internal/releaseupdate/service.go:35-41) has ID/Label/Installed/Available/Changelog but no InstallType or Reference fields. Add both, and populate: archied reads its own compiled-in installtype.Type(); archie-agent reports its own over the NATS status round-trip (depends on the sibling issue that adds that round-trip); third-party dependencies Archie doesn't build (e.g. NATS) can't self-report, so their InstallType/Reference should come from the deployment profile (deployments/*.toml) rather than detection -- add the relevant fields there. Reference is something like 'container' + 'ghcr.io/samcharles93/archie-agent:1.9.0@sha256:...', not just a bare install-type string.","status":"closed","priority":2,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-23T13:06:16Z","created_by":"Sam Catlow","updated_at":"2026-08-23T13:28:53Z","started_at":"2026-08-23T13:22:37Z","closed_at":"2026-08-23T13:28:53Z","close_reason":"Fixed: Component gained InstallType/Reference, populated via Service.Enrich from installtype.Type() (daemon), observed AgentStatus (agent), and [nats] config (third-party). Adversarial review clean (one lint-consistency nit fixed: use config.NATSMode* constants instead of raw strings).","labels":["enhancement","webui"],"dependencies":[{"issue_id":"archie-core-1786751948782-3-837a8fd0.2","depends_on_id":"archie-core-1786751948782-3-837a8fd0","type":"parent-child","created_at":"2026-08-23T23:06:15Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786751948782-3-837a8fd0.2","depends_on_id":"archie-core-1786751948782-3-837a8fd0.1","type":"blocks","created_at":"2026-08-23T23:06:19Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} -{"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0.3","title":"Surface per-component update status on Configuration page and /version","description":"Part 3/3, point 5 of archie-core-1786751948782-3-837a8fd0's design. Depends on the InstallType/Reference issue landing first -- there's nothing to surface otherwise. Add a /version endpoint and a per-component block on the Configuration page (internal/webui/api_config.go, ui/src/settings/), structured as {install_type, running_version, reference, latest_available, status} per component, where status is an enum (ok / update_available / drift / unknown) rather than a bare color. The actual comparison basis (e.g. running digest vs latest digest) should be visible on hover/expand, modeled on docker version's Client/Server nested-block convention per the original design doc.","status":"in_progress","priority":2,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-23T13:06:16Z","created_by":"Sam Catlow","updated_at":"2026-08-23T13:29:01Z","started_at":"2026-08-23T13:29:01Z","labels":["enhancement","webui"],"dependencies":[{"issue_id":"archie-core-1786751948782-3-837a8fd0.3","depends_on_id":"archie-core-1786751948782-3-837a8fd0","type":"parent-child","created_at":"2026-08-23T23:06:16Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786751948782-3-837a8fd0.3","depends_on_id":"archie-core-1786751948782-3-837a8fd0.2","type":"blocks","created_at":"2026-08-23T23:06:20Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0.3","title":"Surface per-component update status on Configuration page and /version","description":"Part 3/3, point 5 of archie-core-1786751948782-3-837a8fd0's design. Depends on the InstallType/Reference issue landing first -- there's nothing to surface otherwise. Add a /version endpoint and a per-component block on the Configuration page (internal/webui/api_config.go, ui/src/settings/), structured as {install_type, running_version, reference, latest_available, status} per component, where status is an enum (ok / update_available / drift / unknown) rather than a bare color. The actual comparison basis (e.g. running digest vs latest digest) should be visible on hover/expand, modeled on docker version's Client/Server nested-block convention per the original design doc.","status":"closed","priority":2,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-23T13:06:16Z","created_by":"Sam Catlow","updated_at":"2026-08-23T13:36:52Z","started_at":"2026-08-23T13:29:01Z","closed_at":"2026-08-23T13:36:52Z","close_reason":"Fixed: GET /api/version + Configuration-page 'Update status' card, sourced from the InstallType/Reference/RunningVersions plumbing landed in .1/.2. Adversarial review found one real bug (Installed=='' with Available set incorrectly returned update_available instead of unknown) and one test gap (present-but-empty running-version map entry) -- both fixed, tests added, all green.","labels":["enhancement","webui"],"dependencies":[{"issue_id":"archie-core-1786751948782-3-837a8fd0.3","depends_on_id":"archie-core-1786751948782-3-837a8fd0","type":"parent-child","created_at":"2026-08-23T23:06:16Z","created_by":"Sam Catlow","metadata":"{}"},{"issue_id":"archie-core-1786751948782-3-837a8fd0.3","depends_on_id":"archie-core-1786751948782-3-837a8fd0.2","type":"blocks","created_at":"2026-08-23T23:06:20Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1786751948782-3-837a8fd0.1","title":"Stamp archie-agent's install type and add NATS status round-trip","description":"Part 1/3 of point 4 in archie-core-1786751948782-3-837a8fd0's design. archied's own build is stamped with internal/installtype via -ldflags (Taskfile.yml:65, Dockerfile.archied:48-49), but archie-agent's build has no equivalent stamp -- Dockerfile:14 and Taskfile.yml:170 (agent build target) pass no -X installtype flag. Without it, an agent worker has nothing to self-report even once the daemon asks. Also add the NATS-side status/version request the daemon can send a running agentworker to get its install type + running version back (agentworker already has a NATS channel for logs; extend it for a status response rather than inventing a new transport). This is the prerequisite for archie-core-1786751948782-3-837a8fd0 point 4's 'archie-agent reports its own the same way' clause.","status":"closed","priority":2,"issue_type":"task","assignee":"Sam Catlow","owner":"sam@catlow.tech","created_at":"2026-08-23T13:06:14Z","created_by":"Sam Catlow","updated_at":"2026-08-23T13:18:03Z","started_at":"2026-08-23T13:06:41Z","closed_at":"2026-08-23T13:18:03Z","close_reason":"Fixed: archie-agent's build is now stamped (installtype + agentworker.Version), and it reports both back to the daemon in every taskrun.Response. daemon.AgentStatus records the latest observation; daemonRunningVersions includes the agent component once one lands. Adversarial review clean (one nice-to-have comment added).","labels":["enhancement","webui"],"dependencies":[{"issue_id":"archie-core-1786751948782-3-837a8fd0.1","depends_on_id":"archie-core-1786751948782-3-837a8fd0","type":"parent-child","created_at":"2026-08-23T23:06:14Z","created_by":"Sam Catlow","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"archie-core-w35v","title":"Workflows page 'Start work' form inputs unstyled (white boxes in dark theme)","description":"The Start work card on the Workflows dashboard page (ui/src/workflows/workflows.js renderStartWork) creates raw \u003cinput\u003e/\u003cselect\u003e/\u003ctextarea\u003e elements with no CSS class, so they fall back to browser default styling -- white background, black text -- against the rest of the dark-themed app. Every other form control in the app (e.g. Configuration's .kv-input in ui/src/settings/config-row.js) uses a themed class. Fix: style these form controls to match the app theme, either by reusing an existing input class or adding scoped rules in ui/src/workflows/workflows.css.","status":"closed","priority":2,"issue_type":"bug","owner":"sam@catlow.tech","created_at":"2026-08-23T12:22:59Z","created_by":"Sam Catlow","updated_at":"2026-08-23T12:53:38Z","closed_at":"2026-08-23T12:23:14Z","close_reason":"Fixed: themed .wf-form input/select/textarea in workflows.css to match the dark theme.","external_ref":"https://github.com/samcharles93/archie-core/issues/593","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"archie-core-1787489597262-23-f61d8b1b","title":"Docs: promote the shipped review stage into docs/architecture and reconcile CLAUDE.md","description":"Under the scope-discipline rule merged as PR #533, a design is promoted into docs/architecture/ only once it is built and true. This is that promotion, and it is deliberately a separate bead so it is not lost when the feature lands and attention moves on.\n\nDo three things once the stage ships:\n\n1. Promote the docs/prds/ decision into docs/architecture/, describing the review stage as it actually works -- not as designed. Cut anything a reader could learn from the code.\n2. Update ARCHITECTURE.md's task lifecycle: queued -\u003e running(workflow:stage) -\u003e pr_open -\u003e merged|rejected gains a review stage that can divert to waiting_human before pr_open. The current text does not mention it.\n3. Reconcile CLAUDE.md's Development Protocol. It currently tells a human or agent contributor to run the adversarial pass by hand. Once archied does this for the PRs it opens, that section needs to say which path applies to whom, or it will read as describing a manual step that is now automatic.\n\nCLAUDE.md's own rule: a comment or doc that contradicts its code is worse than none, because the next reader trusts it.","status":"open","priority":2,"issue_type":"task","created_at":"2026-08-23T12:22:29Z","updated_at":"2026-08-23T12:22:29Z","external_ref":"https://github.com/samcharles93/archie-core/issues/586","source_system":"github:https://github.com/samcharles93/archie-core/issues/586:586","metadata":null,"dependency_count":0,"dependent_count":0,"comment_count":0}