08ebc19c8c7bb33765c4e5ffbccc8ac49130c60e
100
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
708233a538 |
fix(webhook): keep a route path out of the sender identity
A webhook set SenderID to its configured route path. The turn path reads that field through a per-channel resolver which refuses webhook, but the session curator derives its participant from the raw field with no channel filter, so a webhook session with exactly one distinct sender and one extracted fact wrote agent-user memory addressed to User: "/hooks/...". Nothing reads it, and every pass added more, because the facts are identical strings with no dedup. docs/prds/memory-engine-unification.md criterion 7 requires that a route path never become a user identity. Clear it at the producer rather than teaching every consumer which channels are lying: a route path is a source, not a person, so it no longer enters SenderID. It still keys the inbound rate limit, where it is the documented per-source budget for webhooks (config.RateLimitConfig), so it travels in the new transport-only Inbound.BudgetKey -- carried on the wire beside Page, never persisted, and never read as an identity. pb.Message gains budget_key (field 9) for the same reason page (field 7) exists: transport context that rides with an inbound message and is deliberately absent from storedProto's rendering of a canonical record. The curator needs no change. An empty SenderID already fails closed as an unidentified user message, which is the path a dashboard session takes, and sessionParticipant's existing skip covers it; the test name now says so. |
||
|
|
4c77a20fa8 |
fix(archied): re-establish the control-plane watch streams after they end
The settings and persona watches were launched once, at boot, and ended on the
first stream failure: the goroutine returned, so every later stored change for
that kind was silently never applied and the process recovered only by
restarting (archie-core-yrmr).
Both watches now run one keepWatch goroutine per kind, which re-establishes the
stream in place after a bounded backoff, resuming after the last version an
update carried and stopping on ctx cancellation -- which the loop watches for
itself, so a stream that never closes cannot hold up shutdown. A first open that
fails still fails the boot that asked for it.
The reconnect delay is decided by the attempt that just ended, and only by that
(attemptHealthy, retryDelay): an attempt is healthy iff it delivered an update
this watch had not handled, or it outlived a window that is a strict multiple of
the delay it would otherwise be charged. A healthy attempt returns the delay to
the minimum, a failed one doubles it up to the cap, and the window moves with
the ladder instead of sitting at its floor. The acceptance of a reopen is the
wrong unit: gRPC takes the stream before the handler reads anything, and
controlplane.Server.Watch answers a store it cannot read by ending the stream,
so during the outage this reconnect exists for every reopen is accepted and
every stream ends carrying nothing -- measured with the real server and client
over bufconn, 4.0 watch RPCs a second across 2s of store outage with retry_in
pinned at 250ms when that acceptance is read as health. A window fixed at the
minimum is the same defect for the likelier shape of outage: a store that has
stopped answering does not error at once, it stalls until its read times out,
and an attempt that takes longer to fail than the minimum outlives that window
on every attempt -- measured in the end-to-end outage test before the change, a
300ms stall left the ladder flat at 250ms/250ms/250ms/250ms while the store
never answered a read. Both shapes are charged now, and the outage test drives
three of them (an immediate error, a 300ms stall, and a stall as long as the
delay that rung would be charged) up four rungs of the ladder, each logged retry
held to the delay actually waited.
The wait is injected (wait, production passes waitFor), because the ladder was
only ever asserted through the retry_in attribute: a loop that logged one delay
and waited another would have reported a growing ladder and reopened on a
schedule of its own. TestKeepWatchWaitsTheDelayItCharged reads the delays back
as values and asserts the ladder, and the outage test's gaps catch a wait that
returns without waiting. The retargeted reset test is joined by
TestKeepWatchChargesAReopenTheStoreMerelyAccepted: a delay reset by the
acceptance of a reopen charges every attempt of the outage from the minimum, and
nothing pinned that before.
The watch returns on cancellation without draining what the producer left for
it, so controlplane.Client's producers stop on the same context instead of
parking on a send no reader will ever take -- reproduced 40/40 times as a
goroutine still blocked on an undelivered send after keepWatch returned, one
goroutine and one channel leaked per kind at every exit. That cross-package
coupling is load-bearing in both directions and is stated as such; the two
producers now share the one stream reader that carries it.
A Recv failure is the store being unreachable, not a document this process
refused, and docs/prds/control-plane-apply-status.md ("What can be reported, and
what cannot") is what forbids reporting it as a failure of the process it
affected. The record is now written only for an update that carries a version,
which is what controlplane.Client emits for a document that would not validate
and never for a transport failure. Reporting the transport failure would also
overwrite the text of a standing refusal, replacing the one message that says
what to fix with "control-plane unavailable". The record is not un-clearable of
itself -- Report overwrites it on the next applied version -- but a store that
never changes again leaves the one stamp standing, and the process must not
write it at all. That emission is the whole of the failure path and now has the
test it lacked, from the producer's side:
TestWatchClientsDeliverARecvFailureAsAVersionlessUpdate pins that a Recv failure
is handed over carrying the mapped error and no version, and that a stream the
server closed and one that ended with the watch's context are not updates at all.
The refused version is deliberately not re-offered: the resume point moves past
it, so an edit only a newer build can decode cannot become a hot loop. Both ends
of that contract are pinned now: the watch stub filters its scripted stream by
AfterVersion as the server does, and controlplane.Server.Watch's own filter has
a test for the first time. The apply-status reporter's 30s re-stamp is unchanged
(TestRestampKeepsAReportedFailure).
|
||
|
|
d4d10faa9f |
feat(eda): wire the playbook coordinator into production workflow selection
A loaded playbook now decides a real task's workflow. The wiring point is the daemon's definition pin (Daemon.resolveWorkflowID, consumed by pinWorkflowFromCollection), not pollNATS/publishTask as the design doc assumed: routing moved out of the agent process when workflow definitions became database rows pinned before dispatch, so the pin is the one place a task's workflow is chosen. Precedence: an explicit Task.Workflow (the waiting_human -> approved requeue) still wins, then a matching playbook, then workflow.ResolveWorkflowID's existing label/kind bindings. A playbook naming an undefined workflow is a reported failure that parks the task rather than a silent fall-through to the binding's choice -- the operator bound that trigger deliberately. Store.Dispatch returns the selected workflow name plus the matching playbook's id and version, instead of a compiled workflow.Workflow: the production caller decides against the active definition collection, and the id/version are the first two components of the resolved gap-2 idempotency key. The playbook package no longer imports internal/domain/workflow. The shipped example's `when` read event.priority, a field no intake supplies, so it could never have fired once wired. Both examples now read the event surface playbookInput really builds, and label-trigger.yaml documents the axis an instance defines for itself: trigger.kind is the closed workintake vocabulary because a kind addresses a NATS subject, while trigger.labels is free-form and binds an operator's own taxonomy to a workflow. Module/Channel/Forge positions stay rejected at load; they need the playbook_dispatches ledger first (archie-core-t2db.24). Closes archie-core-t2db.23 |
||
|
|
66ea2937a9 |
fix(workflow): make gate.diff-rules fail closed on a change it never read
The step's contract said it diffs "the worktree". It does not: Trees.Diff reports the merge base against HEAD, so only committed work is visible. A stored definition that placed gate.diff-rules before the step that commits therefore ran every rule against an empty diff, found nothing and returned nil, letting the run proceed -- the "load and check nothing" failure the same file's settings validation exists to prevent, and indistinguishable in the run's events from a change that passed. The rules now read the committed change, and a run that read no committed change while the worktree still holds uncommitted work fails on the spot, naming the step it must follow. The count of added lines read is logged on every run, so "checked nothing" is visible rather than silent. Telling those two apart needs a fact Trees does not carry, so it arrives as the same shape of optional capability changeStatsReader is: an unexported interface in the domain, implemented where git is actually read (worktree.Manager.HasUncommittedChanges, which excludes ignored files the way CommitAll's own status check does) and forwarded by hybridTrees, the Trees every production run uses. A Trees implementation that cannot answer is refused rather than assumed clean: for a gate, silence about the change is a failure, not a pass. The four remaining review findings are recorded, not fixed, in archie-core-ze7y (the escalated .archie/stages/*.go decision, P1, which now blocks archie-core-8szi), archie-core-4kbg (discoverability), archie-core-s1jz (hunk-header and threshold hardening) and archie-core-vof9 (retry keeps the pinned definition, so a rule cannot be unblocked by editing it). |
||
|
|
eb4d5c2017 |
feat(workflow): register gate.diff-rules as the .archie/gate.go replacement
Part of archie-core-8szi. Restores the deleted .archie/gate.go Check() behaviour as a registered, declarative workflow step type: RE2 rules matched against the committed diff, per-rule level (error parks with findings in Detail, warn logs), file:line preserved, registered through the workflowsteps provider set. The .archie/stages equivalent (an argv-running step) is deliberately not landed and is held for the maintainer's trust-boundary decision. |
||
|
|
e3748895a7 |
feat(workflow): register gate.diff-rules as the .archie/gate.go replacement
steps.go's StageYaegiGate tells the operator to migrate the deleted
.archie/gate.go hook to a registered YAML workflow step, and
BuiltinStepRegistry() exposed only the six shipped workflows' own stages,
so there was nothing to migrate to. What that hook did, from
|
||
|
|
c0ec3f6b8e |
fix(workflow): pin the roots, drop the dead vocabulary, guard the nil manager
Third review pass on the step-vocabulary shape, one fix per finding. P1, roots unpinned. The agreement test built its own manager and injected it, so it pinned the resolution sites and not the roots that decide the provider set; a root regressed to workflow.NewManager() (no shipped stages) left go test green. archied now resolves through one unit, stepVocabulary (step_vocabulary.go), and agentworker's productionWorkerDependencies is exercised directly: internal/app/agentworker/step_vocabulary_test.go and internal/app/archied/step_vocabulary_test.go assert each root's manager resolves the shared provider set's shipped stages and accepts a provider registered through it. RunStateStore and openStateStoreAdapter own a SQLite file and a gRPC dial, so their calls are pinned by source position, the way composition_order_test.go pins the memory-engine ordering. P2-B, dead vocabulary. archie-messaging registered a step vocabulary it never resolved (its only control-plane call is RuntimeChatConfig) and could fail startup on it before the State Store target guard. The workflow-definitions surface is now its own type, controlplane.WorkflowDefinitionsClient, so the vocabulary is a constructor dependency of the one surface that resolves step types and of nothing else. The messaging root no longer imports workflowsteps. P2-C, nil manager. A nil *workflow.Manager dereferenced on every resolution path. stepRegistry and CompilePinnedWorkflow now refuse with an error naming the wiring mistake; TestNilStepVocabularyFailsClosedAtEveryResolutionSite pins the refusal. Claim-vs-code corrections: agreement is stated as within one build (vocabulary.go, stepRegistry, openStateStoreControlPlane, openStateStoreAdapter); the Yaegi claim now says no bridge to StepFactory has been built and cites internal/secret/secretextract; the provider set names its three roots; Manager.Register's ordering is documented as a constraint with its consequence, and the shape rule no longer claims to reserve shipped stage names; the shipped-stage test compares against the builtin factory's own stage. |
||
|
|
56f7295a3c |
feat(workflow): own the step vocabulary in a family manager registered at each composition root
archie-core-fwmp. Every call site hardcoded workflow.BuiltinStepRegistry(), so the step vocabulary a workflow definition may name was closed to the six shipped workflows and archie-agent could compile only what the control plane happened to validate against the same literal. internal/domain/workflow.Manager is the family owner (ARCHITECTURE.md#plugin- engine-rule-strict invariant 2): a constructed, injected value with no package-level registry and no init()-time registration. Register validates at the producer and atomically -- nil or unnamed provider, malformed provider or step-type identifier, a step type with no factory, a duplicate claim, a provider declaring one type twice, and a contribution shadowing a shipped stage are each refused, and a refused contribution applies nothing. Registry() hands back a copy, so the closed set is a property of the manager rather than a convention. internal/infrastructure/workflowsteps is the one package both composition roots import: it holds the compiled-in provider set and builds the manager. archied registers it in RunStateStore (the validating side) and in openStateStoreAdapter (the daemon's client), archie-agent in productionWorkerDependencies (the executing side), and archie-messaging at its own root, each before the first resolution. The five hardcoded sites now resolve the injected manager instead: the State Store's workflow-definitions validate closure and encodeWorkflowDefinitions, the control-plane client's read and write paths, and CompilePinnedWorkflow's shipped -definition and pinned compiles (one resolution per package). step_vocabulary_agreement_test.go registers a provider through the production Manager and drives all three sides with it; breaking any one of the six resolution points back to the builtin registry fails that side's assertion. |
||
|
|
be4e29c91b |
feat(controlplane): report which settings version each process is running
Every process that layers database-owned settings now publishes the version it applied, and re-stamps it every 30 seconds so the report time doubles as a liveness signal. A record older than 90 seconds belongs to a process that has stopped, which is the only way this surface can tell a live process from one that applied a version and then died. RuntimeConfig returned the merged config and discarded the versions it read, so no caller could report what it had applied. It now returns them, and archied and archie-gateway report each kind through boot.runtimeConfig at boot and on SIGHUP. A validation failure reports every kind with the error, because the layering is all-or-nothing, and leaves the recorded version alone so a rejected edit does not erase the fact that an older one is live. The daemon also reports workflow execution settings as the watch applies them, and archie-messaging reports channel settings at startup. Reporting is best-effort by construction: the configuration a report describes has already been applied, so a failed write is logged and never returned. That keeps it off the reload's error path, where it would have raised a banner saying a reload failed when its config took effect. applystatus.New refuses a process name Processes() does not list. The reader renders known names, so an invented one would be invisible rather than wrong, which is the same thing the page means by a process that never started. Relates to archie-core-pskb. |
||
|
|
f38e1a30c8 |
feat(statestore): carry control-plane apply status on the store contract
Adds PutApplyStatus/ListApplyStatus so each process can report which version of a control-plane resource it is running, and the UI can read it back. docs/prds/control-plane-apply-status.md is the approved design. It goes on the State Store contract rather than the control plane, whose service is for editing a resource: a status report is not an edit. The config-snapshot pair is the precedent, and the deny-by-default arm of authorizesTaskScopedCall already refuses both new RPCs to a task grant, which TestOnlyAdminReportsApplyStatus pins. The row is keyed on (process, kind) and replaced in place, because a process re-stamps on an interval and nothing reads a history of re-stamps. An error leaves applied_version alone, so a rejected edit never erases the fact that an older version is live. The read is a list and an empty one is not an error, unlike the config snapshot's found=false singleton. Contract PRD inventory and RPC count follow in the same series. Relates to archie-core-pskb. |
||
|
|
d8dd9ac6d6 |
fix(webui): attribute dashboard writes to an identity, not a literal
internal/webui hardcoded the control-plane actor as "operator:web", so every audit row a dashboard edit wrote to resource_history named a constant rather than an identity the repository can resolve. The identity API next door already had the answer: the dashboard authenticates with one shared token and carries no per-user session, so the actor is the System identity. Both dashboard paths now derive attribution from one webAudit helper, which also stops swallowing the request ID error that would otherwise write an empty idempotency key. Messaging said the same thing but only checked the sender string was non-empty before passing it through as the actor. Its set and replace paths now resolve the sender to an identity and record its ID, on the same resolver the identity subcommand uses, so a sender that does not resolve cannot change settings. |
||
|
|
3944f544e8 |
feat(controlplane): runtime administration over the State Store's gRPC server
The Web UI and messaging channels now read and write Archie's runtime settings through one versioned, audited control-plane API hosted on the State Store's existing gRPC server: catalog, query, command, watch. Each feature owns its resource, validation and commands; storage only writes versions and audit records. Workflows move with it. Definitions become portable YAML compiled through a closed, typed step registry and stored as a control-plane resource, so the yaegi interpretation paths (internal/gate, wfeval, wfextract, gateeval, gateextract, skillbuild) are deleted rather than carried. The UI process reads definitions as data: the JSON projection lives in internal/domain/workflow/task so a dashboard decodes the stored collection without linking the workflow engine, which cmd/archie-ui's deletion gate forbids. Shipped definitions ride the catalog descriptor rather than a bespoke REST route, keeping the API to its four operations. archie-messaging gains -state-store-target/-state-store-token and reads channel settings from the database, failing closed when the State Store is unreachable: the database is authoritative for those settings. |
||
|
|
d4ce6799b6 |
fix(yaegiutil): refuse incomplete Yaegi interface wrappers at load
The generated symbol tables carried 25 hand-added nil guards across three
packages, re-applied by hand after every regeneration because `yaegi extract`
does not emit them. Regeneration silently dropped them, and three package docs
instructed the next agent to put them back.
The guards also answered the wrong way. A nil WResolve returned ("", nil), so a
malformed secret engine served an empty secret and reported success; a nil
WStop reported a clean shutdown for a module that never ran one.
Reject the wrapper where it enters the daemon instead. Yaegi type-checks
"var X Iface = impl{}" and refuses an incomplete impl on its own, but the
wrapper type is exported into the symbol table, so interpreted code can build
one directly and struct-literal semantics leave the omitted method nil.
Resolve now names the missing method and skips the plugin.
Generated tables are used verbatim again. Also names the wanted type on a
failed assertion, which formatted as "want <nil>" for every interface target.
|
||
|
|
f45ebd288d |
fix: address the Greptile findings on the merged PRs (#902)
* fix: address the Greptile findings on the merged PRs Four valid review findings from PRs #892, #893, #898 and #899, which were merged without the comments being read. - Config.Clone left the new diff-cap pointers aliased (#899, mine). Clone deep-copies every reference field, including the *bool beside it, so a clone could write the cap through to the published snapshot. Both the top-level field and the identity overrides are copied, with the clone test extended to cover them. - providerOutcomeRecorder.record could report an older call as the latest (#892). The completion time is taken before the lock, so two concurrent calls can reach the lock in the opposite order to their completion and the unconditional store overwrote the newer outcome. It now keeps the newer, via a recordAt seam that makes the reordering testable. - Curator model calls bypassed the recorder (#892). curatorLLMRunner calls the runtime directly, so a daemon whose only recent model traffic was curator work reported "no calls attempted yet" while the provider was demonstrably reachable. It records at its own adapter, and sendChatTurn's "single choke point" comment is corrected to say there are two. - A provider error reached /status raw (#892), unlike channel details, so a multiline or oversized error broke the one-line-per-fact layout. Both now share one bounded formatter. Found while fixing the curator path: agentexec.NewRuntime returns nil when no provider is configured, and a nil *runtime.Runtime panics on its first method call, so a curator asking for a completion took the daemon down. It now returns an error, and records nothing -- a local misconfiguration is not a provider call. Not fixed, filed instead: the shared lastPollAt masking a stuck identity, the container max-uptime callback resurrecting teardown bookkeeping, the dashboard dropping a served-only status filter on cold load, and the route registry test's line-by-line parser. * fix(build): drop goimports from the gate's formatter set `task check` spent 136 of its 167 seconds in `task fmt`, and 134 of those 136 in one formatter: goimports alone over the tree. golangci-lint's goimports formatter calls imports.Process once per file, which builds a fresh x/tools ProcessEnv each time, so internal/imports.getFixesWithSource re-reads modindex.Read($GOMODCACHE) per file. On this machine that index is 62.7 MiB / 2,081,070 lines (an 11 GiB module cache), and modindex's in-process memo does not take effect: 3 files read 187.9 MiB back, 15 files open the payload 15 times. That is ~53 GiB of I/O and CSV parsing per run, and it is linear at ~155 ms per file (122 files -> 18.8s, 864 -> 133.8s). Pointing the index cache elsewhere drops the same command to 3.9s. The same analyzer runs under `golangci-lint run`, so a cold cache pays it again: 169s cold with goimports, 31s without -- which is what CI and archied's own PR gate see, since only `fmt` never caches locally. Removing it costs no enforcement. gofumpt and gci remain, `task lint` still reports formatter drift as an issue, and the whole-tree fmt is now 2.2s with the tree byte-identical. What is given up is goimports' convenience of adding and removing import lines, which compile errors already cover. The examples/secret-engines exclusion stays: gofumpt and gci leave those Yaegi programs alone today, but the exclusion is the stated invariant that a formatter must not rewrite the imports of files it cannot type-check, and TestFormattersExcludeInterpretedSecretEngines holds it. Its comment no longer pins the reason to the formatter that was dropped. * fix(gateway): stop /status promising and mis-reporting health it cannot see Two findings from the cloud review of #892. Title generation no longer records chat-model health. It runs detached after a first turn under its own 30s bound and its error is swallowed by the caller, but it shared the process-wide outcome recorder, so a title that merely timed out overwrote the health line with "failed" -- reporting a broken provider on the strength of a call no user was waiting for. The /status command description no longer claims "workers" and "channels". Neither can render: newStatusHealth reads the container pool and the poll loop from boot, but the only production router.Health assignment is in setupGatewayChat, which runs solely in the archie-gateway process, where neither exists; channels is nil since the Messaging Service took the front-ends. Only the broker and chat-model lines actually appear, so that is what the help text now says. The underlying split -- daemon owns the facts, Gateway owns the Router -- is filed rather than patched here: it needs either a cross-process health contract or a ratified two-section /status, not a quick wire-up. |
||
|
|
29bd321894 |
feat(messaging): Messaging Service operator surface, chat report rendering, and the diff-cap config fix (#899)
* feat(workflow): post line-anchored review comments with suggested fixes Bead archie-core-q9au (docs/prds/inline-review.md). A review's findings reached the operator only as a flat list in the PR body, so the author had to map every finding back to its line by hand and apply mechanical fixes by hand. Now the line-anchored findings are also posted as inline review comments, carrying a one-click suggestion when the reviewer could state the fix. Domain (internal/domain/workflow): - ReviewFinding gains Suggestion; Validate rejects one on anything but a confirmed finding, so the agent's record_finding call is refused with something it can act on. Validate splits into validateAnchor / validateClassification / validateDisposition, which also brings it back under the cyclop limit the gate enforces. - StagePostReviewComments runs after StageOpenPR in the implement workflow. It posts only line-anchored findings (Line > 0); a whole-file finding has no line to attach to and stays in the body list, which remains the complete record. It is best-effort: the PR is open and the body already lists every finding, so a failed comment is logged, never a park -- the same reasoning as OpenPR's existing best-effort LinkBranch call. - The suggestion fence is gated on Verdict == confirmed where the fence is written, because it is a one-click apply: a wrong suggestion breaks the code and the author has to notice. Forge (internal/forge): ReviewCommentWriter + GitHub/Gitea implementations, type-asserted like PullRequestReader so a forge that cannot is skipped rather than faked (NoopForge is pinned as not satisfying it). GitHub loops one CreateComment per comment and joins the failures, so one refused anchor cannot drop the rest; Gitea carries them on a single COMMENT-state review. Two deliberate departures from the PRD's sketch, both recorded in it: - The interface is batch (CreateReviewComments), not one call per comment: Gitea's only inline shape is one submitted review, and the set then crosses NATS once instead of once per finding. - The head SHA is resolved inside each forge implementation rather than by the caller. The stage runs in archie-agent, which holds no forge credentials and has no PullRequestReader; the daemon-side forgerpc handler is the only place that does. Transport (internal/forgerpc): workflow.Forger gains the method, so the agent reaches the daemon over the new create_review_comments subject; the server type-asserts the writer and answers an incapable forge with an error the stage logs. This is the one proxied method whose absence on an image skew does not park a task. The reviewer prompt and record_finding schema ask for a suggestion on a confirmed, mechanically fixable defect only. Regenerating the wfextract symbol table -- the documented way a new exported workflow symbol reaches interpreted stage plugins -- also picked up symbols that were missing from the committed table (the Status* and Source* constants, ReviewCheck, Store, Task, and the _Store wrapper). Nil-guards were re-applied to every wrapper afterwards, as that file's header requires. Evidence: task check exit 0 (incl. 229 UI tests). Three mutations of the new stage logic each fail a test that names the behaviour -- dropping the confirmed-only gate, dropping the Line > 0 filter, and letting a posting failure escape -- so the tests discriminate rather than passing vacuously. * fix(build): drop the Dockerfile pin assertion The guard fetched golangci-lint's go.mod at image build time to fail the build when GOLANGCI_LINT_VERSION and GOFUMPT_VERSION disagreed. It only ever tripped on self-inflicted pin drift, but it added a network fetch and a new failure mode to the release build, which is not where that belongs. The pins stay correct (golangci-lint 2.13.2, whose vendored gofumpt v0.11.0 equals GOFUMPT_VERSION) and the comment above them still states the invariant, so the reasoning survives without the build-time machinery. The pin change itself reaches the agent image through the normal release path: CI rebuilds and pushes archie-agent on an archie/vX.Y.Z release, and a gateway-only release deliberately does not. * feat(workflow): add the remediate workflow for PR review remediation Implements step 5 of docs/prds/pr-review-remediation.md: a remediate workflow that resumes the task's existing worktree onto its PR branch (worktree.Manager.Resume, not Prepare's refresh), runs a builder agent against the review's actionable comments, commits and pushes to the same branch, and replies via the forge's ReplyToReview. Task.RetryCount doubles as the remediation round counter, capped by the repo's max_retries; the round-cap stage parks the task and posts one comment when it's hit. Task gains a ReviewPayload field (JSON-encoded review unit) with full store/proto/staterpc plumbing. workflow.Forger gains Comment and ReplyToReview, proxied to archie-agent via a new forgerpc RPC. Resume and its Dir lookup are added as an unexported optional Trees capability rather than widening the exported interface, which is already at golangci-lint's interfacebloat cap and is projected into wfextract's Yaegi symbol table for repository-authored stage plugins. The daemon-side reaction consumer that dispatches into this workflow (subscribing ARCHIE_REACTIONS, grouping comments by review, enforcing per-task serialization) is tracked separately in archie-core-8li9.4. * feat(messaging): extract standalone messaging service binary and process composition * feat(messaging): adapt channel frontends to consume Gateway ChatContract * feat(messaging): remove in-process channels and Router from daemon bootstrap Telegram, email and webhook now run only in the Messaging Service, which reaches this process through the Gateway's ChatContract. The daemon builds no channel and no gateway.Router, so the wiring that existed only to serve them goes with it: setupGateways, setupEmailGateway, setupWebhookGateway, setupTelegramGateway, buildTelegramRouter, makeTelegramReload and the release-announcement path helper. The seams those paths owned move to where they can still be honoured: - Channel ValidateConfig runs in archiemessaging.compose, which now returns an error, so a configured-but-invalid front-end fails the service rather than being dropped silently. - The inbound rate limiter moves to the Gateway process, which owns the only Router and therefore the only place a per-sender budget applies to every channel's turns. - The daemon's gateway readiness probe becomes a ContractProbe against the Gateway. It cannot observe a channel lifecycle it no longer runs, and a channel-count probe would have reported every daemon degraded. - telegramSetup is now chatSetup (in chat_setup.go), trimmed to the fields a chat turn runner actually reads. Telegram operator features that were wired only in the daemon (/update, release announcements, version reporting, SIGHUP reload) are not yet wired in the Messaging Service: archie-core-8cda.6.6. Channel lifecycle reporting: archie-core-8cda.6.8. The Gateway process builds no worktree manager, so review_pr is unadvertised on every channel: archie-core-8cda.6.7. * feat(messaging): re-wire the Telegram operator surface in the Messaging Service setupTelegramGateway satisfied eight telegram.Gateway seams from the daemon's own process. Each is resolved by where the fact it needs is owned, not by where it used to be built; the decision table is in docs/architecture/migration-decisions.md. Wired here: /update (built from this service's own [chat.telegram] check and install commands), the update-report relay (same sha256(bot_user)[:8] path the daemon wrote, so a pending report is found rather than written afresh), show_tool_calls, and /restart's config reload, which re-resolves the token and allowlist from this service's own file and refuses a reload that resolves to an empty token. /version is sourced from the Gateway: ChatSnapshot gains a Version field carrying the Gateway's rendered build block, read per call and bounded by the dependency timeout. cmd/archie-messaging deliberately takes no version ldflags, so it cannot report a partial upgrade as a matched one. RunningVersions and ReleaseAnnouncements stay nil. Both need a component's real running version, and the only versions this process can obtain are a different binary's stamps -- reporting them would manufacture exactly the false success the update check exists to catch, and the announcer without parseable versions is a no-op that reads as configured. archie-core-8cda.6.9 carries the contract that unblocks them. Dangerous stays nil: no composition has ever supplied a command authority. Enrich is dropped from the update service: componentInstallTypeEnricher read [nats], which this service must not decode, so the check command's own reported install type stands. * fix(workflow): guard inline review comments against head drift Two findings from the review of q9au. A comment's line numbers describe exactly one revision of the branch, but the forge resolved the pull request's head at posting time -- after the review had already read the worktree. A push in that window (a collaborator, a retry) meant the findings were anchored to whatever now occupied those lines, mislabelling instead of failing. The revision the review measured now travels with the comment set: OpenPR records it from the same worktree read it already performs (TaskContext.ReviewedHeadSHA), StagePostReviewComments threads it through Forger to forgerpc, and the forge refuses the whole set once the head it reads has moved off it -- which the best-effort stage logs, the PR body remaining the record. An unmeasured revision posts unverified rather than dropping every finding, so a worktree that cannot report one degrades instead of regressing. Suggestion was documented single-line only, because GitHub applies a suggestion fence up to its first line and a multi-line replacement would silently corrupt the file. Only the verdict was validated, so a multi-line suggestion reached the renderer and posted as that truncated fence. Validate now rejects an embedded newline, which makes record_finding refuse it with feedback the model can act on instead of the reviewer discovering the corruption later. * fix(gateway): render chat reports as lines, not one run-on paragraph /status and /tasks are line-oriented reports, but their newlines were plain "\n" -- CommonMark's soft wrap. The Telegram rich-block renderer space-joins soft-wrapped lines, by design: a Telegram paragraph renders an embedded newline as nothing at all, so a space is the only separator that survives. The reports therefore arrived as one line each: "Runtime Provider: DeepSeek Model: deepseek/deepseek-flash", and every task's title, state and park reason jammed together. The renderer now implements CommonMark's hard line break (two trailing spaces, or a trailing backslash): the line closes its own block and the next one hugs it, so a stanza keeps its lines without the spacer paragraph that separates unrelated blocks. Ordinary prose is untouched -- a model's wrapped paragraph still joins with a space. The producers mark their report lines with it. Two report fixes alongside: - A park reason is capped to its first line at 160 runes. It carries whatever the failing stage reported, which for a lint gate is the whole tool log; unbounded, one parked task pushed every other task out of the reply. The full reason is still on the task. - /status loses its "Runtime" sub-header. A section header over two fields made a four-fact report read like a document. * fix(config): let diff_cap_lines = 0 actually switch the cap off Config.DiffCapLines was a plain int, so the defaults pass could not tell an absent key from an explicit 0 and rewrote both to 400. The dashboard schema said "0 means unlimited" and StageDiffCap treated <= 0 as unlimited, but 0 never reached the step: the documented way to switch the cap off was unreachable through config. Same root cause, worse instance: configForIdentity assigned root.DiffCapLines = identity.DiffCapLines unconditionally, so an identity that simply omitted the key overwrote the shared cap with the zero value and silently disabled the safety rail for that identity. DiffCapLines is now *int on both Config and IdentityConfig -- nil is absent, 0 is no cap -- read through Config.DiffCap(). Defaults fill only nil, and an identity overrides only when it set the key. TaskConfig keeps a resolved int, so the daemon/agent wire format is unchanged and a version-skewed agent cannot misread a null. The park reason changes too. It told the operator to "approve manually", but a parked task's actions are retry, abandon and reject (internal/taskstate): there is no approve path out of diff-cap, so it sent them looking for a button that does not exist. It now names the two things that work. * feat(config): make the daemon's readiness dependency timeout configurable The daemon's gateway probe bounded its call with a hardcoded 5s constant, while every other NewContractProbe call site (archie-ui, archie-messaging) passes the service's configured DependencyTimeout. It was the only magic number among them. [health].dependency_timeout carries it, defaulting to the same 5s the extracted services' -dependency-timeout flag defaults to, so every process bounds a probe into a dependency the same way out of the box. It is not added to the dashboard config schema or the reloadable set: [health] appears in neither today, health.listen included, and a probe assembled at boot would not observe a reload anyway. |
||
|
|
1dc212e50e |
feat(gateway): give /status a real daemon-health surface (#892)
* feat(gateway): give /status a real daemon-health surface Phase 2 of archie-core-wp9s. Phase 1 split the commands apart (health vs work) but left /status with one aggregate queue line and a static runtime block; it could not answer the questions an operator actually asks when something feels wrong. /status now reports, between the queue line and the runtime block: - Broker: the live state of this process's own NATS connection (eventbus/nats.Client.Connected), not a fresh dial -- a probe would report the probe's reachability, not the daemon's. - Containers: the pool's own active counter against the configured cap (Pool.Active/Cap), not a Docker listing, which would include containers this pool does not own. A zero cap means unlimited, so it is not shown as a ratio. - Channels: the channel manager's real lifecycle state, including a failed adapter's reason (the documented decision: read the existing manager rather than re-deriving health per adapter). - Chat model: last-known outcome of every chat-model call this process made, recorded once in sendChatTurn (the single choke point) and read back by /status. The second documented decision: never a live probe, so /status stays instant and reports what happened -- or says plainly that nothing has been attempted yet. - Last poll: when the most recent poll pass began, stamped on both poll paths (Run's single-identity loop and runIdentities' per-identity goroutines). A pass that hangs leaves the stamp stale, which is the signal; stamping completion would leave a wedged poller looking healthy. Truthful or absent: a section this process has no source for is omitted rather than rendered as a zero. The standalone Gateway owns no poll loop, pool or channel manager, so its /status reports broker and chat-model health only; aggregating across processes would need a new daemon RPC and is deliberately not built. Version stays out (/version owns it). /status and /tasks descriptions now describe what each command actually does on both published surfaces (Telegram menu/help and the shared specs), pinned by a test that also fails if the two surfaces drift. Sources are read through functions, not captured values: occupancy and channel state move, and the daemon is built after the gateways, so a source captured at construction would freeze /status on boot state. Left in place deliberately: the Runtime (provider/model) block, which Phase 1 flagged and which duplicates /model and /whoami. Removing it is a product call on a command Sam uses daily, not a mechanical follow-up. * docs(prds): record the two open /status health decisions as settled Both were flagged in PR #892 as needing the maintainer's call; both are now answered, and the PRD is the place a follow-up would look: - The Runtime (provider/model) block stays. It is the one line in /status the ticket's own rule says should not be there, but /status is read daily to see the active model at a glance, so the duplication is deliberate. Recorded as a settled product decision so it is not removed later as an oversight. - Health stays per-process. Pooling the daemon's and the Gateway's chat-model outcomes would need a new daemon<->gateway health RPC for one status line, and a per-process line is true where an aggregate would be a claim about a process the answering one cannot see. /agents' published description is still left to archie-core-mxls, unchanged. |
||
|
|
c29cdf6f79 |
feat(workflow): post line-anchored review comments with suggested fixes (#891)
* feat(workflow): post line-anchored review comments with suggested fixes Bead archie-core-q9au (docs/prds/inline-review.md). A review's findings reached the operator only as a flat list in the PR body, so the author had to map every finding back to its line by hand and apply mechanical fixes by hand. Now the line-anchored findings are also posted as inline review comments, carrying a one-click suggestion when the reviewer could state the fix. Domain (internal/domain/workflow): - ReviewFinding gains Suggestion; Validate rejects one on anything but a confirmed finding, so the agent's record_finding call is refused with something it can act on. Validate splits into validateAnchor / validateClassification / validateDisposition, which also brings it back under the cyclop limit the gate enforces. - StagePostReviewComments runs after StageOpenPR in the implement workflow. It posts only line-anchored findings (Line > 0); a whole-file finding has no line to attach to and stays in the body list, which remains the complete record. It is best-effort: the PR is open and the body already lists every finding, so a failed comment is logged, never a park -- the same reasoning as OpenPR's existing best-effort LinkBranch call. - The suggestion fence is gated on Verdict == confirmed where the fence is written, because it is a one-click apply: a wrong suggestion breaks the code and the author has to notice. Forge (internal/forge): ReviewCommentWriter + GitHub/Gitea implementations, type-asserted like PullRequestReader so a forge that cannot is skipped rather than faked (NoopForge is pinned as not satisfying it). GitHub loops one CreateComment per comment and joins the failures, so one refused anchor cannot drop the rest; Gitea carries them on a single COMMENT-state review. Two deliberate departures from the PRD's sketch, both recorded in it: - The interface is batch (CreateReviewComments), not one call per comment: Gitea's only inline shape is one submitted review, and the set then crosses NATS once instead of once per finding. - The head SHA is resolved inside each forge implementation rather than by the caller. The stage runs in archie-agent, which holds no forge credentials and has no PullRequestReader; the daemon-side forgerpc handler is the only place that does. Transport (internal/forgerpc): workflow.Forger gains the method, so the agent reaches the daemon over the new create_review_comments subject; the server type-asserts the writer and answers an incapable forge with an error the stage logs. This is the one proxied method whose absence on an image skew does not park a task. The reviewer prompt and record_finding schema ask for a suggestion on a confirmed, mechanically fixable defect only. Regenerating the wfextract symbol table -- the documented way a new exported workflow symbol reaches interpreted stage plugins -- also picked up symbols that were missing from the committed table (the Status* and Source* constants, ReviewCheck, Store, Task, and the _Store wrapper). Nil-guards were re-applied to every wrapper afterwards, as that file's header requires. Evidence: task check exit 0 (incl. 229 UI tests). Three mutations of the new stage logic each fail a test that names the behaviour -- dropping the confirmed-only gate, dropping the Line > 0 filter, and letting a posting failure escape -- so the tests discriminate rather than passing vacuously. * fix(build): drop the Dockerfile pin assertion The guard fetched golangci-lint's go.mod at image build time to fail the build when GOLANGCI_LINT_VERSION and GOFUMPT_VERSION disagreed. It only ever tripped on self-inflicted pin drift, but it added a network fetch and a new failure mode to the release build, which is not where that belongs. The pins stay correct (golangci-lint 2.13.2, whose vendored gofumpt v0.11.0 equals GOFUMPT_VERSION) and the comment above them still states the invariant, so the reasoning survives without the build-time machinery. The pin change itself reaches the agent image through the normal release path: CI rebuilds and pushes archie-agent on an archie/vX.Y.Z release, and a gateway-only release deliberately does not. * feat(workflow): add the remediate workflow for PR review remediation Implements step 5 of docs/prds/pr-review-remediation.md: a remediate workflow that resumes the task's existing worktree onto its PR branch (worktree.Manager.Resume, not Prepare's refresh), runs a builder agent against the review's actionable comments, commits and pushes to the same branch, and replies via the forge's ReplyToReview. Task.RetryCount doubles as the remediation round counter, capped by the repo's max_retries; the round-cap stage parks the task and posts one comment when it's hit. Task gains a ReviewPayload field (JSON-encoded review unit) with full store/proto/staterpc plumbing. workflow.Forger gains Comment and ReplyToReview, proxied to archie-agent via a new forgerpc RPC. Resume and its Dir lookup are added as an unexported optional Trees capability rather than widening the exported interface, which is already at golangci-lint's interfacebloat cap and is projected into wfextract's Yaegi symbol table for repository-authored stage plugins. The daemon-side reaction consumer that dispatches into this workflow (subscribing ARCHIE_REACTIONS, grouping comments by review, enforcing per-task serialization) is tracked separately in archie-core-8li9.4. * feat(messaging): extract standalone messaging service binary and process composition * feat(messaging): adapt channel frontends to consume Gateway ChatContract * feat(messaging): remove in-process channels and Router from daemon bootstrap Telegram, email and webhook now run only in the Messaging Service, which reaches this process through the Gateway's ChatContract. The daemon builds no channel and no gateway.Router, so the wiring that existed only to serve them goes with it: setupGateways, setupEmailGateway, setupWebhookGateway, setupTelegramGateway, buildTelegramRouter, makeTelegramReload and the release-announcement path helper. The seams those paths owned move to where they can still be honoured: - Channel ValidateConfig runs in archiemessaging.compose, which now returns an error, so a configured-but-invalid front-end fails the service rather than being dropped silently. - The inbound rate limiter moves to the Gateway process, which owns the only Router and therefore the only place a per-sender budget applies to every channel's turns. - The daemon's gateway readiness probe becomes a ContractProbe against the Gateway. It cannot observe a channel lifecycle it no longer runs, and a channel-count probe would have reported every daemon degraded. - telegramSetup is now chatSetup (in chat_setup.go), trimmed to the fields a chat turn runner actually reads. Telegram operator features that were wired only in the daemon (/update, release announcements, version reporting, SIGHUP reload) are not yet wired in the Messaging Service: archie-core-8cda.6.6. Channel lifecycle reporting: archie-core-8cda.6.8. The Gateway process builds no worktree manager, so review_pr is unadvertised on every channel: archie-core-8cda.6.7. * feat(messaging): re-wire the Telegram operator surface in the Messaging Service setupTelegramGateway satisfied eight telegram.Gateway seams from the daemon's own process. Each is resolved by where the fact it needs is owned, not by where it used to be built; the decision table is in docs/architecture/migration-decisions.md. Wired here: /update (built from this service's own [chat.telegram] check and install commands), the update-report relay (same sha256(bot_user)[:8] path the daemon wrote, so a pending report is found rather than written afresh), show_tool_calls, and /restart's config reload, which re-resolves the token and allowlist from this service's own file and refuses a reload that resolves to an empty token. /version is sourced from the Gateway: ChatSnapshot gains a Version field carrying the Gateway's rendered build block, read per call and bounded by the dependency timeout. cmd/archie-messaging deliberately takes no version ldflags, so it cannot report a partial upgrade as a matched one. RunningVersions and ReleaseAnnouncements stay nil. Both need a component's real running version, and the only versions this process can obtain are a different binary's stamps -- reporting them would manufacture exactly the false success the update check exists to catch, and the announcer without parseable versions is a no-op that reads as configured. archie-core-8cda.6.9 carries the contract that unblocks them. Dangerous stays nil: no composition has ever supplied a command authority. Enrich is dropped from the update service: componentInstallTypeEnricher read [nats], which this service must not decode, so the check command's own reported install type stands. * fix(workflow): guard inline review comments against head drift Two findings from the review of q9au. A comment's line numbers describe exactly one revision of the branch, but the forge resolved the pull request's head at posting time -- after the review had already read the worktree. A push in that window (a collaborator, a retry) meant the findings were anchored to whatever now occupied those lines, mislabelling instead of failing. The revision the review measured now travels with the comment set: OpenPR records it from the same worktree read it already performs (TaskContext.ReviewedHeadSHA), StagePostReviewComments threads it through Forger to forgerpc, and the forge refuses the whole set once the head it reads has moved off it -- which the best-effort stage logs, the PR body remaining the record. An unmeasured revision posts unverified rather than dropping every finding, so a worktree that cannot report one degrades instead of regressing. Suggestion was documented single-line only, because GitHub applies a suggestion fence up to its first line and a multi-line replacement would silently corrupt the file. Only the verdict was validated, so a multi-line suggestion reached the renderer and posted as that truncated fence. Validate now rejects an embedded newline, which makes record_finding refuse it with feedback the model can act on instead of the reviewer discovering the corruption later. |
||
|
|
d5026f1a49 |
feat(memory): four-scope contract and builtin engine CRUD (unification slice 2) (#886)
* feat(memory): four-scope contract with CRUD and revisions
Seam for memory unification slice 2 (docs/prds/memory-engine-unification.md
§1, §2, §7): internal/domain/memory is now a scope-addressed CRUD contract.
- Scope{Kind,Agent,User} with the four ratified kinds, Validate rejecting a
component present where it is not required, and a length-prefixed Key so
opaque channel-native ids cannot collide.
- Subject{AgentID,UserID} with Scopes()/WritableScopes(): global is never
writable, and an absent user id removes every scope requiring one.
- Store becomes Create/Get/Query/List/Update/Forget/Revisions over
NewRecord/RecordUpdate/Record/Revision, with ErrNotFound/ErrStaleRevision.
Observation, Identity and Metadata are deleted.
- The content scanner moves into the family (internal/domain/memory) so every
engine applies it in Create and Update; internal/memory re-exports the types
until slice 5 deletes it.
- The markdown store moves to internal/infrastructure/memory/builtin, its
correct home per organisation.md.
WIP: internal/infrastructure/memory and internal/infrastructure/sessioncurator
are converted in the lanes that follow this commit.
* feat(memory): builtin engine CRUD, retained revisions and the curator's agent-user write
Slice 2 implementation (docs/prds/memory-engine-unification.md §1, §2, §6,
§7), on top of the contract seam in the previous commit.
- internal/infrastructure/memory: per-scope markdown heads with a JSON
provenance marker, per-scope HISTORY.md retaining superseded and deleted
states, Update superseding before replacing the live block, ErrStaleRevision
via RecordUpdate.Expected, idempotent Forget, and the family scanner applied
in Create and Update. Scope directories are hex(sha256(Scope.Key())).
- internal/infrastructure/sessioncurator: the participant is derived from the
session's user-role senders; exactly one writes agent-user scope, zero or
several write nothing and return ActionSkipped naming the count.
- docs/architecture: the settled decision recorded in migration-decisions §5
(superseding the 2026-09-02 marker entry) and agent-system.md pointing at it.
Draft: to be squashed and reviewed before publication.
* test(curator): conform the registry's fake memory engine to the CRUD contract
The fake still implemented the pre-CRUD Store surface (Write taking an
Observation, List/Forget keyed by a bare string), so the package's test
binary no longer compiles: fakeMemoryEngine is missing Create, Get, Update
and Revisions, and domainmemory.Observation no longer exists. That took
`go fix ./...`, `go vet ./...` and `go test ./...` down with it, which is
what `task check` runs first.
Missed by the same commit that updated internal/infrastructure/sessioncurator's
own fake to the new interface. Repaired on the fake, not by loosening the
interface: the fake is the only thing out of date.
* fix(sessioncurator): refuse to attribute a session with unidentified user messages
sessionParticipant skipped user-role messages with an empty SenderID and
counted only the identified ones, so a session holding one identified sender
plus any number of unidentified user messages yielded that sender as the
single participant. Those messages are still part of the excerpt the
extraction model reads, so facts derived from content of unknown provenance
were written into the identified sender's agent-user scope: user A's memory
can end up crediting content that may belong to someone else. It is exactly
the case the function's own doc comment claims to handle, which it only
caught when no message at all was identified.
An unidentified user message now makes the session unattributable outright,
beside any number of identified senders, and the skip action's reason names
the count instead of reporting a sender count that no longer explains the
skip. Assistant-role messages are unaffected: they carry the bot, so they
still cannot manufacture a participant.
Fixed in sessionParticipant rather than at the write, because it is the
single producer of the attribution decision: it now returns the participant
or the reason there is none, so the caller cannot print a reason that
disagrees with what it decided. The fail-closed path (nothing written, one
ActionSkipped) and the extraction flow are unchanged.
* fix(memory): carry record content through the block format intact
builtin.Store's format ends a block at a blank line and starts a section at a
"## " line, but storeContent only trimmed the content and rejected an empty
one. Content holding either delimiter was accepted, written, and answered back
to the caller in full -- then read back truncated at the delimiter by Get,
List, or a process restart, with the remainder unaddressable and no error
anywhere along the path.
Fixed at the producer, in the render/parse pair that owns the block format:
renderBlock escapes the two delimiter shapes (an empty line becomes a single
backslash, a line already starting with a backslash or "## " gains one) and
parseBlocks undoes it on the way back, so a record's content survives the
write whole. Rejecting the content instead would have made an ordinary
multi-paragraph note or a quoted heading unrepresentable; escaping every line
would have changed the on-disk shape of every record. Only the lines that need
it are escaped, so a one-paragraph record is byte-identical to what the
unfixed engine wrote and the document stays hand-editable.
Reachable from both producers: the chat tool's note and the curator's
model-extracted fact are free text, and neither is constrained to one
paragraph.
Tests: TestBuiltinEngineRenderedBlockRoundTripsContent asserts
parseBlocks(renderBlock(c)) == c for eleven content shapes, and
TestBuiltinEngineContentSurvivesTheWriteAndAReopen carries the same shapes
through Create, Get, and a second engine reading the file a restart would.
* fix(memory): compare Update's expected revision against the file, not the cache
Update read the record to compare against out of findBlock(stores.live, ...)
-- the engine's cached copy of the scope document -- and checked Expected
against that copy. This engine caches one document per scope and rewrites it
whole, so a second engine over the same scope file (archied and the gateway,
or a restart) holds a copy taken when it last read the file: its view of the
record's revision is superseded, Expected matches the revision it remembers,
ErrStaleRevision never fires, and the rewrite that follows writes that stale
copy back over the file -- discarding the other writer's update and every
record written since the copy was loaded. The field existed and could not
fire.
Reload the scope document before anything is decided from it, so the check
answers about the revision actually on disk and the rewrite starts from the
current document. That is the smaller of the two fixes the PRD leaves open
("Not determined": a reload-before-mutate or an advisory lock); no locking
scheme, no retry loop, and no change to the read paths.
Still unsolved, and deliberately: the whole-document rewrite is
last-writer-wins between the reload and the write, so two engines writing one
scope concurrently can still lose one of the two writes, and HISTORY.md is
rewritten from the cached copy the same way.
Tests: TestBuiltinEngineSecondEngineCannotReuseAStaleRevision asserts the
second engine gets ErrStaleRevision and the first writer's state survives;
TestBuiltinEngineUpdateDoesNotEraseRecordsItHasNotLoaded asserts the record
written after the second engine loaded is still there after its update.
* fix(memory): emit the scanner's warning instead of dropping it
scanContent returned nil for every result that was not ThreatBlock, so a
ThreatWarn result -- documented in the scanner as "allow the write but emit a
warning", and what every sensitive-data match produces (API keys, passwords,
tokens, private keys) -- was stored with no audit signal anywhere. The
comment justified the silence by pointing at Bind, but Bind's argument is
about Registrar.Events: internal/events declares no memory kind and the
composition binds no memory event sink, so an invented kind would look wired
and not be. A scanner warning is a diagnostic rather than an event, and there
was nothing else to carry it: the registrar had no logger.
Bind now takes Registrar.Log, optional and mirroring the curator family's
Registrar for the same reason, scanContent emits the warn-level result
through it before the write is allowed, and bootstrap passes the daemon's
logger so the line reaches archied's configured sinks instead of only the
process default. The write is still allowed: only the silence changed.
Tests: TestBuiltinEngineScanWarnsWithoutRefusingTheWrite runs Create and
Update over warn, clean and block content, asserting the write lands either
way, that a warn-level scan result logs exactly one warning carrying the
scanner's own message, that clean content logs none, and that a refused
block-level match logs none.
* test(memory): carry every content shape through Update and Revisions
Update replaces the block it read out of the document by that text, and
retains the superseded state in HISTORY.md, so an escaped block has to be
found, superseded and retained exactly like an unescaped one. Covered here
rather than left to the Create path: without the escaping, every shape in
this table came back truncated after an update, including the plain
one-paragraph record whose replacement holds a blank line.
The test asserts values only: the updated record as a second engine reads it
off disk, and the superseded content as Revisions returns it.
* style(memory): apply the linter's gofumpt form to the Update revision error
golangci-lint's bundled gofumpt wants the closing paren of that wrapped
fmt.Errorf on its own line; the standalone gofumpt binary the fmt task uses
(0.7.0, a different version) leaves it as it was. The text is unchanged from
before the engine fixes in this branch, so this is pre-existing drift inside a
function these commits already touch -- taken so the file is clean under both
formatters rather than only one.
|
||
|
|
0064da1d2b | feat(workintake): authorize review reactions by owned PR | ||
|
|
d956959d39 | feat(workintake): define review reaction envelope | ||
|
|
2385e81066 |
Merge pull request #878 from samcharles93/feat/attempt-attribution
Feat/attempt attribution |
||
|
|
cae63b37c4 |
Merge pull request #875 from samcharles93/feat/archie-reactions-stream
feat(nats): provision the ARCHIE_REACTIONS fan-out stream |
||
|
|
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. |
||
|
|
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).
|
||
|
|
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. |
||
|
|
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 |
||
|
|
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 |
||
|
|
862ac46e8b |
feat(tasks): attribute events, changes and config to the attempt that produced them
The events table had no attempt column, so two attempts of the same task were indistinguishable: a retried task's stage events interleaved into one timeline and nothing could say which run produced a given result. - events gains an `attempt` column through the existing presence-gated migrateTasks loop rather than a version bump, so user_version stays 3 and an existing archie.db is migrated in place. A legacy-database test builds the pre-change schema and proves both that existing rows survive unattributed (attempt = 0) and that a new value round-trips. - Event.attempt = 11 and ReadTaskLogRequest.stage = 9 are field additions to existing messages: no new RPC, no new table, and no change to any canonical error message that crosses the state-store wire. - Every task event the workflow engine emits now carries the attempt. Producers that have no attempt yet (task_queued, binding_dispatch_failure) stay unattributed rather than guessing one. - Changed files are captured as a durable changes_captured event at commit and push time, reusing the existing three-dot diff primitive: paths from FilePatches(), counts from Stats(), base_sha recorded as the merge base actually diffed rather than the base tip, a 200-file cap with totals kept complete. Consumption goes through an unexported optional interface so workflow.Trees -- the yaegi capability surface for interpreted stage plugins -- is not widened. A capture is also taken once the pull request exists, so the capture can link it. - The per-attempt configuration is captured as a durable config_captured event carrying the non-secret config.TaskConfig, instead of a new table plus two new state-store RPCs: events are already this system's per-attempt provenance stream, so a table would have given one feature two provenance mechanisms. Redaction is proven against canary secrets. Measured payload: 539 bytes typical, 2333 bytes at 20 models. - Captures carry a schema marker and are refused unless their key set matches the declared payload shape, so drift surfaces as "recorded but could not be read" rather than as a capture of zeroes. - Three read endpoints serve the attempt rail, the changed-file captures and a raw debug view, mapping to UI-owned response types rather than dumping store types. - The task-log read gains a stage filter, bound to the stage logger for that stage's own lines; agent and tool output records no stage. A task-scoped grant may already insert events on its own task, so this provenance is exactly as trustworthy as the rest of that task's event stream. That limit is documented rather than papered over. |
||
|
|
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. |
||
|
|
2fd0f23971 |
Merge pull request #848 from samcharles93/feat/state-store-task-log-download
feat(staterpc): read task logs through the State Store and make them downloadable |
||
|
|
cf7cc9d891 |
feat(webui): read a task's log through the State Store and let it be downloaded
The dashboard's attempt-log panel answered every read with "task logging is
optional and was not enabled for this run". That message was false: logging is
wired unconditionally in the daemon, and the log files exist. The dashboard
process simply had no reader -- composition left TaskLogs absent because no
contract carried it -- so the handler saw a nil registry and reported the
disabled shape, which the page rendered as a claim about configuration.
internal/logging now answers whether an attempt has a log at all: Tail sets
Result.Found, so "this attempt has no log" is a value rather than an empty
list indistinguishable from a read that never happened. Its registry gains
TaskLog (a decoded page) and TaskLogContent (the file verbatim, streamed,
because a log is unbounded input), and an absent reader reports
ErrTaskLogsUnavailable rather than an empty page -- a process that cannot read
logs must not implicate the attempt.
Those two answers travel the State Store contract as storecontract.TaskLogStore
(ReadTaskLog, StreamTaskLogContent) and are rehydrated on the client by
(Unavailable, canonical message), so archie-ui composes the reader from its own
store client instead of opening another process's files. The daemon's registry
is wired as the server-side reader in the State Store process only.
On top of that read, GET /api/tasks/{id}/logs/download serves the attempt's log
as a Content-Disposition attachment named task-<id>-attempt-<n>.log, and the
panel offers it. The JSON route keeps its shape and gains found, so the page
states the attempt has no log instead of blaming a setting.
Task log files stay owned by their directory's owner: archiving still removes a
task's log directory, and that removal is the daemon's, not the dashboard's.
|
||
|
|
ea128443e0 |
feat(gateway): persist the channel-native sender id on messages
Slice 1 of docs/prds/memory-engine-unification.md: persist the participant, so a later curator can address agent-user memory scope. - messages gains sender_id: schema, ALTER migration (idempotent via duplicate-column detection), both inserts, and both history selects. Pre-existing rows default to empty. - curator.SessionSummary gains AgentID and ConversationMessage gains SenderID; the sessioncurator adapter fills them from the session's bot identity and the stored record. The memory contract is untouched and nothing consumes the new fields yet. Deriving a session's participant from its user-role messages, and failing closed on ambiguity, stays with the curator rewrite. |
||
|
|
0b3dc6c01f |
refactor(forge): delete the unwired RepliesAfter surface
DELETE: IssueForge.RepliesAfter and its Reply type had no production caller -- the waiting_human status exists and is reachable, but automatic detection of a human reply never landed, so the intended poller was never built. Neither implementation paginated either (both read one page of 50), so the method would have been wrong if wired as-is. The manual path is untouched: waiting_human remains reachable and an operator requeues through the existing task-action flow. Removing the interface method also removes seven test fakes that existed only to satisfy it. No behavioural test accompanies this: a pure deletion has no assertion to make fail, and the compiler enforces completeness across every implementation. |
||
|
|
f4e32ee6d4 |
docs(skill): drop comments that named the deleted skill.Discover
Lane F deleted skill.Discover/skill.DiscoverPlugins/skill.Skill (no
production caller) in
|
||
|
|
1177012a3a |
refactor(binding): delete dead Matcher.Overlaps method
DELETE: no document in docs/architecture/ or docs/prds/ specifies a consumer for binding.Matcher.Overlaps, and it has no caller or test caller. The store enforces the overlap invariant with its own SQL (internal/store/bindings.go InsertBinding/UpdateBinding), which is out of this lane's ownership and left untouched. The doc comment's empty-Source rule is already covered by Binding.validateCommon's "matcher.source is required" check, so nothing needs moving. |
||
|
|
0548a944b1 |
refactor(skillbuild): delete dead AugmentRegistry path
DELETE: no document in docs/architecture/ or docs/prds/ names AugmentRegistry as a consumer. The live per-task registry construction is skillbuild.BuildRegistry(workDir) at internal/app/agentworker/ task_execution.go; AugmentRegistry was an unwired alternate merge-over- base path (with collision/override and nil-base semantics) that only tests exercised. mergeSkillWorkflows remains reachable through BuildCatalog/BuildRegistry. |
||
|
|
b5230941ec | merge: lane A (gate-subsystem-2, gate-subsystem-1, infra-misc-3) | ||
|
|
e93ad6353b |
fix(gate): validate finding level and share the blocking threshold
Resolves gate-subsystem-2 and gate-subsystem-1. WIRE: gate.Finding.Level is now a typed gate.Level restricted to LevelError/LevelWarn, and Finding.Validate rejects any other value so a mis-typed or empty level fails the gate closed instead of silently downgrading an intended blocker to a pass -- mirroring the fail-closed standard ReviewFinding.Validate already sets in internal/domain/workflow/review_findings.go. WIRE: StageYaegiGate now delegates the blocking decision to gate.Finding.Blocking instead of re-implementing the raw "error" literal, so the script-facing gate.Blocking helper (exposed by gateextract to interpreted .archie/gate.go scripts) and the rule the daemon actually enforces share one source of truth and cannot drift. |
||
|
|
8bef9605f3 |
fix(curator): populate PassInput.Since with the prior pass time
WIRE: docs/prds/session-memory-curator.md specifies that each pass finds "sessions with activity since the last pass", and its effectiveSince rule treats a zero Since as "the runtime declining to name a horizon" (24h fallback for the first pass). The runtime is the only production constructor of PassInput and already carries lastPass, so it must name the horizon at the producer by setting Since to the prior pass time. Previously Since was never set, so the session curator fell back to now-24h on every pass and re-read the same window each chat turn. |
||
|
|
b0050ff20a |
refactor(state): delete the dead IncrementRetryCount RPC (breaking change, accepted)
IncrementRetryCount had zero production callers -- only tests and the staterpc plumbing referenced it. taskactions.Service.applyRetry already uses the atomic RetryTask exclusively, which increments retry_count and requeues in one transaction. Unlike ListCaptures/ListUndispatchedCaptures (kept as declared-unconsumed compatibility surfaces because a rolling deploy could have an old client/server pairing mid-flight), this repo has one production consumer (see AGENTS.md's solo-project note), so the breaking removal is accepted outright rather than deprecated-and-kept. Deleted the Go method, the storecontract interface entry, the staterpc server/client methods, and the RPC/messages from state.proto, regenerating the .pb.go/_grpc.pb.go pair. Test fixtures that used IncrementRetryCount as a setup helper now drive retry_count through the real path instead: queries_test.go bumps it via direct SQL (same package, no contract to route through), and api_tasks_actions_test.go now loops RetryTask+Transition, which exercises production code instead of a deleted one. |
||
|
|
db18d2675a |
feat(ratelimit): wire per-identity inbound rate limiting into the gateway
internal/ratelimit was fully built (sliding-window limiter, ticker-driven eviction) but had no consumer, leaving multi-identity deployments with no inbound request budget on any channel (archie-core-6wxb / GH #797). Adds Message.SenderID (Telegram numeric user ID, SMTP from address, or webhook route path -- the closest thing webhook has to a caller identity), threads it into Router.Route/RouteStream via a shared checkRateLimit, and wires an opt-in [chat.rate_limit] config section through bootstrap with the documented EvictStale ticker. |
||
|
|
355e1c64b2 | fix(scheduling): respect configuration ownership | ||
|
|
bdf73ed371 |
feat(workflow): review calibration -- checked properties, style nits out of contract
Closes archie-core-h019.5. The shipped contract already made only a confirmed
error-level finding block, and kept zero-findings distinct from not-run; what
was missing was the other half of calibration, and that is what a reviewer that
cries wolf needs.
- ReviewReport gains Checked []ReviewCheck {Property, Evidence}: the properties
the reviewer verified clean. Evidence is required, for the same reason a
finding requires a failure scenario -- a check without evidence is an
assertion, not a verification.
- The reviewer records checks through a typed record_checked tool, mirroring
record_finding, so it cannot end its turn having silently skipped the
checklist.
- Style/formatting/naming nits are stated out of contract, in the ReviewFinding
type doc and the reviewer prompt: they are the padding that trains an
operator to skim.
- The PR-body findings section renders the cleared properties, so a
zero-finding review arrives backed by what was checked rather than reading
the same as a review that never looked.
Design: docs/prds/review-calibration.md.
|
||
|
|
a00c578cb7 |
refactor(ui): sever the archie-ui binary from every daemon runtime package
Completes the objective deletion gate for the UI Service (archie-core-8cda.5.6): go list -deps ./cmd/archie-ui now links zero banned packages -- no modernc.org/sqlite, no internal/store, gateway, channels, memory, secret, agentexec, tools, skill, yaegiutil, curator, or the workflow engine. The closure shrinks from 68 to 26 archie-core packages. Each cut is a producer-side move; no consumer-side defensive shims. - Store contracts (TaskStore family, value types, sentinels) moved from internal/store to internal/domain/storecontract -- the approved contract location per state-store-contract rev. 2d, and NOT internal/contracts: that tree is buf generate output and tools/proto.sh check deletes hand-written files there. internal/store keeps aliases; sentinel message strings are byte-identical and remain the wire contract. - Chat contracts (ChatContract, sessions, turns, streaming, commands) moved from internal/gateway to internal/domain/messaging; gateway keeps aliases. ToolCallEvent rendering helpers become gateway functions (methods cannot live on alias types). - Task vocabulary (Task, statuses, mid-run Store, Definition) split into internal/domain/workflow/task; the pipeline engine stays in package workflow with aliases, so daemon-side callers are unchanged. - overlay.DeniedKeys moved to internal/infrastructure/configuration: webui referenced the constant and that dragged the overlay SQLite store in. - webui.Server's concrete runtime handles become webui-owned view interfaces with daemon-side bootstrap adapters: channel lifecycle (internal/channels/status), MemoryStatus, CuratorStatus, and a SkillCatalog seam replacing the direct skill.DefaultRoots/CatalogRoots calls. Each degrades to an empty page when unwired. - config.SecretRef moved into internal/config (config vocabulary); internal/secret keeps an alias and Registry.Resolve absorbs the zero-value short-circuit. Docs: state-store-contract rev. 2d relocation record; ui-service-boundary deletion gate marked satisfied; ARCHITECTURE.md package map rows. |
||
|
|
8a5d8814d2 |
fix(workflow): order findings before footer; test the report stash
Self-review of #784: (1) the tc.ReviewReport = report stash was untested, so a regression dropping it would silently omit the findings section; (2) the section rendered after the workflow footer, reading as content-after-signature. Move the findings before the footer and pin the StageReview->implementPRBody integration with a test. |
||
|
|
36c7b9d3c6 |
feat(workflow): surface adversarial review findings on the PR body
StageReview now stashes its ReviewReport on TaskContext, and implementPRBody
appends a findings section when the review ran -- explicit in the zero-findings
case ('ran and found no defects') and listing non-blocking warn/plausible
findings. A disabled or never-run review renders no section, so silence is not
mistaken for a clean review. The parked-task park reason already carries
blocking findings (renderReviewDetail), satisfying the dashboard/api-tasks half
of the acceptance criteria.
Closes archie-core-h019.6.
|
||
|
|
d6b2589448 |
refactor(archied): move webhook capture intake to the process that owns work intake
The dashboard's POST /webhooks/capture/{source} handler becomes
internal/infrastructure/captureintake.Receiver, mounted by the daemon on
the same bypass mux through webui.Server.CaptureIntake; the dashboard
keeps only the GET /api/captures read and the mapping preview's scan
window. The UI process now mounts no intake route at all instead of one
that answers 503 (archie-core-8cda.5.4).
|
||
|
|
89d8dc0e7f |
feat(messaging): migrate gateway session persistence onto domain types
SessionStore message history now stores/loads domain/messaging.Message: sender attribution, derived role, and conversation address are canonical record fields. SQLite gains a role column with open-time backfill for pre-migration databases. gateway.Message remains the channel-facing transport; conversion lives in one boundary module. ChatContract, gatewayrpc proto, and dashboard JSON are unchanged; the RPC client splits into ChatContract (Client) and SessionStore (StoreClient) views. Sessions stay SessionContext: UUID keys and platform/bot/title/branch metadata have no lossless home in Conversation; keyed migration tracked separately once Agent/user/binding ownership settles. Refs: archie-core-d9dv |
||
|
|
05529d48d5 |
refactor(state-store): cut daemon/Gateway over to the remote State Store (archie-core-8cda.4.6) (#774)
* refactor(state-store): delete NATS storerpc; agent store is gRPC-only (archie-core-8cda.4.6) The agent is fully on the gRPC State Store contract, so the legacy NATS storerpc path is dead (docs/prds/state-store-contract.md §12 step 4): - delete internal/storerpc (Server, Client, subjects) and its tests - drop the storerpc registration from registerTaskRPCServers and the now-unused store param - make the agent transport's State Store URL required and Store() return only the gRPC staterpc.Client (no NATS fallback) - rework agentworker/agent transport tests to back the store with a real gRPC State Store server instead of the deleted NATS storerpc server The agent binary now fails fast when STATE_STORE_URL is absent. Agent store calls (workflow.Store) go over gRPC to the archie-state-store service. * refactor(state-store): delete daemon/gateway in-process store ownership (archie-core-8cda.4.6) The daemon and gateway no longer open archie.db in-process: the single SQLite file is owned by the standalone archie-state-store process, and both consumers dial its gRPC State StateStore contract (docs/prds/state-store-contract.md §12 step 7, no dual-store ownership). - openStores no longer opens the production task store or seeds b.st; it only wires secrets/forge and the gateway conversation store - openStateStoreAdapter now requires [services.state].target (the old local default is deleted) and resolves b.stateStore as the remote *staterpc.Client - delete the in-process startStateStoreServer (the multiplexed gRPC server and its per-task bearer-token registry) from the daemon composition - RunGateway now resolves the same remote State Store adapter; its session SQLite stays Gateway-owned and untouched - daemon.ConnectedStateStore carries the configured target plus the resolved bearer token, which containerEnv injects as STATE_STORE_URL / STATE_STORE_TOKEN so archie-agent authenticates to the same remote service - readiness store probe reads b.stateStore PRD-consistent choice (noted): with the in-process server gone, per-task token generation is removed; the daemon/gateway/agent all present the single [services.state].target_token (or STATE_STORE_TOKEN secret) that the standalone store validates. * docs(webui): require [services.state].target in config and deployment templates (archie-core-8cda.4.6) After the in-process store path is deleted, archied and archie-gateway dial the standalone archie-state-store gRPC service via [services.state].target and never open archie.db themselves (docs/prds/state-store-contract.md §12 step 7). - config.example.toml documents [services.state].target as required, with the loopback vs Docker-bridge gateway + target_token rule - deployment templates set [services.state] per topology: bridge gateway + token for container-mode agents, loopback for host-only - deployments/README.md and systemd-user-service.md describe start commands for both topologies and drop the stale "not yet consumed by the daemon" note * style: gofumpt alignment for State Store daemon literal; appease noctx/staticcheck (archie-core-8cda.4.6) * docs(state-store): refresh stale in-process references post-cutover (archie-core-8cda.4.6) |
||
|
|
5c0efaceaf |
refactor(workflow): relocate Task/Status/Source and define workflow.Store (#754)
* refactor(workflow,store): relocate Task/Status/Source and define workflow.Store Move store.Task, store.Status*/store.Source*, and the 3-method workflow store interface out of internal/store into internal/domain/workflow as workflow.Task/workflow.Status/workflow.Source plus a consumer-owned workflow.Store, superseding store.WorkflowStore. internal/domain/workflow now imports zero internal/store symbols; internal/store persists the domain type instead (infrastructure depends on domain), and its Store satisfies workflow.Store. Updates every production and test caller of the relocated symbols across daemon, webui, gateway, agentworker, agenttransport/nats, storerpc, taskrun, and worktreerpc, and removes TestRecordDispatchViaExplicitTx per docs/prds/state-store-contract.md (rev. 2c) sections 4 and 12 step 2. Two workflow-package integration tests that exercise the real *store.Store move to an external workflow_test package (store_integration_test.go) to avoid a workflow(test)->store->workflow(prod) import cycle now that store depends on workflow. * no-mistakes(document): docs(state-store): mark §4.8 relocation done in state-store-contract |