cleanup: remove tag system, expose equivalents as CLI flags#63
Conversation
The inline @-tag syntax (@record-only, @codegen, @id, @docs, @help) was undiscoverable, drift-prone (e.g. @record-only silently ignored on the agent path), and a duplicate of existing CLI surface. Removed entirely. Surviving capabilities now live as first-class flags / arguments: @record-only -> manual --no-engineer (already existed) @id <run_id> -> engineer <run_id> (already existed) @id <run_id> <prompt> -> engineer <run_id> --prompt "..." (new) @id <run_id> --fresh -> engineer <run_id> --fresh (new) Dropped without replacement: @codegen + ActionRecorder + playwright_codegen module (low usage, superseded by the standard capture+engineer flow) @docs (will return as a dedicated `docs` subcommand in a follow-up) @help (the existing /help slash command covers it) Also removes the dead `--reverse-engineer/--no-engineer` flag from the agent command — it was parsed but never propagated to the auto path. Net -1325 / +51. 635 tests passing; the 5 remaining failures all reproduce on cleanup/agent-mode (this branch's base) — none introduced here. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13926a9b55
ℹ️ 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".
| def engineer(run_id, prompt, fresh, model, output_dir): | ||
| """Run reverse engineering on a previous run.""" | ||
| run_engineer(run_id, model=model, output_dir=output_dir) | ||
| run_engineer(run_id, prompt=prompt, model=model, output_dir=output_dir, is_fresh=fresh) |
There was a problem hiding this comment.
Preserve original prompt for non-fresh --prompt
When replacing the old non-fresh @id <run_id> <prompt> workflow, passing the new CLI value as prompt makes run_engineer skip prompt = run_data["prompt"] (lines 1252-1253) and send the user's refinement as the entire original task instead of as additional_instructions. For existing runs, reverse-api-engineer engineer RUN --prompt "add pagination" now loses the capture's original goal/context, whereas the removed path explicitly treated non-fresh text as additive instructions; this can cause re-engineering to optimize for only the small refinement text rather than the API that was captured.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Ack — fixed in ec9de62. Confirmed by reading run_engineer (cli.py:1239-1257): when prompt is set the prompt = run_data["prompt"] fallback is skipped, so the user's refinement was indeed replacing the captured run's original goal. New wiring matches the legacy semantics:
--fresh+--prompt X→ main prompt becomes X (replaces original)- (no
--fresh) +--prompt X→ X becomesadditional_instructions(original preserved) --freshonly → fresh re-engineer on the original prompt- nothing → vanilla re-engineer on the original prompt
Added tests/test_cli_engineer_command.py with one test per combination.
Test Results🛡️ 4/6 Results
Issues FoundProject health checks: The branch is not clean on the requested validation commands. Docs consistency: The updated README and top changelog entry reflect the new flag-based UX, and the deleted SummaryI verified the core change itself: the explicit
View full run details · Tested by Kind I tested |
…fresh When the user runs `engineer <run_id> --prompt "X"` on an existing capture *without* --fresh, the previous wiring passed X straight through as the main prompt. That bypassed the `prompt = run_data["prompt"]` fallback in run_engineer, so the captured run's original goal/context was lost and the SDK only saw the small refinement. Now --prompt is treated like the legacy `@id <run_id> <prompt>` syntax: - no --fresh: --prompt becomes additional_instructions, original goal kept - --fresh: --prompt fully replaces the original goal Adds tests/test_cli_engineer_command.py covering all four flag combinations. Reported by chatgpt-codex-connector on PR #63 (P2). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Self-audit follow-up to the tag removal: the engineer/user.md prompt template still framed the session as "Tag-Based Workflows" and printed "@id <run_id>" / "@docs" labels into the LLM context. These referenced tags that no longer exist in the CLI, would confuse the SDK's model, and could surface in user-visible LLM output. - Renamed the section to "Run Context" and dropped the @id formatting - Removed the now-unused tag_extra template variable from base_engineer and the corresponding test_prompts harness - Updated test_prompt_includes_tag_context -> test_prompt_includes_run_context - Sharpened the CHANGELOG to spell out --prompt semantics (additive without --fresh, replacement with --fresh) — matches the fix in ec9de62 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Stacked on top of #60 (
cleanup/agent-mode). Once #60 lands, the base will rebase tomain.Summary
The inline
@-tag syntax inside the REPL was undiscoverable (not in--help), drift-prone, and largely a duplicate of existing CLI surface. This PR removes it entirely.@record-only <prompt>manual --no-engineer(already existed)@id <run_id>engineer <run_id>(already existed)@id <run_id> <prompt>engineer <run_id> --prompt "..."(new flag)@id <run_id> --fresh <prompt>engineer <run_id> --fresh --prompt "..."(new flag)@codegenplaywright_codegenmodule dropped)@docsdocssubcommand@help/helpslash commandAlso removes the dead
--reverse-engineer/--no-engineerflag from theagentcommand. It was parsed but never propagated to the auto path (the only path remaining after #60), so it lied about its effect.Net diff
−1325 / +51 across 9 files. Three modules deleted entirely (
action_recorder.py,playwright_codegen.py,tests/test_action_recorder.py). Three tag parsers (parse_engineer_prompt,parse_record_only_tag,parse_codegen_tag) and four mode-specific help functions removed.Test plan
uv run pytest— 635 passing on this branch; the 5 remaining failures all reproduce oncleanup/agent-mode(this branch's base), none introduced hereuv run ruff check src/reverse_api/cli.py— 1 fewer warning than the baseengineer --helpshows the new--prompt/--freshflagsagent --helpno longer shows the dead--reverse-engineer/--no-engineerflag<run_id>switches, free text re-engineers latest)Out of scope (follow-up)
docssubcommand to replace@docs(tracked alongside agent friendliness #62 ideas)output_mode="docs"parameter inrun_engineeris left in place (dead but harmless) so the follow-up just wires the click command without re-implementing the engine🤖 Generated with Claude Code
Summary by cubic
Removed the inline @-tag system from the REPL in favor of clear CLI flags and simplified flows. Also cleaned the engineer prompt template to show run context (no tag references), fixed
engineer --promptsemantics, and removed low-usage codegen modules plus the dead agent flag.Bug Fixes
engineer <run_id> --prompt "..."now adds instructions on top of the captured run’s original goal;--freshmakes--prompta full replacement.Migration
@record-only→manual --no-engineer@id <run_id>→engineer <run_id>@id <run_id> <prompt>→engineer <run_id> --prompt "..."@id <run_id> --fresh <prompt>→engineer <run_id> --fresh --prompt "..."@codegen→ removed (droppedActionRecorderandplaywright_codegen)@docs→ removed for now (will return as adocssubcommand)@help→ use/helpin the REPLagent --reverse-engineer/--no-engineer→ removed; usemanual --no-engineerfor HAR-only runsWritten for commit 7300df8. Summary will update on new commits.
Greptile Summary
This PR replaces the undiscoverable inline
@-tag system with first-class CLI flags and standard positional arguments, removing ~1325 lines across three deleted modules (action_recorder.py,playwright_codegen.py,tests/test_action_recorder.py) and simplifying the REPL engineer loop to a clean two-branch flow.engineerCLI gains--promptand--freshflags to cover the@id <run_id> [--fresh] <prompt>use-cases that previously only worked in the REPL.agentCLI loses the dead--reverse-engineer/--no-engineerflag, which was parsed but never forwarded to the auto-capture path.--freshis now only accessible via theengineersubcommand.Confidence Score: 4/5
Safe to merge; all deletions are self-consistent and the new CLI surface matches the documented replacements.
The changes are a straightforward deletion of tag-parsing infrastructure and the modules that depended on it. The new engineer REPL logic correctly reproduces the pre-existing run-id-switch and free-text-instruction paths. The only finding is a leftover
reverse_engineer=Falseargument inrun_agent_capturewhose return value is never consumed — harmless but slightly misleading about what the function controls.src/reverse_api/cli.py — the dead
reverse_engineerargument inrun_agent_captureis worth a quick look.Important Files Changed
engineerCLI command, and drops --reverse-engineer fromagent. One small dead-code remnant:reverse_engineer=Falseis still passed toprompt_interactive_optionsinrun_agent_capturebut the key is never read from the returned dict.Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "cleanup: remove tag system, expose equiv..." | Re-trigger Greptile