ci: add memory validation workflow for ADR-017 enforcement#342
Conversation
Adds the missing workflow that creates the "Validate Memory Files" required check. This workflow was on an unmerged feature branch, causing PR #334 to be blocked indefinitely. Fixes #341 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
AI Quality Gate ReviewWarning WalkthroughThis PR was reviewed by six AI agents in parallel, analyzing different aspects of the changes:
Review Summary
Architect Review DetailsNow I have sufficient context. Let me review the workflow file against the architecture. Design Quality Assessment
Overall Design Score: 4.8/5 Architectural Concerns
Breaking Change Assessment
Technical Debt Analysis
ADR Assessment
Recommendations
ObservationsThe workflow adheres to established patterns:
VerdictQA Review DetailsBased on my analysis, here is the QA review: QA Review: memory-validation.ymlTest Coverage Assessment
Quality Concerns
Regression Risk Assessment
Detailed FindingsWorkflow Structure AnalysisThe workflow file is well-structured:
Missing Test CoverageThe PowerShell scripts invoked by this workflow lack Pester test coverage:
Mitigating Factors
Recommendation: Accept this PR to unblock #334. Open a follow-up issue to add Pester tests for Validate-SkillFormat.ps1 and Validate-MemoryIndex.ps1 following the pattern in Validate-Consistency.Tests.ps1. Security Review DetailsSecurity Review: Memory Validation WorkflowFindings
AnalysisInjection Vulnerabilities (CWE-78, CWE-89): [PASS] The workflow passes no untrusted input to the PowerShell scripts. The Secret Detection: [PASS] No hardcoded credentials, API keys, or tokens detected. No environment variables or secrets accessed. Dependency Security: [PASS] Uses Permissions Model: [PASS] Uses minimal permissions ( Trigger Configuration: [PASS] Path-filtered triggers on specific files reduce unnecessary execution. No Concurrency Control: [PASS] Uses Validation Scripts: The PowerShell scripts ( RecommendationsNone required. The workflow follows security best practices. VerdictAnalyst Review DetailsNow let me check the workflow file and compare with similar workflows in the repository: Let me also check the I have enough context. Let me provide the analysis. Code Quality Score
Overall: 4.75/5 Impact Assessment
Findings
Recommendations
VerdictRoadmap Review DetailsStrategic Alignment Assessment
Feature Completeness
Impact Analysis
Concerns
Recommendations
VerdictDevOps Review DetailsThe checkout action SHA Both scripts support the I'll perform manual YAML syntax analysis based on my view of the file: Pipeline Impact Assessment
CI/CD Quality Checks
Findings
Positive Observations
Template Assessment
Automation Opportunities
The workflow already follows established patterns from other workflows in this repo. Recommendations
VerdictRun Details
Powered by AI Quality Gate - View Workflow |
There was a problem hiding this comment.
Pull request overview
This PR adds the missing memory-validation.yml GitHub Actions workflow that creates the "Validate Memory Files" required check, which was blocking PR #334 and potentially other PRs. The workflow enforces ADR-017 (Tiered Memory Index Architecture) by validating that memory files follow the proper skill format and index structure.
Key Changes:
- Adds CI workflow to validate ADR-017 compliance for memory system changes
- Triggers on push/PR when
.serena/memories/**files or validation scripts are modified - Runs two validation steps: skill format check and memory index validation
Address Copilot review comment: Document ARM runner choice per ADR-014 (GitHub Actions Runner Selection) for cost optimization and consistency. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds conditional check to skip validation when only workflow/script files change. This allows bootstrapping the workflow without failing on pre-existing bundled memory files on main. Validation still runs when .serena/memories/** files are modified. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update: Added Skip Condition for BootstrapThe previous version failed because it validated ALL memory files on main, which includes pre-existing bundled files that violate ADR-017. Fix: Added conditional check to skip validation when no
The check now:
This is the correct behavior for a "gate" workflow - only validate what's being changed. |
Comprehensive investigation of 20 open PRs to identify those stuck for similar reasons as PR #334. Key Findings: - PR #334 is NOT stuck (all checks pass, approved, mergeable) - 16 of 20 PRs are actually stuck - 10 PRs blocked by Aggregate Results failures (62.5%) - Only 1 PR (#342) shares PR #334's blocker type (missing workflow) - 6 PRs have merge conflicts - 3 PRs ready to merge immediately (#334, #336, #245) Analysis identifies systemic pattern in Aggregate Results failures affecting majority of stuck PRs, distinct from originally described missing workflow issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previous run failed due to transient Copilot CLI failure. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughAdds a new GitHub Actions workflow Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant GH as GitHub Actions
participant Repo as Repository
participant Runner as ubuntu-24.04-arm Runner
participant PS as PowerShell validators
GH->>Repo: Event (push / pull_request targeting main / workflow_dispatch)
GH->>Runner: start job (checkout)
Runner->>Repo: fetch refs + changed paths
Runner->>Runner: compute changed memory files list
alt no memory files changed
Runner->>GH: emit skip output (skip=true) & notice
GH->>GH: mark check skipped
else memory files changed
Runner->>PS: run Validate-SkillFormat.ps1 --ci
PS-->>Runner: exit status
alt validator success
Runner->>PS: run Validate-MemoryIndex.ps1 --ci
PS-->>Runner: exit status
Runner->>GH: report success/failure
else validator failure
Runner->>GH: report failure
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Comment |
Address Copilot review: PowerShell -like operator with single '*' only matches files in the immediate directory, not subdirectories. Use -match with regex pattern to align with workflow trigger's '**' glob. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
bbda547
Reverting the memory file split and index updates as the background agent did not create all required atomic skill files. The indexes referenced files that don't exist (skill-documentation-*, skill-implementation-*, etc.), causing CI validation to fail. The bundled skill files are restored until a complete split is done. Issue #342 tracks the memory validation workflow, and the split should be done as a separate PR with proper verification. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Retrospective of CI workflow debugging session that fixed phantom required check blocking. Analyzed PR #342 (initial fix) and PR #343 (comprehensive edge case handling). **Skills Extracted** (atomicity 88-95%): - Skill-CI-Workflow-001: Required check + path filter anti-pattern (95%) - Skill-CI-Workflow-002a: Zero SHA handling in git diff (95%) - Skill-CI-Workflow-002b: Missing commit handling with cat-file (93%) - Skill-CI-Workflow-002c: Git diff exit code validation (92%) - Skill-CI-Workflow-003: Required check deployment testing (90%) - Skill-Architecture-016: ADR compliance documentation (88%) - Skill-Implementation-007: Fast iteration cycle pattern (92%) **Key Learnings**: - Path filters on required check workflows cause phantom blocking - Internal skip logic preserves efficiency while ensuring status reports - Git diff in workflows needs comprehensive edge case handling - Fast iteration (<10min cycles) enabled 5 rounds in 20 minutes **Memory Files Created**: - ci-workflow-required-checks.md (5 skills) - architecture-adr-compliance-documentation.md (1 skill) - implementation-fast-iteration.md (1 skill) **Related**: PR #342 (merged), PR #343 (pending merge) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Comprehensive investigation of 20 open PRs to identify those stuck for similar reasons as PR #334. Key Findings: - PR #334 is NOT stuck (all checks pass, approved, mergeable) - 16 of 20 PRs are actually stuck - 10 PRs blocked by Aggregate Results failures (62.5%) - Only 1 PR (#342) shares PR #334's blocker type (missing workflow) - 6 PRs have merge conflicts - 3 PRs ready to merge immediately (#334, #336, #245) Analysis identifies systemic pattern in Aggregate Results failures affecting majority of stuck PRs, distinct from originally described missing workflow issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…atus check (#346) * fix(ci): remove path filters from memory validation workflow The 'Validate Memory Files' job is a required status check. With path filters at the workflow trigger level, the workflow doesn't run for PRs that don't touch memory files, causing those PRs to be blocked. Changes: - Remove path filters from on.push and on.pull_request triggers - Add comment explaining why path filters are not used - Fix git diff to use event-specific commit ranges - Properly split git diff output into array before filtering The change detection logic inside the job still skips validation for PRs that don't modify .serena/memories/** files. Fixes PRs being blocked by phantom 'Validate Memory Files' check. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(ci): add robust git diff handling for edge cases Address Copilot review comments: 1. Handle zero SHA when first commit on new branch 2. Detect force-push/rebase when before commit doesn't exist 3. Use two dots (..) for push events instead of three (...) 4. Add exit code check after git diff command Fallback to origin/main comparison when: - github.event.before is all zeros (first commit) - before commit no longer exists (force-push/rebase) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(retrospective): extract 7 atomic skills from PR #342 & #343 Retrospective of CI workflow debugging session that fixed phantom required check blocking. Analyzed PR #342 (initial fix) and PR #343 (comprehensive edge case handling). **Skills Extracted** (atomicity 88-95%): - Skill-CI-Workflow-001: Required check + path filter anti-pattern (95%) - Skill-CI-Workflow-002a: Zero SHA handling in git diff (95%) - Skill-CI-Workflow-002b: Missing commit handling with cat-file (93%) - Skill-CI-Workflow-002c: Git diff exit code validation (92%) - Skill-CI-Workflow-003: Required check deployment testing (90%) - Skill-Architecture-016: ADR compliance documentation (88%) - Skill-Implementation-007: Fast iteration cycle pattern (92%) **Key Learnings**: - Path filters on required check workflows cause phantom blocking - Internal skip logic preserves efficiency while ensuring status reports - Git diff in workflows needs comprehensive edge case handling - Fast iteration (<10min cycles) enabled 5 rounds in 20 minutes **Memory Files Created**: - ci-workflow-required-checks.md (5 skills) - architecture-adr-compliance-documentation.md (1 skill) - implementation-fast-iteration.md (1 skill) **Related**: PR #342 (merged), PR #343 (pending merge) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(session): update session log with commit SHA --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
…atus check (#346) * fix(ci): remove path filters from memory validation workflow The 'Validate Memory Files' job is a required status check. With path filters at the workflow trigger level, the workflow doesn't run for PRs that don't touch memory files, causing those PRs to be blocked. Changes: - Remove path filters from on.push and on.pull_request triggers - Add comment explaining why path filters are not used - Fix git diff to use event-specific commit ranges - Properly split git diff output into array before filtering The change detection logic inside the job still skips validation for PRs that don't modify .serena/memories/** files. Fixes PRs being blocked by phantom 'Validate Memory Files' check. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(ci): add robust git diff handling for edge cases Address Copilot review comments: 1. Handle zero SHA when first commit on new branch 2. Detect force-push/rebase when before commit doesn't exist 3. Use two dots (..) for push events instead of three (...) 4. Add exit code check after git diff command Fallback to origin/main comparison when: - github.event.before is all zeros (first commit) - before commit no longer exists (force-push/rebase) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(retrospective): extract 7 atomic skills from PR #342 & #343 Retrospective of CI workflow debugging session that fixed phantom required check blocking. Analyzed PR #342 (initial fix) and PR #343 (comprehensive edge case handling). **Skills Extracted** (atomicity 88-95%): - Skill-CI-Workflow-001: Required check + path filter anti-pattern (95%) - Skill-CI-Workflow-002a: Zero SHA handling in git diff (95%) - Skill-CI-Workflow-002b: Missing commit handling with cat-file (93%) - Skill-CI-Workflow-002c: Git diff exit code validation (92%) - Skill-CI-Workflow-003: Required check deployment testing (90%) - Skill-Architecture-016: ADR compliance documentation (88%) - Skill-Implementation-007: Fast iteration cycle pattern (92%) **Key Learnings**: - Path filters on required check workflows cause phantom blocking - Internal skip logic preserves efficiency while ensuring status reports - Git diff in workflows needs comprehensive edge case handling - Fast iteration (<10min cycles) enabled 5 rounds in 20 minutes **Memory Files Created**: - ci-workflow-required-checks.md (5 skills) - architecture-adr-compliance-documentation.md (1 skill) - implementation-fast-iteration.md (1 skill) **Related**: PR #342 (merged), PR #343 (pending merge) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(session): update session log with commit SHA --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Adds the missing
memory-validation.ymlworkflow that creates the "Validate Memory Files" required check.Problem
PR #334 (and potentially other PRs) are blocked indefinitely by a phantom required check:
memory-automation-index-consolidationSolution
Copy the workflow file from the feature branch to main. The validation scripts (
Validate-SkillFormat.ps1,Validate-MemoryIndex.ps1) already exist on main.Workflow Behavior
.serena/memories/**files changeValidate Memory Files(matches required check name)Test Plan
Fixes #341
🤖 Generated with Claude Code