Skip to content

feat: Add --expect captured-variable assertions to await-pause-point#1894

Merged
hatayama merged 2 commits into
feature/pause-point-round4-integrationfrom
feat/pause-point-expect-assertions
Jul 20, 2026
Merged

feat: Add --expect captured-variable assertions to await-pause-point#1894
hatayama merged 2 commits into
feature/pause-point-round4-integrationfrom
feat/pause-point-expect-assertions

Conversation

@hatayama

@hatayama hatayama commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • await-pause-point (and enable-pause-point --await) now accept a repeatable --expect 'Name=value' option that has the CLI check a captured variable's value for you.

User Impact

  • Previously, confirming a variable's value at a hit meant reading CapturedVariables from the JSON response yourself and comparing it by eye.
  • With --expect 'Health=100' (repeatable for multiple assertions), the hit response now includes an Expectations array (Name, Expected, Actual, Passed, Found) and an overall AllExpectationsPassed flag, so the pass/fail read is immediate instead of manual.
  • If no --expect was passed, the response is unchanged — no new fields appear.

Changes

  • Matching searches Name across every captured-variable kind (Local, Parameter, InstanceField, This); a name that isn't found reports Found: false, Passed: false instead of erroring.
  • Comparison is string equality against the serialized value. A value containing its own = (for example a connection string) is preserved: the CLI splits only on the first =.
  • Expectations are evaluated against the hit's raw captured variables before --captured-variable-names/--captured-variables=names can narrow or strip them, so an --expect target is never silently dropped just because it wasn't also requested through those flags.
  • Works through both call paths: the existing await-pause-point command and enable-pause-point --await.
  • Exit code is unchanged; the pass/fail signal is JSON-only (AllExpectationsPassed), so scripts checking exit codes are unaffected.

Verification

  • scripts/check-go-cli.sh: all packages pass (fmt/vet/lint/test/build)
  • New tests: --expect value parsing (valid, and a value with no = rejected), an inner-= value split correctly, expectation evaluation against captured variables (match/mismatch/name-not-found), and end-to-end hit responses through await-pause-point (with and without --expect) and enable-pause-point --await, plus a repeatable-flag extraction test and a --expect-without---await rejection test
  • Manual check against a running Unity Editor: enable-pause-point --await --expect ... without --await correctly rejected with INVALID_ARGUMENT; an expired marker with --await --expect correctly reports PAUSE_POINT_EXPIRED with Command: enable-pause-point
  • uloop skills install --claude --agents: regenerated copies verified byte-identical to source

Review in cubic

Callers currently have to eyeball CapturedVariables JSON to check a
value at a hit. --expect 'Name=value' (repeatable, on both
await-pause-point and enable-pause-point --await) has the CLI do
that comparison instead: it looks up Name across Local/Parameter/
InstanceField/This entries, compares the serialized value with
string equality (splitting only on the first "=" so an expected
value containing "=" still round-trips), and adds an Expectations
array plus AllExpectationsPassed to the hit response. Evaluation
runs against the raw CapturedVariables before --captured-variable-
names/--captured-variables can narrow or strip them, so an --expect
target is never dropped just because it wasn't also requested
through those flags. Exit code is unchanged; the pass/fail signal is
JSON-only.
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: afc17294-a973-42ae-b426-b94011cfa4a3

📥 Commits

Reviewing files that changed from the base of the PR and between ab3e753 and 983065f.

📒 Files selected for processing (13)
  • .agents/skills/uloop-pause-point/SKILL.md
  • .claude/skills/uloop-pause-point/SKILL.md
  • Packages/src/Editor/CliOnlyTools~/PausePoint/Skill/SKILL.md
  • cli/project-runner/internal/projectrunner/list_output.go
  • cli/project-runner/internal/projectrunner/native_command_help.go
  • cli/project-runner/internal/projectrunner/native_command_help_test.go
  • cli/project-runner/internal/projectrunner/pause_point_enable.go
  • cli/project-runner/internal/projectrunner/pause_point_enable_test.go
  • cli/project-runner/internal/projectrunner/pause_point_expect.go
  • cli/project-runner/internal/projectrunner/pause_point_expect_test.go
  • cli/project-runner/internal/projectrunner/pause_point_logs.go
  • cli/project-runner/internal/projectrunner/pause_point_wait.go
  • cli/project-runner/internal/projectrunner/pause_point_wait_test.go

📝 Walkthrough

Walkthrough

Changes

The pause-point CLI now supports repeatable --expect 'name=value' assertions for await-pause-point and enable-pause-point --await. Expectations are parsed, evaluated against captured variables, included in responses, and documented.

Pause-point expectation assertions

Layer / File(s) Summary
Expectation CLI contract and wiring
cli/project-runner/internal/projectrunner/{native_command_help.go,list_output.go,pause_point_expect.go,pause_point_enable.go,pause_point_wait.go}, cli/project-runner/internal/projectrunner/*_test.go, .agents/skills/..., .claude/skills/..., Packages/src/Editor/...
Adds repeatable --expect parsing, validation, command help/catalog entries, await-flow propagation, parser tests, and skill documentation.
Expectation evaluation and response output
cli/project-runner/internal/projectrunner/{pause_point_expect.go,pause_point_wait.go,pause_point_enable.go,pause_point_logs.go}, cli/project-runner/internal/projectrunner/*_test.go
Matches expectations against raw captured variables using serialized string equality and returns per-expectation results plus AllExpectationsPassed, including when log fetching fails.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant PausePointWait
  participant StatusQuery
  participant ExpectationEvaluator
  participant LogFetcher
  CLI->>PausePointWait: await pause point with --expect
  PausePointWait->>StatusQuery: query hit state
  StatusQuery-->>PausePointWait: captured variables
  PausePointWait->>ExpectationEvaluator: evaluate expectations
  ExpectationEvaluator-->>PausePointWait: results and all-passed status
  PausePointWait->>LogFetcher: fetch matching logs
  LogFetcher-->>PausePointWait: logs or fetch error
  PausePointWait-->>CLI: JSON response
Loading

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/pause-point-expect-assertions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The --expect bullet sat right after two bullets that explicitly name
their commands, so it read as if pause-point-status also accepted
--expect. It does not: passing it there hits the outdated-runner-hint
Unknown option error and misleadingly suggests the CLI is stale.
@hatayama
hatayama merged commit 152a788 into feature/pause-point-round4-integration Jul 20, 2026
1 check was pending
@hatayama
hatayama deleted the feat/pause-point-expect-assertions branch July 20, 2026 20:04
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