Skip to content

fix(validation): Allow .agents/memory/ in investigation-only sessions#926

Merged
rjmurillo merged 2 commits into
mainfrom
copilot/fix-validation-allow-agents-memory
Jan 18, 2026
Merged

fix(validation): Allow .agents/memory/ in investigation-only sessions#926
rjmurillo merged 2 commits into
mainfrom
copilot/fix-validation-allow-agents-memory

Conversation

Copilot AI commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

The session protocol validation blocks .agents/memory/causality/causal-graph.json when using SKIPPED: investigation-only QA exemption, breaking memory-first workflows.

Root Cause

Memory infrastructure files (causal graphs, decision patterns) are automatically updated by memory extraction scripts but weren't in the investigation-only allowlist. The validator incorrectly classified them as implementation artifacts rather than audit trail.

Changes

Updated allowlist in Test-InvestigationEligibility.ps1 (2 locations):

  • Added '^\.agents/memory/' pattern to $investigationAllowlist
  • Added '.agents/memory/' to $allowedPaths display list
  • Pattern count: 5 → 6

Updated Test-InvestigationEligibility.Tests.ps1:

  • Added pattern verification assertion
  • Added test case for memory infrastructure matching
  • Updated expected count and pattern list

Result

Investigation sessions can now commit memory infrastructure alongside session logs without triggering E_INVESTIGATION_HAS_IMPL:

# Previously failed, now passes
git add .agents/sessions/session-807.md .agents/memory/causality/causal-graph.json
pwsh .claude/skills/session/scripts/Test-InvestigationEligibility.ps1
# Returns: "Eligible": true

Aligns with ADR-007 memory-first principle by treating memory tracking as cross-session continuity infrastructure, not implementation.

Original prompt

This section details on the original issue you should resolve

<issue_title>fix(validation): Allow .agents/memory/ in investigation-only sessions</issue_title>
<issue_description>## Problem

The session protocol validation blocks commits containing .agents/memory/causality/causal-graph.json when using SKIPPED: investigation-only QA exemption.

Error:

E_INVESTIGATION_HAS_IMPL: Investigation-only QA skip claimed but staged files include implementation:
.agents/memory/causality/causal-graph.json

Why This Is Wrong

The causal-graph.json file is memory infrastructure, not implementation:

  1. Automated tracking file - Updated automatically by memory extraction scripts
  2. Cross-session continuity - Essential for agent memory between sessions
  3. No user-facing behavior - Doesn't affect application functionality
  4. Audit trail category - Similar to session logs and .serena/memories/

Impact

  • Agents cannot commit memory updates during investigation sessions
  • Forces artificial separation of memory tracking from session work
  • Breaks the memory-first principle when memory updates are blocked

Current Workaround

Manually exclude causal-graph.json from commits, losing memory continuity.

Proposed Solution

Add .agents/memory/ to the investigation-only allowlist in scripts/Validate-Session.ps1:

$allowedInvestigationPaths = @(
    '.agents/sessions',
    '.agents/analysis',
    '.agents/retrospective',
    '.serena/memories($|/)',
    '.agents/security',
    '.agents/memory'  # Add this
)

Validation Test

After fix, this should pass:

# Investigation session with causal graph update
git add .agents/sessions/2026-01-08-session-807.md .agents/memory/causality/causal-graph.json
pwsh scripts/Validate-Session.ps1 -SessionLogPath .agents/sessions/2026-01-08-session-807.md
# Expected: PASS

References

  • Session 807: Blocked from committing causal-graph.json
  • Memory-first principle: ADR-007, session-init-003-memory-first-monitoring-gate
  • Similar exemptions: .serena/memories/ already allowed
    </issue_description>

<agent_instructions>## Observations

The validation system currently blocks .agents/memory/causality/causal-graph.json during investigation-only sessions because .agents/memory/ is not in the investigation-only allowlist. The allowlist is defined in two validation scripts and tested in two test files. The causal-graph.json file is automatically updated by memory extraction scripts and serves as memory infrastructure for cross-session continuity, not implementation. The current allowlist has 5 patterns; adding .agents/memory/ will make it 6 patterns.

Approach

Add .agents/memory/ to the investigation-only allowlist in both validation scripts and update corresponding tests. This aligns with the memory-first principle (ADR-007) by treating memory infrastructure files as audit trail artifacts rather than implementation. The fix requires updating two validation scripts (with consistent regex patterns), two test files (updating pattern counts and adding validation tests), and ensuring pattern consistency across all files.

Implementation Steps

1. Update Primary Validation Script

File: scripts/Validate-Session.ps1

Modify the $script:InvestigationAllowlist array (lines 330-336):

  • Add '^\.agents/memory/' as the sixth pattern
  • Place it after '^\.serena/memories($|/)' and before '^\.agents/security/'
  • Include inline comment: # Memory infrastructure
  • Ensure consistent formatting with existing patterns

2. Update Investigation Eligibility Skill

File: .claude/skills/session-qa-eligibility/scripts/Test-InvestigationEligibility.ps1

Update two arrays:

Regex patterns (lines 43-49):

  • Add '^\.agents/memory/' to $investigationAllowlist
  • Include inline comment: # Memory infrastructure

Human-readable paths (lines 52-58):

  • Add '.agents/memory/' to $allowedPaths
  • Include inline comment: # Memory infrastructure

3. Update Validation Tests

File: tests/Validate-Session.Tests.ps1

Pattern verification (lines 52-64):

  • Add assertion: $script:InvestigationAllowlist | Should -Contain '^\.agents/memory/'
  • Place after the .serena/memories assertion and before .agents/security/

Count verification (line 62):

  • Change from Should -Be 5 to Should -Be 6

Add new test context (after line 248):

  • Add test case: "Returns eligible for memory infrastructure files"
  • Test file: .agents/memory/causality/causal-graph.json
  • Verify IsEligible is $true

4. Update Investigation Eligibility Tests

File: tests/Test-InvestigationEligibility.Tests.ps1

Pattern verification (lines 26-32):

  • Add assertion: $investigationAllowlist | Should -Contain '^\.agents/memory/'
  • Place after .serena/memories and before .agents/security/

Count verification (line 34-36):

  • Change from Should -Be 5 to Should -Be 6

**Pattern matching...


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Add .agents/memory/ pattern to investigation-only allowlist in Test-InvestigationEligibility.ps1 scripts and update tests. This allows memory infrastructure files like causal-graph.json to be committed in investigation sessions per ADR-034 memory-first principle.

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix validation to allow .agents/memory/ in investigation-only sessions fix(validation): Allow .agents/memory/ in investigation-only sessions Jan 15, 2026
Copilot AI requested a review from rjmurillo January 15, 2026 07:28
Comment thread .claude/skills/session/scripts/Test-InvestigationEligibility.ps1
@rjmurillo

Copy link
Copy Markdown
Owner

Review Triage Required

Caution

Priority: CRITICAL - Human approval required before bot responds

Review Summary

Source Reviews Comments
Human 1 2
Bot 1 0

⚠️ Human CHANGES_REQUESTED

A human reviewer has requested changes. Address this feedback first before processing bot comments.

Next Steps

  1. Review human feedback above
  2. Address any CHANGES_REQUESTED from human reviewers
  3. Add triage:approved label when ready for bot to respond to review comments

Powered by PR Maintenance workflow - Add triage:approved label

@rjmurillo rjmurillo added the triage:approved Human has triaged and approved bot responses for this PR label Jan 15, 2026
@rjmurillo rjmurillo marked this pull request as ready for review January 15, 2026 18:22
Copilot AI review requested due to automatic review settings January 15, 2026 18:22
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions github-actions Bot added automation Automated workflows and processes area-skills Skills documentation and patterns labels Jan 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Validation Report

Note

Status: PASS

Description Validation

Check Status
Description matches diff PASS

QA Validation

Check Status
Code changes detected True
QA report exists false

⚡ Warnings

  • QA report not found for code changes (recommended before merge)

Powered by PR Validation workflow

@github-actions

Copy link
Copy Markdown
Contributor

AI Quality Gate Review

Warning

⚠️ Final Verdict: WARN

Walkthrough

This PR was reviewed by six AI agents in parallel, analyzing different aspects of the changes:

  • Security Agent: Scans for vulnerabilities, secrets exposure, and security anti-patterns
  • QA Agent: Evaluates test coverage, error handling, and code quality
  • Analyst Agent: Assesses code quality, impact analysis, and maintainability
  • Architect Agent: Reviews design patterns, system boundaries, and architectural concerns
  • DevOps Agent: Evaluates CI/CD, build pipelines, and infrastructure changes
  • Roadmap Agent: Assesses strategic alignment, feature scope, and user value

Review Summary

Agent Verdict Category Status
Security PASS N/A
QA PASS N/A
Analyst WARN N/A ⚠️
Architect PASS N/A
DevOps PASS N/A
Roadmap PASS N/A

💡 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 Details

Security Review: PR #926

PR Type Classification

Category Files Changed
CODE .claude/skills/session-qa-eligibility/scripts/Test-InvestigationEligibility.ps1
CODE .claude/skills/session/scripts/Test-InvestigationEligibility.ps1
CODE tests/Test-InvestigationEligibility.Tests.ps1

Security Scrutiny Level: Full review (PowerShell scripts with security implications)

Analysis

Changes reviewed:

  1. Two validation scripts modified to add .agents/memory/ to investigation-only allowlist
  2. Test file updated to verify the new pattern

Security Assessment:

Check Status Notes
Shell Injection (CWE-78) [PASS] No user input processed; static regex patterns only
Path Traversal (CWE-22) [PASS] Regex pattern ^\.agents/memory/ anchored at start, no traversal possible
Privilege Escalation [PASS] Allowlist expansion is additive for internal memory infrastructure only
Secret Detection [PASS] No credentials, API keys, or sensitive data in changes
Input Validation [PASS] Patterns are hardcoded, not user-controlled

Risk Assessment:

The change expands an allowlist that determines which files can bypass QA during investigation-only sessions. The .agents/memory/ path contains:

  • Causal graphs (JSON tracking decision patterns)
  • Memory infrastructure for cross-session continuity

Security Implications:

  • Risk Score: 2/10 (Low)
  • The added path is internal infrastructure, not user-facing code
  • Follows established pattern: .agents/security/ and .serena/memories/ already allowed
  • Regex is properly anchored with ^ to prevent path injection

Findings

Severity Category Finding Location CWE
None - No security issues identified - -

Recommendations

None. The change is a straightforward allowlist expansion for internal memory infrastructure files that follows the same secure patterns used for existing allowlist entries.

Verdict

VERDICT: PASS
MESSAGE: Allowlist expansion for .agents/memory/ is low-risk. Static regex patterns are properly anchored. No injection vectors, no secrets, no privilege escalation paths. Change aligns with ADR-007 memory-first principle.
QA Review Details

Let me check if there's a main Validate-Session.ps1 (non-JSON version) and verify the PR changes are complete:

I'm encountering permission issues with bash. Let me analyze the PR based on the files I've already viewed:

Now I have a complete picture of the PR. Let me generate the QA validation report:

QA Pre-PR Validation Report

VERDICT: PASS
MESSAGE: All test cases present for added functionality with proper pattern coverage.

PR TYPE: CODE
FILES: 
  - CODE: .claude/skills/session-qa-eligibility/scripts/Test-InvestigationEligibility.ps1
  - CODE: .claude/skills/session/scripts/Test-InvestigationEligibility.ps1
  - CODE: tests/Test-InvestigationEligibility.Tests.ps1

EVIDENCE:
- Tests found: 1 new test ("Matches memory infrastructure files") for 1 new pattern
- Edge cases: Covered (pattern matching verified for .agents/memory/causality/causal-graph.json)
- Error handling: N/A - pattern addition, no new error paths
- Blocking issues: 0

Detailed Analysis

Step 1: CI Environment Test Validation

Metric Value
Test file tests/Test-InvestigationEligibility.Tests.ps1
New assertions Pattern contains '^\.agents/memory/', count updated 5→6
Test case added "Matches memory infrastructure files" (line 91-95)
Status [PASS]

The test file includes:

  • Pattern verification assertion at line 35: $investigationAllowlist | Should -Contain '^\.agents/memory/'
  • Count updated at line 38-39: Should -Be 6 (was 5)
  • New test case at lines 91-95 testing .agents/memory/causality/causal-graph.json

Step 2: Fail-Safe Pattern Verification

Pattern Status Evidence
Input validation [PASS] Regex pattern anchored with ^ prefix
Error handling [N/A] No new error paths added
Timeout handling [N/A] Not applicable
Fallback behavior [N/A] Not applicable

Step 3: Test-Implementation Alignment

Criterion Test Coverage Status
New pattern in allowlist Pattern contains assertion (line 35) [PASS]
Pattern count updated Count assertion 5→6 (line 38-39) [PASS]
Pattern matches target file "Matches memory infrastructure files" test (lines 91-95) [PASS]
Patterns synced between scripts Both scripts at lines 50-51 have identical pattern [PASS]

Coverage: 4/4 criteria covered (100%)

Step 4: Coverage Threshold Validation

Metric Value Threshold Status
Line coverage N/A - minimal change 70% [PASS]
Branch coverage N/A - no new branches 60% [PASS]
New code coverage 100% (pattern tested) 80% [PASS]

Quality Concerns

Severity Issue Location Evidence Required Fix
LOW Dual script maintenance Two identical scripts in session/ and session-qa-eligibility/ Potential drift risk Document sync requirement (not blocking)

Consistency Verification

Both scripts updated identically:

  • .claude/skills/session-qa-eligibility/scripts/Test-InvestigationEligibility.ps1 (lines 50-51, 60-61)
  • .claude/skills/session/scripts/Test-InvestigationEligibility.ps1 (lines 50-51, 60-61)

Pattern added consistently:

'^\.agents/memory/'           # Memory infrastructure

Human-readable path added:

'.agents/memory/'             # Memory infrastructure

Regression Risk Assessment

  • Risk Level: Low
  • Affected Components: Investigation-only QA skip eligibility check
  • Breaking Changes: None - additive change only (expands allowlist)
  • Required Testing: Pattern matching for .agents/memory/ paths

Issues Found

None. Implementation is complete and well-tested.


Status: [APPROVED]

Blocking Issues: 0

Rationale: All validation gates pass. The PR adds a single pattern to the investigation-only allowlist with corresponding test coverage. Both duplicate script files are updated identically. Test assertions verify pattern presence, count, and matching behavior.

Analyst Review Details

Now checking the issue reference (ADR-034) and the primary validation script mentioned in the issue to verify completeness:

Let me check ADR-034 to verify alignment and search for Validate-Session.ps1:

I notice a discrepancy. ADR-034 does not list .agents/memory/ in the allowlist. This PR adds it but the ADR shows only 5 patterns. Let me check if there's a Validate-Session.ps1 in scripts/ or elsewhere:

There's no Validate-Session.ps1 in scripts/. The issue description mentions scripts/Validate-Session.ps1 but the actual files are Test-InvestigationEligibility.ps1 in the skills directories. Let me check if there's another validation script:

Let me check if the investigation eligibility check is done in this file or if there's another file that needs updating:

The Validate-SessionJson.ps1 doesn't contain the investigation allowlist. The investigation eligibility is checked in the skill scripts. Let me check if there are any duplicate Test-InvestigationEligibility.ps1 files and verify the two locations mentioned in the PR:

I see two locations with Test-InvestigationEligibility.ps1:

  1. .claude/skills/session/scripts/
  2. .claude/skills/session-qa-eligibility/scripts/

Now I have enough context to provide my analysis.


Analysis: PR #926 - Allow .agents/memory/ in investigation-only sessions

Code Quality Score

Criterion Score (1-5) Notes
Readability 5 Changes are minimal and follow existing patterns
Maintainability 5 Consistent structure with existing allowlist entries
Consistency 5 Matches formatting, comments, and style of adjacent patterns
Simplicity 5 Adds 1 pattern per list, no complex logic

Overall: 5/5

Impact Assessment

  • Scope: Isolated to investigation-eligibility validation logic
  • Risk Level: Low - expands an allowlist; no removal of existing functionality
  • Affected Components: Test-InvestigationEligibility.ps1 (2 copies), Test-InvestigationEligibility.Tests.ps1

Findings

Priority Category Finding Location
Medium Documentation ADR-034 defines 5 patterns but PR adds 6th. ADR should be amended to document this change. .agents/architecture/ADR-034-investigation-session-qa-exemption.md:78-84
Low Duplication Two copies of Test-InvestigationEligibility.ps1 exist (session/ and session-qa-eligibility/). Both were correctly updated. .claude/skills/*/scripts/

Recommendations

  1. [Medium] Update ADR-034: The ADR defines the investigation allowlist as the source of truth. Add .agents/memory/ to the allowlist in lines 78-84 and update the error message template in lines 119-131 to include the new path.

  2. Test verification: The tests correctly update pattern counts from 5 to 6 and add test coverage for .agents/memory/causality/causal-graph.json matching.

Verdict

VERDICT: WARN
MESSAGE: Code changes are correct and complete. ADR-034 should be amended to document the new allowlist pattern.
Architect Review Details

Now I'll check for existing ADRs and verify the scripts are consistent. Let me also look at the ADR-034 and ADR-007 to verify the design alignment.

I now have all the information needed to complete the architectural review. The PR adds .agents/memory/ to the investigation-only allowlist. Let me verify consistency across both modified scripts and check if there's a Validate-Session.ps1 that should also be updated.

I note that Validate-SessionJson.ps1 does not contain the investigation-only allowlist. The PR description mentions Validate-Session.ps1 but that file doesn't exist in the scripts folder. Let me check if there's another location for this validation logic.

Let me search for where the investigation allowlist is defined in the pre-commit hook.

Now I have a clear picture. The investigation-only allowlist is defined in TWO skill scripts:

  1. .claude/skills/session-qa-eligibility/scripts/Test-InvestigationEligibility.ps1
  2. .claude/skills/session/scripts/Test-InvestigationEligibility.ps1

The pre-commit hook uses Validate-SessionJson.ps1 which does NOT contain the investigation-only allowlist. The issue description originally mentioned scripts/Validate-Session.ps1 (line 296 of ADR-034), but that file doesn't exist. The PR correctly updates the two skill scripts.

Let me now verify the changes are consistent and analyze the architecture.

Design Quality Assessment

Aspect Rating (1-5) Notes
Pattern Adherence 5 Follows existing allowlist pattern with trailing comma, inline comment, consistent placement
Boundary Respect 5 Changes only investigation eligibility skill scripts and corresponding tests
Coupling 5 No new dependencies; extends existing allowlist array
Cohesion 5 Single-purpose change: add .agents/memory/ to allowlist
Extensibility 5 Allowlist is array-based, trivially extensible

Overall Design Score: 5/5

Architectural Concerns

Severity Concern Location Recommendation
Low Duplicate script locations .claude/skills/session-qa-eligibility/scripts/ and .claude/skills/session/scripts/ Document why two copies exist (skill isolation) or consolidate

Breaking Change Assessment

  • Breaking Changes: No
  • Impact Scope: None
  • Migration Required: No
  • Migration Path: N/A

Technical Debt Analysis

  • Debt Added: Low (one more pattern in allowlist)
  • Debt Reduced: Low (removes need for workarounds when committing memory files)
  • Net Impact: Improved

ADR Assessment

  • ADR Required: No
  • Decisions Identified: Extending investigation-only allowlist to include memory infrastructure
  • Existing ADR: ADR-034 (Investigation Session QA Exemption) - the change aligns with this ADR
  • Recommendation: Consider updating ADR-034 allowlist section to include .agents/memory/ for documentation completeness. However, ADR-034 line 78-84 shows the allowlist and per line 87: "Allowlist Owner: Architect agent (reviews additions via ADR amendment)." This change should be documented but not blocking.

The change aligns with ADR-007 (Memory-First Architecture) which establishes that memory infrastructure is essential for cross-session continuity. Treating .agents/memory/ as investigation-compatible infrastructure (not implementation) is architecturally sound.

Recommendations

  1. Update ADR-034 to reflect the expanded allowlist (line 78-84) with .agents/memory/ pattern as P2 documentation task
  2. Consider consolidating the two identical Test-InvestigationEligibility.ps1 scripts if they serve the same purpose

Verdict

VERDICT: PASS
MESSAGE: Sound extension of investigation-only allowlist. Aligns with ADR-007 memory-first principle. Memory infrastructure files are correctly classified as audit trail artifacts, not implementation. Consistent changes across both skill scripts and tests.
DevOps Review Details

Now let me run the tests to verify the changes work correctly:

Let me check if the scripts exist and verify their YAML syntax manually:

Based on my review of the files, here is my DevOps analysis:


DevOps Review: PR #926

PR Scope Detection

Category Files Changed Review Scope
SCRIPT Test-InvestigationEligibility.ps1 (2 locations) Shell quality review
CODE Test-InvestigationEligibility.Tests.ps1 Build impact only

Scope: PowerShell scripts in skills directories and test file. No workflows, actions, or infrastructure changes.


Pipeline Impact Assessment

Area Impact Notes
Build None No build config changes
Test Low Test file updated with new assertions
Deploy None No deployment changes
Cost None No runner or resource changes

CI/CD Quality Checks

Check Status Location
YAML syntax valid N/A No workflow files changed
Actions pinned N/A No actions changed
Secrets secure No secrets referenced
Permissions minimal N/A No workflow changes
Shell scripts robust Both scripts

Shell Script Quality Review

Check Status Details
Error handling $ErrorActionPreference = 'Stop' set in both scripts
Exit codes Always exits 0, eligibility in output per ADR-035
Input validation Git output sanitized via newline split and empty filter
Path normalization Windows backslashes converted to forward slashes
Regex patterns Consistent patterns across both script copies

Findings

Severity Category Finding Location Fix
Low Consistency Two copies of same script exist .claude/skills/session/ and .claude/skills/session-qa-eligibility/ Consider consolidating to single source

The two script copies are functionally identical and both correctly updated. This is existing technical debt, not introduced by this PR.


Template Assessment

  • PR Template: N/A (not in scope)
  • Issue Templates: N/A (not in scope)

Automation Opportunities

Opportunity Type Benefit Effort
Consolidate duplicate scripts Refactor Medium Low

Recommendations

  1. Both Test-InvestigationEligibility.ps1 scripts are updated consistently with the new '^\.agents/memory/' pattern
  2. Test file properly validates the new pattern with count verification (5 → 6) and pattern matching test
  3. Changes align with ADR-034 investigation-only exemption requirements

VERDICT: PASS
MESSAGE: PowerShell scripts correctly add memory infrastructure to investigation-only allowlist. No CI/CD, workflow, or infrastructure concerns.
Roadmap Review Details

Now I have sufficient context to perform the roadmap review. Let me analyze this PR strategically.


Strategic Alignment Assessment

Criterion Rating Notes
Aligns with project goals High Directly supports memory-first principle (ADR-007) and investigation session workflow (ADR-034)
Priority appropriate High Bug fix enabling existing architecture decisions to function correctly
User value clear High Unblocks memory-first workflows for 29.4% of sessions identified as investigation-only
Investment justified High Minimal change (6 lines across 4 files) with high workflow impact

Feature Completeness

  • Scope Assessment: Right-sized
  • Ship Ready: Yes
  • MVP Complete: Yes
  • Enhancement Opportunities: None. This is a targeted allowlist fix.

Impact Analysis

Dimension Assessment Notes
User Value High Eliminates forced workarounds for memory infrastructure updates
Business Impact Medium Infrastructure fix enabling strategic capability (memory-first)
Technical Leverage Medium Unblocks causal-graph.json tracking across sessions
Competitive Position Neutral Internal tooling improvement

Concerns

Priority Concern Recommendation
Low Pattern count assertion hardcoded to 6 Acceptable. This is intentional enforcement per ADR-034.

Recommendations

  1. Approve immediately. This is a blocking fix for a documented architectural decision.
  2. The change correctly extends ADR-034's investigation allowlist to include .agents/memory/, which contains causality tracking files essential for memory-first workflows (ADR-007).
  3. The 6-pattern enforcement (previously 5) is appropriate governance.

Verdict

VERDICT: PASS
MESSAGE: Change correctly extends ADR-034 investigation allowlist to support ADR-007 memory-first architecture. Scope is surgical (6 lines), tests are updated, and the fix unblocks memory infrastructure commits during investigation sessions.

Run Details
Property Value
Run ID 21023092854
Triggered by pull_request on 926/merge
Commit 28121014b1cbbfb3727790beb3e816fc0ede651b

Powered by AI Quality Gate workflow

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request extends the investigation-only session allowlist to include .agents/memory/ files, enabling memory infrastructure updates (like causal graphs) to be committed alongside session logs without triggering QA validation requirements.

Changes:

  • Added '^\.agents/memory/' pattern to the investigation-only allowlist in two skill scripts
  • Updated pattern count from 5 to 6 in test assertions
  • Added test coverage for memory infrastructure file matching

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.claude/skills/session/scripts/Test-InvestigationEligibility.ps1 Added .agents/memory/ to investigation allowlist and display paths
.claude/skills/session-qa-eligibility/scripts/Test-InvestigationEligibility.ps1 Added .agents/memory/ to investigation allowlist and display paths (identical change)
tests/Test-InvestigationEligibility.Tests.ps1 Updated test assertions for 6 patterns and added memory infrastructure test case

Comment thread .claude/skills/session/scripts/Test-InvestigationEligibility.ps1
@rjmurillo-bot

Copy link
Copy Markdown
Collaborator

PR Review Summary

Outstanding Issues

Design Question (blocking)

  • @rjmurillo asked: Why is Test-InvestigationEligibility.ps1 duplicated between:
    • .claude/skills/session/scripts/
    • .claude/skills/session-qa-eligibility/scripts/

ADR-034 Sync Issue (2 threads)

  • The addition of .agents/memory/ to the allowlist is not documented in ADR-034
  • The ADR should be updated to reflect this new pattern

Recommended Actions

  1. Resolve the script duplication question (remove duplicate or explain why both are needed)
  2. Update ADR-034 to include .agents/memory/ in the investigation artifact allowlist

CI Status

  • Some CI runs were cancelled due to race conditions with concurrent pushes
  • Once the design question is resolved and code updated, CI should re-run cleanly

Auto-generated PR review coordination comment

@rjmurillo rjmurillo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved - .agents/memory/ allowlist for investigation-only sessions

@rjmurillo rjmurillo merged commit f6051b7 into main Jan 18, 2026
67 of 71 checks passed
@rjmurillo rjmurillo deleted the copilot/fix-validation-allow-agents-memory branch January 18, 2026 17:04
@github-actions github-actions Bot added this to the 0.2.0 milestone Jan 18, 2026
rjmurillo-bot pushed a commit that referenced this pull request Jan 19, 2026
…#926)

* Initial plan

* feat: Add .agents/memory/ to investigation allowlist

Add .agents/memory/ pattern to investigation-only allowlist in Test-InvestigationEligibility.ps1 scripts and update tests. This allows memory infrastructure files like causal-graph.json to be committed in investigation sessions per ADR-034 memory-first principle.

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
rjmurillo added a commit that referenced this pull request Jan 19, 2026
* docs!: add ADR-042 Python migration strategy (supersedes ADR-005)

Migrate ai-agents from PowerShell to Python as primary scripting
language over a 12-24 month phased migration period.

## Decision Summary

- Python 3.10+ established as project language standard
- ADR-005 superseded for new development
- Phased approach: Foundation -> New Development -> Migration
- Python already prerequisite via skill-installer (PR #962)

## Rationale

- 70-second PowerShell tool startup times per invocation
- No CodeQL support for PowerShell (deterministic security unavailable)
- AI/ML ecosystem (Anthropic SDK, MCP) is Python-native
- skill-installer already requires Python 3.10+ and UV

## 6-Agent ADR Review Debate

| Agent | Verdict |
|-------|---------|
| Analyst | CONCERNS |
| Architect | CONCERNS |
| Critic | CONCERNS |
| Independent-Thinker | CONCERNS |
| Security | CONCERNS |
| High-Level-Advisor | ACCEPT |

Result: Disagree-and-Commit (5 CONCERNS + 1 ACCEPT)
Tie-breaker: High-Level-Advisor

## P0 Issues Resolved

- Stack Overflow claim corrected (Python growth, not #1)
- Path Dependence language fixed ("Python-first with phased migration")

## P1 Issues Deferred to Phase 1 Implementation

- pyproject.toml creation
- pytest infrastructure setup
- PROJECT-CONSTRAINTS.md update
- Supply chain controls (uv.lock, Dependabot, pip-audit)

BREAKING CHANGE: ADR-005 PowerShell-only standard superseded.
New scripts SHOULD be Python. Existing scripts migrate incrementally.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(planning): add ADR-042 Python migration implementation plan

Self-contained 618-line plan synthesizing inputs from:
- traycerai[bot]: Phase structure validation
- coderabbitai[bot]: 9 actionable suggestions
- github-actions[bot]: Detailed PRD with success metrics

Covers:
- Phase 1: Foundation (pyproject.toml, pytest, security controls)
- Phase 2: New Development Guidelines
- Phase 3: Migration (priority order, deprecation timeline)

Complete code templates included for immediate execution.

Relates-to: #965

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(planning): add verification sections for autonomous execution

Enhance ADR-042 implementation plan for amnesiac agent execution:
- Add Quick Verification section with pre-flight checks
- Add Session Protocol section with JSON template
- Add Local File References table (all verified 2026-01-18)
- Add repository field to header metadata

Plan now 712 lines, fully self-contained for context-free execution.

Relates-to: #965

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(python)!: implement Phase 1 Python infrastructure (ADR-042)

BREAKING CHANGE: Language policy changes from PowerShell-only to Python-first

Phase 1 establishes Python infrastructure for new development:

Infrastructure:
- pyproject.toml: Project metadata, dependencies, tool configs (ruff, mypy, pytest)
- uv.lock: Hash-pinned dependencies for supply chain security (16 packages)
- tests/conftest.py: Shared pytest fixtures (project_root, temp_test_dir)
- .github/workflows/pytest.yml: CI workflow with paths-filter, coverage, pip-audit, bandit

Policy Updates:
- PROJECT-CONSTRAINTS.md: SHOULD prefer Python for new scripts (ADR-042)
- CRITICAL-CONTEXT.md: Python-first (.py preferred)
- .githooks/pre-commit: Non-blocking Python linting with ruff
- .github/dependabot.yml: pip ecosystem for dependency updates

Housekeeping:
- .gitignore: Python patterns (__pycache__, .venv, .egg-info, etc.)
- .markdownlint-cli2.yaml: Exclude .venv from linting

Verification: uv pip install -e ".[dev]" succeeds, pytest discovers 77 tests

Refs: #965, ADR-042

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: update documentation for Python-first development (ADR-042)

Update CONTRIBUTING.md and AGENTS.md to reflect the Python migration:

- Change "Always Do" from PowerShell-only to Python-first for new scripts
- Update "Never Do" to prohibit bash only (Python now allowed)
- Add Python 3.12.x and UV to Tech Stack table
- Add pytest testing section with automated quality gates emphasis
- Update Development Tools commands to include Python testing
- Emphasize shift-left automation: pre-commit hooks and CI handle quality
- Note Python 3.12.x requirement due to Ubuntu 25 incompatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): update session log with documentation changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(python): implement Phase 2 parallel infrastructure (ADR-042)

Add documentation and security utilities for Python development:

- Create CI/CD migration patterns guide for GitHub Actions integration
- Create Python security checklist covering CWE-22, CWE-78, CWE-798
- Create path validation utility with 42 tests for CWE-22 protection
- Create PowerShell-to-Python developer migration guide

Part of epic #965.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(python): add pilot migration of Check-SkillExists to Python (ADR-042 Phase 3)

Migrates Check-SkillExists.ps1 to Python as the pilot script for ADR-042 Phase 3.
This demonstrates the migration patterns established in Phase 2.

Changes:
- scripts/check_skill_exists.py: Python port with argparse CLI, type hints,
  ADR-035 exit codes, and path_validation utility usage
- tests/test_check_skill_exists.py: 31 pytest tests with 88% coverage

The Python version provides:
- --list-available: Lists all skills by operation type
- --operation/--action: Checks if a skill exists using substring matching
- --project-root: Optional custom project root for testing

Both PowerShell and Python versions will run in parallel per migration plan.

Refs: #965

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(python): add gradual rollout migrations (ADR-042 Phase 4)

Migrate two additional scripts from PowerShell to Python following
the pilot pattern established in Phase 3:

- Detect-SkillViolation.ps1 -> detect_skill_violation.py
  - 89% test coverage (35 tests)
  - Uses dataclass for Violation type
  - Integrates path_validation utility
  - Non-blocking warning for skill violations

- Validate-SessionJson.ps1 -> validate_session_json.py
  - 91% test coverage (39 tests)
  - Uses ValidationResult dataclass
  - Case-insensitive JSON key lookup
  - Pre-commit mode for compact output

Also fixes uv.lock format (was incorrectly in pip-tools format,
now in native uv format).

See: ADR-042 Python Migration Strategy, Issue #965

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(python): fix regex bug and dead code in detect_skill_violation

- Fixed regex pattern gh\\s\+ to gh\s+ in extract_capability_gaps
- Replaced duplicated capability extraction logic in report_violations
  with call to extract_capability_gaps function (DRY)
- All 34 tests pass

Issues identified by pr-review-toolkit parallel review agents.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(security): address gemini-code-assist security findings

**Security Fixes**:

1. **Path Validation (CWE-22)** - scripts/validate_session_json.py:
   - Added `validate_safe_path` import from scripts.utils.path_validation
   - Validate user-provided session_path before file operations
   - Prevents path traversal attacks (../, symlinks, etc.)

2. **Python Version Alignment** - pyproject.toml:
   - Updated ruff target-version: py310 → py312
   - Updated mypy python_version: 3.10 → 3.12
   - Aligns linting/type checking with project standard (3.12.x)

**Gemini Review Comments Addressed**:
- Comment 2702879539: Added path validation imports ✓
- Comment 2702879541: Added CWE-22 protection with validate_safe_path ✓
- Comment 2702879542: Updated ruff to target py312 ✓
- Comment 2702879543: Updated mypy to python 3.12 ✓

**Testing**:
- Verified imports work correctly
- Path validation prevents traversal attacks
- Session protocol validation: PASS

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* refactor: slim instructions files by removing redundant agent registry (#961)

Remove agent catalog tables and routing heuristics from instruction
file templates. This content is already available in YAML frontmatter
of each agent file, which platforms parse directly.

- Claude: 129 → 45 lines (65% reduction)
- Copilot CLI: 126 → 53 lines (58% reduction)
- VSCode: 116 → 45 lines (61% reduction)

Estimated savings: ~2,000 tokens per session per platform.

Signed-off-by: Richard Murillo <6811113+rjmurillo@users.noreply.github.com>
Co-authored-by: Richard Murillo <richard.murillo@example.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Richard Murillo <6811113+rjmurillo@users.noreply.github.com>

* docs(analysis): Factory-AI/droid-action security constraint blocker (#960)

* docs(analysis): document Factory-AI/droid-action security constraint blocker

Root cause analysis of Droid Auto Review workflow failure. The Factory-AI/droid-action
internally uses actions/upload-artifact@v4 (non-SHA-pinned), which violates repository
security constraints requiring all actions to be pinned to full-length commit SHAs.

Key findings:
- Latest droid-action version (e3f8be9f, 2026-01-12) still contains non-pinned references
- Repository security rules apply recursively to all nested action dependencies
- No workaround available without modifying third-party action or relaxing security constraints

Impact: BLOCKING - droid-review.yml and droid.yml workflows fail at setup phase

Recommendations:
- File issue with Factory-AI requesting SHA-pinned action references
- Evaluate alternative PR review automation tools
- Document as known limitation in operational runbook

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* docs(session): update session-9 with PR comment responses

- Added workLog entries for PR #960 comment activities
- Documented upstream issue research (no issue exists)
- Added PR comments as deliverables
- Added learning pattern about upstream issue verification

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: record upstream issue Factory-AI/droid-action#20

- Updated memory with upstream issue link and status
- Marked "file upstream issue" as DONE in recommendations
- Updated session log with issue filing activity
- Added next step to monitor for maintainer response

Upstream: Factory-AI/droid-action#20

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: rjmurillo-bot <rjmurillo-bot@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Richard Murillo <richard.murillo@example.com>

* fix(ci): disable Droid workflows due to unpinned action (#957)

* chore: recover 650 orphaned session logs and memory files (#964)

* chore: recover 650 orphaned session logs and memory files

Extract artifacts from 52 feature branches that were left behind when
PRs auto-merged before session logs were pushed.

Recovery summary:
- Session logs: 378 files recovered
- Memory files: 272 files recovered
- Total: 650 files, 82,632 lines of content

Analysis found 61,497 file references across branches but only 1,728
unique files (average file in 35+ branches). Of these, 1,080 already
existed in main. The 648 truly orphaned files are now consolidated.

Used consolidated PR approach instead of 52 individual PRs to avoid
massive merge conflicts from overlapping content.

Note: 150 memory files use legacy 'skill-' prefix naming that predates
ADR-017. These are historical artifacts being preserved as-is.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* docs: update session log with PR #964 details

Add PR information and audit trail for validation skip.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: rjmurillo-bot <noreply@github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: implement investigation-only session validator (ADR-034 Phase 1) (#931)

* Initial plan

* Add comprehensive test suite for investigation-only validation

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* fix: convert functional tests to pattern-based tests to avoid git state dependency

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* fix(validation): Allow .agents/memory/ in investigation-only sessions (#926)

* Initial plan

* feat: Add .agents/memory/ to investigation allowlist

Add .agents/memory/ pattern to investigation-only allowlist in Test-InvestigationEligibility.ps1 scripts and update tests. This allows memory infrastructure files like causal-graph.json to be committed in investigation sessions per ADR-034 memory-first principle.

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* feat: Add verification-based session-start gates for Codex effectiveness (#924)

* Initial plan

* docs: add Codex effectiveness backlog and context optimization plan (Phase 1 complete)

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* feat: add Codex session-start gate script with 4 verification gates (Phase 2 complete)

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* Changes before error encountered

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
Co-authored-by: Richard Murillo <richard.murillo@example.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

* docs: standardize YAML array format for cross-platform compatibility (#923)

* Initial plan

* refactor: convert frontmatter to block-style YAML arrays in prompt and command files

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* docs: update frontmatter examples to use block-style YAML arrays

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* docs(governance): add YAML frontmatter array format constraint

- Add YAML Frontmatter Constraints section to PROJECT-CONSTRAINTS.md
- Include rationale with evidence from Session 826 RCA and GitHub Copilot CLI Issue #694
- Add validation checklist item for frontmatter arrays
- Add frontmatter validation requirement to SKILL-CREATION-CRITERIA.md
- Create session log for session 02

Refs: #898, Session 826

* docs: add issue URLs to YAML array format references

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
Co-authored-by: Richard Murillo <richard.murillo@example.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

* docs: improve autonomous-issue-development.md structure (#566)

* docs: improve autonomous-issue-development.md structure

Expand documentation from 46 to 441 lines to match autonomous-pr-monitor.md style:

- Add "Common Development Patterns" section (5 validated patterns)
- Add "Troubleshooting" section (5 common scenarios)
- Enhance "Example Session Output" with TodoWrite and agent handoffs
- Add "Workflow Phases" table for quick reference
- Add "Agent Responsibilities" reference table
- Add "Prerequisites" and "Related Documentation" sections

Closes #506

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(session): add protocol compliance sections

Added Session Start and Session End checklist tables to match
the required session protocol format.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(security): prevent command injection in PR creation example

Addresses gemini-code-assist[bot] security review comment #2653014226.

The example showed a hardcoded PR title which could enable command
injection if autonomous agents construct titles from untrusted GitHub
issue titles containing shell metacharacters (e.g., $(reboot)).

Changes:
- Add security warning comment explaining CWE-78 risk
- Use read -r with process substitution to safely read issue title
- Demonstrate secure pattern for handling untrusted external input

This aligns with security principle of validating all external inputs.

Comment-ID: 2653014226

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: rjmurillo[bot] <rjmurillo-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Claude <claude@anthropic.com>

* feat: implement local GitHub Actions validation and testing infrastructure (#925)

* Initial plan

* feat: Add actionlint validation for GitHub Actions workflows (Phase 1)

- Add actionlint to pre-commit hook (.githooks/pre-commit)
- Integrate actionlint into unified validation runner (scripts/Validate-PrePR.ps1)
- Add actionlint to Worktrunk pre-merge hooks (.config/wt.toml)
- Update SHIFT-LEFT.md documentation with workflow YAML validation section
- Update validation sequence to include step 3.5 (Workflow YAML)
- Create session log 2026-01-15-session-01-github-actions-local-testing.json

This implements Phase 1 (P0) of the GitHub Actions local testing epic.
actionlint catches 80%+ workflow YAML errors before push, reducing expensive CI iteration cycles.

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* feat: Add act support for local workflow testing (Phase 2)

- Create .actrc configuration with optimized defaults for act
- Create scripts/Test-WorkflowLocally.ps1 PowerShell wrapper for act
- Update SHIFT-LEFT.md with comprehensive local workflow testing documentation
- Document supported workflows (pester-tests, validate-paths, memory-validation)
- Document unsupported workflows (AI-dependent: ai-session-protocol, etc.)
- Add troubleshooting guide for act and PowerShell issues

This implements Phase 2 (P1) of the GitHub Actions local testing epic.
Enables local testing for PowerShell-only workflows without CI round-trips.

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* feat: Add yamllint for YAML style validation (Phase 3)

- Create .yamllint.yml configuration with GitHub Actions-optimized rules
- Add yamllint validation to scripts/Validate-PrePR.ps1 (validation 3.9)
- Add yamllint to pre-commit hook (.githooks/pre-commit) as non-blocking warnings
- Update SHIFT-LEFT.md with YAML style validation documentation
- Document yamllint vs actionlint relationship (style vs semantics)
- Configure yamllint as non-blocking to avoid impeding development velocity

This implements Phase 3 (P2) of the GitHub Actions local testing epic.
yamllint enforces YAML style consistency while actionlint handles semantic validation.

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* docs: Update session log with completion status

* fix: Address PR feedback on local testing infrastructure

- Add gh act extension to installation instructions
- Include .github/actions in actionlint validation scope
- Remove chocolatey recommendation, use GitHub releases instead
- Clarify Copilot CLI installation vs BOT_PAT requirement for AI workflows
- Switch to full production images in .actrc for maximum compatibility
- Update documentation to reflect full image usage and rationale

Addresses comments: 2693400619, 2693406075, 2693409506, 2693411769, 2693418268

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* refactor: Move Test-WorkflowLocally.ps1 to .claude/skills/github/scripts

- Move Test-WorkflowLocally.ps1 from scripts/ to .claude/skills/github/scripts/
- Update all documentation references in SHIFT-LEFT.md
- Update session log to reflect new location

Addresses comment 2699896328

Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>

* fix: address all PR #925 review comments

Fixes all 15 unresolved review threads from owner and automated reviewers:

1. Remove duplicate actionlint validation block in pre-commit hook
   - Kept newer comprehensive version (validates workflows + actions)
   - Removed old TIER 1 block (lines 269-313)

2. Fix wt.toml to validate both workflows and actions directories
   - Changed: actionlint .github/workflows/*.yml .github/actions/*.yml
   - Matches pre-commit hook validation scope

3. Remove Windows-specific chocolatey references
   - Prioritize cross-platform gh extension
   - Show macOS brew as alternative
   - Link to releases for manual download

4. Rename Write-Warning to Write-WarningMessage
   - Avoids shadowing PowerShell built-in cmdlet
   - Updated all call sites

5. Fix Validate-PrePR.ps1 to match both .yml and .yaml files
   - Changed -Filter to -Include with both extensions
   - Applies to both workflow and YAML validation sections

6. Fix session log field name inconsistencies
   - Changed handoffNotUpdated.evidence -> Evidence
   - Changed handoffNotUpdated.complete -> Complete
   - Matches other compliance entries

7. Add endingCommit to session log
   - Set to 38217dc (latest commit)
   - Required field per session protocol

8. Fix Test-WorkflowLocally.ps1 null handling
   - Check for null before Test-Path call
   - Prevents crash under Set-StrictMode when workflow not found

All fixes maintain existing functionality while addressing review feedback.

Related: #925

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rjmurillo <6811113+rjmurillo@users.noreply.github.com>
Co-authored-by: Richard Murillo <richard.murillo@example.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: ADR-017 memory validation compliance (skill- prefix removal + bundled skill splitting) (#966)

* fix(pr-964): clean up session files and remove skill- prefix violations

Addresses two validation failures in PR #964:

1. Session file cleanup:
   - Moved 341 .md session files to .agents/archive/sessions/
   - Deleted 1 session file already in archive
   - All moved files have corresponding JSON equivalents

2. Memory file ADR-017 compliance:
   - Removed 87 duplicate memory files with skill- prefix
   - Renamed 56 unique memory files to remove skill- prefix
   - Zero skill- prefixed files remain
   - Added skills-serena-index to memory-index.md

These legacy files predate ADR-017 naming conventions and were
recovered from 52 orphaned branches. The skill- prefixed duplicates
existed alongside non-prefixed versions and have been cleaned up.

Note: Bundled skill validation failures are pre-existing in PR #964
and require separate handling via skill unbundling process.

Script: scripts/Fix-PR964-Validation.ps1

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* refactor: split 37 bundled skill files into 135 atomic files per ADR-017

Split bundled skill files to comply with one-skill-per-file standard.

Changes:
- Created scripts/Split-BundledSkills.ps1 automation script
- Split 37 bundled files containing 135 skills total
- Generated 110 new atomic skill files with proper naming
- Modified 25 existing skill files
- Deleted 37 bundled files

Validation:
- Validate-SkillFormat.ps1: PASSED
- markdownlint: PASSED (0 errors)

Context: PR #964 recovered orphaned files that predate ADR-017
Note: Memory index will be updated in a follow-up commit

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* docs: update session log to JSON schema v1.0

Update session-04 log to use new JSON schema format with protocolCompliance
and learnings sections per SESSION-PROTOCOL.md requirements.

Validation: Validate-SessionJson.ps1 PASSED

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix: convert skills-serena-index to table-only format per ADR-017

---------

Co-authored-by: rjmurillo-bot <noreply@github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(ci): use PATH export instead of source env for uv

The uv installer no longer creates an env file to source. Replace
`source $HOME/.local/bin/env` with `export PATH="$HOME/.local/bin:$PATH"`
to properly add uv to PATH in GitHub Actions workflows.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ci): add --system flag to uv pip install

uv pip now requires either a virtual environment or the --system flag
to install packages. Add --system flag for GitHub Actions workflows
where we want to install directly to the system Python.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(ci): enable Python tooling for agent contributions

- Add Python setup to setup-code-env composite action with:
  - enable-python and python-version inputs
  - Python version output
  - Python dependency installation via uv
  - Verification of ruff and pytest availability
- Enable Python 3.12 in copilot-setup-steps workflow
- Add Python dependency installation to bootstrap-vm.sh

This enables agents to contribute Python code with proper
tooling (ruff, pytest) available in the development environment.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(ci): use pip-audit without --requirement flag

The --requirement flag expects requirements.txt format, not pyproject.toml.
Running pip-audit without arguments audits installed packages instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(tests): patch SAFE_BASE_DIR for temp directory tests

- Monkeypatch _PROJECT_ROOT in validate_session_json tests
- Monkeypatch SAFE_BASE_DIR in invoke_skill_learning tests
- Fix tests checking 'extracted_learning' to use 'source' key

The path validation correctly rejects temp directories outside
project root. Tests now patch the base directory to allow temp
paths during testing while maintaining security in production.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(hooks): rename test_skill_context to check_skill_context

Pytest was collecting the function as a test because it started
with 'test_'. Renamed to 'check_skill_context' to prevent pytest
from treating it as a test function.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: add test exit code interpretation as blocking constraint

- Add testing-exit-code-interpretation memory documenting that pytest
  "X passed, Y errors" output means test suite FAILED (non-zero exit)
- Update AGENTS.md Testing section with BLOCKING Test Exit Code
  Interpretation subsection
- Update CRITICAL-CONTEXT.md with explicit test exit code requirement
- Update memory-index with new memory for discoverability

Learning: "error" and "failed" are both non-pass outcomes in pytest.
Both result in non-zero exit code and must block commits.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Signed-off-by: Richard Murillo <6811113+rjmurillo@users.noreply.github.com>
Co-authored-by: Test <test@test.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Richard Murillo <richard.murillo@example.com>
Co-authored-by: Richard Murillo <6811113+rjmurillo@users.noreply.github.com>
Co-authored-by: rjmurillo-bot <rjmurillo-bot@users.noreply.github.com>
Co-authored-by: rjmurillo-bot <noreply@github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Claude <claude@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-skills Skills documentation and patterns automation Automated workflows and processes triage:approved Human has triaged and approved bot responses for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(validation): Allow .agents/memory/ in investigation-only sessions

4 participants