feat(cli): implement step read command #485

Merged
xiaoju merged 1 commits from fix/484-step-read-command into main 2026-05-25 01:43:12 +00:00
Owner

What

Implement uwf step read <step-hash> command to render a step's turns as human-readable markdown.

Why

#463 planned this command but it was left as a half-baked TODO. Completes the step layer CLI.

Changes

  • step.ts — full cmdStepRead implementation with quota enforcement, turn loading, skip hints
  • cli.ts — register step read command with --quota option
  • step-read.test.ts — 519 lines of tests
  • README.md — add step read to CLI reference table

Ref

Fixes #484

— 小橘 🍊(NEKO Team)

## What Implement `uwf step read <step-hash>` command to render a step's turns as human-readable markdown. ## Why #463 planned this command but it was left as a half-baked TODO. Completes the step layer CLI. ## Changes - `step.ts` — full cmdStepRead implementation with quota enforcement, turn loading, skip hints - `cli.ts` — register step read command with --quota option - `step-read.test.ts` — 519 lines of tests - `README.md` — add step read to CLI reference table ## Ref Fixes #484 — 小橘 🍊(NEKO Team)
xiaoju added 1 commit 2026-05-25 01:42:57 +00:00
Implements the `uwf step read` command to render a single step's turns
as human-readable markdown with quota enforcement.

Changes:
- Implement cmdStepRead() in step.ts with quota enforcement
  - Renders step metadata (hash, role, agent)
  - Loads and formats turns from detail node
  - Enforces quota by selecting most recent turns
  - Always shows at least one turn even if it exceeds quota
  - Gracefully handles steps with no detail or no turns
- Register `step read` command in cli.ts with --quota flag (default 4000)
- Add comprehensive test suite in step-read.test.ts (6 tests covering
  basic functionality, quota enforcement, edge cases, and special chars)
- Update README.md CLI Reference table to include `step read`
- Update package-level README.md with command documentation and example

Closes #484

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
xiaoju reviewed 2026-05-25 01:43:06 +00:00
xiaoju left a comment
Author
Owner

Code Review — 小橘 🍊

Verdict: Approved

  • cmdStepRead 实现完整:加载 detail→turns,quota 逆序选择,skip hint
  • quota 逻辑与 thread read 保持一致(先检查再添加,至少保留一个 turn)
  • 519 行测试覆盖
  • README 已更新

LGTM 🍊

## Code Review — 小橘 🍊 **Verdict: Approved** ✅ - cmdStepRead 实现完整:加载 detail→turns,quota 逆序选择,skip hint - quota 逻辑与 thread read 保持一致(先检查再添加,至少保留一个 turn) - 519 行测试覆盖 - README 已更新 LGTM 🍊
xiaoju merged commit 1ca13e02b2 into main 2026-05-25 01:43:12 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#485