Skip to content

test(cli): cover the tool-episode completion sources - #4372

Merged
Sinity merged 1 commit into
masterfrom
worktree-agent-ae7c9ac08efe03b44
Aug 28, 2026
Merged

Sinity merged 1 commit into
masterfrom
worktree-agent-ae7c9ac08efe03b44

Conversation

@Sinity

@Sinity Sinity commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Summary
Declare the tool-episode/tool-episodes completion sources in the CLI interaction oracle and back them with real per-shell completion coverage.

Problem
tests/unit/cli/test_interaction_oracles.py fails on master with CLI interaction coverage gaps: completion-source:tool-episode, completion-source:tool-episodes. QueryUnitDescriptor.source_aliases gained both aliases for the action unit (#4354) without a coverage owner, and no test referenced them (grep -rn tool-episode tests/ was empty).

Solution
The two aliases are not a singular/plural duplicate to collapse: every terminal unit declares both spellings, and query_unit_descriptor resolves both to the action descriptor. So the fix is coverage, not deduplication.

  • tests/infra/cli_interaction.py: add both to DECLARED_COMPLETION_SOURCES (owner test_completion_matrix.py).
  • tests/unit/cli/test_completion_matrix.py: test_tool_episode_source_completion_per_shell asserts, for bash/zsh/fish, that completing find tool-epi yields exactly {tool-episode where , tool-episodes where }; that field completion after <alias> where is non-empty and equal to the actions unit's; and that parse_expression_ast("<alias> where tool:Bash") equals the actions AST.

Verification

  • devtools test tests/unit/cli/test_interaction_oracles.py — 9 passed, 1 skipped (was 2 failed).
  • devtools test tests/unit/cli/test_completion_matrix.py -k "tool_episode or terminal_completion_contract" — 6 passed.
  • devtools verify --quick — all gates ok, no out of sync.
  • Anti-vacuity: dropping "tool-episode" from source_aliases turns the new test red on all three shells (verified, then reverted).

Residual
Scope is one red family; other master failures are untouched. The field-completion assertion compares against the actions unit, so a defect common to both would not be caught — the non-empty assertion on the action baseline bounds that.

🤖 Generated with Claude Code

https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA

The action unit gained `tool-episode`/`tool-episodes` source aliases with
no coverage owner, so the CLI interaction oracle reported two uncovered
completion-source cells. Declare both in the oracle's completion-source
dimension and back them with a per-shell test: prefix completion offers
both spellings with the `where` insertion, post-`where` field completion
matches the action unit's, and both aliases parse to the same AST as
`actions`.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9e346c2d-8f77-416b-9641-39a6913fbc1c


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.

@Sinity
Sinity merged commit 7405dcd into master Aug 28, 2026
3 checks passed
@Sinity
Sinity deleted the worktree-agent-ae7c9ac08efe03b44 branch August 28, 2026 02:24
Sinity added a commit that referenced this pull request Aug 28, 2026
Summary
Declare the `tool-episode`/`tool-episodes` completion sources in the CLI
interaction oracle and back them with real per-shell completion
coverage.

Problem
`tests/unit/cli/test_interaction_oracles.py` fails on master with `CLI
interaction coverage gaps: completion-source:tool-episode,
completion-source:tool-episodes`. `QueryUnitDescriptor.source_aliases`
gained both aliases for the `action` unit (#4354) without a coverage
owner, and no test referenced them (`grep -rn tool-episode tests/` was
empty).

Solution
The two aliases are not a singular/plural duplicate to collapse: every
terminal unit declares both spellings, and `query_unit_descriptor`
resolves both to the `action` descriptor. So the fix is coverage, not
deduplication.

- `tests/infra/cli_interaction.py`: add both to
`DECLARED_COMPLETION_SOURCES` (owner `test_completion_matrix.py`).
- `tests/unit/cli/test_completion_matrix.py`:
`test_tool_episode_source_completion_per_shell` asserts, for
bash/zsh/fish, that completing `find tool-epi` yields exactly
`{tool-episode where , tool-episodes where }`; that field completion
after `<alias> where` is non-empty and equal to the `actions` unit's;
and that `parse_expression_ast("<alias> where tool:Bash")` equals the
`actions` AST.

Verification
- `devtools test tests/unit/cli/test_interaction_oracles.py` — 9 passed,
1 skipped (was 2 failed).
- `devtools test tests/unit/cli/test_completion_matrix.py -k
"tool_episode or terminal_completion_contract"` — 6 passed.
- `devtools verify --quick` — all gates ok, no `out of sync`.
- Anti-vacuity: dropping `"tool-episode"` from `source_aliases` turns
the new test red on all three shells (verified, then reverted).

Residual
Scope is one red family; other master failures are untouched. The
field-completion assertion compares against the `actions` unit, so a
defect common to both would not be caught — the non-empty assertion on
the action baseline bounds that.

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

https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sinity added a commit that referenced this pull request Sep 1, 2026
Summary
Declare the `tool-episode`/`tool-episodes` completion sources in the CLI
interaction oracle and back them with real per-shell completion
coverage.

Problem
`tests/unit/cli/test_interaction_oracles.py` fails on master with `CLI
interaction coverage gaps: completion-source:tool-episode,
completion-source:tool-episodes`. `QueryUnitDescriptor.source_aliases`
gained both aliases for the `action` unit (#4354) without a coverage
owner, and no test referenced them (`grep -rn tool-episode tests/` was
empty).

Solution
The two aliases are not a singular/plural duplicate to collapse: every
terminal unit declares both spellings, and `query_unit_descriptor`
resolves both to the `action` descriptor. So the fix is coverage, not
deduplication.

- `tests/infra/cli_interaction.py`: add both to
`DECLARED_COMPLETION_SOURCES` (owner `test_completion_matrix.py`).
- `tests/unit/cli/test_completion_matrix.py`:
`test_tool_episode_source_completion_per_shell` asserts, for
bash/zsh/fish, that completing `find tool-epi` yields exactly
`{tool-episode where , tool-episodes where }`; that field completion
after `<alias> where` is non-empty and equal to the `actions` unit's;
and that `parse_expression_ast("<alias> where tool:Bash")` equals the
`actions` AST.

Verification
- `devtools test tests/unit/cli/test_interaction_oracles.py` — 9 passed,
1 skipped (was 2 failed).
- `devtools test tests/unit/cli/test_completion_matrix.py -k
"tool_episode or terminal_completion_contract"` — 6 passed.
- `devtools verify --quick` — all gates ok, no `out of sync`.
- Anti-vacuity: dropping `"tool-episode"` from `source_aliases` turns
the new test red on all three shells (verified, then reverted).

Residual
Scope is one red family; other master failures are untouched. The
field-completion assertion compares against the `actions` unit, so a
defect common to both would not be caught — the non-empty assertion on
the action baseline bounds that.

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

https://claude.ai/code/session_014BQsaB1NBY8mTR6yZByfMA

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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