Skip to content

feat(cli): semantic validator deprecation & structural positional oracles (#436) - #579

Merged
dan-petty merged 1 commit into
release/v0.2.23from
feat/436-semantic-validator-positional-oracles
Sep 25, 2026
Merged

dan-petty merged 1 commit into
release/v0.2.23from
feat/436-semantic-validator-positional-oracles

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary & Context

Closes #436

Audits AI review schemas and validators to strip keyword-matching assertions in favor of strict structural schema boundaries and positional enumeration / structural positional oracles.

Key Changes

  • Constants Centralization: Centralized review schema and deterministic verification constants in src/devops_cli/config/constants.py (CONST_REVIEW_PROMPT_PLACEHOLDER_BASENAMES, CONST_REVIEW_TITLE_FILLER_WORDS, CONST_AUTH_HEADER_CLAIM_KEYWORDS, CONST_AUTH_HEADER_CODE_PATTERNS, CONST_AUTH_DISPATCH_PATTERNS, CONST_FIXTURE_CREDENTIAL_KEYWORDS, CONST_MASKED_SYNTAX_ERROR_PHRASES, CONST_UNINITIALIZED_CLAIM_KEYWORDS, CONST_MONOLOGUE_PREFIXES, CONST_COMPLIMENT_PHRASES, CONST_COMPLIMENT_NEGATIONS, CONST_HALLUCINATION_FORBIDDEN_WORDS).
  • Strict Structural Location Boundary: Stripped brittle has_scratchpad_phrase regex in canonicalize_finding_location in favor of strict structural location grammar parsing (_LOCATION_REGEX, _TARGET_LOCATION_REGEX, _EMBEDDED_LOCATION_REGEX), cleanly rejecting conversational scratchpad text while supporting Windows drive letters and space-delimited paths.
  • Structural Positional finding_id: Added structural positional identifier finding_id: int | None with aliases (id, index) to Finding schema in src/devops_cli/ai/review_schema.py. Safe before-validator coerces numeric IDs without breaking string IDs on SavedFinding.
  • Structural Positional Oracle Resolution: Updated _bind_verdicts_to_findings in src/devops_cli/ai/review/verification.py to bind verdicts via positional finding_id first, eliminating title-drift and verdict-misbinding vulnerabilities, with identity fallback.
  • Verification Protocol: Updated src/devops_cli/ai/tasks/verify_finding_system.md to require finding_id in verdict output arrays.
  • Complexity Compliance: Decomposed canonicalize_finding_location, _match_verdict_by_positional_oracle, and _check_missing_header_hallucination into pure helpers, maintaining $M \le 6$ and depth \le 3.
  • Test Coverage: Added comprehensive test suite in tests/test_structural_positional_oracles.py with structural tuple equality assertions.

Verification

  • uv run pytest tests/test_structural_positional_oracles.py -v: 11/11 passed
  • uv run pytest tests/test_review_verification.py -v: 84/84 passed
  • uv run devops scan complexity: All modified files compliant ($M \le 10$, depth \le 5)
  • uv run devops ci: 10/10 Gated CI Quality Gates passing

@dan-petty
dan-petty merged commit 05171f9 into release/v0.2.23 Sep 25, 2026
8 checks passed
@dan-petty
dan-petty deleted the feat/436-semantic-validator-positional-oracles branch September 25, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant