Repository navigation
test(scenarios): replace vacuous clean_stderr invariant and classify lane assertions - #878
Conversation
…lane assertions - Delete _check_clean_stderr from showcase invariants (always returned success without checking stderr, since CliRunner merges stderr into output) - Add AssertionClass enum: SMOKE_PROCESS, SEMANTIC_OUTPUT, RUNTIME_BUDGET, LIVE_OBSERVABILITY, METADATA_SPEC - Auto-classify AssertionSpec from populated fields; default AssertionSpec() is SMOKE_PROCESS (exit_code only) - Show assertion classification in devtools run-validation-lanes output - Label generated-scenario proof evidence as metadata/spec completeness (it checks static subject metadata, not executed behavior) - Add classification tests and remove _check_clean_stderr tests Closes #857 Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR improves the honesty/clarity of scenario and validation-lane evidence by removing a vacuous showcase invariant and introducing explicit assertion classification that can be surfaced in lane listings and proof evidence.
Changes:
- Removed the
_check_clean_stderrshowcase invariant and its associated unit test coverage. - Added
AssertionClass+ auto-classification toAssertionSpec, with payload round-tripping for explicit overrides and new unit tests. - Surfaced assertion classification in validation lane listing output, and annotated generated-scenario proof runners with an explicit “metadata/spec completeness” note.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
polylogue/scenarios/assertions.py |
Adds AssertionClass, auto-classification, override support, and payload parsing/serialization changes. |
polylogue/scenarios/__init__.py |
Re-exports new assertion classification symbols. |
polylogue/showcase/invariants.py |
Removes the vacuous clean_stderr invariant from the invariant registry. |
devtools/validation_lane_runtime.py |
Prints assertion classification when listing non-composite lanes. |
polylogue/proof/runners.py |
Adds evidence_note clarifying that generated-scenario evidence is metadata/spec completeness. |
tests/unit/scenarios/test_assertions.py |
Adds classification and payload round-trip tests. |
tests/unit/showcase/test_invariants_runtime.py |
Removes tests for deleted clean_stderr invariant and keeps nonempty-output skip coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if self.classification_override is not None: | ||
| payload["classification"] = self.classification.value |
| except ValueError: | ||
| return None | ||
| return None |
Closes #857. Some scenario / validation-lane checks reported stronger evidence than they actually produced. `_check_clean_stderr()` always returned success without checking stderr (Click runner output is merged), and default `AssertionSpec()` was exit-code-only with no indication that it was a smoke check rather than semantic proof. - Deletes `_check_clean_stderr` from `polylogue/showcase/invariants.py` and removes it from the `SHOWCASE_INVARIANTS` registry. - Adds `AssertionClass` enum (`SMOKE_PROCESS`, `SEMANTIC_OUTPUT`, `RUNTIME_BUDGET`, `LIVE_OBSERVABILITY`, `METADATA_SPEC`) to `polylogue/scenarios/assertions.py` with auto-classification from populated assertion fields. Default `AssertionSpec()` is `SMOKE_PROCESS` so the exit-code-only default is visibly not semantic proof. - `print_lane` in `devtools/validation_lane_runtime.py` shows `assertion: smoke/process` so `run-validation-lanes --list` distinguishes smoke from semantic lanes. - `polylogue/proof/runners.py`: three runner functions gain `evidence_note` labelling them as metadata/spec completeness, not executed behavior. Closes #857
Direct, no-PR. Mixed direct commit that lands the bulk of the plg/plog alias and lane-enforcement work plus the daemon CORS / remote-bind security boundary, sharing files with the context-pack repair in eedbc1f. - #825: `pyproject.toml` registers `plg` and `plog` as `console_scripts` aliases for `polylogue`, and `polylogue/daemon/cli.py` picks up the matching wiring. - #857: `polylogue/scenarios/assertions.py` and `devtools/lane_models.py` add `AssertionSpec.validate()` plus `LaneEntry.__post_init__` enforcement that warns when `SEMANTIC_OUTPUT` lanes lack stdout assertions, so the classification from PR #878 is enforced at build time. - #868: `polylogue/daemon/http.py` adds `_check_cross_origin()` rejecting browser cross-origin POSTs to mutating endpoints, and requires an auth token whenever the bind address is not loopback. Boundary note: this is intentionally one cross-cutting commit rather than three small ones because the lane enforcement and the CORS check share scenario/handler test fixtures that would have rebased awkwardly. Refs #825, #857, #868
Closes #857. Some scenario / validation-lane checks reported stronger evidence than they actually produced. `_check_clean_stderr()` always returned success without checking stderr (Click runner output is merged), and default `AssertionSpec()` was exit-code-only with no indication that it was a smoke check rather than semantic proof. - Deletes `_check_clean_stderr` from `polylogue/showcase/invariants.py` and removes it from the `SHOWCASE_INVARIANTS` registry. - Adds `AssertionClass` enum (`SMOKE_PROCESS`, `SEMANTIC_OUTPUT`, `RUNTIME_BUDGET`, `LIVE_OBSERVABILITY`, `METADATA_SPEC`) to `polylogue/scenarios/assertions.py` with auto-classification from populated assertion fields. Default `AssertionSpec()` is `SMOKE_PROCESS` so the exit-code-only default is visibly not semantic proof. - `print_lane` in `devtools/validation_lane_runtime.py` shows `assertion: smoke/process` so `run-validation-lanes --list` distinguishes smoke from semantic lanes. - `polylogue/proof/runners.py`: three runner functions gain `evidence_note` labelling them as metadata/spec completeness, not executed behavior. Closes #857
Direct, no-PR. Mixed direct commit that lands the bulk of the plg/plog alias and lane-enforcement work plus the daemon CORS / remote-bind security boundary, sharing files with the context-pack repair in eedbc1f. - #825: `pyproject.toml` registers `plg` and `plog` as `console_scripts` aliases for `polylogue`, and `polylogue/daemon/cli.py` picks up the matching wiring. - #857: `polylogue/scenarios/assertions.py` and `devtools/lane_models.py` add `AssertionSpec.validate()` plus `LaneEntry.__post_init__` enforcement that warns when `SEMANTIC_OUTPUT` lanes lack stdout assertions, so the classification from PR #878 is enforced at build time. - #868: `polylogue/daemon/http.py` adds `_check_cross_origin()` rejecting browser cross-origin POSTs to mutating endpoints, and requires an auth token whenever the bind address is not loopback. Boundary note: this is intentionally one cross-cutting commit rather than three small ones because the lane enforcement and the CORS check share scenario/handler test fixtures that would have rebased awkwardly. Refs #825, #857, #868
Summary
Replace the vacuous
_check_clean_stderrshowcase invariant (always returned success without checking stderr) and add explicitAssertionClassclassification so lanes and assertions are honest about what kind of evidence they provide.Problem
_check_clean_stderr()inpolylogue/showcase/invariants.pyreturnedNone(pass) for all read commands without actually checking stderr (CliRunner merges stderr into merged output)AssertionSpec()defaulted to exit-code-only with no indication it's a smoke/process check, not semantic proofdevtools run-validation-lanes --listdidn't distinguish smoke/process lanes from semantic behavior lanesSolution
_check_clean_stderrfrompolylogue/showcase/invariants.pyand removed fromSHOWCASE_INVARIANTSregistryAssertionClassenum (SMOKE_PROCESS,SEMANTIC_OUTPUT,RUNTIME_BUDGET,LIVE_OBSERVABILITY,METADATA_SPEC) topolylogue/scenarios/assertions.pywith auto-classification from populated assertion fieldsAssertionSpec()isSMOKE_PROCESS— exit-code-only default is visibly not semantic proofprint_laneindevtools/validation_lane_runtime.pynow printsassertion: smoke/processevidence_noteadded to three runner functions inpolylogue/proof/runners.pynoting they check metadata/spec completeness, not executed behaviorVerification
Pre-existing master branch import error (
_WorkerProgress) prevents running the full focused test suite (tests/unit/showcase/test_invariants_runtime.py, tests/unit/devtools/test_validation_lanes.py, tests/unit/proof/test_generated_scenario_obligations.py) — this is unrelated and tracked in #866.Closes #857
Ref #852
Files changed (7)
polylogue/scenarios/assertions.py— +AssertionClass, auto-classification, classification_overridepolylogue/scenarios/__init__.py— export new namespolylogue/showcase/invariants.py— delete _check_clean_stderrpolylogue/proof/runners.py— evidence_note on generated scenario runnersdevtools/validation_lane_runtime.py— classification in print_lanetests/unit/scenarios/test_assertions.py— +6 classification teststests/unit/showcase/test_invariants_runtime.py— remove clean_stderr tests