Commit Graph
1404 Commits
Author SHA1 Message Date
sam f4111e7208 docs(config): document chat.telegram.token_env in config.example.toml
TelegramConfig.TokenEnv was a real, used field with no example-file
mention -- an operator reading the template wouldn't discover the
key exists.
2026-09-02 20:44:37 +10:00
sam cc24b8f129 chore(beads): track minimax video.Provider adapter follow-up (archie-core-1y6y) 2026-09-02 20:36:25 +10:00
sam 45b183b325 docs(image): point the hosted-provider bead at ai-sdk's existing image facility
ai-sdk (already a dependency) has a provider-agnostic image.Provider,
core.GenerateImage, and registry.RegisterImage -- three backends
(azure/togetherai/xai) implement it, OpenAI doesn't yet. The next
bead should adapt that instead of a raw HTTP client, mirroring how
curatorLLMRunner adapts runtime.Runtime for chat. Noted the one real
gap (no edit/mask support in ai-sdk's request type) for that bead to
resolve at its own design step.
2026-09-02 20:23:14 +10:00
sam 75158b7fc7 feat(image): define provider-neutral image capability contract and config
Adds internal/domain/image (Provider/Registry per the plugin engine
family shape, but no Lifecycle -- a provider is call-scoped, not
long-running) and config.ImageConfig with the same explicit
enabled=true cost gate MinimaxConfig already uses, since a hosted
provider spends real API credits and a local one can saturate the
host GPU. Design doc at docs/prds/image-capability-contract.md per
CLAUDE.md's rule for undesigned capabilities.

No provider implementation lands here -- that's the epic's next
child bead. Also re-links all 7 epic children that were unlinked
from archie-core-1786748942120-1-6636e629 (same orphaning pattern
found in the curator/memory epics earlier this session).
2026-09-02 20:20:54 +10:00
sam 622961a875 fix(logging): propagate bound slog attrs to wrapped handler in FeedHandler
FeedHandler.WithAttrs/WithGroup only tracked bound attrs for the live
feed copy; Handle forwarded the bare record to the wrapped handler, so
component (and any other With-bound attr) never reached stderr/file
JSON sinks or survived restart for historical log filtering. Now
WithAttrs/WithGroup also derive the wrapped handler via its own
With*, matching agentexec.SystemLogHandler's existing pattern.
2026-09-02 19:45:42 +10:00
sam be21f5d0d0 Merge pull request #650 from feat/curator-and-other-components-arent-being-logged-or-shown-in
curator and other components aren't being logged or shown in the Web UI (archie)
2026-09-02 19:38:33 +10:00
samcharles93 d466fc80b0 curator and other components aren't being logged or shown in the Web UI (archie) 2026-09-02 04:00:05 +00:00
samcharles93 83dc672074 fix: baseline gate repair (go test ./... -count=1) 2026-09-02 03:53:40 +00:00
sam ee0f6c1327 chore(release): archied v1.19.10
deploy / gate (push) Failing after 3m43s
deploy / build-and-push (push) Skipped
2026-09-02 03:09:58 +10:00
sam 31d8181c39 chore(beads): close session-memory curator reference implementation 2026-09-02 03:09:23 +10:00
sam fc6bffad50 feat(curator): session-memory curator reference implementation
Closes archie-core-1786637499114 (persistent session-memory curator),
the last open item in the curator engine epic.

docs/prds/session-memory-curator.md records the decisions this needed
before coding, most notably: Observation.Identity is the session ID,
not a user or cross-session identity. migration-decisions.md#5's
memory-scope mapping (global/agent-wide/user-wide/agent-user
relationship) is still explicitly open, and this issue has no business
deciding it unilaterally -- session-as-identity is the narrowest
unambiguous scope available today and is forward-compatible with a
later, properly-decided identity resolution.

curator gains ConversationSource (RecentSessions/Messages), gated in
Registry.validateDeclared/filter exactly like Skills/MemoryEngines, plus
Manifest.Conversations. internal/infrastructure/sessioncurator/adapter.go
adapts gateway.SessionStore's full CRUD/branch/search surface down to
those two read-only methods -- curator must not import gateway.Message,
so role derivation (message.From == botUser -> assistant) is copied from
gateway.compressTurnHistory's existing logic, not shared.

sessioncurator.go: Check is a cheap RecentSessions bool. Pass takes each
session's last 40 messages, asks the model for a JSON array of durable
facts (capped at 5/session), and writes each through
Registrar.MemoryEngines.Get(name) -- resolved by name at call time, the
same trust model every other curator capability already uses. A
response that fails to parse degrades to "nothing extracted" for that
session (not a Pass error); a real model-call failure propagates as one
(these were originally conflated into the same swallowed-error path --
caught by TestPassPropagatesALLMFailure, fixed by splitting the model
call from the parse step). PassInput.Since zero resolves to a 24h
lookback, not the beginning of time, so a cold-start first pass can't
read a session's entire history.

Manifest.OnInput = true wakes it via the existing WakeOnPrimaryInput
wiring (events.KindTurnCompleted), which already excludes every
curator-derived event kind from the forwarded set -- the trigger-
accounting invariant (archie-core-1786637489768) needed no new code to
hold here.

Wired into bootstrap.go:setupCurators via a new curatorLLMRunner adapter
(main.go) over the shared ai-sdk runtime, and sessioncurator.NewAdapter
over b.chatSessionStore/b.cfg.BotUser. Model resolves from
b.chatModels.ActiveModel() -- not b.defaultChatIdentity, which names a
task-routing identity, not a model reference (the same source
telegram_setup.go's sendChatTurn already uses for a real chat turn).

task check is green (full Go suite + dashboard tests).
2026-09-02 03:09:04 +10:00
sam 71096f34d4 chore(release): archied v1.19.9 archie v1.19.9
deploy / gate (push) Failing after 2m44s
deploy / build-and-push (push) Skipped
2026-09-02 02:59:17 +10:00
sam 40ad32468b chore(beads): close skill curator reference implementation 2026-09-02 02:58:52 +10:00
sam 8164d21348 feat(curator): skill curator reference implementation
Part of archie-core-1786637499206 (skill curator reference
implementation), under the curator engine epic.

docs/prds/skill-curator.md records the design decision this needed
before coding (no settled design existed for what "review, prune, and
improve skill definitions" means as concrete Pass() behavior): v1 is
mechanical validation and safe whitespace normalization only. No
LLM-authored rewrites of skill content, no automatic deletion -- an
autonomous process editing or deleting a user's skill has no undo path
today, and the epic's actual purpose for this issue is proving the
curator contract holds for a second, structurally different consumer
(files-as-skills vs. observations-as-memory), not solving "what makes a
skill good."

internal/infrastructure/skillcurator/store.go: a curator.SkillStore
implementation over one root's .agents/skills/*/SKILL.md files. Not
internal/skill.Discover directly -- Discover parses every skill up front
and fails the WHOLE call if any one of them doesn't parse (correct for
"load the catalog to boot the daemon", wrong for "review each skill and
report what's wrong with it individually"). This store lists/reads raw
bytes per skill; the curator itself parses each one so one bad skill's
parse failure becomes one Action, not an aborted pass.

internal/infrastructure/skillcurator/skillcurator.go: the CuratorEngine.
Check is a cheap directory-listing bool. Pass classifies each skill into
exactly one of: skill.invalid (frontmatter parse failure, left
untouched), skill.incomplete (missing required name/description,
untouched), skill.normalized (trailing whitespace / missing final
newline, written back), or nothing (already clean). Manifest declares
only Skills -- no Tools, no MemoryEngine -- since nothing here needs
either.

Wired into internal/app/archied/bootstrap.go:setupCurators, rooted the
same way loadWorkflows already resolves skillsBase (cfg.SkillsDir falling
back to cfg.WorkDir) -- one local root, not the full multi-root catalog a
chat turn reads. Skills is now a shared registrar-level service
(alongside Events/MemoryEngines), narrowed out of a curator's view by
registry.filter when undeclared, same as every other capability.

task check is green (full Go suite + dashboard tests); go test ./...
is green.
2026-09-02 02:58:36 +10:00
sam 41a84f04b9 chore(beads): close Honcho engine proof as deprioritized 2026-09-02 02:52:02 +10:00
sam 687cabfaf4 chore(beads): close memory.provider silent-inert bug 2026-09-02 02:51:05 +10:00
sam 8fff1b5dfd fix(config): reject memory.provider instead of silently ignoring it
Closes archie-core-1786637499161-356-e424e40d.1.

setupMemory's own doc comment claimed external providers are added via
RegisterExternal when cfg.Memory.Provider is set -- no such call
existed. Investigated wiring it for real: there is no external
MemoryProvider implementation anywhere in the repo to construct and
register (only internal/memory/builtin.Provider exists), so there is
nothing to route memory.provider's value to yet. Wiring the call would
be dead plumbing to nothing, not a fix.

The actual defect is that setting memory.provider has always silently
done nothing -- an operator who set it reasonably believed they
configured something. validateMemory now rejects it outright with a
clear reason, turning a silent no-op into a loud one at config load,
same failure-loudly posture as every other unimplemented-value check in
this file. Drop the rejection once a real external provider (or the new
domain/memory engine family's Honcho proof, archie-core-1786637492031)
gives the field an effect again.

Updated setupMemory's doc comment and config.example.toml to match --
the provider_config example is removed too, since it has nothing left
to configure.
2026-09-02 02:50:35 +10:00
sam b13077f3b6 chore(beads): close bind-curators-to-memory-engines 2026-09-02 02:48:04 +10:00
sam 49a37118d4 feat(curator): bind curators to memory engines
Closes archie-core-1786637499636 (bind curators to memory engines).

curator.Registrar gets MemoryEngines, a MemoryEngineSource
(Get(name) (domainmemory.MemoryEngine, bool)) mirroring
domain/memory.Registry.Get's exact signature so the real registry
satisfies it with no adapter. Registration enforces presence the same
way Tools/Skills already do: a curator declaring Manifest.MemoryEngine
with no MemoryEngineSource on the host is rejected at Register, and
filter() clears MemoryEngines from a curator's view when it declared no
engine. A curator with a declared name that turns out not to exist in
the registry is not this layer's problem -- Get(name) at call time
returns false, same as ToolBuilder.Build with an undeclared tool.

Resolution is by name at call time, not a value pre-fetched at Bind: a
curator calls MemoryEngines.Get(its own Manifest().MemoryEngine) itself,
the identical trust model ToolBuilder.Build(ctx, declared) already
uses -- the curator is trusted to pass its own declared identifier, not
handed something pre-scoped to it. Swapping the configured engine (a
different name resolving through the same registry) changes where a
curator's memories land with no change to the curator itself, since
nothing about the curator's own code names a concrete engine.

setupCurators wires b.memEngines (*domainmemory.Registry, set by
setupMemoryAll which Run() calls first) straight in -- it already
satisfies MemoryEngineSource.

A curator declaring no memory engine remains valid (existing behavior,
now also covered by the "nothing declared" and "no source" table
cases) and is only ever affected by a memory operation it never has the
means to attempt, since MemoryEngines is nil in its view.
2026-09-02 02:47:48 +10:00
sam d11fb949a3 chore(beads): close builtin engine and config surface issues 2026-09-02 02:44:45 +10:00
sam 6b26f36ee5 feat(daemon): wire the domain/memory engine registry at boot
Completes archie-core-1786637499480 (ship the file-writing store as
the default memory engine): cfg.Memory.Engine now actually selects and
starts an engine, closing the gap the previous commit's message called
out as remaining.

setupMemoryEngine builds a domain/memory.Registry, registers
infraMemory.BuiltinEngine for "builtin" (and the empty/unconfigured
case, matching applyMemoryDefaults' resolution) rooted at
workDir/memory-engine -- separate from the legacy provider's
workDir/memory, so the two can never collide on the same files while
both exist -- starts the registry, and stops it on daemon shutdown.
cfg.Memory.Engine is already validated against the same set at config
load (configuration.validateMemory), so the switch's default case only
guards the two lists drifting apart, not live operator input.

setupMemory and setupMemoryEngine are both called through a new
setupMemoryAll from Run(), which was already at its cyclomatic
complexity budget -- a genuine grouping (both are memory-subsystem
startup), not two unrelated steps merged just to hit a number.
setupMemoryEngine deliberately does not thread Run()'s ctx through to
registry.Start, matching setupMemory's own existing choice for the same
reason (Start is a synchronous startup step, not a subscription that
needs the daemon's lifetime the way setupCurators' WakeOnPrimaryInput
does) -- also what avoids a contextcheck trip that threading ctx through
setupMemoryAll produced during development.

Not yet done: internal/memory.Manager (the live system-prompt/tool-call
path) does not read through this registry -- the two memory systems run
in parallel, per archie-core-1786637490069-11-e245c170's explicit "do
not extend the legacy system in place" scoping. That convergence is
future work, not part of this issue.
2026-09-02 02:44:12 +10:00
sam be03844df8 feat(config): config surface for memory engine selection
Part of archie-core-1786637490043 (config surface for memory engine
selection and settings).

config.MemoryConfig gets an Engine field selecting among the
domain/memory engine family, plus toml tags on every field -- Provider,
ProviderConfig, and SessionTTL had none before, yaml/json only, which
didn't match repo convention.

Engine and Provider are kept as two separate fields rather than one:
they select between two different mechanisms (the new engine family vs.
the legacy external-provider path, archie-core-1786637499161-356-e424e40d.1),
and conflating them would mean a value meant for one silently getting
read by the other once both are wired.

applyMemoryDefaults resolves an absent engine to "builtin" so
unconfigured and explicitly-builtin are the same state everywhere after
defaulting. validateMemory rejects an unrecognised engine name in the
same style as forge.type's existing validation -- named constant list,
"%w: field %q (want %s)" shape, wired into the same validate() chain.
config.example.toml documents the new field.

Not yet wired to anything: nothing reads cfg.Memory.Engine at daemon
boot yet to actually select and start an engine through
domain/memory.Registry. That's bootstrap wiring, tracked as the
remaining half of archie-core-1786637499480 (ship the builtin store as
the default engine).
2026-09-02 02:40:10 +10:00
sam 4252897fa8 chore(beads): note builtin engine progress 2026-09-02 02:36:31 +10:00
sam 7b39f7bd0c feat(memory): builtin engine implementing the domain/memory contract
Part of archie-core-1786637499480 (ship the file-writing store as the
default memory engine).

Records the missing design decision first (migration-decisions.md#5,
"authoritative memory record and revision model" was explicitly open):
internal/memory/builtin.Store addresses blocks by content substring with
no stable per-block ID, which the new Record{ID}/Forget(id) contract
needs. Decided and implemented: an ID assigned once at Write via a
leading `<!--mem:<uuid>-->` marker line, stripped back out of
Record.Content on read, located by that marker (not content) for
Forget -- so an unrelated edit can never orphan a Forget. Identity maps
to a directory named hex(sha256(identity)), not the identity string, so
an arbitrary identity can never traverse outside the configured root.
Kind maps to a builtin section name via the store's own
ValidateSectionName, so an invalid Kind fails the same way an invalid
section already does.

internal/infrastructure/memory.BuiltinEngine wraps one builtin.Store per
identity and implements domain/memory.MemoryEngine end to end
(Write/Query/List/Forget, Lifecycle, Manifest). Lives under
internal/infrastructure per organisation.md ("infrastructure implements
domain contracts"), not internal/domain/memory, which stays
contract-only.

internal/memory/builtin is untouched -- confirmed via git status and its
own test suite passing unmodified, per this issue's acceptance
criterion. This engine is not yet wired into daemon bootstrap or the
config surface (archie-core-1786637490043); it proves the contract
holds for the builtin store the same way curator's reference
implementations prove the curator contract, and registers/runs cleanly
through domain/memory.Registry (TestBuiltinEngineRegistersAndRuns
ThroughTheRegistry).
2026-09-02 02:36:10 +10:00
sam ec86e8c5c1 chore(beads): close memory engine contract/registry issue 2026-09-02 01:55:43 +10:00
sam 4a85725a69 feat(memory): typed memory engine contract, registry, and registrar
Part of archie-core-1786637490069-11-e245c170 (memory engine contract
and owning registry), under epic archie-core-1786637499161 (pluggable
memory engine).

Stands up internal/domain/memory as a conforming engine family per the
strict plugin engine rule, mirroring internal/domain/curator's split
exactly as that issue's notes specify:

- contract.go: MemoryEngine (Lifecycle + Store + identity + Bind), with
  Store carrying the real domain operations the epic requires --
  Write/Query/List/Forget -- not just Name/Version. Store is split out
  from MemoryEngine so the interface stays under golangci-lint's
  interfacebloat threshold the same way curator's embedded Lifecycle
  does: an embedded interface counts as one slot, not its expanded
  method count.
- registrar.go: narrow typed host access (EventSink, Clock). No
  capability-gated fields yet -- unlike curator's Tools/Skills, no
  memory-specific host service exists to gate on today, so Registry.Bind
  passes the host straight through rather than filtering.
- registry.go: Register/Get/Names/Start/Health/Stop with the same
  duplicate/nil/panic/failure-isolation guarantees as curator's registry,
  ctx-bounded Stop, reverse-order shutdown.

This is the contract only -- no engine implements it yet, and
internal/memory's existing ad-hoc MemoryProvider/Manager (pre-migration)
is untouched, per the issue's explicit "do not extend in place" note.
2026-09-02 01:55:11 +10:00
sam 14cb5c6888 chore(beads): link curator and memory-engine epics to their children; file RegisterExternal wiring gap 2026-09-02 01:51:02 +10:00
sam 166f165f5a chore(release): archied v1.19.8
deploy / gate (push) Failing after 3m42s
deploy / build-and-push (push) Skipped
2026-09-02 01:19:31 +10:00
sam b198d5e595 chore(beads): close archie-core-atv2 2026-09-02 01:19:24 +10:00
sam 0cbd644da4 fix(telegram): send undelivered-media fallback after finalize as its own message
Closes archie-core-atv2.

Media delivery is fire-and-forget with a 30s budget, far longer than
the turn's text usually finishes -- so a large upload failing (or
timing out) after doFinalize has already retired the renderer goroutine
is the normal case, not an edge one. appendFallbackLine was still
writing into toolLines and calling requestRender, a non-blocking send
into a channel nothing reads any more once stopRendering has returned:
the line was silently dropped and the finalized message stood
unchanged, with nothing telling the user or the agent the file never
arrived.

stopRendering is the single point every finalize/abandon path funnels
through to retire the renderer, so it's the right place to mark the
reply finalized. appendFallbackLine now checks that flag and, once
set, sends the fallback as its own follow-up message instead of
appending to a buffer nothing will render again.
2026-09-02 01:18:54 +10:00
sam b7c05d0a07 fix(telegram): stop adjacent rich blocks from rendering glued together
Two bugs behind the "System statusEverything is operating normally."
render:

1. Consecutive plain lines with no blank line between them were joined
   into one paragraph's text with an embedded "\n". Telegram's
   rich-block paragraph does not render an interior "\n" as a break --
   it renders nothing, so the words ran together with zero separator.
   Join with a space instead: the correct rendering of a CommonMark
   soft line break anyway, and it survives regardless of how the
   client treats a literal "\n".

2. Telegram's renderer adds no vertical gap between adjacent blocks on
   its own -- only a heading carries its own margin -- so a label line
   immediately followed by a list (or any two non-heading blocks back
   to back) rendered touching, with the list's first item glued to the
   preceding text and no visible line break at all. appendBlock now
   inserts an empty spacer paragraph before any block that doesn't
   follow a heading, making the gap explicit instead of depending on
   client-side spacing that isn't there.

Reproduced directly against markdownToBlocks with the reported input
and confirmed the fix before writing this up.
2026-09-02 01:12:53 +10:00
sam b05e8f189f fix(update): drop dev-facing wording from the unconfirmed-update message
"Treat this as UNCONFIRMED, not complete" is developer-speak in a
message an operator with no codebase context has to act on. Reword to
plain instruction: say what's known, then what to do about it.
2026-09-02 00:35:13 +10:00
sam 155e20af39 ci(deploy): key concurrency group on commit SHA, not ref
git push --follow-tags pushes main plus both archied/v* and archie/v*
tags in one operation, all pointing at the same commit. on.push
matches branches and tags, so every release push fired three identical
deploy runs -- observed just now: archied/v1.19.7, archie/v1.19.7, and
main all running in parallel from the same commit. The ref-keyed
concurrency group added earlier couldn't see these as the same work
since github.ref differs per trigger. Key on github.sha instead so all
three collapse into one.
2026-09-02 00:14:57 +10:00
sam 42bcbc7872 chore(release): archied v1.19.7 archie v1.19.7
deploy / gate (push) Failing after 2m42s
deploy / build-and-push (push) Skipped
2026-09-02 00:13:39 +10:00
sam b0cde5c1ed ci(deploy): cache image layers and cancel superseded deploy runs
Both images built via plain docker build/push with no cache, so every
push to main rebuilt archie-agent's full toolchain (apt packages,
golangci-lint, gofumpt, buf, uv+python, npm globals) from scratch --
several minutes, even when none of those inputs changed. Switch to
docker/build-push-action with GHA-backed layer caching per image.

Also add a concurrency group so a burst of pushes (e.g. a fix commit
immediately followed by its release commit) cancels the superseded
deploy rather than running three in parallel for capacity none of them
can use -- only the last one's :latest push matters anyway.
2026-09-02 00:06:52 +10:00
sam e527f0108a fix(logging): make Tail/Page allocation bound explicit for CodeQL
CodeQL's Go analyzer (go/uncontrolled-allocation-size, alert #6) can't
trace min(limit, MaxTailLines) as a bound on the request-derived limit
before make([]Entry, 0, limit). The clamp was already correct and has
been in place since 5e24072 -- confirmed by rescanning at current HEAD,
the alert still fires -- so this is an analyzer gap, not a live bug.
Same clamp, written as an explicit if so static analysis (and readers)
can verify the bound directly.
2026-09-02 00:04:06 +10:00
sam 3079f86381 chore(release): archied v1.19.6
deploy / gate (push) Failing after 3m39s
deploy / build-and-push (push) Skipped
2026-09-02 00:01:00 +10:00
sam deac0cc130 fix(build): stamp gatewayVersion/runtimeVersion in the right package
-X main.gatewayVersion/main.runtimeVersion targeted package main, but
those vars live in internal/app/archied (cmd/archied is a thin
wrapper). An -X target that doesn't exist is silently ignored by the
linker, so every archied binary this shipped -- task build, install.sh,
Dockerfile.archied, and the carina self-update script -- reported
"dev" instead of its real version. Point every one of those ldflags at
the actual package.

Also, while chasing the carina incident this surfaced:

- restart.go: /restart didn't check for an in-flight /update install.
  The install runs as archied's own child process, so a restart killed
  it mid-build (observed: "signal: terminated") instead of letting it
  finish or fail cleanly. Refuse the restart while updateInProgress.
- update.go / update_report.go: the "no version could be confirmed
  running" branch still opened with "Update complete", contradicting
  its own next clause. Reworded so an unverified outcome isn't
  reported as completion.
2026-09-02 00:00:32 +10:00
sam 9dbf7ccf52 chore(release): archied v1.19.5 archie v1.19.5
deploy / gate (push) Failing after 2m31s
deploy / build-and-push (push) Skipped
2026-09-01 23:42:01 +10:00
sam 29f47b5439 test: replace brittle assertions with behavior checks
- mcp client_test: assert both initialize handshake calls happened and
  notifications/initialized has an empty ID, not their exact order
- telegram model_test: assert the resolved model has an openrouter/
  prefix instead of scanning button text for the string; replace the
  single-hardcoded-count pagination test with cases covering 0/1/8/9/100
  models so pageBounds and nav-row logic are actually exercised
- webui api_chat_test: assert the actionable file path is present in the
  streamed error instead of matching generic wording
2026-09-01 23:39:23 +10:00
sam e9edfb41c8 chore: nolint for containedctx 2026-08-31 23:02:14 +10:00
sam 4cbc2de720 chore: errorlint cleanup 2026-08-31 22:58:37 +10:00
sam 4ebfd0c773 chore: noctx cleanup 2026-08-31 22:56:38 +10:00
sam 83af6eb7a0 chore: remove unusued list 2026-08-31 22:54:11 +10:00
sam 7000e6016d test(telegram): tidy install-context detachment regression test 2026-08-31 22:53:53 +10:00
sam 760ee1ac91 test(webui): replace brittle origin response assertions 2026-08-31 22:53:16 +10:00
sam 27e6bbccf9 chore: beads interactions 2026-08-31 22:52:35 +10:00
sam c3e9e4c43e feat(workflow): adversarial self-review stage before PR open
Implements archie-core-h019.3 (reviewer isolation) and h019.4 (wiring),
per docs/prds/adversarial-self-review.md.

- internal/domain/workflow: new Reviewer interface and StageReview,
  inserted between StageDiffCap and StageOpenPR in the implement
  workflow. Fail-closed: a review that didn't run, or a confirmed
  error-level finding, parks the task (store.StatusParked) with
  findings in Detail; warn/plausible findings never block. Inert
  unless Repo.ReviewEnabled.
- internal/worktree: Manager.Snapshot exports HEAD's tracked files into
  a fresh directory with no .git, for the reviewer's isolated
  workspace. Trees interface gains Snapshot; hybridTrees delegates to
  it.
- internal/app/agentworker: subagentReviewer implements Reviewer using
  ai-sdk's agent.Subagent (nested, in-process, non-streaming
  generation) -- conversation isolation is structural (Subagent.Run
  never carries message history), workspace isolation is the snapshot
  above. The reviewer's toolset is read-only (read/grep/find) rooted
  at the snapshot, never the worker's own toolset, so it cannot reach
  the worktreerpc publication grant. Findings are captured via a typed
  record_finding tool appending to a slice the stage owns, read even
  when Subagent.Run errors (a truncated run's captured findings
  survive).
- internal/config: Repo.ReviewEnabled (default false) and
  Models["reviewer"] (falls back to Models["builder"], no schema
  change).

Judgment calls: Reviewer.Review never returns a Go error -- every
failure folds into ReviewReport per the PRD's fail-closed contract,
which the stage can act on uniformly. A Subagent.Run error with zero
captured findings resolves to ReviewStatusNotRun (park); a
Subagent.Run error with >=1 captured findings resolves to
ReviewStatusCompleted with those findings, since the PRD's own example
("three defects survive a step-limit truncation") requires them to
still be evaluated for blocking rather than discarded.
2026-08-31 21:51:33 +10:00
sam 0fc20319c7 fix(lint): noctx fixes and dead-code cleanup
- install_script_test.go: exec.Command -> exec.CommandContext (noctx)
- architecture_test.go, store_test.go: go fix removed now-unused
  inspectEngineFamilies/parsePackageFiles/stringPtr helpers.
2026-08-31 21:35:58 +10:00
sam 536e4bc0d1 refactor(lint): extract Apply/findWalkVisitor helpers; go fix modernization
- tomlwrite.go: split Apply into collectPending + an applier struct
  (indexTables/resolveTable/matchActiveKeys/uncommentKeys/
  appendMissingKeys/render). gocognit 82 -> under threshold.
- find.go: split findWalkVisitor's closure into findSkipEntry/
  findMatchesFilters. gocognit 46 -> under threshold. This clears the
  last complexity finding from archie-core-agui's original 31.
- richblocks.go: go fix modernization (strings.SplitSeq).

Behavior-preserving.
2026-08-31 21:35:58 +10:00