Repository navigation
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3cb9d7d763
ℹ️ 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".
88c8681 to
bfb0c6d
Compare
…xt (#557) Widen validate_review_response to accept the host-supplied ReviewContext so completeness rules can be checked in code instead of bought as prompt prose, and repair scorecard/ledger ordering deterministically rather than instructing it in the contract layer. Model-authored lines survive verbatim; only block order changes, and a review already in contract order is returned untouched.
Move the contract layer's completeness and cross-field rules into the deterministic boundary now that ReviewContext carries what the host supplied: one row per acceptance criterion and none invented, one inventory-drift row copying its pair verbatim, mutually exclusive memory branches, no external producer declined as internal, no unresolved field under a SAFE verdict, and NONE rejected as a coverage status.
…#557) Build ReviewContext from each scenario's ground-truth block so the completeness rules actually fire during the eval, and carry the required emit shape in each rejection message so a repair can succeed in one attempt. Only the appendix-ordering rule is removed from the contract layer. A smoke run showed why: deleting a reject-class instruction costs a full repair round trip (~17.5k tokens) to recover a ~38-token instruction, so reject-class rules keep their prompt text and code enforces them on top.
…#557) A failed response contract is a shape defect, not a judgment defect. The repair now carries the machine-enforced contract, the validation error, and the previous response, but not the scenario task, cutting the repair prompt ~70%. The 46-scenario run lost 25.41 points of token reduction to repair traffic (42.63% first-attempt vs 17.22% realised), with 17 of 19 repairs caused by one recurring envelope defect.
…#557) A scenario that errored in the frozen run has no baseline to reuse, which made the whole reuse path fail closed and forced regenerating all 46. Regenerate just the missing ones; the model/auth/skill metadata check still gates reuse.
bfb0c6d to
90e4fda
Compare
…dates (#557) Two review findings on the issue #557 proof harness: - The verdict regex accepted trailing text after a favourable verdict, so a conditional approval such as 'Verdict: SAFE TO MERGE only if a future test passes' crossed the deterministic boundary as safe_to_merge=True. Anchor the line to end-of-line and add regression cases for both directions. - Repaired candidate responses are generated after a corrective user turn the baseline never receives, so their rubric grade is not a one-prompt comparison. The comparator now records a per-scenario repaired flag, reports repaired_count and candidate_passed_first_attempt, and counts a repaired scenario as a quality regression regardless of its grade. Repair attempts still count toward candidate token usage. The README records the limitation against the recorded 31/46 result; NOT PROVEN stands under either reading.
…gaps (#557) Findings from the per-file merge review and nine codex rounds on the proof harness, all fixed in this PR: Deterministic review gate (src/sumo_qa/review_gate_poc.py): - A second GATE_REPORT/REVIEW pair absorbed by the lazy REVIEW group validated the first report while the second was never parsed. Exactly one complete envelope pair is now required; prose may still mention a tag. - The verdict line is one literal, case-sensitive line with horizontal whitespace only, so it cannot be split across lines. - A second verdict statement beside the well-formed line (a decorated "verdict:" label, or any line carrying the phrase SAFE TO MERGE in either direction, with whitespace tolerance and no letter/digit adjacency) is rejected instead of ignored, closing the contradictory-verdict bypass. Evidence harness (experiments/issue_557): - compare_results fails closed on malformed attempts instead of raising. - The MCP A/B runner rejects a candidate trace that loads the review skill through sumo_qa_load_skill_context, checks every review-tool result hashes to the candidate prompt, validates each frozen baseline record (scenario, description, config hash, prompt hash, graded output with a score in 0..1), counts only a first-attempt pass as preserved quality, and pins its own file hash in the evidence metadata so stale evidence cannot resume. - README: regression count qualified under the current rule, the "runs once" claim corrected, trace and frozen-record checks documented. Tests: - tests/test_e2e_mcp_initialize.py imports the POC package inside the one A/B test so the production contract tests collect without experiments/. - Regression cases for every bypass above and the false positives they must not introduce.
…ath (#557) Two findings from the final per-file merge review, plus the codex follow-up: - The unresolved-field guards in review_gate_poc required the bare value after Classification:/Coverage:/Status:, so a SAFE verdict with a decorated value (**UNMET**, ~~UNMET~~, (UNMET), "UNMET", <strong>UNMET</strong>, Coverage: **NONE**) was accepted. Any punctuation or HTML tag between the label and the value is now consumed, with letter/digit adjacency excluded; the verdict label pattern accepts the same decoration class. - The candidate A/B server overrode only the review skill tool, so sumo_qa_load_skill_context, the manifest index, and the sumoqa:// resources still served the full review skill, which Codex can read through its built-in resource tool without the trace validator seeing it. The candidate now substitutes the review skill's manifest record at the source, so every surface serves the compact prompt; the override is process-wide (the loader resolves records at request time), removable, and cleared after each in-process test. The trace validator also rejects candidate resource reads, which are invisible to the skill-context token estimate. Tests cover every decoration form (red on the previous head), every review surface on both variants including the resource over the real stdio transport, the resource-read trace rule, and the no-leak ordering.
…l surface (#557) Codex follow-up on the previous commit: - The field guards now consume HTML entities between a label and its value (Classification: UNMET), and a value followed by an underscore and a letter is an identifier (UNMET_BY_DESIGN) rather than the bare value, while Markdown emphasis (_UNMET_) still counts. - The candidate A/B server also overrides execute_external_skill, so a host-installed copy of the review skill returns the compact body; the trace validator rejects a candidate that executes the review skill that way.
…ls (#557) Substitute per-file review (codex quota-blocked) on the previous commit: - The field guards accept the same decoration on the label side as on the value side (**Classification**:, _Coverage:_, <strong>Status</strong>:, Classification :, an entity colon), so a decorated label can no longer hide an unresolved value beside a SAFE verdict. - The candidate external-skill override recognises the review skill by its normalised directory name or by the loaded body's content hash, so a case-insensitive filesystem resolving another spelling, or a renamed host copy, cannot hand the candidate the full skill.
…s, edited host copies (#557) - CodeQL flagged the label decoration pattern for exponential backtracking: the HTML-tag alternative and the single-character class overlapped on '<' and '>'. The decoration grammar is now exclusive by position (a '<' is a tag start or explicitly not one; an '&' is an entity or explicitly not one), shared by the verdict label and both field guards, with a timing test on hostile input. An angle-bracketed value (<UNMET>) stays a value. - Colon character references with leading zeros (:, :) count as the label's colon. - The candidate external-skill override recognises a host copy of the review skill by its frontmatter name or a whitespace-normalised body, so an edited, BOM-prefixed, or older renamed copy cannot leak the full skill.
…ped skill names (#557) Codex final pass on the previous commits: - A value followed by any run of underscores and a letter is an identifier (UNMET__BY_DESIGN), and a label preceded by a letter and an underscore is an identifier (serialized_Classification:), so neither is a field guard hit; Markdown emphasis on either side still counts. - The candidate external-skill override strips leading whitespace before reading the frontmatter name, so an edited renamed copy with leading blank lines and a trailing comment still serves the compact body. - The trace rule for external-skill execution names the review skill by the last real path segment, so ../../skills/<name>/. and similar spellings the resolver accepts are rejected too.
…nderscore labels (#557) Codex pass on the previous commit: - The external-skill trace rule normalises the path (posixpath.normpath) before taking the last segment, so <name>/references/.. and similar spellings the resolver accepts are recognised. - The candidate override skips whitespace, a BOM, and HTML comments before the copied frontmatter, so a commented renamed copy still serves the compact body. - A label preceded by a letter and up to three underscores is an identifier; double-underscore emphasis (__Classification__:) still counts.
…ed-body trace rule (#557) Final per-file backstop and codex confirmatory pass on 5b38ee7: - An HTML-tag body may not contain a bare unresolved value anywhere, so <UNMET/>, <**UNMET**> and <UNMET | Anchor: none> are values, not tags, and the <UNMET> exclusion now has true-negative tests. - The candidate override recognises a host copy of the review skill by line overlap with the production body (frontmatter removed), so a copy whose directory, frontmatter name and body were all changed still serves the compact prompt; test variants cover renamed frontmatter, stripped frontmatter, and an edit everywhere. - The trace validator rejects a candidate external-skill call by the body it returned (full or compact review skill, raw or JSON-encoded), so a symlink alias the name rule cannot see is caught, and external-skill loads count toward the skill-context estimate.
|
Closed without merging by decision of the maintainer. The issue asked a go/no-go question and the answer is no: the compact prompt plus code-enforced gates does not preserve the full review skill's quality (31/46 vs 40/46 with 12 per-scenario regressions despite 85% fewer input tokens; the fully gated full skill costs 4% more; the conservative trim regresses the AC case). The result is recorded as NOT PROVEN on #557 together with the per-AC evidence, the token totals, and the limitations. A secondary finding from the review series: a text-level gate on model prose becomes a regex arms race, which argues against building this design for real. Merging would add about 5,400 lines, a gate module shipping as dead code in the wheel, and roughly 500 tests of ongoing cost for a design that will not be built. The branch is kept as the evidence record (head de3144f: CI 33 of 33, Linux mutation gate green, 3468 tests at 100% coverage). |
|
Correction: the branch has been deleted as part of the cleanup. This PR's commits (head de3144f) remain the evidence record and are restorable from this page. |
Summary
Records issue #557 as
NOT PROVENafter an exhaustive no-cache comparison and a quality-constrained reduction sweep. No production skill or MCP behavior changes.Exhaustive compact result
reviewing-before-mergeconfigs, 46 scenarios.The nine
.ab.yamlfiles are historical controls that embed alternate skill bodies and are intentionally excluded. Every current-skill behavior config was run.Quality-constrained frontier
The conservative routed candidate retained the original red flags, examples, process flow, and all non-appendix instructions. It still regressed on the AC-UNMET case by marking changelog evidence
UNVERIFIEDwhere the unchanged rubric requiredMET.The 6.69% token result is valid provider-reported generation usage across all 46 scenarios: 908,313 full-skill input tokens versus 847,554 routed input tokens. Quality results from the first fallback sweep are invalid and excluded because structured anti-pattern lists were serialized as strings. The serializer and regression tests now preserve native rubric lists and stringify only structured cold prompt context.
A corrected exhaustive rerun is externally blocked: OpenAI returns
429 insufficient_quota, and the Gemini fallback stopped returning judge results. The fail-closed conclusion is that no non-zero reduction is proven quality-neutral.Changes
Review-driven fixes (per-file merge review, two codex review threads, sixteen codex rounds, four per-file backstop rounds)
Deterministic review gate (
src/sumo_qa/review_gate_poc.py):Verdict: SAFE TO MERGE only if a future test passes) or a split line no longer crosses the boundary as a favourable verdict.verdict:label, or any line carrying the phraseSAFE TO MERGEin either direction, whitespace-tolerant, not letter/digit-adjacent. A decorated label with no phrase (Verdict (final):alone) states no direction and is deliberately not chased.GATE_REPORT/REVIEWenvelope pair is required, so a second pair absorbed by the lazyREVIEWgroup is rejected while prose may still mention a tag.Classification/Coverage/StatusvaluesUNMET,UNVERIFIED,UNCOVERED,UNPROVEN, andCoverage: NONE) tolerate any punctuation, HTML tag or HTML entity around the label and the value (**Classification**:,Classification:,**UNMET**,~~UNMET~~,(UNMET),<UNMET/>,<strong>UNMET</strong>, UNMET), so none of those can coexist with a SAFE verdict, while identifiers (UNMET_BY_DESIGN,UNMET__BY_DESIGN,serialized_Classification:,serialized__Classification:) are neither values nor labels. The decoration alternatives are exclusive by position (CodeQL flagged the earlier tag/character overlap as exponential backtracking); a timing test holds the patterns linear on hostile input.Evidence harness (
experiments/issue_557):repairedflag, reportsrepaired_countandcandidate_passed_first_attempt, and counts a repaired scenario as a quality regression regardless of grade. Repair attempts still count toward token usage.attempts(non-list, non-object elements) instead of raising.sumo_qa_load_skill_context(exactskill_namematch), requires every review-tool result to hash to the candidate prompt, validates each frozen baseline record (scenario id, description, config hash, full-skill prompt hash, graded output with a score in 0..1), counts only a first-attempt pass as preserved quality, and pins its own file hash in the evidence metadata so evidence from an earlier harness cannot be resumed. The frozen grade is trusted as captured; regrading all 46 baseline outputs is deliberately out of scope.sumo_qa_load_skill_context, the manifest index, thesumoqa://resources, andsumo_qa_execute_external_skill(for a host-installed copy of the review skill, matched by normalised directory name, frontmatter name, or line overlap with the production body so a case-insensitive filesystem, a renamed copy with its own frontmatter name, or an edited, commented, stripped, or older copy cannot leak it) all serve the compact prompt; no MCP path returns the full skill to the candidate. The override is process-wide (the loader resolves records at request time), removable, and cleared after each in-process test. Candidate resource reads (read_mcp_resourceand friends) and candidate external-skill execution of the review skill (matched on the normalised last path segment, so../../skills/<name>/.and<name>/references/..count, and on the served body, so a symlink alias counts too) are rejected by the trace validator; external-skill loads count toward the skill-context estimate because they are invisible to the skill-context token estimate.Tests:
tests/test_e2e_mcp_initialize.pyimports the POC package inside the one A/B test, so the production contract tests collect withoutexperiments/.UNMETEREDbeside aMETclassification); every review surface checked on both variants, including the resource over the real stdio transport.Verification
90e4fdaaccepts each assafe_to_merge=True) and are rejected on the branch; legitimate forms still validate; the trace, first-attempt, frozen-record, and every-surface checks fire on representative inputs.review_gate_pocis not registered as a tool and is not imported by any production module.<GATE_REPORT>tags (about 2 s at 84 KB); model responses are a few KB, the pattern is not exponential, and a linear hand parser would be a rewrite of the POC boundary.Related issue
Closes #557
Checklist
NOT PROVEN