Skip to content

refactor: move lab smoke surfaces to devtools - #353

Merged
Sinity merged 1 commit into
masterfrom
feature/refactor/lab-audit-showcase-surface
Apr 22, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/refactor/lab-audit-showcase-surface

Conversation

@Sinity

@Sinity Sinity commented Apr 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #337.

Moves synthetic corpus/demo generation and showcase exercise smoke execution out of the product polylogue audit surface and into explicit verification-lab devtools commands.

Problem

polylogue audit generate and polylogue audit --only exercises made lab-only workflows look like normal product/archive operations. After #336 established devtools as the verification-lab surface, these commands needed to move so product CLI help and generated scenario catalogs stop presenting lab smoke work as archive-facing QA.

Solution

  • Added devtools lab-corpus generate and devtools lab-corpus seed backed by new polylogue.showcase.lab_corpus helpers.
  • Added devtools lab-scenario run archive-smoke, including --live so the existing live exercise lane remains archive-backed.
  • Removed polylogue audit generate, removed its generated help exercise/baseline, and narrowed polylogue audit to schema audit plus artifact proof checks.
  • Converted audit from a Click group to a plain command now that it no longer owns subcommands.
  • Updated validation lanes, command catalog discovery, generated docs, migration notes, showcase baselines, and focused tests.

Verification

  • ruff check polylogue/showcase/lab_corpus.py devtools/lab_corpus.py devtools/lab_scenario.py polylogue/cli/commands/qa.py devtools/validation_lane_catalog_live.py tests/unit/cli/test_click_app.py tests/unit/devtools/test_lab_surface.py tests/unit/devtools/test_devtools_main.py tests/unit/devtools/test_execution_specs.py tests/unit/devtools/test_render_quality_reference.py tests/unit/devtools/test_validation_lanes.py
  • pytest tests/unit/devtools/test_lab_surface.py tests/unit/devtools/test_devtools_main.py tests/unit/devtools/test_execution_specs.py tests/unit/devtools/test_render_quality_reference.py tests/unit/devtools/test_validation_lanes.py tests/unit/cli/test_click_app.py tests/unit/cli/test_cli_error_boundaries.py tests/unit/cli/test_terminal_snapshots.py tests/unit/showcase/test_exercise_catalog.py tests/unit/showcase/test_verification_lane.py -q -> 317 passed
  • devtools render-all --check
  • devtools verify-showcase
  • devtools verify
  • pre-push devtools verify --quick

@coderabbitai

coderabbitai Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR migrates synthetic corpus generation and showcase exercise functionality from the product CLI (polylogue audit) to new verification-lab commands under devtools (devtools lab-corpus and devtools lab-scenario). The product audit command is narrowed to schema audit and proof checks only. Supporting modules, documentation, tests, and baselines are updated to reflect this command-surface reorganization and removal of polylogue audit generate.

Changes

Cohort / File(s) Summary
New devtools lab commands
devtools/lab_corpus.py, devtools/lab_scenario.py
New CLI entrypoints for synthetic corpus generation/seeding and showcase scenario execution with subcommand-based argument parsing, provider selection, output directory handling, and formatted result reporting.
Lab surface integration
polylogue/showcase/lab_corpus.py, devtools/command_catalog.py
New module with dataclasses and generation/seeding helpers (GeneratedCorpusResult, SeededDemoResult, generate_lab_corpus, seed_lab_demo); added "lab-corpus" and "lab-scenario" to command specs and verification lab command names.
Product CLI narrowing
polylogue/cli/commands/qa.py, polylogue/cli/commands/generate.py
Converted audit from group with generate subcommand to standalone command; removed --tier, --fail-fast, --capture options; restricted stage choices; entirely deleted generate.py (167 lines).
Validation lane updates
devtools/validation_lane_catalog_live.py, polylogue/showcase/invariants.py
Updated live-exercises lane to use devtools_lane and invoke devtools lab-scenario run archive-smoke instead of polylogue audit --only exercises; updated breaker metadata command reference.
CLI reference cleanup
devtools/render_cli_reference.py, polylogue/cli/machine_errors.py
Removed "Audit Generate" section from rendered reference; removed --capture from machine error value-option tracking.
Exercise catalog updates
polylogue/showcase/exercise_catalog.json, tests/baselines/showcase/help-audit-generate.txt
Removed help-audit-generate exercise entry and its baseline help text (24 lines).
CLI help baselines
tests/baselines/showcase/help-audit.txt, tests/baselines/showcase/help-main.txt, tests/unit/cli/__snapshots__/test_terminal_snapshots.ambr
Updated audit command descriptions from "composable QA" multi-stage to "archive QA" schema/proof-only; removed subcommand and tier/fail-fast/capture option documentation.
Documentation updates
docs/cli-reference.md, docs/devtools.md, docs/generate.md, docs/verification-lab.md, docs/test-quality-workflows.md, docs/verification-catalog.md
Added lab-corpus and lab-scenario command documentation; updated examples from polylogue audit generate to devtools lab-corpus generate/seed; removed audit generate references; updated snapshot counts and migration guidance.
Test code updates
tests/unit/cli/test_click_app.py, tests/unit/devtools/test_devtools_main.py, tests/unit/devtools/test_execution_specs.py, tests/unit/devtools/test_lab_surface.py, tests/unit/devtools/test_render_quality_reference.py, tests/unit/devtools/test_validation_lanes.py
Removed TestGenerateSeed suite; updated QA option assertions; added new lab surface tests (119 lines); updated execution specs and lane tests to reference devtools commands; added coverage for lab_corpus and lab_scenario main functions and argument handling.

Sequence Diagram(s)

sequenceDiagram
    participant User as User / CLI
    participant LabCorpus as devtools.lab_corpus<br/>(main)
    participant Provider as SyntheticCorpus<br/>(provider ops)
    participant Generator as Fixture Generator
    participant Output as Output Directory

    User->>LabCorpus: lab-corpus generate --providers ...
    LabCorpus->>Provider: resolve_lab_corpus_providers()
    Provider-->>LabCorpus: validated provider list
    LabCorpus->>Generator: generate_lab_corpus(providers, corpus_source, ...)
    Generator->>Output: create output directory
    Generator->>Provider: build corpus scenarios
    Generator->>Generator: validate scenarios non-empty
    Generator->>Generator: generate_synthetic_fixtures_from_scenarios()
    Generator-->>LabCorpus: GeneratedCorpusResult(batches, output_dir)
    LabCorpus->>User: print per-provider counts & paths
Loading
sequenceDiagram
    participant User as User / CLI
    participant LabScenario as devtools.lab_scenario<br/>(main)
    participant QABuilder as QA Session Builder
    participant QARunner as QA Runner
    participant Formatter as Result Formatter

    User->>LabScenario: lab-scenario run archive-smoke --tier 0 --json
    LabScenario->>QABuilder: construct QASessionRequest<br/>(exercises-only, tier filter)
    QABuilder-->>LabScenario: QASessionRequest
    LabScenario->>QARunner: run_qa_session(request)
    QARunner-->>LabScenario: QAResult
    alt --json flag set
        LabScenario->>Formatter: generate_qa_session(result)
        Formatter-->>LabScenario: JSON payload
    else default format
        LabScenario->>Formatter: format_qa_summary(result)
        Formatter-->>LabScenario: human-readable summary
    end
    LabScenario->>User: print formatted output + exit code
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 Hops with glee through refactored code!
Lab corpus and scenario, a lighter load,
Audit stays focused—clean, not strayed,
While demo and proof in new homes are laid. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'refactor: move lab smoke surfaces to devtools' clearly and concisely summarizes the main change: relocating lab-only functionality from product CLI to devtools commands.
Description check ✅ Passed The description fully matches the template with all required sections (Summary, Problem, Solution, Verification, Risks) completed with specific details about the refactoring work and verification steps performed.
Linked Issues check ✅ Passed The PR successfully implements all acceptance criteria from #337: moves synthetic corpus/demo generation to lab surface via devtools lab-corpus, adds showcase exercise execution via devtools lab-scenario, updates CLI docs/help, removes polylogue audit generate, and provides comprehensive test coverage with migration notes.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the stated objectives: relocating audit generate and showcase exercises to devtools lab surface, updating documentation, command catalogs, validation lanes, and removing outdated help baselines. No unrelated changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feature/refactor/lab-audit-showcase-surface

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 and usage tips.

@Sinity
Sinity merged commit 854b392 into master Apr 22, 2026
13 of 14 checks passed
@Sinity
Sinity deleted the feature/refactor/lab-audit-showcase-surface branch April 22, 2026 07:48

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d02d4cfe50

ℹ️ 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".

Comment thread polylogue/cli/commands/qa.py Resolved
Sinity added a commit that referenced this pull request Apr 22, 2026
## Summary

Closes #337.

Moves synthetic corpus/demo generation and showcase exercise smoke execution out of the product `polylogue audit` surface and into explicit verification-lab `devtools` commands.

## Problem

`polylogue audit generate` and `polylogue audit --only exercises` made lab-only workflows look like normal product/archive operations. After #336 established `devtools` as the verification-lab surface, these commands needed to move so product CLI help and generated scenario catalogs stop presenting lab smoke work as archive-facing QA.

## Solution

- Added `devtools lab-corpus generate` and `devtools lab-corpus seed` backed by new `polylogue.showcase.lab_corpus` helpers.
- Added `devtools lab-scenario run archive-smoke`, including `--live` so the existing live exercise lane remains archive-backed.
- Removed `polylogue audit generate`, removed its generated help exercise/baseline, and narrowed `polylogue audit` to schema audit plus artifact proof checks.
- Converted `audit` from a Click group to a plain command now that it no longer owns subcommands.
- Updated validation lanes, command catalog discovery, generated docs, migration notes, showcase baselines, and focused tests.

## Verification

- `ruff check polylogue/showcase/lab_corpus.py devtools/lab_corpus.py devtools/lab_scenario.py polylogue/cli/commands/qa.py devtools/validation_lane_catalog_live.py tests/unit/cli/test_click_app.py tests/unit/devtools/test_lab_surface.py tests/unit/devtools/test_devtools_main.py tests/unit/devtools/test_execution_specs.py tests/unit/devtools/test_render_quality_reference.py tests/unit/devtools/test_validation_lanes.py`
- `pytest tests/unit/devtools/test_lab_surface.py tests/unit/devtools/test_devtools_main.py tests/unit/devtools/test_execution_specs.py tests/unit/devtools/test_render_quality_reference.py tests/unit/devtools/test_validation_lanes.py tests/unit/cli/test_click_app.py tests/unit/cli/test_cli_error_boundaries.py tests/unit/cli/test_terminal_snapshots.py tests/unit/showcase/test_exercise_catalog.py tests/unit/showcase/test_verification_lane.py -q` -> 317 passed
- `devtools render-all --check`
- `devtools verify-showcase`
- `devtools verify`
- pre-push `devtools verify --quick`
Sinity added a commit that referenced this pull request Apr 22, 2026
`polylogue audit generate` and `polylogue audit --only exercises`
made lab-only workflows look like normal product/archive
operations. After #336 established `devtools` as the verification-
lab surface, these commands needed to move so product CLI help and
generated scenario catalogs stop presenting lab smoke work as
archive-facing QA.

Moves synthetic corpus/demo generation and showcase exercise smoke
execution out of the product `polylogue audit` surface and into
explicit verification-lab `devtools` commands. Adds `devtools
lab-corpus generate` and `devtools lab-corpus seed` backed by new
`showcase/lab_corpus` helpers. Adds `devtools lab-scenario run
archive-smoke`, including `--live` so the existing live exercise
lane remains archive-backed. Removes `polylogue audit generate`,
removes its generated help exercise/baseline, and narrows
`polylogue audit` to schema audit plus artifact proof checks.
Converts `audit` from a Click group to a plain command now that it
no longer owns subcommands. Updates validation lanes, command
catalog discovery, generated docs, migration notes, showcase
baselines, and focused tests.

Verification: ruff + pytest over 11 focused devtools/cli/showcase
suites (317 pass); devtools render-all --check, verify-showcase,
verify and --quick green.

Closes #337
Sinity added a commit that referenced this pull request Apr 22, 2026
`polylogue audit generate` and `polylogue audit --only exercises`
made lab-only workflows look like normal product/archive
operations. After #336 established `devtools` as the verification-
lab surface, these commands needed to move so product CLI help and
generated scenario catalogs stop presenting lab smoke work as
archive-facing QA.

Moves synthetic corpus/demo generation and showcase exercise smoke
execution out of the product `polylogue audit` surface and into
explicit verification-lab `devtools` commands. Adds `devtools
lab-corpus generate` and `devtools lab-corpus seed` backed by new
`showcase/lab_corpus` helpers. Adds `devtools lab-scenario run
archive-smoke`, including `--live` so the existing live exercise
lane remains archive-backed. Removes `polylogue audit generate`,
removes its generated help exercise/baseline, and narrows
`polylogue audit` to schema audit plus artifact proof checks.
Converts `audit` from a Click group to a plain command now that it
no longer owns subcommands. Updates validation lanes, command
catalog discovery, generated docs, migration notes, showcase
baselines, and focused tests.

Verification: ruff + pytest over 11 focused devtools/cli/showcase
suites (317 pass); devtools render-all --check, verify-showcase,
verify and --quick green.

Closes #337
Sinity added a commit that referenced this pull request Apr 22, 2026
`polylogue audit generate` and `polylogue audit --only exercises`
made lab-only workflows look like normal product/archive
operations. After #336 established `devtools` as the verification-
lab surface, these commands needed to move so product CLI help and
generated scenario catalogs stop presenting lab smoke work as
archive-facing QA.

Moves synthetic corpus/demo generation and showcase exercise smoke
execution out of the product `polylogue audit` surface and into
explicit verification-lab `devtools` commands. Adds `devtools
lab-corpus generate` and `devtools lab-corpus seed` backed by new
`showcase/lab_corpus` helpers. Adds `devtools lab-scenario run
archive-smoke`, including `--live` so the existing live exercise
lane remains archive-backed. Removes `polylogue audit generate`,
removes its generated help exercise/baseline, and narrows
`polylogue audit` to schema audit plus artifact proof checks.
Converts `audit` from a Click group to a plain command now that it
no longer owns subcommands. Updates validation lanes, command
catalog discovery, generated docs, migration notes, showcase
baselines, and focused tests.

Verification: ruff + pytest over 11 focused devtools/cli/showcase
suites (317 pass); devtools render-all --check, verify-showcase,
verify and --quick green.

Closes #337
@Sinity
Sinity requested a review from Copilot May 1, 2026 00:44
@Sinity
Sinity requested review from Copilot and removed request for Copilot May 1, 2026 01:05
@Sinity
Sinity removed the request for review from Copilot May 1, 2026 02:15
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: migrate audit generate and showcase exercises to lab surface

1 participant