feat: ADR-007 Memory-First Architecture enforcement and Forgetful MCP setup#730
Conversation
Copy commands, skills, and agent from ScottRBK/context-hub-plugin: Commands: - /context_gather - Multi-source context retrieval - /encode-repo-serena - Repository encoding workflow - /memory-search, /memory-list, /memory-save, /memory-explore Skills: - curating-memories - Memory maintenance workflows - exploring-knowledge-graph - Knowledge graph traversal - serena-code-architecture - Architectural analysis - using-forgetful-memory - Memory patterns - using-serena-symbols - Symbol analysis guidance Agent: - context-retrieval - Subagent for context gathering 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Enable forgetful, context7, context-hub plugins in settings.json - Add forgetful MCP server config to .mcp.json (HTTP transport) - Document Forgetful tools and usage patterns in CLAUDE.md - Add Forgetful to memory system docs in copilot-instructions.md - Add complete setup guide for Linux/Windows in CONTRIBUTING.md Note: HTTP transport required due to FastMCP banner corruption (upstream issue: ScottRBK/forgetful#19) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Install uv (Python package manager) for uvx command - Start Forgetful MCP server in HTTP mode on port 8020 - Add health check verification in test summary - Wait up to 30s for server startup Enables AI agents in Copilot workspace to use semantic memory. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
QA verification artifact for spec layer traceability implementation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement Claude Code hooks to enforce ADR-007 Memory-First Architecture at runtime. Hooks inject context into Claude's session to ensure memory retrieval precedes reasoning. ## Hooks - Invoke-SessionStartMemoryFirst.ps1: Injects Phase 1/2 blocking gate requirements at session start (Serena init + context retrieval) - Invoke-UserPromptMemoryCheck.ps1: Detects planning/implementation keywords and reminds about memory-first workflow ## Configuration - .claude/settings.json: Registers hooks for SessionStart and UserPromptSubmit events using pwsh cross-platform execution ## Tests - 34 Pester tests covering both hooks - Keyword detection, case insensitivity, JSON parsing, output content Addresses Issue #729 (E1: Claude Code Hooks) Per ADR-005: PowerShell-only with Verb-Noun naming conventions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Multi-agent ADR review artifacts for ADR-007 Memory-First Architecture: ## Analysis - ADR-007-enforcement-gap-analysis.md: Identifies 5 gaps, tracks E1/E3 as resolved, E2/E4/E5 pending (Issue #729) - ADR-007-related-work-research.md: Phase 0 research on related issues ## Critique (6-agent debate) - ADR-007-debate-log.md: Full debate protocol, 6/6 consensus achieved - ADR-007-memory-first-architecture-critique.md: Critic agent review - ADR-007-analyst-independent-review.md: Analyst agent findings ## Serena Memories - adr-007-augmentation-research.md: Forgetful/BMAD/Zettelkasten research - memory-architecture-serena-primary.md: Serena as canonical layer - skill-usage-mandatory.md: Fills gap referenced in CLAUDE.md (E3) Completes ADR-007 review per adr-review skill protocol. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
## ADR-007 Updates (per 6-agent review) - Added Confirmation section with verification methods - Added Implementation Status section - Added Security Considerations (CWE references) - Added Tool Selection clarification (Serena canonical) - Added Relationship to Issue #167 section - Qualified SWE-Bench claim per analyst feedback ## Context-Hub Commands - Minor updates to memory commands from plugin integration - Added context-retrieval agent configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add Test-MemoryEvidence function to Validate-Session.ps1 that: - Finds memory-index row in Session Start checklist - Detects placeholder evidence (empty, template text, brackets) - Extracts memory names using kebab-case regex pattern - Verifies each memory exists in .serena/memories/ Error codes: E_MEMORY_EVIDENCE_INVALID, E_MEMORY_NOT_FOUND Includes 12 Pester tests covering valid evidence, placeholder detection, invalid names, and edge cases. Closes trust gap where agents could self-report memory retrieval without actually doing it. Related: ADR-007, Issue #729 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add lightweight memory evidence check (lines 842-890) that: - Finds memory-index row in staged session log - Extracts Evidence column content - Warns on placeholder patterns (empty, template text, brackets) - Validates kebab-case memory name format Non-blocking warning only - E2 validation provides full enforcement. Related: ADR-007, Issue #729 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updates to ADR-007 Memory-First Architecture: - Fix memory workflow to Serena-first (was incorrectly Forgetful-first) Read → Augment → Persist → Commit - Add Fallback Behavior section documenting graceful degradation: - Forgetful not running: Use Serena memory-index - Forgetful timeout: Proceed with loaded memories - Fresh environment: Full Serena workflow - Document MUST NOT rules for fallback scenarios - Add evidence format for Forgetful-unavailable sessions Addresses P1 debate items: workflow priority, undefined fallback. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Mark E2 and E4 as complete in gap analysis: - E2: Enhanced Session Validation (Validate-Session.ps1) - E4: Pre-commit Memory Evidence Check (.githooks/pre-commit) Update implementation priority table with completion status. Update success criteria checklist (4/5 complete). Remaining: E5 Forgetful Verification (P2) Related: Issue #729 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive issue resolution handling: ## P0/P1 Resolution - P0 must be fully addressed (blocking) - P1 must be addressed OR deferred with justification + backlog issue ## P1 Deferral Requirements - Documented justification in ADR/debate log - GitHub issue with priority:P1, backlog, adr-followup labels - Linked to related issues/ADRs for surfacing - Keywords in title matching memory-index patterns ## Surfacing Mechanism (for amnesiac agents) - GitHub issue linking (surfaces when working on linked items) - Phase 0 search (searches label:adr-followup) - Memory-index keywords (surfaces during Session Start) ## P2 Backlog - Filed as GitHub issues with backlog, adr-followup labels - Documented in debate log Includes practical example, issue templates, and post-creation steps. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- README.md: Comprehensive setup guide for humans and AI agents - Install-ForgetfulLinux.ps1: systemd user service installation - Install-ForgetfulWindows.ps1: Windows scheduled task installation - Test-ForgetfulHealth.ps1: Health check with TCP and service status Uses uvx for always-up-to-date package execution. HTTP transport on port 8020 to work around upstream stdio bug (FastMCP banner corruption). Related: ADR-007 Memory-First Architecture 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Hook now checks if Forgetful MCP is available via TCP port check and provides appropriate guidance: - When available: includes optional Forgetful step in context retrieval - When unavailable: shows fallback guidance and installation commands Uses TCP connection check instead of full MCP protocol (which requires session initialization) for quick, reliable detection. Related: ADR-007 Memory-First Architecture 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- CLAUDE.md: Add health check command and setup reference - copilot-instructions.md: Add setup reference and health check Points to scripts/forgetful/README.md for installation details. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Convert bash to PowerShell for consistency (ADR-005) - Use TCP port check instead of invalid /health endpoint - MCP HTTP transport requires session initialization for full protocol - Reference scripts/forgetful/README.md for local setup documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PR Validation ReportNote ✅ Status: PASS Description Validation
QA Validation
⚡ Warnings
Powered by PR Validation workflow |
Spec-to-Implementation ValidationWarning No spec references found This PR does not reference any specifications (REQ-, DESIGN-, TASK-*, or linked issues). How to add spec referencesAdd spec references to your PR description to enable traceability:
Spec Requirement by PR Type:
See PR template for full guidance. Powered by AI Spec Validator workflow |
There was a problem hiding this comment.
Code Review
This pull request introduces a significant set of features to enforce the Memory-First Architecture (ADR-007) and provides comprehensive infrastructure for setting up the Forgetful MCP server. The changes include new agent definitions, Claude commands, skills, and PowerShell hooks for validation. Additionally, it adds installation scripts for Linux and Windows, health checks, and extensive documentation.
My review focuses on the new scripts and documentation. I've identified a few areas for improvement:
- A PowerShell hook script does not adhere to the repository's error handling style guide.
- The documentation for manual systemd service setup on Linux contains non-robust paths that could lead to user error.
Overall, this is a very thorough implementation of the ADR. The new enforcement mechanisms and setup scripts are well-structured. The suggested changes will improve the robustness and maintainability of the new components.
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. DevOps Review DetailsLet me now review the test files mentioned in the PR and check the workflow more thoroughly for any potential issues. Now I have enough information to provide the DevOps review. DevOps Review: ADR-007 Memory-First ArchitecturePR Scope Detection
Review Scope: Full CI/CD review, Shell quality review, Build impact assessment Pipeline Impact Assessment
CI/CD Quality Checks
Findings
Shell Script Quality Assessment.githooks/pre-commit:
PowerShell Scripts (
Workflow Specific Analysiscopilot-setup-steps.yml:
Template Assessment
Automation Opportunities
Recommendations
VerdictRoadmap Review DetailsStrategic Alignment Assessment
Feature Completeness
Impact Analysis
Concerns
Recommendations
VerdictQA Review DetailsNow let me check the scripts folder for Forgetful and look at the GitHub workflow changes mentioned in the PR: Now I have sufficient information to provide the QA review. Let me compile my analysis: PR Quality Gate ReviewTest Coverage Assessment
Quality Concerns
Regression Risk Assessment
Code Quality Observations
Fail-Safe Pattern Verification
SummaryThis PR implements ADR-007 Memory-First Architecture enforcement with:
All 34 tests cover the critical enforcement paths. The install scripts are deployment utilities that require platform-specific manual testing, which is acceptable for this PR type. Architect Review DetailsBased on my comprehensive review of this PR, here is my architectural assessment: Design Quality Assessment
Overall Design Score: 4.6/5 Architectural Concerns
Breaking Change Assessment
The PR adds new enforcement mechanisms without modifying existing interfaces. Forgetful is supplementary (graceful degradation when unavailable). Existing workflows continue to work. Technical Debt Analysis
The PR reduces institutional knowledge loss by enforcing memory-first patterns. The added infrastructure is maintainable. ADR Assessment
Recommendations
VerdictSecurity Review DetailsBased on my review of the changed files, I can now provide the security assessment. Security Review: ADR-007 Memory-First ArchitecturePR Type: WORKFLOW + CODEFiles reviewed:
Findings
Security Controls Verified
RecommendationsNone blocking. Minor observations:
VerdictAnalyst Review DetailsLet me check the local repository for the PR changes and relevant files. Let me examine the ADR-007 and related architecture files, and run the existing tests to establish baseline. Now I have a complete picture of the PR changes. Let me view the architecture ADR-007 document and examine the security aspects of the workflow. Now let me check the security review and examine one more aspect. Based on my comprehensive review of this PR, I can now provide the analysis. Analyst PR Review: ADR-007 Memory-First Architecture EnforcementCode Quality Score
Overall: 4.75/5 Impact Assessment
Findings
Recommendations
Security ReviewInfrastructure Changes:
No Critical Security Issues: The changes follow established security patterns in the repository. TCP client operations are properly scoped and disposed. VerdictRun Details
Powered by AI Quality Gate workflow |
There was a problem hiding this comment.
Pull request overview
This PR implements comprehensive ADR-007 Memory-First Architecture enforcement mechanisms and establishes Forgetful MCP server setup infrastructure. The changes transition memory-first from aspirational documentation to automated enforcement through validation, hooks, and infrastructure.
Key Changes
- Enforcement Mechanisms: Enhanced session validation with
Test-MemoryEvidencefunction, pre-commit memory evidence warnings, and Claude Code lifecycle hooks (SessionStart, UserPromptSubmit) - Forgetful Infrastructure: Complete setup automation for Linux (systemd) and Windows (scheduled tasks) with comprehensive health checking
- ADR-007 Enhancements: Added fallback behavior documentation, corrected memory workflow to Serena-first, clarified tool selection rationale
- Test Coverage: 34 new Pester tests covering all enforcement mechanisms with 100% pass rate
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/Test-MemoryEvidence.Tests.ps1 |
12 Pester tests for E2 validation (placeholder detection, memory file verification) |
tests/Invoke-UserPromptMemoryCheck.Tests.ps1 |
14 tests for UserPromptSubmit hook (keyword detection, output content) |
tests/Invoke-SessionStartMemoryFirst.Tests.ps1 |
8 tests for SessionStart hook (output content validation) |
scripts/forgetful/Test-ForgetfulHealth.ps1 |
Health check with TCP connectivity and service status verification |
scripts/forgetful/README.md |
Comprehensive setup documentation covering HTTP transport rationale |
scripts/forgetful/Install-ForgetfulWindows.ps1 |
Scheduled task installation with automatic startup |
scripts/forgetful/Install-ForgetfulLinux.ps1 |
Systemd user service installation with daemon management |
scripts/Validate-Session.ps1 |
Added Test-MemoryEvidence function (E2 enforcement) |
.githooks/pre-commit |
Memory evidence warning (E4 enforcement) |
.claude/hooks/Invoke-UserPromptMemoryCheck.ps1 |
UserPromptSubmit hook with keyword-based memory reminders |
.claude/hooks/Invoke-SessionStartMemoryFirst.ps1 |
SessionStart hook with blocking gate requirements |
.claude/settings.json |
Hook registration and Forgetful plugin enablement |
.serena/memories/skill-usage-mandatory.md |
New memory documenting mandatory skill usage before GitHub operations |
.serena/memories/memory-architecture-serena-primary.md |
Documents Serena as primary persistence layer |
.serena/memories/adr-007-augmentation-research.md |
Research summary for ADR-007 augmentation |
.agents/architecture/ADR-007-memory-first-architecture.md |
Enhanced with fallback behavior, corrected workflow, tool selection |
.agents/critique/* |
Multi-agent ADR review artifacts (debate log, critique, analyst review) |
.agents/analysis/* |
Related work research and enforcement gap analysis |
.mcp.json |
Added Forgetful MCP configuration |
.github/workflows/copilot-setup-steps.yml |
Forgetful server startup in CI with TCP health check |
CONTRIBUTING.md, CLAUDE.md, .github/copilot-instructions.md |
Forgetful setup documentation |
.claude/skills/* |
New skills for Serena symbols, Forgetful memory, architecture analysis |
.claude/commands/* |
New commands for memory operations and context gathering |
.claude/agents/context-retrieval.md |
New context-retrieval agent for memory-first workflows |
- Add $LASTEXITCODE checks after systemctl commands in Linux installer - Wrap Register-ScheduledTask in try/catch in Windows installer - Exit with code 1 on failure with descriptive error messages Addresses PR #730 review findings (P1-1, P1-2) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace incorrect REST /health endpoint with correct JSON-RPC POST to /mcp endpoint using tools/list method. Matches actual MCP protocol used by installation scripts. Addresses PR #730 review findings (P1-3) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add finally block with Dispose() for TcpClient to ensure cleanup on all code paths (success, timeout, exception). Follows .NET IDisposable best practices. Addresses PR #730 review findings (P2-1) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Handle edge case where TCP connection attempt completes but $tcpClient.Connected is false. Sets explicit "connection timeout" message for better debugging. Addresses PR #730 review findings (P2-2) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rename skill-usage-mandatory to usage-mandatory across 7 files. ADR-017 removed skill- prefix from memory naming convention. Files updated: - AGENTS.md (4 refs) - src/claude/AGENTS.md (2 refs) - .claude/skills/AGENTS.md (3 refs) - .claude/agents/AGENTS.md (2 refs) - .claude/skills/github/references/api-reference.md (1 ref) - .claude/skills/session-log-fixer/references/template-sections.md (2 refs) - docs/technical-guardrails.md (1 ref) Addresses PR #730 review findings (P3-2) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Resolved conflicts by taking main's version for: - PowerShell hooks (ADR-005 compliance) - Forgetful installation scripts - ADR-007 documentation updates - Workflow PowerShell conversion 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(context-hub): add context-hub commands and skills Copy commands, skills, and agent from ScottRBK/context-hub-plugin: Commands: - /context_gather - Multi-source context retrieval - /encode-repo-serena - Repository encoding workflow - /memory-search, /memory-list, /memory-save, /memory-explore Skills: - curating-memories - Memory maintenance workflows - exploring-knowledge-graph - Knowledge graph traversal - serena-code-architecture - Architectural analysis - using-forgetful-memory - Memory patterns - using-serena-symbols - Symbol analysis guidance Agent: - context-retrieval - Subagent for context gathering 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(forgetful): add Forgetful MCP integration documentation - Enable forgetful, context7, context-hub plugins in settings.json - Add forgetful MCP server config to .mcp.json (HTTP transport) - Document Forgetful tools and usage patterns in CLAUDE.md - Add Forgetful to memory system docs in copilot-instructions.md - Add complete setup guide for Linux/Windows in CONTRIBUTING.md Note: HTTP transport required due to FastMCP banner corruption (upstream issue: ScottRBK/forgetful#19) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * ci(copilot): add Forgetful MCP server to setup steps - Install uv (Python package manager) for uvx command - Start Forgetful MCP server in HTTP mode on port 8020 - Add health check verification in test summary - Wait up to 30s for server startup Enables AI agents in Copilot workspace to use semantic memory. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(qa): add Phase 2 traceability verification for PR #715 QA verification artifact for spec layer traceability implementation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(hooks): add ADR-007 memory-first enforcement hooks Implement Claude Code hooks to enforce ADR-007 Memory-First Architecture at runtime. Hooks inject context into Claude's session to ensure memory retrieval precedes reasoning. ## Hooks - Invoke-SessionStartMemoryFirst.ps1: Injects Phase 1/2 blocking gate requirements at session start (Serena init + context retrieval) - Invoke-UserPromptMemoryCheck.ps1: Detects planning/implementation keywords and reminds about memory-first workflow ## Configuration - .claude/settings.json: Registers hooks for SessionStart and UserPromptSubmit events using pwsh cross-platform execution ## Tests - 34 Pester tests covering both hooks - Keyword detection, case insensitivity, JSON parsing, output content Addresses Issue #729 (E1: Claude Code Hooks) Per ADR-005: PowerShell-only with Verb-Noun naming conventions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(adr-007): add enforcement gap analysis and review artifacts Multi-agent ADR review artifacts for ADR-007 Memory-First Architecture: ## Analysis - ADR-007-enforcement-gap-analysis.md: Identifies 5 gaps, tracks E1/E3 as resolved, E2/E4/E5 pending (Issue #729) - ADR-007-related-work-research.md: Phase 0 research on related issues ## Critique (6-agent debate) - ADR-007-debate-log.md: Full debate protocol, 6/6 consensus achieved - ADR-007-memory-first-architecture-critique.md: Critic agent review - ADR-007-analyst-independent-review.md: Analyst agent findings ## Serena Memories - adr-007-augmentation-research.md: Forgetful/BMAD/Zettelkasten research - memory-architecture-serena-primary.md: Serena as canonical layer - skill-usage-mandatory.md: Fills gap referenced in CLAUDE.md (E3) Completes ADR-007 review per adr-review skill protocol. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: update ADR-007 and context-hub commands ## ADR-007 Updates (per 6-agent review) - Added Confirmation section with verification methods - Added Implementation Status section - Added Security Considerations (CWE references) - Added Tool Selection clarification (Serena canonical) - Added Relationship to Issue #167 section - Qualified SWE-Bench claim per analyst feedback ## Context-Hub Commands - Minor updates to memory commands from plugin integration - Added context-retrieval agent configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(validation): add memory evidence validation (E2, ADR-007) Add Test-MemoryEvidence function to Validate-Session.ps1 that: - Finds memory-index row in Session Start checklist - Detects placeholder evidence (empty, template text, brackets) - Extracts memory names using kebab-case regex pattern - Verifies each memory exists in .serena/memories/ Error codes: E_MEMORY_EVIDENCE_INVALID, E_MEMORY_NOT_FOUND Includes 12 Pester tests covering valid evidence, placeholder detection, invalid names, and edge cases. Closes trust gap where agents could self-report memory retrieval without actually doing it. Related: ADR-007, Issue #729 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(hooks): add memory evidence warning in pre-commit (E4, ADR-007) Add lightweight memory evidence check (lines 842-890) that: - Finds memory-index row in staged session log - Extracts Evidence column content - Warns on placeholder patterns (empty, template text, brackets) - Validates kebab-case memory name format Non-blocking warning only - E2 validation provides full enforcement. Related: ADR-007, Issue #729 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(adr): add fallback behavior and fix workflow priority (ADR-007) Updates to ADR-007 Memory-First Architecture: - Fix memory workflow to Serena-first (was incorrectly Forgetful-first) Read → Augment → Persist → Commit - Add Fallback Behavior section documenting graceful degradation: - Forgetful not running: Use Serena memory-index - Forgetful timeout: Proceed with loaded memories - Fresh environment: Full Serena workflow - Document MUST NOT rules for fallback scenarios - Add evidence format for Forgetful-unavailable sessions Addresses P1 debate items: workflow priority, undefined fallback. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(analysis): update ADR-007 enforcement gap status Mark E2 and E4 as complete in gap analysis: - E2: Enhanced Session Validation (Validate-Session.ps1) - E4: Pre-commit Memory Evidence Check (.githooks/pre-commit) Update implementation priority table with completion status. Update success criteria checklist (4/5 complete). Remaining: E5 Forgetful Verification (P2) Related: Issue #729 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(skill): add issue resolution protocol to adr-review Add comprehensive issue resolution handling: ## P0/P1 Resolution - P0 must be fully addressed (blocking) - P1 must be addressed OR deferred with justification + backlog issue ## P1 Deferral Requirements - Documented justification in ADR/debate log - GitHub issue with priority:P1, backlog, adr-followup labels - Linked to related issues/ADRs for surfacing - Keywords in title matching memory-index patterns ## Surfacing Mechanism (for amnesiac agents) - GitHub issue linking (surfaces when working on linked items) - Phase 0 search (searches label:adr-followup) - Memory-index keywords (surfaces during Session Start) ## P2 Backlog - Filed as GitHub issues with backlog, adr-followup labels - Documented in debate log Includes practical example, issue templates, and post-creation steps. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(forgetful): add MCP server setup scripts and documentation - README.md: Comprehensive setup guide for humans and AI agents - Install-ForgetfulLinux.ps1: systemd user service installation - Install-ForgetfulWindows.ps1: Windows scheduled task installation - Test-ForgetfulHealth.ps1: Health check with TCP and service status Uses uvx for always-up-to-date package execution. HTTP transport on port 8020 to work around upstream stdio bug (FastMCP banner corruption). Related: ADR-007 Memory-First Architecture 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(hooks): add MCP availability check to SessionStart hook Hook now checks if Forgetful MCP is available via TCP port check and provides appropriate guidance: - When available: includes optional Forgetful step in context retrieval - When unavailable: shows fallback guidance and installation commands Uses TCP connection check instead of full MCP protocol (which requires session initialization) for quick, reliable detection. Related: ADR-007 Memory-First Architecture 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: add Forgetful setup references to instruction files - CLAUDE.md: Add health check command and setup reference - copilot-instructions.md: Add setup reference and health check Points to scripts/forgetful/README.md for installation details. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor(ci): update Forgetful setup to use PowerShell and TCP check - Convert bash to PowerShell for consistency (ADR-005) - Use TCP port check instead of invalid /health endpoint - MCP HTTP transport requires session initialization for full protocol - Reference scripts/forgetful/README.md for local setup documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(pr-730): address CI failures and reviewer feedback ## Root Causes Fixed 1. Memory file naming violation (ADR-017): Remove duplicate skill-usage-mandatory.md - File used 'skill-' prefix which violates ADR-017 naming convention - usage-mandatory.md already exists with same content - Updated CLAUDE.md references to use 'usage-mandatory' 2. ErrorActionPreference style violation (gemini-code-assist feedback) - Changed from 'SilentlyContinue' to 'Stop' per style guide - Added 'finally' block for proper resource cleanup 3. systemd ExecStart paths (gemini-code-assist feedback) - Changed /home/$USER/ to %h/ specifier for portability - Applied in both CONTRIBUTING.md and scripts/forgetful/README.md 4. Fixed corrupted PowerShell comment terminator - '# >' was corrupted to '# >' (with space) by linting ## Not Fixed (pre-existing CI issue) - Generate-Skills.Tests.ps1 failure: PSGallery not accessible (powershell-yaml module install fails) User has added PSGallery URLs to firewall allowlist 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(hooks): add pre-PR validation gate to UserPromptSubmit hook Enhances UserPromptSubmit hook to detect PR creation requests and inject pre-PR validation checklist. This prevents CI failures by reminding the agent to: 1. Run local Pester tests 2. Validate PowerShell script syntax 3. Check memory file naming (ADR-017) 4. Read validation-pre-pr-checklist memory 5. Avoid running markdownlint on .ps1 files Triggered by keywords: "create pr", "open pull request", "gh pr create" Adds 8 new Pester tests for PR detection functionality. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(hooks): add gh CLI skill usage detection to UserPromptSubmit hook Enhances the UserPromptMemoryCheck hook to detect GitHub CLI commands and remind users to check for existing skills before using raw gh CLI. Detected commands: - gh pr create/list/view/merge/close/checks/review/comment/diff/ready/status - gh issue create/list/view/close/comment/edit - gh api (including GraphQL) - gh run/workflow Test coverage: - 75 tests covering all detection patterns - Case insensitivity verification - Multiple trigger combination tests - Non-triggering pattern tests Memory: - Added validation-pre-pr-checklist memory with CI failure learnings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(hooks): address PR #730 review findings Fixes identified by multi-agent review (code-reviewer, silent-failure-hunter, pr-test-analyzer, comment-analyzer): ## Critical Fixes - Add exception logging to silent catch block (Invoke-SessionStartMemoryFirst.ps1:45-47) - Replace TcpClient.Close() with Dispose() for proper cleanup - Fix SilentlyContinue to ErrorAction Stop (Invoke-UserPromptMemoryCheck.ps1:50) - Fix .sh references to .ps1 in ADR-007-enforcement-gap-analysis.md ## Naming Consistency (ADR-017 Compliance) - Update SESSION-PROTOCOL.md to use usage-mandatory (not skill-usage-mandatory) - Update PROJECT-CONSTRAINTS.md to use usage-mandatory - Update gap analysis document to reference correct file path - Update code-style-conventions.md with correct path ## Governance - Add historical-reference-protocol.md for artifact traceability All 84 Pester tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(forgetful): add error handling to installation scripts - Add $LASTEXITCODE checks after systemctl commands in Linux installer - Wrap Register-ScheduledTask in try/catch in Windows installer - Exit with code 1 on failure with descriptive error messages Addresses PR #730 review findings (P1-1, P1-2) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(forgetful): fix health endpoint verification in CONTRIBUTING.md Replace incorrect REST /health endpoint with correct JSON-RPC POST to /mcp endpoint using tools/list method. Matches actual MCP protocol used by installation scripts. Addresses PR #730 review findings (P1-3) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(forgetful): add proper resource disposal in health check Add finally block with Dispose() for TcpClient to ensure cleanup on all code paths (success, timeout, exception). Follows .NET IDisposable best practices. Addresses PR #730 review findings (P2-1) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(hooks): add else clause for TCP connection timeout Handle edge case where TCP connection attempt completes but $tcpClient.Connected is false. Sets explicit "connection timeout" message for better debugging. Addresses PR #730 review findings (P2-2) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor(docs): update memory name references per ADR-017 Rename skill-usage-mandatory to usage-mandatory across 7 files. ADR-017 removed skill- prefix from memory naming convention. Files updated: - AGENTS.md (4 refs) - src/claude/AGENTS.md (2 refs) - .claude/skills/AGENTS.md (3 refs) - .claude/agents/AGENTS.md (2 refs) - .claude/skills/github/references/api-reference.md (1 ref) - .claude/skills/session-log-fixer/references/template-sections.md (2 refs) - docs/technical-guardrails.md (1 ref) Addresses PR #730 review findings (P3-2) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(docs): use placeholder notation in historical protocol example Change ADR cross-reference example from real ADR-005 reference to placeholder notation (ADR-NNN, YYYY-MM-DD, Issue #NNN) to clarify this is a format template, not documenting a real relationship. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(docs): add dates to historical references per protocol Add missing dates to PR, issue, and commit references in analysis documents per historical-reference-protocol.md requirements. Files fixed: - 003-quality-gate-comment-caching-rca.md: 5 references - 281-similar-pr-detection-review.md: 3 references 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs(session): complete Session 123 with memory update - Finalized session log with PR reference - Added Serena memory for historical reference compliance learnings 🤖 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>
Summary
Implements ADR-007 Memory-First Architecture enforcement mechanisms and comprehensive Forgetful MCP server setup infrastructure. This PR establishes automated validation to ensure memory retrieval precedes reasoning in all agent sessions.
Specification References
.agents/architecture/ADR-007-memory-first-architecture.md.agents/analysis/ADR-007-enforcement-gap-analysis.md.agents/critique/ADR-007-debate-log.mdChanges
Enforcement Mechanisms
Test-MemoryEvidencefunction validates Evidence column contains actual memory namesForgetful MCP Setup Infrastructure
scripts/forgetful/README.md- Comprehensive setup documentationscripts/forgetful/Install-ForgetfulLinux.ps1- systemd user service installationscripts/forgetful/Install-ForgetfulWindows.ps1- Windows scheduled task installationscripts/forgetful/Test-ForgetfulHealth.ps1- Health check with TCP and service statusADR-007 Enhancements
adr-review Skill Enhancements
adr-followuplabelCI/CD Updates
copilot-setup-steps.ymlto use PowerShell and TCP port check/healthendpoint (MCP requires session init)Type of Change
Testing
Test Coverage:
tests/Test-MemoryEvidence.Tests.ps1- 12 tests for E2 validationtests/Invoke-SessionStartMemoryFirst.Tests.ps1- 8 tests for SessionStart hooktests/Invoke-UserPromptMemoryCheck.Tests.ps1- 14 tests for UserPromptSubmit hookAgent Review
Security Review
.agents/security/)Files requiring security review:
.github/workflows/copilot-setup-steps.yml- Forgetful server startup.githooks/pre-commit- Memory evidence warning.claude/hooks/*.ps1- Memory-first enforcement hooksOther Agent Reviews
Multi-agent ADR Review:
.agents/critique/ADR-007-debate-log.mdChecklist
Related Issues
Related to ADR-007 Memory-First Architecture implementation
🤖 Generated with Claude Code