feat(ps): goal column joined from launch receipts - #523
Conversation
|
Claude encountered an error after 1s —— View job I'll analyze this and get back to you. |
- container_goal(): last matching receipt wins (attach restamps write fresh receipts; create-time env cannot change), docker-inspect DEVA_GOAL env as fallback since receipt writes are warning-only - deva ps grows a GOAL column; deva status prints goal: when set - scripts/test-launch-receipts.sh: 13 hermetic round-trip cases (scratch XDG, stubbed docker) for writer + reader, wired into CI -- first test coverage for write_launch_receipt at all Refs #520 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1401b55988
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| done | jq -rs --arg c "$name" \ | ||
| '[.[] | select(.container == $c) | .goal] | last // empty' 2>/dev/null |
There was a problem hiding this comment.
Ignore malformed receipt lines when joining goals
When any archived receipt is malformed—something write_launch_receipt can produce when a valid workspace path contains a quote or certain backslashes because cwd is interpolated without JSON escaping—this whole-archive jq -s invocation exits before filtering. container_goal then discards every valid receipt and falls back to the create-time environment or -- for all containers, so one malformed JSONL line globally disables newer attach-time goal restamps.
Useful? React with 👍 / 👎.
| for f in "$dir"/*.jsonl; do | ||
| if [ -f "$f" ]; then cat "$f"; fi | ||
| done | jq -rs --arg c "$name" \ | ||
| '[.[] | select(.container == $c) | .goal] | last // empty' 2>/dev/null |
There was a problem hiding this comment.
Disambiguate receipts across container recreations
After deva rm or deva clean, relaunching the same workspace and agent recreates the same deterministic container name, while historical receipts intentionally remain. If the new launch has no --goal, this name-only join selects the previous container generation's receipt instead of the new container's empty environment, causing ps and status to report a stale goal; constrain matches using the current container's creation time or another generation identifier.
Useful? React with 👍 / 👎.
1401b55 to
9f772bf
Compare
a94fcaa to
01dec9e
Compare
|
Claude encountered an error after 1s —— View job I'll analyze this and get back to you. |
|
Claude encountered an error after 1s —— View job I'll analyze this and get back to you. |
|
CI note: ci.yml triggers only on PRs targeting main, so checks here stay silent until #516 merges and GitHub retargets this PR. Full suite ran locally: shellcheck severity=error clean; mount-shape, image-precedence, kimi-auth, version-targets, container-slug, status-helpers, launch-receipts all green; live ps -g / status -g smoke against a real daemon. The red claude check is #524 (pre-existing). |
Receipts (#516) get their first reader. Stacked on #516 — merge that
first; this diff is only the join.
container_goal(): last matching receipt from$XDG_DATA_HOME/ccx/launches/*.jsonlwins (an attach with a fresh--goalrestamps via a new receipt; create-time env cannot change),docker inspectDEVA_GOAL env as fallback (receipt writes arewarning-only)
deva psgrows a GOAL column,deva statusagoal:line when setscripts/test-launch-receipts.sh: 13 hermetic round-trip cases withscratch XDG and stubbed docker, wired into CI — the receipt writer
had zero coverage before
Live-smoked
ps -g/status -gagainst a real daemon: columnrenders, non-goal containers show
--.Scope note: #520 asked for a new
deva pscommand; ps already existed(list_containers_pretty). The actual gap was only the goal join, so
that is the whole diff.
Closes #520
🤖 Generated with Claude Code