Add bedside ask and step for operator gates - #8
Conversation
Encode human gates in tools so product AGENTS.md can point at ask/step instead of restating multi-choice free-text manners. UI-agnostic cores, exit 10 for declined or still-needed, fixtures and surface docs. Closes #6
Resolve eval/README.md fixture table: keep choice-wall/structured-choice from #7 and ask/step operator-gate fixtures from this branch.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 338a1a877a
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
Adds an “operator gate” surface to Bedside by introducing bedside ask (structured choice gate) and bedside step (single human act with confirmation), implemented as UI-agnostic command cores under bedside.commands.*, wired into the argparse CLI, documented in surface and root READMEs, and exercised via new eval fixtures.
Changes:
- Added new command cores for
askandstep, plus CLI subcommands/flags and stable exit-code semantics (0/10/30). - Added eval fixtures (known-good
operator-gate-ask/operator-gate-step, known-badmulti-step-body-dump) and documentation updates describing the operator-gate contract. - Added a dedicated test module for
ask/stepbehavior and basic CLI integration, and bumped version to0.1.2.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_ask_step.py | New tests for ask/step cores, CLI wiring, and fixture eval integration. |
| surface/README.md | Documents ask/step as preferred operator-gate verbs and codifies rules/exit codes. |
| src/bedside/exit_codes.py | Documents stable meanings for exit codes, including new gate semantics. |
| src/bedside/commands/step_cmd.py | Implements run_step core (prompt + optional expect + confirm/decline/pending paths). |
| src/bedside/commands/init_cmd.py | Updates generated agent guidance to point to bedside ask / bedside step for human gates. |
| src/bedside/commands/ask_cmd.py | Implements run_ask core (choices/default/recommended ordering + interactive/non-interactive handling). |
| src/bedside/cli.py | Adds argparse subcommands for ask and step, and dispatch to the new cores. |
| src/bedside/init.py | Version bump to 0.1.2. |
| README.md | Documents new verbs and updated exit-code semantics. |
| pyproject.toml | Version bump to 0.1.2. |
| eval/README.md | Registers the new fixtures in the known-good/known-bad index. |
| eval/fixtures/known-good/operator-gate-step/transcript.md | New known-good transcript illustrating bedside step. |
| eval/fixtures/known-good/operator-gate-step/meta.toml | Fixture metadata for operator-gate-step. |
| eval/fixtures/known-good/operator-gate-ask/transcript.md | New known-good transcript illustrating bedside ask. |
| eval/fixtures/known-good/operator-gate-ask/meta.toml | Fixture metadata for operator-gate-ask. |
| eval/fixtures/known-bad/multi-step-body-dump/transcript.md | New known-bad transcript illustrating batched physical steps + cliff. |
| eval/fixtures/known-bad/multi-step-body-dump/meta.toml | Fixture metadata for multi-step-body-dump. |
| AGENTS.md | Updates repo agent guidance to reference ask/step and clarify anti “choice wall” guidance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Map argparse usage errors to SETUP_ERROR (30) for agent branching. - Print ask/step prompt before blocking stdin read. - Fix --no-wait Record line to wait=false. - Enforce case-insensitive unique choices. - Fail tests if shipped operator-gate fixtures are missing.
Summary
bedside ask: one structured yes/no or multi-choice gate (--id,--prompt,--choices,--default,--answer). Recommended option shown first. Exit 0 if recommended; 10 if alternate/needed; 30 setup.bedside step: one human body/browser act with--expectin their words,--confirm/--decline. Exit 0 confirmed; 10 declined/needed; 30 setup.commands/; fixture-friendlyRecord:lines; surface/README + root README + init AGENTS stub pointer.operator-gate-ask/operator-gate-step; known-badmulti-step-body-dump.Closes #6
Test plan
pytest -q(27 passed)bedside evalall fixtures match expectbedside ask --id confirm-deploy --prompt Deploy? --choices yes,no --default no --answer noexits 0bedside step --id plug-usb --prompt Plug USB --confirmexits 0