feat(ui): download a task attempt's log, and stop blaming a setting for it
The attempt-log panel offered no way to get a log out of the dashboard, and its failure copy asserted that task logging was not enabled for the run. The first is the feature: the panel now links to the download route for the attempt it is showing, so the browser owns the filename the server sets and streams the body to disk rather than the client holding a whole log in memory. The second is the honesty fix. "No log recorded for this attempt" is a fact about the attempt; "this dashboard cannot read task logs" is a fact about the deployment, and only the second is worth sending an operator to a setting for. The panel renders them differently off the response's found/disabled markers. Rebuilds ui/dist, which is a committed asset.
This commit is contained in:
1 parent
cf7cc9d891
commit
3cb3cf7e62
8 files changed
+137
-23
No files matched your search
@@ -259,8 +259,9 @@ Methods are named after the store methods so the mapping is unambiguous. `workfl
|
||||
| Dispatch | `ArmedBindingsForSource`, `RecordDispatch`, `ListUndispatchedCaptures` |
|
||||
| BindingTaskCreator | `EnqueueBindingTask` |
|
||||
| Config snapshot | `PutConfigSnapshot`, `GetConfigSnapshot` |
|
||||
| Task log | `ReadTaskLog`, `StreamTaskLogContent` |
|
||||
|
||||
That is **42 unique RPCs** across one service (the `TaskEvents.Close` method is dropped).
|
||||
That is **44 unique RPCs** across one service (the `TaskEvents.Close` method is dropped).
|
||||
`Close()` is **excluded** from the wire (it is server lifecycle, not a client call) — see §11.
|
||||
|
||||
The config-snapshot pair was added by `archie-core-ymut` (see
|
||||
@@ -271,6 +272,19 @@ neither. `ConfigSnapshot.document` is opaque to this contract — the store neit
|
||||
validates it, and `schema` names the projection so a reader can refuse a shape it does not
|
||||
understand.
|
||||
|
||||
The task-log pair was added by `archie-core-iaqx` (see `docs/prds/ui-service-boundary.md`'s
|
||||
route inventory). It is the one surface whose payload is not a row: the store service reads
|
||||
them out of the state directory it owns with `internal/logging`'s own reader, so the wire
|
||||
carries `logging.Entry`/`logging.Query` values and neither side restates the JSONL format.
|
||||
`ReadTaskLog` returns a decoded page and `StreamTaskLogContent` returns the raw bytes
|
||||
server-streamed, because a log file rotates at 20 MB — past gRPC's 4 MiB unary cap — and the
|
||||
same reasoning that made `StreamCaptures` supersede `ListCaptures` applies. `found=false` with
|
||||
no error means the attempt has no log; a service with no reader answers `Unavailable` instead,
|
||||
and the two answers are load-bearing for the dashboard: only the second is a deployment
|
||||
condition, and the panel that collapsed them told operators task logging was switched off when
|
||||
it was not. The Go facade is `storecontract.TaskLogStore` (2 methods), carried by
|
||||
`*staterpc.Client` alongside the rest.
|
||||
|
||||
### Domain types and `values.go` mapping
|
||||
|
||||
`values.go` maps proto ⇄ these types. The task model for the **agent** path is the domain-owned
|
||||
@@ -638,7 +652,7 @@ an explicit operator decision.
|
||||
(`workflow.Store` + `workflow.Task`/`Status`/`Source`, per dependency rules #2 and #7);
|
||||
daemon/webui store surfaces stay **producer-owned** in `internal/store`. `store.WorkflowStore`
|
||||
is superseded by `workflow.Store`.
|
||||
- **One `StateStore` gRPC service** (42 RPCs, grouped by contract) + narrow Go consumer facades
|
||||
- **One `StateStore` gRPC service** (44 RPCs, grouped by contract) + narrow Go consumer facades
|
||||
(≤8) on `staterpc.Client` — mirrors the single-`ChatService` precedent.
|
||||
- **Domain type relocation** (`Task`/`Status`/`Source` → `internal/domain/workflow`) is a
|
||||
Phase 2 prerequisite, pulled forward from migration-decisions §4 (minimal bound,
|
||||
|
||||
@@ -65,7 +65,8 @@ cutover.
|
||||
| `/api/chat/*` | Gateway `ChatContract` and its versioned client | contract seam exists; DTO and stream parity remain |
|
||||
| `/api/tasks/*`, `/api/workflows`, `/api/setup` | State Store read/action contracts plus an explicit execution/admin action contract | State Store adapter exists; UI-facing narrow surface remains |
|
||||
| `/events` | State Store `EventsSince`, polled by one UI-process pump feeding `Server.Broadcast` | RESOLVED (`archie-core-za9f`): see migration-decisions, "Dashboard live event delivery". No new RPC; replay cursor and drop-recovery are the existing `since` watermark in `sse.go` |
|
||||
| `/api/logs`, `/api/logs/stream` | daemon diagnostic feed, host-local | unresolved: `logging.Feed` is in-process on the daemon host and has no contract |
|
||||
| `/api/logs`, `/api/logs/stream` | daemon diagnostic feed, host-local | unresolved: `logging.Feed` is in-process on the daemon host and has no contract. The per-task log routes moved off this row: see `/api/tasks/*` above |
|
||||
| `/api/tasks/{id}/logs`, `/api/tasks/{id}/logs/download` | State Store task-log read contract (`TaskLogStore`: `ReadTaskLog` + `StreamTaskLogContent`), read by the UI process from the service that owns the state directory | RESOLVED (`archie-core-iaqx`): the UI process composes `TaskLogStore` from its own State Store client and serves the attempt log as JSON (`found` distinguishes "no log for this attempt" from "this process cannot read logs") and as a `Content-Disposition` attachment named `task-<id>-attempt-<n>.log`. The daemon's in-process registry is wired as the server-side reader in `internal/app/archied/state_store.go` only (`staterpc.Deps.TaskLogs`), so no process opens another process's log files |
|
||||
| `/api/captures`, `/api/mappings`, `/api/bindings` | State Store contracts, with webhook verification owned by Work Intake/Messaging | RESOLVED (cutover, `archie-core-8cda.5.4`): the UI process composes CaptureStore/MappingStore/BindingStore and mounts the `captureintake.Receiver` from its own State Store client; the daemon's binding-dispatch loop keeps consuming captures from the same store |
|
||||
| `/api/config` (read) | daemon-published `ConfigView` snapshot, read over the State Store contract | RESOLVED (`archie-core-ymut`): see migration-decisions, "Dashboard configuration page" |
|
||||
| `/api/config` (write), `/api/config/reset`, `/api/config/repos/*` | a configuration write contract; the daemon stays the policy owner | DESCOPED for Phase 3 (`archie-core-ymut`), NOT abandoned: 503 in the UI process, SPA hides the controls, editing is config.toml plus reload. Dashboard editing is a tracked feature (`archie-core-1786637498420-327`) and its transport is `archie-core-j28m`; the handlers and their func-field seams on `webui.Server` are kept for it |
|
||||
|
||||
Reference in new issue
Block a user