Skip to content

feat: add wt step eval for template expression evaluation#1004

Open
max-sixty wants to merge 7 commits intomainfrom
arbitrary-data
Open

feat: add wt step eval for template expression evaluation#1004
max-sixty wants to merge 7 commits intomainfrom
arbitrary-data

Conversation

@max-sixty
Copy link
Owner

Summary

  • Add experimental wt step eval subcommand that evaluates a minijinja template in the current worktree context and prints the result to stdout
  • Reuses existing hook template infrastructure — all variables (branch, repo, worktree_path, etc.) and filters (hash_port, sanitize, sanitize_db) are available
  • Output goes to stdout with no decoration or shell escaping, designed for scripting and shell substitution
$ wt step eval '{{ branch | hash_port }}'
16066

$ curl http://localhost:$(wt step eval '{{ branch | hash_port }}')/health

This is the first step from the IDEAS.md design doc, directly addressing the user request in #947 — "found no way to run it on a single branch."

Test plan

  • 6 integration tests: basic branch, hash_port, multiple values, sanitize_db, conditionals, template error
  • Help text and completion snapshots updated
  • stdout guard allowlisted
  • Doc pages auto-synced
  • All lints pass
  • 2360 tests pass (5 pre-existing shell_wrapper failures excluded)

Ref #947

This was written by Claude Code on behalf of @max-sixty

…ntal)

Evaluates a minijinja template in the current worktree context and prints
the result to stdout. Reuses the existing hook template infrastructure
(variables, filters like hash_port/sanitize/sanitize_db).

Designed for scripting — no shell escaping, no decoration, output to
stdout only.

```
$ wt step eval '{{ branch | hash_port }}'
16066

$ curl http://localhost:$(wt step eval '{{ branch | hash_port }}')/health
```

Ref #947

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty
Copy link
Owner Author

Follow-up PR for per-branch kv state: #1006

This was written by Claude Code on behalf of @max-sixty

max-sixty and others added 4 commits February 13, 2026 16:03
# Conflicts:
#	src/main.rs
#	tests/integration_tests/completion.rs
The merge brought a debug_assert for multiline errors without .context(),
which caught step_eval wrapping TemplateExpandError into a plain anyhow
string. Let the typed error propagate so main.rs handles it via its
TemplateExpandError display handler, producing better output with
template line context and available variables.

Co-authored-by: Claude <noreply@anthropic.com>
# Conflicts:
#	src/cli/mod.rs
@max-sixty max-sixty marked this pull request as ready for review February 19, 2026 21:44
Features 1+2 are implemented across arbitrary-data (step eval) and
kv-state (arbitrary per-branch state, templates, JSON output).
Feature 3 (custom columns) can be tracked as a separate issue.

Co-authored-by: Claude <noreply@anthropic.com>
max-sixty added a commit that referenced this pull request Feb 19, 2026
… code

The CI reviewer was approving PRs without noticing obviously misplaced
files (e.g. IDEAS.md at repo root in PR #1004). It read the diff but
went straight to Rust code review without stepping back to look at the
change holistically. Add a substep prompting the reviewer to look at
what files are being added/changed before reading them in detail.

Co-Authored-By: Claude <noreply@anthropic.com>
max-sixty added a commit that referenced this pull request Feb 20, 2026
…#1117)

## Summary

- **pr-review skill**: adds a substep prompting the reviewer to assess
the PR's shape (what files are being added/changed) before diving into
code details — so obvious misplacements like a scratch file at the repo
root don't slip through
- **nightly review-reviewers**: adds a cross-check step that compares
bot review verdicts against subsequent commits and human comments on the
same PR, identifying things the bot should have caught

Triggered by the bot approving PR #1004 without flagging an `IDEAS.md`
design document at the repo root.

## Test plan

- [ ] Next `claude-review` run: verify the reviewer pauses to assess
file list before code review
- [ ] Next `claude-nightly-review-reviewers` run: verify it cross-checks
review sessions against PR outcomes

> _This was written by Claude Code on behalf of max-sixty_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
# Conflicts:
#	src/main.rs
#	tests/integration_tests/completion.rs
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.

2 participants