Commit Graph
1404 Commits
Author SHA1 Message Date
sam 0064da1d2b feat(workintake): authorize review reactions by owned PR 2026-09-19 10:46:18 +10:00
sam d956959d39 feat(workintake): define review reaction envelope 2026-09-19 10:46:18 +10:00
sam 2809d58fee chore(release): archied v1.28.0 archie v1.28.0 2026-09-19 00:35:08 +00:00
sam 192369e98b Merge pull request #881 from samcharles93/fix/daemon-sweep-budget-diagnostics
fix(daemon): name an exhausted sweep budget as the cause
2026-09-19 03:38:55 +10:00
sam 568c872a50 Merge pull request #885 from samcharles93/refactor/ui-finish-preact-port
refactor(ui): finish the Preact port and delete the imperative DOM layer
2026-09-19 03:38:20 +10:00
sam b5e9831dea refactor(ui): finish the Preact port and delete the imperative DOM layer
The dashboard was a hybrid: a Preact page per route rendered into a shell
built by a hand-rolled el() helper. Every route was Preact and the shell was
not, which is why nothing failed -- the last of the vanilla layer was the
part that composed the app.

Removed:
- ui/src/base/dom.jsx -- el/append/mount, the unused pill/empty pair, and a
  statusKind re-export that duplicated task-meta for one caller
- ui/src/chat/chat-tools.jsx and the el-based bubble builders in
  chat-render.jsx: nothing in src/ called them, only their own tests did
- the chatPage() DOM bridge, which existed so an imperative shell could embed
  a VNode

Ported:
- base/icons.jsx: icon() -> <Icon>; the glyph path table stays data
- base/gauge.jsx, base/statTile.jsx, base/log-row.jsx: DOM builders ->
  components, with inline SVG instead of innerHTML
- base/format.jsx: ago/compact, which never were DOM
- chat/markdown.jsx: renderMarkdown() -> <ChatMarkdown>, so a streamed reply
  is diffed rather than rebuilt block by block
- main.jsx: shell, nav, jump-to search, theme and chat drawer are one App;
  pages still render into one long-lived outlet

Routing stays wired at import rather than from an effect. A page installs its
own hash-sensitive state as it mounts, and task detail writes its tab
selection back with replaceState as it settles: if the outgoing page is still
mounted when the hashchange lands it canonicalises the URL back to its own
route and the navigation is silently lost. The outlet and the two
navigation-owned pieces of chrome are published through a callback ref, which
runs at commit time, before any page effect.

Tests: dom.test.js (el) and chat-tools.test.js are gone. The statTile cases
in dom.test.js were not dropped -- they pinned the zero-value headline bug
that made fresh installs look broken, and moved to test/statTile.test.js
against the component. log-row and chat-markdown render their components.

ui/dist rebuilt: index.js 146977 -> 146010 bytes.

Closes archie-core-v9gv.2 and archie-core-v9gv.
2026-09-19 03:35:14 +10:00
sam 22a34eae13 Merge pull request #883 from samcharles93/docs/service-registry
Docs/service registry
2026-09-19 03:25:10 +10:00
sam 3b027a8670 fix(daemon): don't call a cancelled startup a spent sweep budget
ctx.Err() is non-nil for a parent cancellation as well as for the sweep
budget, so SIGINT/SIGTERM during the boot sweep logged "sweep budget
exhausted" with err="context canceled" -- an expected shutdown reported
as a failed sweep (Greptile P2 on #881).

Attribute on this sweep's own context instead: DeadlineExceeded is the
budget, any other non-nil context error means the startup was cancelled,
and neither is a repo access failure. A forge's own request timeout,
with the sweep context still live, still reports per repo.

RED before (cancelled parent, three repos):

    budget warnings = 1, want 0
    level=WARN msg="push check abandoned: sweep budget exhausted" repo=acme/one err="context canceled"
2026-09-19 03:10:46 +10:00
sam 73f019ea9f docs: correct the withdrawn State Store topology and the authority revision
Two of the three findings from review. The third had already been fixed by the
version of the service-registry PRD that landed on main.

1. docs/prds/state-store-contract.md §10 still prescribed the topology that was
   deleted when the State Store was extracted. It said an empty `Target` opens a
   local `*store.Store` adapter, and that the daemon's base path is that local
   store "already opened by openProductionTaskStore". Neither holds: the
   standalone archie-state-store process exclusively owns archie.db, and both
   archied and archie-gateway reject an empty target (bootstrap.go,
   state_store_client.go: "services.state.target is required").
   openProductionTaskStore still exists, but only inside that standalone process.
   Following the ratified section would have reinstated the deleted in-process
   ownership path. The config.example.toml bullet (which still advised adding the
   section with a COMMENTED target -- impossible to boot) and the "opposite
   default (local, not remote)" blockquote are corrected with it; the section is
   already present with the target uncommented and marked REQUIRED.

2. CLAUDE.md named the State Store authority rev. 2c while the contract itself is
   ratified at rev. 2d. AGENTS.md is a symlink to CLAUDE.md, so one edit covers
   both guides.

Not changed: the typo-visibility finding is already addressed by the PRD on main.
Its tracking name, unregisteredServiceKeys, is unimplemented in Go, so the runtime
diagnostic is still missing -- filed as archie-core-jp4g.
2026-09-19 03:07:38 +10:00
sam 1284cb69f6 docs(docsgen): drop a duplicated line in the obsoleteArtifacts comment 2026-09-19 03:07:38 +10:00
sam f1f7745001 fix(config): clone the Services map so an overlay cannot mutate the published snapshot
Config.Clone deep-copies every reference-type field except Services, which became a
map[string]ServiceConnection. A value copy shares the map header, and yaml.Unmarshal
writes keys into whatever map it is handed -- so Loader.ApplyOverlay, which clones
precisely so it cannot corrupt the base document, rewrote the published snapshot in
place:

  ApplyOverlay(doc, {"services": {"state": {"target": "10.0.0.5:9090"}}})
  left doc.Config.Services["state"].Target changed

That defeats the reason Clone exists: a failed or partial overlay must not alter the
configuration still being served.

Red: TestConfigCloneDeepCopiesReferenceFields failed with "Services map is shared"
after the case was added; green with the one-line clone.
2026-09-19 03:07:14 +10:00
sam 369dfdf550 fix(config): stop a partial overlay clearing the fields it omits
An overlay or dashboard PATCH naming only some fields of a map-valued config entry
silently zeroed the rest. For [services.<name>] that meant losing the bearer token,
so changing a State Store endpoint dropped its authentication:

  start   Services{"state": {Target: "127.0.0.1:50051", TargetToken: "secret"}}
  overlay {"services": {"state": {"target": "10.0.0.5:50051"}}}
  result  Services{"state": {Target: "10.0.0.5:50051", TargetToken: ""}}

Cause: ApplyOverlayValues did yaml.Marshal(overrides) then yaml.Unmarshal into cfg.
yaml gives a struct FIELD the field-level treatment the doc comment promises, but a
map VALUE is decoded into a fresh zero value, so an entry the overlay only partly
addresses loses every field it does not name. That contract was written when
Services was a struct; making it map[string]ServiceConnection changed the behaviour
underneath it.

Fix at the producer: fold the fields the overlay omits forward out of the entry cfg
already holds, so the decoder is handed a complete entry. Recursion follows the
destination type, so the promise now holds for every map of structs -- services,
image.hosted, image.local and providers -- in one place instead of at each field's
reader. Struct field-level merge, scalar-valued map-key merge and slice replacement
are unchanged, and overrides is read, never mutated.

The regression test also converts to the map form, which is what unbreaks the build:
apply_test.go still built Services with the struct form after services.go became a
map, and because the two live in different files the breakage merged cleanly. There
is no Go build or test CI, so nothing compiled it.

Red: four cases failed with the token, the target and the sibling fields zeroed.
Green after the fold.
2026-09-19 03:07:14 +10:00
sam 2385e81066 Merge pull request #878 from samcharles93/feat/attempt-attribution
Feat/attempt attribution
2026-09-19 02:48:25 +10:00
sam 8be730976f Merge pull request #879 from samcharles93/fix/docs-ci-and-overlay-coverage
fix(ci): unbreak the docs workflow, and cover nested config-overlay merge
2026-09-19 02:41:37 +10:00
sam 9484eeb0bb Merge pull request #880 from samcharles93/chore/dead-chat-modules
chore(webui): delete the chat modules orphaned by the Preact refactor
2026-09-19 02:40:55 +10:00
sam 08e16c82be fix(daemon): name an exhausted sweep budget as the cause
sweepAccess spends one sweepTimeout budget on a forge's whole boot
sweep. When that budget ran out mid-loop, every remaining repo was
warned as "repo not pushable -- tasks from it will fail" -- asserting
that access had been denied when all that was known was that the
deadline passed, once per repo.

Report the budget once, name it as the cause, and stop: later calls
return the same deadline error, so continuing only multiplies a
misleading warning.

RED before (three repos, budget exhausted by the first):

    VerifyPush calls = 3, want 1
    "sweep budget exhausted" logged 0 times, want 1
    level=WARN msg="repo not pushable  --  tasks from it will fail" repo=acme/one err="context deadline exceeded"
    level=WARN msg="repo not pushable  --  tasks from it will fail" repo=acme/two err="context deadline exceeded"
    level=WARN msg="repo not pushable  --  tasks from it will fail" repo=acme/three err="context deadline exceeded"
2026-09-19 02:31:28 +10:00
sam 5a3712ffc0 chore(webui): delete the chat modules orphaned by the Preact refactor
Five files survived the Preact chat cutover with no production consumer:

- ui/src/chat/chat-view.jsx, chat-catalog.jsx, chat-panels.jsx: zero importers
  anywhere in ui/src or ui/test.
- ui/src/chat/chat.html: referenced only by chat-view.jsx, itself orphaned.
- ui/src/chat/chat-stream.jsx: imported only by ui/test/chat-markdown.test.js.
  Its updateStreamingReply helper swaps a rendered Markdown node into the DOM --
  the imperative hyperscript pattern the Preact port replaced.

Corroborating evidence that these were already outside the build graph: a full
"task ui" rebuild after deleting them produced NO change to the committed
ui/dist bundle, so tree-shaking had already excluded all five.

ui/test/chat-markdown.test.js loses only the case that exercised the deleted
module. Its two renderMarkdown cases stay, because renderMarkdown is live --
ui/src/chat/chat-render.jsx and chat.jsx both call it.

Not touched: chat.jsx, chat-render.jsx, chat-retry.jsx, chat-state.jsx,
chat-tools.jsx, chat-update-status.jsx, markdown.jsx -- each still has at least
one importer, so none of them is an orphan.
2026-09-19 02:30:51 +10:00
sam 86bbc468c9 test(daemon): prove a stalled forge cannot block a sibling sweep
sweepAccess sweeps each forge in its own goroutine, but nothing pinned
that: the table test asserts coverage, not ordering, so the sweep could
be made sequential again without a failure.

The test stalls the root forge in AcceptInvitations and asserts the
sibling identity is swept while it is still blocked, then that Startup
returns once the stall is released. Verified RED against a sequential
sweepAccess (times out waiting for the sibling) and GREEN against the
goroutine-per-forge implementation.
2026-09-19 02:28:20 +10:00
sam 51a4177a48 fix(webui): remount the task detail page when the task id changes
Code review on this PR: navigating from one /tasks/:id route to another keeps the
previous task's data. The router renders pages with Preact's own render() into
one long-lived outlet (main.jsx show()), and taskDetailPage returned
RunDetail with no key, so the same element was diffed in place and never
remounted. Every task-scoped read lives in a useEffect with empty deps and the
open tab and pinned attempt are useState initialisers, so all of them ran once
for the first task and the new task was rendered against another task's reads:
run history, events, open tab, pinned attempt, and the log/change/debug caches.

RunDetail's own comment already asserted "the route remounts it when that
changes" -- the remount it relied on never happened. Keying by id makes it happen.

Keying rather than resetting is deliberate: RunDetail holds 14 pieces of
task-scoped state, and a hand-rolled reset must name every one and silently
regresses when a fifteenth is added. A remount is exhaustive by construction.

Preact 10.29.8 wraps render() in a Fragment and diffs children by key, so a
changed root key unmounts and mounts fresh; both regression tests were shown to
fail without the key.

Tests: component-level (two task ids rendered into one shared host, mirroring the
router's outlet) and router-level through the real show() path.
2026-09-19 02:26:23 +10:00
sam 22afccbc0b Merge pull request #873 from samcharles93/fix/restart-command-wiring
fix(chat): remove unreachable Telegram-router restart wiring
2026-09-19 02:25:52 +10:00
sam 66728eadb0 Merge pull request #874 from samcharles93/fix/per-identity-boot-sweep
fix(daemon): sweep the root forge and every identity at startup
2026-09-19 02:25:27 +10:00
sam 63d7501cfb test(config): pin that a partial overlay preserves omitted nested fields
ApplyOverlayValues documents that "only the keys present are replaced, every
field the overlay omits keeps its existing value". That promise was only tested
one level deep (budgets.max_steps); it was untested two levels deep into a
struct of structs, which is the shape config.Services has.

The concrete risk being pinned: an overlay that changes only
services.state.target must not clear target_token, because dropping the token
silently removes authentication for a non-loopback State Store.

All three cases pass, so the behaviour is correct as written and no production
change is warranted. This test is a regression guard on the depth that matters.
2026-09-19 02:24:38 +10:00
sam 5a00cdf46b fix(ci): stop the docs workflow failing on a missing pip manifest
.github/workflows/docs.yml runs actions/setup-python@v6 with cache: pip. That
option hashes a requirements.txt or pyproject.toml to build the cache key and
fails outright when neither exists:

    ##[error]No file in ... matched to
            [**/requirements.txt or **/pyproject.toml]

This repository is Go and has no Python manifest, so the step failed as the
first step of every run triggered by the workflow's pull_request paths: docs/**
filter. mkdocs build --strict therefore never executed: docs changes were not
being verified, and every docs-touching PR was reported as a build failure. It
only surfaced on #878 because #878 touches docs/architecture/; PRs that do not
touch docs report no checks at all.

Drop cache: pip. The only Python use is a single `pip install mkdocs-material`,
so there is nothing worth caching.
2026-09-19 02:24:37 +10:00
sam cae63b37c4 Merge pull request #875 from samcharles93/feat/archie-reactions-stream
feat(nats): provision the ARCHIE_REACTIONS fan-out stream
2026-09-19 02:22:29 +10:00
sam 267de032de fix(chat): remove unreachable Telegram-router restart wiring
Review fix for PR #873. The previous attempt wired Router.Restart on the
Telegram router, but that path is unreachable: telegram.go:260 registers an
exact-match /restart handler (restartHandler, restart.go:24) which consumes the
update before the chat router is reached.

The wiring was therefore a false affordance: it made the Telegram router report
RestartAvailable: true for a callback no production path invokes, and the test
only passed because it assembled a LocalChatAdapter by hand rather than driving
the composition production uses.

Remove it. Telegram's own restartHandler remains the sole path to
RequestRestart. The removals of boot.restartTelegram and
telegramSetup.RegisterRestart stand: those were written and never read, which is
the real defect (channels-telegram-3).

Tests are retargeted and table-driven: buildTelegramRouter leaves Restart nil
with and without an adapter (regression guard against re-adding the unreachable
wiring), the router's /restart route reports not-configured, and
RequestRestart's queue-then-reject contract is pinned at the adapter level.

This deliberately does NOT fix dashboard /restart: the web router runs in the
archie-gateway process while the Telegram adapter runs in archied, and no
gateway->daemon restart RPC exists. That needs its own design (see the bead
referenced in the PR body).
2026-09-19 02:17:59 +10:00
sam 8a5e99832f fix(nats): bound the ARCHIE_REACTIONS stream by age
Review fix for PR #875. ARCHIE_REACTIONS is provisioned under LimitsPolicy,
which retains every message until a limit is reached. With no limit configured,
acknowledged reactions accumulated without bound and continuous traffic could
grow the stream until it exhausted disk.

nats.Config gains MaxAge *time.Duration, using the same pointer form as
Retention so "unset" (nil) is distinguishable from an explicit zero. It is
applied to the stream config only when set, so every existing caller keeps its
current behaviour.

ARCHIE_REACTIONS sets MaxAge = 24h. A reaction is a producer-only wake event
whose authoritative state is re-read at pass time, so a dropped reaction delays
work until the next poll (default 60s) rather than losing it; 24h tolerates a
consumer down for a full maintenance window and matches the package's existing
DefaultInactiveTTL.

ARCHIE_TASKS is deliberately left unbounded. It uses WorkQueuePolicy, which
discards a message on acknowledgement, so its size is bounded by outstanding
work; a limit there could discard a task that has not been delivered yet, which
is a worse failure than the disk risk. The table asserts that non-change.
2026-09-19 02:16:38 +10:00
sam 7df5279fb3 Merge pull request #876 from samcharles93/fix/flaky-ui-shutdown-deadline
fix(archieui): exit cleanly when graceful shutdown overruns its deadline
2026-09-19 02:13:59 +10:00
sam 01d2548476 test(archieui): make the shutdown regression test table-driven and bounded
Review fixes for PR #876. The production fix is unchanged; this reworks only
the test.

- Bound the wait for the handler-start signal and select on the request
  goroutine's error and on an early serve() exit, so a request that never
  reaches the handler fails promptly instead of hanging until the package-wide
  timeout.
- Restructure into a table, per AGENTS.md:256 / CLAUDE.md:256 ("table-driven
  tests against target behaviour"): a request that drains within
  ShutdownTimeout returns nil, and a request still in flight when it elapses is
  force-closed and still returns nil.

The overrun row was verified to fail against the previous
"return server.Shutdown(shutdownCtx)" and to pass against the approved
force-close. Both rows hold the request in flight deterministically, so no case
depends on machine load.
2026-09-19 02:12:27 +10:00
sam 648876b977 Merge pull request #877 from samcharles93/docs/messaging-sender-role-comment
docs(messaging): correct the Sender field's role-discrimination claim
2026-09-19 02:01:15 +10:00
sam b31e98bee5 fix(daemon): sweep the root forge alongside every identity
The per-identity sweep skipped the root forge and root repo list whenever
[[identities]] was configured, on the reasoning that Run never polls them
there. Polling is not the only way a task reaches a repo: dispatchBinding
enqueues with an empty identity, resolveBindingRepo falls back to the root
repo list, and forgeFor/repoFor resolve an empty identity to the root forge
and root repos. Root targets stay reachable in multi-identity mode, so they
stay worth verifying at boot.

Collapse both sweeps into one sweepAccess path over the root plus every
identity. Each forge is swept in its own goroutine under its own deadline:
Startup gates the gateways and the run loop and a forge client carries no
request deadline, so warning on a failed sweep isolated a failing sibling
but not a stalled one.

Test is table-driven over single-identity, multi-identity, and an identity
with no repos.
2026-09-19 02:00:23 +10:00
sam 4cb54ead00 Merge pull request #871 from samcharles93/docs/ratify-pr-review-remediation
docs(prds): ratify PR review remediation with amendments
2026-09-19 01:56:41 +10:00
sam e646e5e9d5 docs(messaging): correct the Sender field's role-discrimination claim
Message.Sender's doc comment asserted "role discrimination uses Role, never this
field", which the code contradicts: at the gateway wire boundary Role is
deliberately dropped and rebuilt from Sender via RoleForSender, and the wire
carries no role field at all.

The comment was wrong, not the code. gatewayrpc already documents the design
(values.go:28, server.go:152 -- "The wire carries no role; both sides derive from
... messaging.RoleForSender"), and RoleForSender's own comment states the rule.
Only the Sender comment disagreed, so it is corrected to say that Role is
authoritative in-process while Sender is preserved for the wire reconstruction,
history search, and transcript rendering.

Resolves .local/issue-tracker messaging-2. Doc-only: no behaviour change.
2026-09-19 01:53:52 +10:00
sam 2978191f21 Merge pull request #872 from samcharles93/feat/service-registry
feat(config): key services by name through a registry
2026-09-19 01:53:00 +10:00
sam c798f89a35 fix(archieui): exit cleanly when graceful shutdown overruns its deadline
The gate failed intermittently with "task: Failed to run task \"test\": exit
status 1" and a tailed log that hid the failing package. The package was
cmd/archie-ui, which sorts before internal/logging and so never appeared in the
visible tail.

Cause: serve() returned the error from server.Shutdown, which is
context.DeadlineExceeded whenever a request is still draining when
ShutdownTimeout elapses. That converted a normal load-induced overrun into a
non-zero process exit, and TestUIProcessServesTheDashboardAgainstLiveDependencies
asserts a clean exit after SIGTERM.

Fix at the producer, in serve(): on overrun, force-close the remaining
connections and report a clean shutdown. No timeout is lengthened, no retry,
skip or -p 1 is added, and the smoke test's assertion is untouched.

Reproduced under parallel build load: -count=30 on the suspect test produced the
exact shutdown-deadline signature once; after the fix, 30/30 pass with zero
occurrences. The new test drives the deadline path deterministically by holding
a request in flight rather than relying on machine load.
2026-09-19 01:51:11 +10:00
sam 33c6be185a feat(nats): provision the ARCHIE_REACTIONS fan-out stream
archie.reaction.* had no matching stream. bootstrap.go:501-502 bound only
ARCHIE_TASKS to archie.task.> under WorkQueuePolicy, so any publish to a
reaction subject made js.PublishMsg fail and the publisher saw a publish error
-- the reason a previously landed reaction producer would have answered HTTP 500
on every webhook delivery.

ARCHIE_TASKS must stay WorkQueuePolicy: under it a second consumer on an
overlapping filter subject silently receives nothing, which is the trap recorded
in CLAUDE.md. Reactions need the opposite property, so they get a second stream:

- workintake.SubjectReactionWildcard ("archie.reaction.>")
- nats.DefaultReactionStreamName ("ARCHIE_REACTIONS")
- nats.FanOutRetention(), a pointer helper so composition can select
  LimitsPolicy without importing the NATS SDK, since nil Retention already means
  WorkQueuePolicy and the zero value (LimitsPolicy) is a valid explicit choice
- a second nats.Connect in connectNATS carrying that stream, closed on failure
  and registered for shutdown cleanup

Red-then-green: TestConnectNATSCreatesReactionStream failed with "publish to
archie.reaction.* = nats: no response from stream, want it to land in
ARCHIE_REACTIONS" before the stream existed.

Step 1 of docs/prds/pr-review-remediation.md (bead archie-core-8li9.1).
2026-09-19 01:51:07 +10:00
sam f51ce148b9 fix(daemon): sweep every identity's forge and repos at startup
daemon.Startup ran the invitation sweep and push verification only against the
root forge and Cfg().Repos. In multi-identity mode Run branches to
runIdentities, where each identity polls its own forge and its own repo list --
so per-identity invitations were never accepted and per-identity repos were
never push-verified. A task from those repos failed later at dispatch instead of
warning at boot.

Startup now branches on len(d.Identities) and sweeps each identity through
sweepIdentity, which reuses id.Forge and id.Repos -- the same IdentityRunner
fields runIdentities and pollForIdentity already iterate, so there is no second
identity-to-forge mapping. One identity's forge outage cannot abort a sibling's
sweep: failures are logged as warnings, matching Run's stated failure-isolation
intent.

Red-then-green: TestStartupSweepsEveryIdentityForgeAndRepos failed with
"identity one AcceptInvitations = 0, want 1" (and both identities' repos empty)
before the change.
2026-09-19 01:51:03 +10:00
sam 559f07034b fix(chat): wire the Telegram adapter restart callback into the chat router
/restart could never work in production. boot.setupGateways captured the
Telegram adapter's restart callback into boot.restartTelegram, a field no code
ever read, so gateway.Router.Restart was nil in every composition:
handleRestartAdapter always answered "not configured" and LocalChatAdapter's
snapshot always reported RestartAvailable: false.

Fix at the producer: buildTelegramRouter assigns Router.Restart directly from
the adapter it already holds. The dead field and the telegramSetup.RegisterRestart
indirection are deleted rather than kept alive.

Red-then-green: TestBuildTelegramRouterWiresRestartCallback failed with
"router.Restart = nil, want the telegram adapter restart callback wired into the
router" before the change. TestBuildTelegramRouterRestartUnconfigured pins the
unchanged no-adapter behaviour, including the not-configured reply.
2026-09-19 01:50:41 +10:00
sam 987573443c fix(config): enforce the service context at registration
ServiceSpec.Context documented which addresses a service must end up with, but
nothing read it, so a typo'd context was accepted and meant nothing. Review
caught it as scaffolding that looked load-bearing.

RegisterService now validates it: an unknown context, or a hosted (server/both)
service registered with no default listen address, panics. Registrations come
from this repository's own init(), never from operator input, so an invalid one
is a programming error with no caller positioned to handle an error return, and
failing at process start beats a service binding where nobody dials.

Services.RequireTarget replaces the same check and message hand-written in
composeStateStoreClient and composeChatContract. An empty registered default
target is what declares a target operator-supplied, so the requirement belongs
to the registry rather than to each consumer. It stays a lazy check at
composition time rather than becoming load-time validation: a process that
never dials a service must still load a configuration that omits it.

The review's stated failure mode does not occur. A hosted service with an empty
listen does not reach net.Listen as an ephemeral port; resolveServiceListen
returns "no listen address" and archied refuses to start. The defect was the
inert field, not a silent bind.

Refs: archie-core-u23g
2026-09-19 01:50:25 +10:00
sam 37231d56bb docs(prds): pin review remediation identity to the resolved task 2026-09-19 01:48:53 +10:00
sam 280c97de7c docs(prds): ratify PR review remediation with amendments
Status moves to Decided. Six amendments, all found by measuring the draft
against the tree and against what PR #859 produced from it:

- Sequencing gains the reaction stream as step 1. The parent decision already
  requires ARCHIE_REACTIONS under LimitsPolicy and 7d5u.2 parameterised
  Retention for it, but no stream exists, so every publish to archie.reaction.*
  fails against no matching stream.
- The owned-task guard becomes its own step. The (owner, repo, pr_number)
  lookup it depends on does not exist: pr_number is written and never read in
  a WHERE clause, so it needs a store method, a StateStoreService RPC and an
  index.
- The producers move to the end. A producer built before its consumer and its
  guard publishes into nothing, and becomes an unguarded intake the moment a
  stream appears.
- Idempotency keys gain the reaction kind. Review IDs and review-comment IDs
  are independent forge sequences, so the bare id let the two collide.
- A review is the unit of remediation, never a comment. One review with eight
  inline comments would otherwise mean eight builder runs, eight gates and
  eight pushes to answer one review. Runs also serialise per task regardless
  of allow_concurrent.
- Only archie's own comments are excluded, not all bots'. The external review
  bot is the main source of findings on an archie-opened PR. Because that
  makes bot comments actionable, the exchange can run away between two bots
  with no human involved, so remediation rounds are capped by max_retries.

Withdraws the RepliesAfter citation: no such mechanism exists in the tree.
2026-09-19 01:11:01 +10:00
sam 121fbf730f Merge pull request #870 from samcharles93/fix/label-routing-and-triage-criteria
fix: restore kind routing for namespaced labels, and give triage real criteria
2026-09-19 00:35:05 +10:00
sam 678539e390 fix(workflow): require a workflow from triage when a code change is needed
The selection criteria alone left workflow optional and defaulted an omitted
or unrecognised value to implement, so a decide call could still skip the
decision and send an unsettled capability straight to the builder.

Omission is now a retryable rejection: CaptureTool gains RequiredWhenTrue, a
conditional requirement a flat RequiredFields entry cannot express, because
the close-without-change branch has no workflow to name and must not be made
to invent one. A rejected call is not recorded, so it does not consume
MaxCalls and the model retries with the field.

A value outside the enum now fails the stage rather than degrading to
implement: reaching OnResult with one means the model ignored its own schema.

Splits validateCaptureArgs into per-constraint checks (cyclop) and carries
the regenerated contracts.json.
2026-09-19 00:33:39 +10:00
sam 017f8e775f Merge pull request #869 from samcharles93/fix/ui-event-pump-retry-and-uptime-timer
fix: recover the UI activity feed and stop reaping released containers
2026-09-19 00:18:41 +10:00
sam 4e3e48ca76 feat(workflow): give triage criteria for choosing between workflows
The classify stage picked between implement, tdd and feasibility with no
stated criteria: the mission spent its guidance on needs_code_change and the
schema said only 'Which workflow fits best', with implement as the free
default for an omitted or unrecognised answer. Issue 813 was classified
implement on that basis.

Both surfaces now state what each workflow is for and say not to pick
implement merely because nothing else obviously fits. The mission moves to a
named triageMission so a test can assert the criteria reach the model.

Closes archie-core-s5ys
2026-09-19 00:17:44 +10:00
sam a73762d1e7 fix(workintake): match namespaced forge labels when routing by kind
labelKinds is keyed on bare strings, and this repo namespaces its labels
(type::feature, priority::medium), so KindsForLabels matched nothing and
every issue fell through kind routing to Route's triage fallback. Kind
routing has therefore never fired here: issue 813, a type::feature that
defaultKindWorkflows binds to feasibility, reached implement instead.

Labels now resolve to the value after the last '::'. The namespace is not
checked: bug/feature/bootstrap is specific enough that a label ending in one
means that kind whatever the tracker files it under.

Closes archie-core-tjoc
2026-09-19 00:17:44 +10:00
sam b38c14f6e1 fix(container): claim container teardown once instead of cancelling a timer
Timer.Stop cannot unwind a max-uptime callback that has already begun, so
cancelling still let the reaper and Release both stop and remove the same
container, which is the duplicate teardown and the misleading 'No such
container' warnings this was meant to remove.

Teardown is now claimed once per container: whichever of the two gets there
first talks to Docker and the loser skips to its own bookkeeping. Release
still claims after the grace period, so MaxUptime keeps biting during it.

Also table-drives the event pump priming cases, per the repo's test directive.
2026-09-19 00:13:36 +10:00
sam 0e1e5303ed fix(container): keep the max-uptime cap active during the grace period
The reaper was cancelled at the top of Release, before the grace-period
sleep, which let a container outlive MaxUptime by GracePeriod. MaxUptime is
documented as a cap from creation enforced regardless of task state, and a
grace period is task state, so the cancel belongs after the sleep.

Also asserts the disarmed reaper directly rather than only inferring it from
the absence of later Docker calls.
2026-09-19 00:06:26 +10:00
sam dedafd7d43 fix(container): cancel a container's max-uptime reaper on release
The timer stayed armed after Release removed the container, so an hour later
it stopped and removed an ID Docker had already forgotten and logged two
warnings that read like a failed teardown.
2026-09-18 23:59:40 +10:00
sam 13d32f34b0 fix(webui): retry event pump priming until the state store answers
archie-ui binds before archie-state-store is guaranteed to be listening, so
the first prime is routinely refused. PumpEvents returned on that error, which
left the activity feed history-only for the life of the process. Prime now
retries with capped backoff and gives up only when the context ends.

Orders archie-ui.service after archie-state-store.service as well, which
narrows the window without closing it: After= sequences the start, it does
not wait for the listener.
2026-09-18 23:59:40 +10:00
sam da4547e27c feat(config): key services by name through a registry
Services was a struct with one field per service, so each service's name was
stated three times: the field, the loader's defaulting branch, and every
consumer's field access. Adding one meant editing all three, and nothing
stopped them disagreeing. The drift was already there: stateStoreResolvedToken
and gatewayResolvedToken were identical apart from the env var each hard-coded.

Services becomes map[string]ServiceConnection, and RegisterService declares a
service once with the five fields it has. Everything that differs between
services is now an argument rather than a branch elsewhere: an empty registered
target means the operator must supply one, which is how services.state.target
stays required while the gateway's is defaulted, and the registered token env
var replaces the two copied resolvers with Services.ResolvedToken.

Defaulting iterates the registry, so a new service needs no loader edit.
Consumers read Services.Get(name).

Keeping a typo'd section reported took explicit work. [services.gatway] used to
land in toml.MetaData.Undecoded() because the struct had no such field; a map
decodes any section, so it would have loaded silently and left the daemon
dialing the default. unregisteredServiceKeys asks the registry which names are
real, and the test for it fails with an empty UnknownKeys when that check is
removed.

The TOML shape is unchanged, so no deployment profile, config.example.toml or
install.sh edit is needed.

Refs: archie-core-u23g
2026-09-18 23:32:36 +10:00