fix(validator): validate all MUST items in session logs, not just hardcoded subset#1328
Conversation
…dcoded subset The session validator only checked MUST items listed in hardcoded frozensets. Any MUST item added to session logs but not in the allowlist was silently ignored, passing validation even when incomplete. This fix: 1. Iterates over all items in sessionStart/sessionEnd that declare level == "MUST", not just the hardcoded subset. 2. Keeps the hardcoded sets as minimum required items (must exist). 3. Adds evidence-contradiction detection: warns when complete is true but evidence contains "not available", "SKIPPED", "N/A", "deferred", "pending", "TODO", "TBD", or future-tense language. Fixes #1028 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
✅ Pass: Memory ValidationNo memories with citations found. 📊 Validation Details
|
PR Validation ReportNote ✅ Status: PASS Description Validation
QA Validation
⚡ Warnings
Powered by PR Validation workflow |
There was a problem hiding this comment.
Code Review
This pull request correctly identifies a validation gap and refactors the logic to check all MUST items in a session log, not just a hardcoded subset. The introduction of contradiction detection for evidence is also a valuable improvement. However, the new implementation has a critical flaw where it fails to report an error if a required checklist item is missing entirely, which undermines the goal of robust validation and violates the principle of propagating errors in critical operations. I've provided a suggestion to fix this.
Spec-to-Implementation ValidationTip ✅ Final Verdict: PASS What is Spec Validation?This validation ensures your implementation matches the specifications:
Validation Summary
Spec References
Requirements Traceability DetailsRequirements Coverage Matrix
Summary
Gaps
Implementation Completeness DetailsNow I have enough context to evaluate the implementation against the acceptance criteria. Acceptance Criteria Checklist
Missing FunctionalityNone identified. All acceptance criteria are addressed. Edge Cases Not Covered
Implementation Quality
Run Details
Powered by AI Spec Validator workflow |
AI Quality Gate ReviewTip ✅ Final Verdict: PASS WalkthroughThis PR was reviewed by six AI agents in parallel, analyzing different aspects of the changes:
Review Summary
💡 Quick Access: Click on individual agent jobs (e.g., "🔒 security Review", "🧪 qa Review") in the workflow run to see detailed findings and step summaries. Security Review DetailsPR #1328 Security Review complete. PR Type: CODEChanged files: Security AnalysisFindings
Analysis Summary
RecommendationsNone required. VerdictQA Review DetailsBased on my review of the PR changes and pre-executed test results, here is my QA verdict: Test Coverage Assessment
Quality Concerns
Regression Risk Assessment
Positive Findings
Analyst Review DetailsAnalysis: PR #1328 - Session Validator MUST Item FixCode Quality Score
Overall: 5/5 Impact Assessment
Findings
Detailed AnalysisBug Fix Correctness: The fix addresses issue #1028 correctly. Previous code only validated items in hardcoded Evidence Contradiction Detection: Adding Test Coverage: 15 new tests added covering:
Rename Clarity: Renaming Backward Compatibility: The fix is backward compatible. Tests updated to use helper functions Recommendations
VerdictArchitect Review DetailsLet me check the validation types module and existing session validation design review for context. Now I have enough context to complete the architectural review. The changes are a bug fix to the session validator that makes it validate ALL MUST items dynamically rather than only checking a hardcoded subset. Design Quality Assessment
Overall Design Score: 5/5 Architectural Concerns
Breaking Change Assessment
The change is backward compatible. Existing session logs that passed before will pass now. Session logs with incomplete MUST items that were previously silently ignored will now fail validation, which is the correct behavior. Technical Debt Analysis
The rename from ADR Assessment
The contradiction detection pattern ( Recommendations
VerdictDevOps Review DetailsI've reviewed the PR and the workflow that depends on this script. Here's my DevOps analysis: DevOps Review: PR #1328PR Scope Detection
Pipeline Impact Assessment
CI/CD Quality Checks
Findings
Workflow Integration AnalysisThe
Changes are backward compatible:
Recommendations
VerdictRoadmap Review DetailsBased on my review of the PR and roadmap context, here is my strategic alignment assessment: Strategic Alignment Assessment
Feature Completeness
Impact Analysis
Concerns
Recommendations
VerdictRun Details
Powered by AI Quality Gate workflow |
|
Caution Review failedFailed to post review comments 📝 WalkthroughWalkthroughReplaces hardcoded MUST allowlists with minimum required item sets, adds CONTRADICTION_PATTERNS to detect evidence contradicting claimed completion, consolidates checklist validation into validate_checklist_section, and updates session start/end validation to use the new checklist flow. validate_must_item emits evidence-contradiction warnings. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
…oring When a required item from SESSION_START_REQUIRED_ITEMS or SESSION_END_REQUIRED_ITEMS was absent from the section data, validate_checklist_section silently skipped it. This adds an else branch that appends a "Missing required item" error. Tests updated to provide all required items where needed, isolating unit tests that focus on other concerns with empty required sets. Addresses review feedback from gemini-code-assist on PR #1328. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Velocity Accelerator: 2 Opportunities DetectedTODO in scripts/validate_session_json.py: |pending|TBD)\b"
TODO in tests/test_validate_session_json.py: ",
|
Summary
Session validator silently ignores MUST items not in a hardcoded allowlist. This fix validates ALL items with
level == "MUST"and adds evidence-contradiction detection.Specification References
Changes
SESSION_START_MUST_ITEMS/SESSION_END_MUST_ITEMStoSESSION_START_REQUIRED_ITEMS/SESSION_END_REQUIRED_ITEMSto clarify they are the minimum required setvalidate_checklist_section()that iterates over ALL items withlevel == "MUST"or"MUST NOT", not just the hardcoded subsetCONTRADICTION_PATTERNSregex to detect evidence like "not available", "SKIPPED", "N/A", "deferred", "pending", "TODO", "TBD" paired withcomplete: trueType of Change
Testing
Agent Review
Security Review
Other Agent Reviews
Checklist
Related Issues
Fixes #1028