d76bf2be67addcdd1c39536cb8ffcfd1cea4792e
22
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
10dd85443d |
feat(staterpc,daemon): park classification on the wire and at the park sites
Domain fields ParkClass/RemediationRounds landed in d6f61c2c; this is the wire and daemon half. Task gains park_class (32) and remediation_rounds (33) and maps both directions; the classified park write crosses the wire as ParkTask on a narrow TaskParker contract (TaskLifecycle stays under the 8-method cap), with conformance coverage local + grpc including the stale-guard sentinel and needs_human normalization. Every daemon park site now states its class: terminal for a repo that left config and a retired identity, transient for the environmental parks (worktree, storage, grants, taskrun), and identityMayAct returns the class beside its reason. |
||
|
|
53bdbd3309 |
fix(staterpc): carry park class and remediation rounds across the wire
|
||
|
|
a65eae2458 |
docs(agents): a bead never carries production instance detail
Beads sync to a Dolt remote, so anything written into one is published. Two beads filed earlier today named an operator host, its internal address and its filesystem paths -- the tracker was treated as a private store, which it is not. The rule is stated where the tracker is described, next to the existing one about .beads/ never reaching a commit, because it is the same class: the tracker is not a private store. Host-specific facts belong in the operator's memos instance, which a bead may point at. |
||
|
|
052e350bf1 |
feat(daemon): wire the review-reaction consumer to remediate runs
The remediate workflow was registered but had no trigger: the reaction stream was provisioned, the envelope, resolver and owned-PR lookup all landed, yet nothing consumed the stream (pr-review-remediation.md's sequencing left the consumer for this step). The daemon now drains the reaction stream each cycle, before the task drain, so a reaction can be claimed in the same pass that carried it. Per decision 3, the store's owned-PR lookup is the authorization boundary: an unmatched, merged or closed PR drops with a counter, and a public reaction can never start an agent against a foreign repository. Per decision 5, a review is the unit of remediation -- its comment events are appended to the unit while it is queued and dropped once the run is claimed (the round cap bounds the exchange); a standalone comment is its own unit of one; approved reviews never remediate; and archie's own comments, matched on the owning identity's bot user, are excluded so its replies cannot retrigger it. The guarded BeginRemediation/UpdateReviewPayload store methods are the dedup: the pr_open -> queued transition carries the review unit in the same write, so re-delivered reactions fail the status guard instead of starting a second round. Both are new StateStoreService RPCs following the Requeue shape, covered by the local/grpc conformance battery. |
||
|
|
8542f0d42c |
fix(proto): keep EventsSinceRequest.since_id's wire name
The cursor change renamed the field to 'cursor' as well as widening its type, which buf breaking flags as FIELD_SAME_NAME and FIELD_SAME_JSON_NAME on top of the type change. The name buys nothing: the field is already documented as an opaque cursor, and the number and name are the wire identity. Adopt the gate's verdict and change only the type, keeping the break confined to the one rule already recorded in proto/buf.yaml. |
||
|
|
ead8e4016d |
feat(store): generalise the event feed cursor to a total order
EventsSince no longer depends on events.id being monotonic. The feed now pages a total order over (at, id): at is a fixed-width, lexicographically sortable UTC timestamp (storecontract.EventCursorLayout) and id is only a deterministic tie-break for rows sharing one timestamp. The cursor is an opaque string on the wire (EventsSinceRequest.cursor), carried verbatim as the SSE id: field and echoed back via Last-Event-ID, so EventSource resume needs no client change. A new idempotent migration normalises pre-existing RFC3339Nano at values to the fixed-width layout before finishTaskMigration, and idx_events_at backs the new query. Legacy integer and garbage cursors degrade to "from the beginning", preserving the old failed-ParseInt-yields-0 behaviour. Amends the "Dashboard live event delivery" decision's cursor-cannot-skip justification, which previously rested on commit-order id assignment. |
||
|
|
ed1557c12e |
feat(edastore)!: move event capture and bindings onto PocketBase collections
The event-capture tables (captures, mappings, bindings, binding_dispatches,
playbook_dispatches) now live in PocketBase-owned collections and their ids
are opaque record ids rather than autoincrement integers. The task lifecycle
stays on SQLite: tasks/transitions/events carry FIFO claim ordering, id-cursor
pagination and the task-grant map, none of which gain anything from being
hand-editable. binding_dispatches.task_id is the single seam and stays an
integer addressing that store.
BREAKING: CapturedEvent.Id, Mapping.Id, Binding.Id and Binding.MappingId are
strings on the wire, as are the ids in the capture/mapping/binding requests.
RecordDispatchRequest.task_id is deliberately unchanged.
What the collections buy, beyond storage: a payload nobody has modelled yet is
inspectable, a mapping is editable at runtime, and a binding's relation to its
mapping is enforced. The old schema declared no FOREIGN KEY on that link, so a
dangling mapping_id was previously possible and is now refused.
Behaviour preserved deliberately, each recovered from the SQLite version
rather than reimplemented from memory:
- draft -> pending_approval -> armed, with approval only from
pending_approval and an edit always returning a binding for re-approval
- one binding per source, guarded on insert, update and approve
- an empty secret on update keeps the stored one, so an edit form that does
not echo it back cannot silently disarm a binding
- ErrMappingNotFound / ErrBindingNotFound on a missing delete target
- sentinels are re-exported from storecontract, never redefined: staterpc
matches on exact canonical message to rehydrate them, so a second
definition would break errors.Is across the wire invisibly
Two implementation notes worth keeping:
- at-most-once dispatch is now a unique index rather than INSERT OR IGNORE.
Only the unique-violation maps to ErrAlreadyDispatched; any other save
error is returned, because treating them all as "already recorded" would
turn the ledger into a silent at-least-once dispatcher.
- captures store received_at themselves at nanosecond precision in a
fixed-width layout. PocketBase autodates are millisecond and record ids
are random, so same-millisecond captures would otherwise order
arbitrarily; the old store got insertion order free from autoincrement.
- ListUndispatchedCaptures is raw SQL: the anti-join is a subquery and
PocketBase's filter DSL is not SQL. A read fires no hooks either way.
Adds tool_calls, which had no persistence at all: tool calls only ever reached
the on-disk task log, readable as text but never queryable or watchable.
Nothing writes it yet.
The binding secret cipher moves with the bindings it protects.
|
||
|
|
35ca43df61 |
fix(state): carry event attribution across the state-store boundary
The live path recorded actor_id, actor_kind and principal_id as empty while the actor was named inside the event's detail text. The daemon records the event and the State Store holds it, and the contract between them did not carry the three fields, so the columns were empty by the time anything could query them. An audit query reading actor_id found nothing and "who approved this" meant parsing a human-readable string -- the transient, unqueryable attribution this work exists to replace. The in-process test passed throughout because it used the local store and never crossed that hop. The new test runs the same insert through the local adapter AND a bufconn-backed gRPC client and asserts the columns on both, so the two paths cannot disagree again. Verified: task check exit 0 on this tree; the new test passes in both modes. The grpc mode is reasoned to have failed before this change -- the field did not exist on the contract, so it could not be set or read -- but that is inference from the mechanism, not a run I performed against the old code. |
||
|
|
369ae695d4 |
feat(webui): verify a provider credential on a request path
The verifier was a library nothing called. A request now carries a credential or is refused: webui.Server.Authenticate resolves a presented bearer token to the identity that may act, and requireIdentity attaches it to the request context. With a provider configured that check replaces the shared token, so every request resolves to a named identity or is refused; with none, the shared-token gate stays for a loopback instance. Nothing about the caller is read from the request. The subject comes from the credential the provider signed and the identity is the record that subject is bound to, which is what makes attribution possible at all: a caller cannot assert who it is, it can only present what the provider gave it. A test sends an X-Archie-Identity header and an actor field in the body alongside a valid token and asserts the resolved identity is still the credential's. Refusals follow HTTP's own distinction: absent or unverifiable credentials are 401 and name the scheme, while a credential that verified for an identity that may not act is 403. Each is covered, because a refusal path with no test is a path nobody has watched refuse. The two state-store RPCs the dashboard needs to resolve a subject exist: ResolveIdentitySubject and BindIdentitySubject, with the client implementing identity.SubjectBinding (a narrower contract than Repository, so the administrative facade keeps its shape) and the server answering Unavailable rather than pretending when a process has no binding store. chat.proto carries the actor for the next step: actor_id, actor_kind and principal_id on ApplyOperatorTaskActionRequest, regenerated here. The transport can now carry an attribution and nothing fills it yet, which is why the dashboard still records task_approved rather than a human attribution. Not wired in production yet, and worth stating plainly: dep.Authenticate is a seam nothing sets, because the dashboard is served only by the UI process and that process is documented to take endpoint references only -- there is deliberately no config.Config in it. OIDC settings must therefore arrive as flags there, which is an existing design boundary I did not want to cross unilaterally. config.Oidc exists so the daemon-side wiring has somewhere to read from. Verified: task check exit 0 after this commit; focused webui run records the resolution and all four refusals. |
||
|
|
bbec2617e1 |
feat(state): carry channel lifecycle from the Messaging Service to the dashboard
archie-core-8cda.6.8's carrier. The service now records channel lifecycle and has nowhere to put it: /api/channels answered with nothing because webui.Server.Channels had no production source, and reload answered 501 for the same reason. This adds the surface the register decided on, following the split archie-core-ymut established for config snapshots -- a pair of administrative RPCs whose writer is one process and whose reader is the UI -- and wires both ends. Wire and store: PutChannelStatus / ListChannelStatus, with ChannelStatus carrying id, name, state, detail, configured, reload_supported and observed_at. The store holds one row per channel and replaces the reported set, so a channel the reporter no longer mentions is deleted rather than left standing as a stale "running"; an empty report clears the table, because hosting no channels is a fact worth reporting. A row without an id is refused: it could never be replaced or removed by a later report. Writer: the service publishes on every lifecycle transition through a coalescing signal -- a burst of transitions is one write, since a reader only wants the latest state of every channel -- plus a start-up report and a final report after shutdown, so a stopped service leaves the store honest. A failed write is logged and retried on the next signal; the dashboard losing channel state is worth a warning and never worth failing a channel start over. Reader: webui.Server.Channels becomes a source rather than a concrete manager, and webui.RemoteChannelStatus reads the store the way RemoteConfigView reads the config snapshot. A store it cannot reach reports nothing rather than a stale "running", and a state the reader does not recognise is carried through rather than dropped. The contract's own index gains the group in the same change that adds the RPCs -- a surface the grouped table does not list is one nobody finds -- and the count moves to 51. The register records why the surface is the State Store rather than a resource kind, and why reload gets its own surface rather than a field here: reading status must not be able to retrigger an action, a transient request is not distinguishable from state once anything polls it, and it would invert the writer/reader relationship the precedent establishes. Verified: task check exit 0. New coverage: the store's replace-the-set semantics and its refusal of an id-less row, the reader's mapping including an unknown state, and the publisher's start-up, transition and final reports. |
||
|
|
653303b7d3 |
feat(eda): playbook dispatch idempotency ledger
Add the playbook_dispatches at-most-once ledger (docs/prds/eda-playbook-engine.md gap 2) and the record-then-invoke coordinator helper, with the cross-process plumbing the State Store boundary requires. - proto: RecordPlaybookDispatch and DeletePlaybookDispatches RPCs (string keys) - storecontract: PlaybookDispatcher interface (no *sql.Tx, reuses ErrAlreadyDispatched) - store: playbook_dispatches table + INSERT OR IGNORE dedup + delete-by-playbook - staterpc: client/server methods and Deps field; error sentinel survives the hop - eda/playbook: InvokeOnce record-before-invoke helper, keyed on (playbook, version, event, action) with a "1" action-position fallback The ledger is administrative-only: task-scoped grants never reach it, matching TaskGrants' Update/Transition/InsertEvent allowlist. Not wired into the daemon workflow pin; the production call site arrives with the first side-effecting position. |
||
|
|
ed9af64314 |
fix(statestore): carry the workflow pin across the wire
task.WorkflowDefinitionVersion/Digest/YAML had no pb.Task field and no taskProto/taskValue mapping, so over gRPC the pin was never persisted and any pin already in the row was zeroed by the same Update. The production daemon's Store is the gRPC client, so the digest guard in pinWorkflowDefinition was dead there: WorkflowDefinitionYAML was never non-empty for a task read back over the wire, and each retry re-resolved from the active control-plane resource instead of the version it started with (docs/prds/runtime-control-plane.md:95). The SQL store already wrote and read all three columns; only the contract dropped them. Adds proto fields 28-30 and the mapping both ways. Field parity was untied, which is why this was invisible: the task still crossed, just with those fields silently zeroed. TestTaskProtoCarriesEveryDomainField fills every domain field and requires the round trip to return it, so the next forgotten field fails by name. The conformance battery now carries the pin through Update and back out of TaskByID, failing in grpc mode only. |
||
|
|
21b5931f15 |
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. |
||
|
|
02720c8e81 |
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. |
||
|
|
4750ac097b |
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. |
||
|
|
3773856c70 | feat(workintake): authorize review reactions by owned PR | ||
|
|
14e7512d14 |
feat(contracts): carry attempt on Event and stage on ReadTaskLogRequest
Add two field-only extensions to the State Store contract, no new message and no new RPC: Event.attempt (11) gives every task event an attempt key, and ReadTaskLogRequest.stage (9) lets a log read be scoped to one stage. Generated stubs regenerated with tools/proto.sh and committed as LAW so proto:check, which diffs the working tree against the index, can pass. |
||
|
|
b75335582d |
feat(staterpc): add the task-log read contract to the State Store service
One task attempt's persisted log lives in the state directory the State Store process owns, and no contract carried it: the dashboard process therefore had no way to read a log at all, and answered every attempt with "task logging is optional and was not enabled for this run" in a deployment where logging is unconditional. ReadTaskLog returns a decoded page and StreamTaskLogContent returns the raw bytes server-streamed -- a log rotates at 20 MB, past gRPC's unary cap, the same reason StreamCaptures superseded ListCaptures. found=false with no error means the attempt has no log; a service with no reader answers Unavailable, and keeping those apart is the point: only the second is a deployment condition. |
||
|
|
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. |
||
|
|
242e51b3e1 |
feat(staterpc): carry the dashboard's configuration snapshot
archie-core-ymut decided the configuration page reads a projection the daemon publishes rather than reaching into a shared config.Holder. This is the carrier: a single-row store surface plus PutConfigSnapshot/GetConfigSnapshot, taking the contract to 42 RPCs. The document is opaque here. Its shape belongs to the daemon that builds it and the page that renders it, so the store neither parses nor validates it, and schema names the projection so a reader can refuse one it does not understand. It is secret-free where it is built: the projection carries an API key's environment variable name and whether it resolved, never a value. Both RPCs are administrative. authorizesTaskScopedCall is deny-by-default, so a container's task-scoped grant can neither rewrite what an operator reads nor read a projection of the deployment it runs inside; a test pins both. Nothing publishes or reads it yet -- the daemon's publisher and the UI's read path land with the rest of the cutover. |
||
|
|
f5414a82a1 |
fix(state-store): task-scope container credentials, stream large capture lists, validate Update, wire dev's state-store (archie-core-8cda.4.7)
Closes six review findings against .4.6 (PR #775): - daemon.StateStoreGrantIssuer + staterpc.TaskGrants: containers get a per-task credential authorized only for their own Update/Transition/ InsertEvent, never the daemon's administrative token. Issued before Acquire, revoked on Release; fails closed if no issuer is wired. - StreamCaptures/StreamUndispatchedCaptures: new streaming RPCs so a batch of large capture bodies can't exceed gRPC's 4MiB unary cap. The original unary RPCs are kept, unmodified (deprecated) rather than reshaped, so buf breaking stays green for an in-flight rolling deploy. - Update rejects a nil Task with InvalidArgument instead of panicking in the store layer. - RequireHostGateway only forces on for embedded NATS, so an externally reachable NATS/State Store no longer requires a local Docker bridge. - Client-side token resolution now matches the server's (target_token, then STATE_STORE_TOKEN secret/env). - task dev now runs archie-state-store (dev:state-store) alongside archied/archie-gateway/vite; deployments/dev.toml points them at it. |
||
|
|
576e22b554 |
feat(state-store): generalize storerpc as the State Store gRPC contract (archie-core-8cda.4.2) (#770)
* feat(state-store): generalize storerpc as the State Store gRPC contract Implements archie-core-8cda.4.2 against docs/prds/state-store-contract.md rev. 2c: generate protobuf/gRPC client and server adapters for every ratified store contract (proto/state/v1/state.proto, 40 RPCs, one StateStoreService), add internal/infrastructure/staterpc with a bufconn conformance suite exercising both local and remote adapters, serve the service in-process (bridge address + mandatory per-task bearer token when agent containers exist, loopback-only otherwise), and flip archie-agent's workflow.Store to a long-lived gRPC client when the daemon injects STATE_STORE_URL/STATE_STORE_TOKEN (falling back to the legacy NATS storerpc path otherwise -- one agent process is never both). Also drops the *sql.Tx parameter from store.BindingDispatcher.RecordDispatch (a required wire-blocker fix: a transaction cannot cross a gRPC boundary, and production always passed nil). fix(store): drop RecordDispatch's unusable *sql.Tx parameter feat(config): add services.state contract-adapter selector * fix(state-store): apply no-mistakes review decisions - Drop StreamTokenInterceptor (unused; the State Store service has no streaming RPCs and nothing calls it). - Make StateStoreTokens.Validate compare tokens in constant time (crypto/subtle) per the auto-fix hardening.ing finding. - Amend config.example.toml / config.Services.State doc text so it frames [services.state].target as the ratified surface consumed by the upcoming standalone archie-state-store binary (.4.3), not active today. |