Skip to content

feat(ps): goal column joined from launch receipts - #523

Open
lroolle wants to merge 2 commits into
feat/goal-receiptsfrom
feat/ps-goal-column
Open

feat(ps): goal column joined from launch receipts#523
lroolle wants to merge 2 commits into
feat/goal-receiptsfrom
feat/ps-goal-column

Conversation

@lroolle

@lroolle lroolle commented Jul 29, 2026

Copy link
Copy Markdown
Member

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/*.jsonl wins (an attach with a fresh
    --goal restamps via a new receipt; create-time env cannot change),
    docker inspect DEVA_GOAL env as fallback (receipt writes are
    warning-only)
  • deva ps grows a GOAL column, deva status a goal: line when set
  • scripts/test-launch-receipts.sh: 13 hermetic round-trip cases with
    scratch XDG and stubbed docker, wired into CI — the receipt writer
    had zero coverage before

Live-smoked ps -g / status -g against a real daemon: column
renders, non-goal containers show --.

Scope note: #520 asked for a new deva ps command; 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

@claude-yolo

claude-yolo Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread deva.sh
Comment on lines +1260 to +1261
done | jq -rs --arg c "$name" \
'[.[] | select(.container == $c) | .goal] | last // empty' 2>/dev/null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread deva.sh
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@lroolle
lroolle force-pushed the feat/ps-goal-column branch from 1401b55 to 9f772bf Compare July 29, 2026 05:48
@lroolle
lroolle force-pushed the feat/goal-receipts branch from a94fcaa to 01dec9e Compare July 29, 2026 05:48
@claude-yolo

claude-yolo Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 1s —— View job


I'll analyze this and get back to you.

Decision chain for the #516/#523/#517 stack and issues #518-#524:
scope corrections (ps already existed), stacked-PR reasoning, goal
source-of-truth choice, and the #518 layout decision as the live wire.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@claude-yolo

claude-yolo Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 1s —— View job


I'll analyze this and get back to you.

@lroolle

lroolle commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant