Commit Graph
37 Commits
Author SHA1 Message Date
sam 7414713d61 feat(webui): add the per-run task detail page
A per-task page at #/tasks/{id} with tabs for the attempt's stages and log, changed
files, configuration and a raw debug view. Reachable from the task list, deep
linkable via ?tab= and ?attempt=, and reload safe. Existing URLs (#/tasks?task=N
and #/tasks?status=...) are unchanged.

- A stage rail per attempt: name, duration, terminal status and error text, with
  unattributed events surfaced and the agent's own verdict shown separately.
- No pass/fail badge and no exit code anywhere: the backend has neither, and a stage
  that returned nil after producing a poor diff is a success. Status word, duration
  and error text are shown instead.
- The log pane filters by attempt, stage and level, states the coverage caveat for
  stage filters (agent and tool output records no stage), and keeps the three read
  outcomes distinct: no log reader in this deployment, no file for this attempt, and
  no entries matching the filter.
- Retry is labelled as a new run and its confirm says the previous attempt's commits
  are discarded, because it hard-resets the branch onto the base.
- An absent capture reads "not captured for this run" rather than implying nothing
  changed, and no elapsed-run figure is shown since only per-stage durations exist.
- The events cache is invalidated on retry (it previously kept the ended attempt's
  events) and the log cache is keyed by attempt, so two attempts cannot be conflated.
- ui/dist is rebuilt and committed: the gate runs the node tests but never rebuilds
  the bundle, so a stale one would otherwise ship behind a green gate.
- docs/prds/task-run-detail.md records the surface and its limits, and
  docs/architecture/observability.md describes it alongside the read endpoints.

Both new vocabularies are pinned by tests on each side (config schema, change
statuses) so a one-sided rename fails a test instead of silently degrading the page.
2026-09-18 18:33:03 +10:00
sam a533810546 docs(site): close the excluded-PRD link chain and reconcile the CI section
Two fixes to the published site, both about not shipping something false.

exclude_docs held back prds/ but let ui-service-boundary.md through, because
architecture/migration-decisions.md links to it three times. That PRD in turn
links to service-decomposition.md and config-schema.md, so the exclusion was
still producing two dead links on the published site. Letting those two
through closes the chain: the build now reports no excluded-link references
at all.

generated-documentation.md's "Step 9: CI" said no workflow builds, checks or
publishes documentation. Adding .github/workflows/docs.yml made the first
clause false. Restated to say what that workflow does and, more importantly,
what it deliberately does not: it does not run docsgen, regenerate
contracts.json, or publish. Generated-artifact drift is still gated locally by
task check, which is the split that section exists to protect, since a CI job
that regenerated output could paper over uncommitted differences rather than
fail on them.
2026-09-18 13:17:02 +10:00
sam 641c80f7d9 feat(build): gate generated contract data in task check
Closes #855 (archie-core-5gzx).

The check mode added in the preceding commit had no caller, so it prevented nothing: a
stale contracts.json still passed every gate. This wires it in and makes
drift fail the build.

- `task docs:generate` writes the committed artifact.
- `task docs:check` verifies it, non-destructively.
- `task check` runs `docs:check`, right after `proto:check`, so both
  generated-artifact surfaces are judged the same way in the same place.

The check cannot be satisfied by rewriting: it generates into a temporary
directory, so a failing gate leaves the artifact exactly as it found it and
the author applies the regenerated bytes. That keeps the regenerated diff
reviewable in the same commit as the code change that caused it, which is
what Step 9 of the architecture document requires and what a CI auto-update
would quietly bypass.

Documents that called this gap open are updated rather than left to
contradict the code:

- `generated-documentation.md` Step 8 (no `docs:*` task exists -> both exist),
  Step 9 (drift is gated locally, not in CI), and the hook/CI policy (rule 3
  is now enforced by the gate; rules 1, 2, and 4 still rely on the author,
  since nothing observes a commit).
- `contract-conformance-audit.md` gap 1, now closed.
- `config-example-drift.md` item 3, which asked for exactly this wiring.
- `CLAUDE.md`, whose `task check` description listed neither `docs:check`
  nor `test:tools`.
- The build, docs, and diagnostics skills, plus a re-baselined diagnostics
  snapshot: the `task_docs` delivery surface went 0 -> 6 and the `tools`
  module 4 -> 7 now that the tasks exist.

Verified with `task check` (green), including the new `docs:check` step.
2026-09-18 12:46:40 +10:00
sam 0ee2d27ebc fix(workflow): record a parked run's reason in its own log
The agent-side half of the same gap. A stage failure already logged
"stage failed -- parking" before parking, but a run whose OUTCOME was parked
(a review that could not run, a workflow that ended with no outcome) reached
the timeline as a KindParked event and the store as park_reason and never
the log an operator downloads.

park is the one place a park's reason is final, so it is now the one place
that logs it; the stage-failure branch no longer logs its own near-copy, and
the stage names itself inside the reason. The entry carries the stage as a
field so nothing is lost by dropping the duplicate line.

observability.md's "Implemented design" section documented the container's
system-log path as though it were the only source of task-log content; it
now records the daemon's and the workflow's own park writers, including why
the entry follows the transition rather than preceding it.
2026-09-18 01:49:56 +10:00
sam af3a8a2a61 refactor(config): delete the two decoded-but-unread policy fields
MemoryConfig.SessionTTL and ToolPolicy.ParallelExecution were decoded by
config loading and read nowhere, so setting either silently did nothing.
Removing them routes both keys into the unknown-key detector, which names
them in a boot warning instead. A live-looking knob wired to nothing is
the worse state, and the sibling memory.provider already earned a loud
load-time rejection for exactly this.

Also drops the config.example.toml line that shipped session_ttl into
every first-run config.toml via configtemplate.go, and the commented-out
dir_test.go assertions that would have re-created both fields under that
file's "make these pass without modifying them" header.
2026-09-17 00:32:02 +10:00
sam 07e39144e2 docs(architecture): record the NATS scaffolds as deliberate deferrals
servicediscovery/nats and gatewayrpc.StoreClient are implemented and fully
tested, but neither has a production caller and no config surface exposes
either. Both were previously unrecorded, which made them indistinguishable
from oversight. The register now names them: StoreClient under the session
migration that will consume it, service discovery under shared mechanics,
alongside the runtime boundary that pins container addressing by injected NATS
URL instead. Kept rather than deleted because re-deriving tested wire code
later is pure cost.
2026-09-15 16:54:12 +10:00
sam 639cd7f8b7 docs(architecture): record the embeddings client as deliberately inert
setupEmbeddings constructs a client at boot and holds it on b.embeddings, but
no production code reads that field yet, so a resolved models.embedding role
currently produces a client whose only observable effect is a boot log line.
The document already notes that no curator consumes a Sampler yet; it now says
the same of the embeddings client, so the inert state is stated rather than
implied. Both are prerequisites waiting on #437, not unwired defects.
2026-09-15 16:54:12 +10:00
sam de150f2068 chore(docs): remove the VitePress site and its build step
The docs site was never published: GitHub Pages is not configured for this
repository, so the workflow built and uploaded a site nobody served. docs/ is
repository documentation — Markdown read in the repository, an editor, or the
forge's file view — and does not need a renderer.

Removed:

- docs/.vitepress/config.mts, docs/package.json, docs/pnpm-lock.yaml (1620
  lines), docs/pnpm-workspace.yaml
- docs/index.md (the site's landing page)
- .github/workflows/docs.yml (pnpm install, VitePress build, Pages deploy)
- the docs build-artefact ignores from .gitignore

Kept and corrected:

- docs/prds/01-project-management.md linked its decision documents with
  VitePress root-absolute paths (/architecture/...), which only resolve under a
  site build. Repointed to repository-relative paths.
- docs/architecture/generated-documentation.md named VitePress as the renderer
  throughout. Now records the renderer and publishing surface as an open
  decision, with the consequences stated: reference pages unrendered, no link
  checker, no authoring server. Also corrected three claims that were never
  true — the docsgen all/check subcommands and the docs:* tasks do not exist,
  and no pre-commit hook is installed.
- .agents skills: build-and-env and docs-and-writing no longer describe a docs
  site to build; the diagnostics scripts drop .vitepress skip rules and the
  dead github_docs_build scan.

Generated output is unchanged: docs/data/generated/contracts.json and the
docsgen toolchain are untouched, and tools/ remains its own module.
2026-09-12 01:01:12 +10:00
sam 03afd2e8ad refactor(webui): take configuration off the dashboard server
webui.Server declared Cfg *config.Holder with eight read sites, none of
which ran in the UI process: composition leaves it nil there. The field
survived because the daemon kept a webui.Server it never served, using it
to render the published ConfigView snapshot and to hold the readiness
probes (archie-core-ml30).

Split at the producer. LocalConfigView becomes webui.BuildConfigView, a
pure function over a ConfigViewInput the configuration owner assembles;
the DTO and its schema stay where the UI renders them. The daemon builds
that input from its own state (boot.configViewInput) and publishes the
result. Readiness reads the daemon's Holder, channel manager and chat
contract, and the registry it produces is a daemon field, not a field on
a server with no listener. Boot now owns one Holder instead of seeding a
second and replacing it in buildDaemon; operator retry caps read it too,
so they follow a reload rather than a boot-time snapshot.

Server loses Cfg, ConfigProvenance, LastReload, ConfigOverrides and
SetProvenance. The nil-guarded branches they fed went with them, each
checked first against what the UI process actually serves:

- chat.show_tool_calls and the /api/setup checklist were degraded, not
  dead. ConfigView gains a chat section carrying show_tool_calls, the
  operator name and whether a channel is configured, and both surfaces
  read the projection. The end-to-end suite asserts the checklist renders
  from the published snapshot.
- /api/logs takes its path as a process-local option. The history is on
  the daemon's disk, so a dashboard elsewhere cannot read it by learning
  the path; that route still needs a contract.
- handleChannels drops its config-derived fallback, superseded by the
  status manager, which already carries the descriptions and detail.
- trustForwardedHeaders keeps only the process's own setting, which the
  UI process already sets.
- resolveForge keeps the published-projection path it already had.

ConfigView.Editable moves to handleConfig, decided by whether this
process holds UpdateConfig. It describes the writer, not the document, so
the write contract (archie-core-j28m) makes the page editable by wiring
one field. The write handlers and their seams stay for it.

overlay.Store gains Keys: Snapshot nests dotted keys for decoding, so the
overridden-key list was publishing section names ("budgets") where the
dashboard marks and resets rows by stored key ("budgets.max_steps").

Multi-identity forge links move to archie-core-pv6t: forgeConfigForTask
resolved a task's forge from config.Config, had no reachable caller once
the holder was gone, and belongs in the projection rather than the
rendering package.
2026-09-11 23:57:38 +10:00
sam fdf73243a0 docs(architecture): promote the shipped review stage, reconcile CLAUDE.md
Closes archie-core-h019.7. Three parts:

- Promote docs/prds/adversarial-self-review.md into
  docs/architecture/adversarial-review.md, describing the stage as shipped
  (subagent executor, .git-free snapshot, ReviewReport contract, fail-closed
  park, models.reviewer budget, operator-triggered review_pr) and mark the PRD
  as promoted.
- Add the review stage to ARCHITECTURE.md's task lifecycle.
- Reconcile CLAUDE.md's Development Protocol: distinguish the contributor's
  opt-in manual pass from archied's automatic pre-PR review.

Note: the h019.7 text said the review diverts to waiting_human, but the
shipped stage (h019.1/h019.4) parks to StatusParked, not waiting_human. This
change documents the shipped behaviour (parked), not the stale wording.
2026-09-10 01:31:50 +10:00
sam d6fc2b3f1e docs(architecture): make the dashboard configuration page read-only for Phase 3
archie-core-ymut. The ratified boundary assumed one narrow admin contract
carrying both the configuration read and the write. It splits.

Read: webui.ConfigView is already a UI-owned, secret-free value projection
(ProviderView carries the API key's env var name and a Configured bool, never
a value; RepoView is metadata only) and is already the exact shape the browser
receives. The daemon publishes it, plus provenance, reload status and the
overridden-key list, as a snapshot the UI reads over two new State Store RPCs.
Nothing is designed, only moved.

Rejected a config admin service on archied. That would make the daemon a gRPC
server for the first time: grpc.NewServer appears only in RunGateway and
RunStateStore, which are the standalone binaries' entry points, not the
daemon's, so it costs a new listener, port, token and interceptor.

Write: PATCH /api/config, POST /api/config/reset and the repo-field route
answer 503 in the UI process, and the SPA hides the controls. This is a
deliberate feature reduction. The update policy is daemon-local
(installUpdateConfigHandler denies non-runtime-tunable keys, applies a dotted
overlay to a clone, validates the materialised config, writes overlay rows and
rebuilds provenance); contracting it verbatim would build a Configuration
Service inside a migration bead. Revisit with archie-core-1786637498420-327,
where it is a feature rather than migration residue.

Implementation is assigned to archie-core-8cda.5.4, the cutover that removes
the daemon's dashboard. Nothing is built here.
2026-09-09 03:00:56 +10:00
sam eafb58e1c0 feat(webui): deliver live dashboard events by polling the State Store cursor
archie-core-za9f. The UI process owns no event bus, so after the .5.4 cutover
the activity feed would show history at page load and then go silent: live
delivery is a Server.Broadcast call made only from the daemon's bus
subscription.

Decided against the push-subscription RPC the bead assumed, on three findings:

* store.Open sets SetMaxOpenConns(1), so writes serialise and the event id is
  assigned in commit order. The gap-skipping failure that normally rules out
  polling an autoincrement cursor cannot happen here, and SSE catch-up already
  depends on the same property.
* sseStream.drain treats a broadcast as a wakeup, not a payload: it fills the
  persisted gap via catchUp and delivers the event only if catch-up missed it,
  deduplicating on the since watermark. A poller substitutes for the bus with
  no change to sse.go and no new SSE semantics.
* The events table is the only complete fan-out point. ArchiveTask writes an
  audit event inside its transaction and daemon.go inserts binding-dispatch
  failures directly, neither touching the bus. A push hub needs a hook at every
  write site and misses any added later.

So: no proto change, no new auth surface, no backpressure policy. The pump
primes past existing history (a client's own catch-up serves that), then ticks
EventsSince into Broadcast. One pump serves every browser. A failed fetch
leaves the watermark intact, so a State Store restart costs latency, not
events.

Wired into archieui.Run in the background so priming a large events table
cannot delay the listener, with -event-poll-interval (default 1s).

Decision recorded in migration-decisions.md; ui-service-boundary.md's /events
route-owner row moves to RESOLVED, and /api/logs splits out of it as still
unresolved and host-local.
2026-09-09 02:53:32 +10:00
sam 63a54e0850 docs(architecture): ratify UI service boundary 2026-09-07 18:29:42 +10:00
sam 6affe0eea3 chore(curator): add embedding client and sampler interface prerequisites (#752)
* feat(curator): add embedding client and sampler wave-1 prerequisites

Bead archie-core-1786637500752-415-434e5bb9 (GitHub #436) was closed with
no linked PR/commits, and the surprisal-sampling bead
archie-core-1786637500776-416-600a66e5 (GitHub #437) found none of its
stated prerequisites -- an embedding client, a Sampler interface, or the
four wave-1 cheap sampling strategies -- actually exist. This builds them:

- internal/domain/embedding + internal/infrastructure/embedding: a narrow
  typed embedding client, config-driven via a providers table + a role in
  [models], mirroring the existing chat model role convention. Degrades to
  capability-unavailable (never fails startup or a call) for a missing
  role, unknown provider, unsupported class, or unresolved credential.
  Wired as an optional capability in bootstrap.go's setupEmbeddings.
- internal/domain/sampling: the Sampler interface plus recency, random,
  all, and staleness-proxy strategies, per docs/prds/curator-sampler-wave1.md.
  Deterministic given fixed inputs, matching GitHub #437's stated
  acceptance criterion for the embedding-backed strategy it will add
  behind this same interface (not part of this change).

Table-driven tests throughout; httptest for the embedding client, no live
service. No curator wiring yet -- nothing consumes either capability in
this change.

* no-mistakes(document): docs(architecture): mark curator sampling prereqs as landed
2026-09-05 22:53:08 +10:00
sam c75ed44721 feat(telegram): support secret refs for bot tokens (#705) 2026-09-03 14:52:31 +10:00
sam d640b6b915 docs: reconcile plugins-and-extensions.md and ARCHITECTURE.md with shipped webhook intake
ARCHITECTURE.md described forge intake as polling-only and listed Gitea
as still "planned" despite internal/forge/gitea.go fully implementing
it -- both stale since 7d5u.4/.2/.3 shipped forge webhook intake.
Corrected the opening description, package map, Provenance-by-origin
paragraph, [forge] config bullet, and Implemented/Planned lists; added
a "Webhook intake" subsection documenting internal/forge/webhook as a
separate HTTP receiver reusing the poller's TaskEnvelope/PublishTask
path.

CLAUDE.md gains the internal/forge/webhook/ trap: HMAC verification
must precede payload parsing, and the webhook-built TaskEnvelope must
keep its poll-compatible owner/repo/number idempotency key or
poll/webhook double-dispatch returns.

plugins-and-extensions.md gains a section cross-referencing 7d5u.1's
decision (in-process typed families, no amendment needed) and naming
the Module action position as the shipped instance -- Channel/Forge
positions are correctly left as open investigation (t2db.19), not
claimed as shipped.

Closes archie-core-7d5u.6.
2026-09-03 06:48:02 +10:00
sam 7bbd6dff71 docs(architecture): document the playbook binding model and threat model
Partial completion of archie-core-t2db.6 -- covers the binding model
(matcher/mapping/versioning/state machine) and verifies each of the
five threat-model non-negotiables from archie-core-t2db.5 against the
actual shipped code (not just the design intent), plus the AES-GCM
secret-at-rest encryption from t2db.7 and the binding_dispatches
at-most-once ledger.

Every claim checked against real code before writing, not assumed --
caught and corrected one wrong claim in-flight: binding-originated
tasks enqueue via EnqueueChatTask (the same direct-to-store.Task path
chat-spawned tasks use), NOT workintake.TaskEnvelope/NATS the way
forge-polled tasks do. Both converge on the same tasks table and
downstream gate/worktree pipeline, but by genuinely different enqueue
mechanisms -- worth noting for t2db.6's still-open ARCHITECTURE.md
task-lifecycle section, since this is exactly the provenance
distinction that section needs to state.

Explicitly does not cover: the ARCHITECTURE.md lifecycle addendum or
the operator walkthrough, both still open pieces of t2db.6.
2026-09-03 04:24:27 +10:00
sam 421daae371 docs(architecture): fix stale internal/workflow and internal/nats paths
Both packages no longer exist -- internal/workflow moved to
internal/domain/workflow at the 2026-08-07 domain migration (7e896c9),
confirmed by TaskContext still living there today. internal/nats is
gone entirely; verified TaskMessage as a type doesn't exist anywhere
in the codebase now, and archie.task.* subjects + TaskEnvelope live in
internal/domain/workintake (recorded as a completed migration in
migration-decisions.md), with transport in
internal/infrastructure/agenttransport/nats.

Fixed the two simple path corrections directly. Left the NATS row's
deeper question open rather than guessing: whether the row's entire
"current meaning" is now superseded by TaskEnvelope (not just its
location) needs a closer look this pass didn't have grounds to assert.
2026-09-03 04:19:11 +10:00
sam dea69d895d fix(gateway): stop SOUL from forging the prompt invariant tags
Persona/SOUL text was interpolated raw at the top of archie.md.tpl,
so a hostile SOUL could inject its own <core_rules> or
<instruction_precedence> tags ahead of the real ones. Render it
through the existing xml-escaping helper into a labeled
trust="data" <soul> block, and tell instruction_precedence
explicitly that the block is reference data, not an authority.

Closes archie-core-1786637490097-12-bf415ffb
2026-09-02 21:48:57 +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 932a8b0680 docs(architecture): reconcile domain package map, add domain/messaging types
- migration-decisions.md: confirm curator/mapping/scheduling as
  legitimate domains that were never added to the confirmed list;
  document identity/agent/messaging/plugin as approved-but-unmaterialised
  targets rather than creating dead stub packages.
- Resolve the open Session/Messaging decision (section 2): keep
  internal/gateway as-is rather than risk a big-bang rewrite of live
  session/compression/approval/branch logic; materialise
  internal/domain/messaging with the already-settled canonical
  Message/Conversation/ToolCall/ToolResult types. Actual gateway
  migration onto these types is tracked as sequenced follow-up bd
  issues (label messaging-migration).
- ARCHITECTURE.md: add internal/gateway, internal/tools, internal/memory,
  internal/secret, internal/plugin, internal/skill to the Package Map.
2026-08-31 21:26:06 +10:00
sam 5ce821b561 chore: update issue tracker, remove ai-sdk ADR 2026-08-28 22:28:49 +10:00
sam 3b8ac3e8d1 docs: record ai-sdk to goai migration decision 2026-08-28 22:28:26 +10:00
sam 972fb5b8e1 feat(deployment): default to managed NATS workers
Autonomous workflows now always hand a complete task to a scoped archie-agent container. Embedded NATS is the default and external NATS changes only broker placement; legacy agent and containers.enabled inputs decode for migration but cannot select an execution path. The daemon flushes task-event subscriptions before a worker can publish, and runtime updates snapshot and restore the configured worker image.
2026-08-24 14:56:57 +10:00
sam 5d00ec7b0c refactor(agentexec): remove legacy execution paths
Autonomous workflows now have exactly one production boundary: a task-scoped archie-agent receives a full-task core-NATS request and runs the worker-local stage loop. The legacy [agent] section remains decode-only for migration; it no longer selects runtime behavior.
2026-08-24 14:56:57 +10:00
sam 691e10c251 fix(telegram): compact tool output and drop turn caps
Render completed ToolCallEvents as Telegram-safe streaming blocks
with compact name/status and a short cleaned preview. Summarize
file contents and listings instead of dumping source or quoted
JSON. Collapse repeated legacy turn-budget failures.

Remove max_tokens turn gating and the 200000 turn_budget_chars
default so absent or commented config cannot restore an aggregate
cap. Keep per-result max_result_chars and spill.

Confine find/grep discovery to the active workspace/worktree.

Refs #604
2026-08-23 16:40:16 +00:00
sam 45345cdfb6 refactor(agent): move worker runtime into application layer
cmd/archie-agent used to own worker construction, NATS lifecycle, task execution, MCP setup, and workflow wiring. It now owns process input only and invokes internal/app/agentworker, while transport-specific NATS, boot-brief, and git-safety mechanics live under infrastructure.
2026-08-15 00:43:12 +10:00
sam 99fb1102cc docs(architecture): mark the config-overlay subset implemented on safe-change-and-recovery 2026-08-10 01:46:18 +10:00
sam 5343c68160 docs(architecture): record the implemented config reload and runtime overlay
Per the sequencing call (adversarial pass first, docs last), the docs
now reflect the design the reviews confirmed.

configuration.md:
- Mutation ledger gains rows for SIGHUP reload, dashboard PATCH,
  dashboard reset, and the runtime overlay store, each mapping to the
  universal change protocol with what is and is not yet implemented.
- New section 'Implemented runtime reload and config overlay (2026-08)':
  the Holder published-snapshot model, the reloadable-field criterion
  (a field is reloadable when EVERY consumer re-reads it), SIGHUP
  reload semantics, the overlay store (separate -config.sqlite, dotted
  keys, denylist, bootstrap degrade), and the PATCH/reset paths.

safe-change-and-recovery.md:
- New section 'Runtime config overlay: degrade paths and recovery'
  tabulating the three boot degrade paths and the reload degrade, all
  verified by the adversarial passes, plus the three documented
  recoveries (--no-config-overlay flag, rm the overlay file, dashboard
  reset). Status line notes the overlay subset is implemented while
  the full runtime-supervision protocol remains under design.

No new documents, per the constraint.
2026-08-10 01:45:44 +10:00
sam 61b4b7b0cf refactor(store): replace legacy persistence with SQLite
Task and event persistence now uses a dedicated SQLite sidecar derived from the configured state prefix, matching the independently persisted conversation store. The configured path now means a state-path prefix rather than a database file so fresh SQLite state never attempts to interpret the previous storage format.

Remove the retired implementation and dependency completely, strengthen SQLite migrations and concurrency behavior, restore backend-neutral coverage, and align configuration, operational guidance, UI labels, and deployment documentation with the new storage and host-daemon topology.
2026-08-09 22:27:25 +10:00
sam 95c5d59e7c docs(architecture): mark observability design as implemented 2026-08-09 19:29:33 +10:00
sam fab8a66486 Merge pull request #457 from samcharles93/fix/452-task-log-sink
feat(logging): add a per-task log sink
2026-08-09 18:17:24 +10:00
sam fd4420a038 docs(architecture): record decisions recovered from the pre-migration tracker
Eight approved decisions existed only as beads memories and were lost when
the tracker was removed. Recovered from a backup taken six minutes before
8bf0f6b and folded into the docs that own them, rather than a new document.

- migration-decisions: recorded position as of 2026-07-29, the deferred
  private-input-DTO compromise, and the agreed internal/app/{archied,
  agentworker} next step
- configuration: missing credential degrades a capability, only invalid
  config is fatal; config generation moves from install.sh to archied setup
- identity: the three-layer invariants/SOUL/representation model, and why
  a curator may only propose SOUL changes
- agent-system: the curator isolation invariant (curators are peers, never
  on a chat turn's critical path)
- messaging-and-work-intake: semantic search over messages is an explicit
  non-goal, with the measurements behind it
- safe-change-and-recovery: the /restart deadlock and lockout constraints
- plugins-and-extensions: dates the surprisal deferral

Also replaces the dead `**Beads issue:** archie-core-5d7` frontmatter across
all 12 documents with the GitHub issue it migrated to (#73), and rewrites
every other beads identifier to its issue number.
2026-08-09 18:10:12 +10:00
sam 86d3071f39 fix(workflow): carry gate output into the baseline park error
StageBaselineGate captured a failing gate command's full output but
discarded it: a 200-char clip went into a Warn log, and the terminal
error carried only res.Status. A park reason like "go build ./...
fails ... (status: failed)" gave no way to see the actual compiler
error, and the container that had it is already gone (AutoRemove).

Now the park error carries a bounded tail of the real output (tail,
not head, since a failing test's explanation is at the end after
pages of "ok" lines), rune-safe so it can't emit invalid UTF-8 into
a persisted park reason. The three existing byte bounds in this
stage (log line, agent mission, park error) are named and documented
as independently sized rather than left as bare numbers.

Also adds docs/architecture/observability.md, the design doc for the
larger task-observability epic (#450) this fix is the first step of.
2026-08-09 16:23:24 +10:00
sam 308666b410 chore: remove legacy terminology and dead code
- Reword docs and comments to drop vague "legacy" qualifiers where they no longer describe deprecation status
- Remove unused code: RecentEvents, MessageEvent.ToLegacy, index setState, stderr redaction tool, telegramOnlyCommands
- Delete or comment out tests covering removed or superseded behavior
2026-08-06 22:55:26 +10:00
sam 4ece064026 feat(curator): engine family contract, registry, and runtime (archie-core-rfp, archie-core-89x)
internal/curator is a conforming engine family per the strict plugin
engine rule: typed CuratorEngine contract (Lifecycle + domain ops),
owning Registry (registration, discovery, start/health/stop with
failure isolation, reverse-order shutdown, ctx-bounded stop), and a
narrow typed Registrar — each curator receives a capability-filtered
view of the host at Bind, never the daemon.

Runtime: one loop per curator on an injectable clock (fake-clock
testable), best-effort wake nudges with the trigger decision kept in
Check (a dropped nudge only delays to the next check-in, never
corrupts accounting), per-pass timeout and a max-concurrent-passes
slot so curator bursts cannot starve chat turns, per-pass panic
recovery, and bounded shutdown even when a pass ignores cancellation.
curator_run / curator_action / curator_error ride the in-process
event bus so activity stays attributable.

Wired in cmd/archied/main.go (constructed beside memory, Start after
daemon startup, shutdown ordered before memory/LLM teardown) and
exposed as daemon.Daemon.Curators.
2026-08-05 14:54:12 +10:00
sam 69640b5216 docs: consolidate into a single docs/ tree
Fold the old docs/ into the VitePress site and rename docs-2 -> docs.
The 12 architecture PRDs become first-class pages at docs/architecture/
with sidebar nav, rather than being buried under an archive path.
Historical material stays at docs/archive/. Rewrites every docs-2 and
docs/prds/architecture reference across the repo. Site builds clean.
2026-07-29 03:17:42 +10:00