Add ward agent logs for director-surface engineer log reads #694

Closed
opened 2026-07-08 20:43:26 +00:00 by coilyco-ops · 2 comments
Member

Goal

Add an ergonomic ward agent logs command so a director surface can read engineer run logs without direct Docker socket access or host filesystem mounts.

Why

During the 2026-07-08 harness debugging run, the director surface needed logs for engineer-goose-ward-692. The surface had a dispatch broker but no /var/run/docker.sock, no /Users/kai/.ward/... host path, and an empty /opt/ward-agent-logs mount. The only practical recovery was asking Kai to run host commands.

A director already has the broker relationship needed to launch and stop engineers. Logs should have the same ergonomic path.

Proposed UX

ward agent logs coilyco-flight-deck/ward#692
ward agent logs engineer-goose-ward-692
ward agent logs coilyco-flight-deck/ward#692 --tail 200
ward agent logs coilyco-flight-deck/ward#692 --follow

Resolution should accept the same target shapes as ward agent stop: issue ref or container name.

Behavior

  • From a director surface, forward the request through the host dispatch broker.
  • On the host, resolve the target to the engineer container or drained log directory.
  • Prefer live docker logs for a running/exited-but-present container.
  • Fall back to drained ~/.ward/agent-logs/<container>/console.log or redacted logs when the container has already been removed.
  • Print the source being used, such as docker logs <container> or ~/.ward/agent-logs/<container>/console.log.
  • Support --tail and optionally --follow when the source is live Docker logs.
  • Fail loud when zero or multiple engineer containers match, mirroring ward agent stop.

Acceptance

  • A read-only director surface can run ward agent logs <ref> and get the relevant engineer log output without a Docker socket.
  • The command works for a running container, an exited container still present in Docker, and a drained log directory when available.
  • The command reports which source it used.
  • Tests cover broker validation and target resolution.
  • ward exec test passes.

Filed from the read-only director surface after Kai suggested the ergonomic command while debugging ward#692.

## Goal Add an ergonomic `ward agent logs` command so a director surface can read engineer run logs without direct Docker socket access or host filesystem mounts. ## Why During the 2026-07-08 harness debugging run, the director surface needed logs for `engineer-goose-ward-692`. The surface had a dispatch broker but no `/var/run/docker.sock`, no `/Users/kai/.ward/...` host path, and an empty `/opt/ward-agent-logs` mount. The only practical recovery was asking Kai to run host commands. A director already has the broker relationship needed to launch and stop engineers. Logs should have the same ergonomic path. ## Proposed UX ```text ward agent logs coilyco-flight-deck/ward#692 ward agent logs engineer-goose-ward-692 ward agent logs coilyco-flight-deck/ward#692 --tail 200 ward agent logs coilyco-flight-deck/ward#692 --follow ``` Resolution should accept the same target shapes as `ward agent stop`: issue ref or container name. ## Behavior * From a director surface, forward the request through the host dispatch broker. * On the host, resolve the target to the engineer container or drained log directory. * Prefer live `docker logs` for a running/exited-but-present container. * Fall back to drained `~/.ward/agent-logs/<container>/console.log` or redacted logs when the container has already been removed. * Print the source being used, such as `docker logs <container>` or `~/.ward/agent-logs/<container>/console.log`. * Support `--tail` and optionally `--follow` when the source is live Docker logs. * Fail loud when zero or multiple engineer containers match, mirroring `ward agent stop`. ## Related * coilyco-flight-deck/ward#693 asks the reaper to print the flush destination into container logs. * This issue adds the command surface so directors can ask ward for those logs directly. * coilyco-flight-deck/ward#689 covers missing issue comments for failed launches. ## Acceptance * A read-only director surface can run `ward agent logs <ref>` and get the relevant engineer log output without a Docker socket. * The command works for a running container, an exited container still present in Docker, and a drained log directory when available. * The command reports which source it used. * Tests cover broker validation and target resolution. * `ward exec test` passes. Filed from the read-only director surface after Kai suggested the ergonomic command while debugging ward#692.
Author
Member

WARD-RESERVATION: held 🔒

reservation details

Holder: container engineer-codex-ward-694 on host kais-macbook-pro-2.local.

Reserved by ward agent --harness codex (reserved 2026-07-09T17:39:35Z). Concurrent ward agent runs are blocked until it finishes or the reservation goes stale (1h TTL). --force overrides.

Do not comment on or edit this issue to steer the run while it is reserved. The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a new issue, dispatched fresh. That is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494).

run seed context — what this run is carrying (ward#609)
  • Resolved: coilyco-flight-deck/ward#694 · branch issue-694 · harness codex · workflow pull-request-and-merge
  • Run: engineer-codex-ward-694 · ward v0.493.0 · dispatched 2026-07-09T17:39:35Z
  • Comment thread: 0 included in the pre-flight read, 0 stripped (ward's own automated comments).

Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.493.0).

— Codex, via ward agent

<!-- ward-agent-reservation --> WARD-RESERVATION: held 🔒 <details><summary>reservation details</summary> Holder: container `engineer-codex-ward-694` on host `kais-macbook-pro-2.local`. Reserved by `ward agent --harness codex` (reserved 2026-07-09T17:39:35Z). Concurrent `ward agent` runs are blocked until it finishes or the reservation goes stale (1h TTL). `--force` overrides. **Do not comment on or edit this issue to steer the run while it is reserved.** The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a **new issue, dispatched fresh**. That is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494). <details><summary>run seed context — what this run is carrying (ward#609)</summary> - **Resolved:** `coilyco-flight-deck/ward#694` · branch `issue-694` · harness `codex` · workflow `pull-request-and-merge` - **Run:** `engineer-codex-ward-694` · ward `v0.493.0` · dispatched `2026-07-09T17:39:35Z` - **Comment thread:** 0 included in the pre-flight read, 0 stripped (ward's own automated comments). Static container doctrine and seed boilerplate are identical every run and omitted here (they ride ward v0.493.0). </details> </details> <!-- ward-agent-signature --> — Codex, via `ward agent`
Author
Member

WARD-OUTCOME: done

details workflow: pull-request-and-merge; review summary: skipped (`--skip-review` / `--no-review-gate`)

Implementation felt straightforward after the log source split landed. The only surprise was golangci-lint flagging the separator reader and archive matcher, which was a small refactor, not a behavior change.

confidence: high
follow-ups: none

WARD-OUTCOME: done ✅ <details><summary>details</summary> workflow: pull-request-and-merge; review summary: skipped (`--skip-review` / `--no-review-gate`) Implementation felt straightforward after the log source split landed. The only surprise was golangci-lint flagging the separator reader and archive matcher, which was a small refactor, not a behavior change. confidence: high follow-ups: none </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/ward#694
No description provided.