Skip to content

docs(governance): document trust-based compliance antipattern#711

Merged
rjmurillo merged 2 commits into
mainfrom
docs/686-trust-based-compliance-antipattern
Dec 31, 2025
Merged

docs(governance): document trust-based compliance antipattern#711
rjmurillo merged 2 commits into
mainfrom
docs/686-trust-based-compliance-antipattern

Conversation

@rjmurillo-bot

Copy link
Copy Markdown
Collaborator

Summary

Document the trust-based compliance antipattern in architecture governance to prevent future protocol design errors. This captures lessons learned from PR #669 (branch verification failures).

Specification References

Type Reference Description
Issue Closes #686 docs(governance): document trust-based compliance antipattern

Changes

  • Created .agents/governance/PROTOCOL-ANTIPATTERNS.md with:
    • Trust-based compliance antipattern definition and evidence
    • Verification-based enforcement replacement pattern
    • 3 case studies (branch verification, session init, test execution)
    • Design guidelines and implementation checklist
    • Red flags for identifying trust-based patterns
  • Added link from SESSION-PROTOCOL.md Related Documents section
  • Added Related Documents section to AGENT-INSTRUCTIONS.md with link

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update
  • Infrastructure/CI change
  • Refactoring (no functional changes)

Testing

  • Tests added/updated
  • Manual testing completed
  • No testing required (documentation only)

Agent Review

Security Review

  • No security-critical changes in this PR

Other Agent Reviews

  • Architect reviewed design changes
  • Critic validated implementation plan
  • QA verified test coverage

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex logic
  • Documentation updated (if applicable)
  • No new warnings introduced

Related Issues

Create PROTOCOL-ANTIPATTERNS.md documenting:
- Trust-based compliance antipattern with evidence from PR #669
- Verification-based enforcement replacement pattern
- Three case studies (branch verification, session init, test execution)
- Design guidelines and implementation checklist

Also adds links from SESSION-PROTOCOL.md and AGENT-INSTRUCTIONS.md
to the new antipatterns document.

Closes #686

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

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

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@github-actions

Copy link
Copy Markdown
Contributor

PR Validation Report

Tip

Status: PASS

Description Validation

Check Status
Description matches diff PASS

QA Validation

Check Status
Code changes detected False
QA report exists N/A

Powered by PR Validation workflow

@coderabbitai coderabbitai Bot requested a review from rjmurillo December 31, 2025 19:47
@github-actions

github-actions Bot commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

AI Quality Gate Review

Tip

Final Verdict: PASS

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 PASS 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.

Roadmap Review Details

Strategic Alignment Assessment

Criterion Rating Notes
Aligns with project goals High Captures operational learnings to improve agent protocol design
Priority appropriate High Documentation of antipatterns directly supports P0 protocol reliability
User value clear High Prevents future protocol failures by codifying lessons learned
Investment justified High Low-effort documentation (1 file + 2 links) with high prevention value

Feature Completeness

  • Scope Assessment: Right-sized
  • Ship Ready: Yes
  • MVP Complete: Yes
  • Enhancement Opportunities: Could add additional case studies as new antipatterns are discovered

Impact Analysis

Dimension Assessment Notes
User Value High Prevents 100% failure rate patterns documented in PR #669
Business Impact Medium Reduces operational incidents from agent failures
Technical Leverage High Reusable design principles apply to all future protocols
Competitive Position Improved Demonstrates mature protocol engineering

Concerns

Priority Concern Recommendation
Low Session log lacks Session End checklist validation Minor; docs-only change qualifies for QA exemption per ADR-034

Recommendations

  1. Document should be linked from onboarding materials for new contributors
  2. Consider adding to AGENTS.md references for protocol design work
  3. The verification hierarchy provides clear guidance for future protocol requirements

Verdict

VERDICT: PASS
MESSAGE: Documentation captures high-value lessons from PR #669 failures. Low effort, high prevention value. Directly supports protocol reliability which is foundational to agent system success.
QA Review Details

Based on the PR description and diff provided:


VERDICT: PASS
MESSAGE: Documentation-only changes with valid markdown structure and no broken links.

PR TYPE: DOCS

FILES:

Category Files
DOCS .agents/AGENT-INSTRUCTIONS.md, .agents/SESSION-PROTOCOL.md, .agents/governance/PROTOCOL-ANTIPATTERNS.md, .agents/sessions/2025-12-31-session-112-autonomous-development.md

EVIDENCE:

  • Tests found: N/A - DOCS only
  • Edge cases: N/A
  • Error handling: N/A
  • Blocking issues: 0

Link Verification:

  • All cross-references use relative paths
  • Links to existing files: ./SESSION-PROTOCOL.md, ./governance/PROTOCOL-ANTIPATTERNS.md, ./governance/PROJECT-CONSTRAINTS.md
  • New file created at expected path: .agents/governance/PROTOCOL-ANTIPATTERNS.md

Content Quality:

  • RFC 2119 keywords used correctly (MUST, SHOULD, MAY)
  • Tables properly formatted
  • Code blocks have language specifiers
  • Evidence-based with specific PR/issue references
DevOps Review Details

Based on the PR description and diff provided, I can complete the DevOps review.

PR Scope Detection

Category Files Count
DOCS .agents/governance/PROTOCOL-ANTIPATTERNS.md (new) 1
DOCS .agents/AGENT-INSTRUCTIONS.md 1
DOCS .agents/SESSION-PROTOCOL.md 1
DOCS .agents/sessions/2025-12-31-session-112-autonomous-development.md (new) 1

Classification: DOCS-only PR. No CI/CD, workflow, script, or infrastructure changes.


Pipeline Impact Assessment

Area Impact Notes
Build None No source code changes
Test None No test files affected
Deploy None No deployment config changes
Cost None No CI/CD changes

CI/CD Quality Checks

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

Findings

Severity Category Finding Location Fix
- - No DevOps-relevant findings - -

Template Assessment

  • PR Template: Adequate (properly completed)
  • Issue Templates: Not modified
  • Template Issues: None

Automation Opportunities

Opportunity Type Benefit Effort
None identified - - -

Documentation-only PR. The content documents protocol antipatterns which may inform future automation but requires no immediate DevOps changes.


Recommendations

  1. No DevOps action required for this PR.

VERDICT: PASS
MESSAGE: Documentation-only PR with no CI/CD, workflow, or infrastructure impact.
Analyst Review Details

Code Quality Score

Criterion Score (1-5) Notes
Readability 5 Clear structure with headings, tables, and code blocks
Maintainability 5 Self-contained document with clear sections
Consistency 5 Follows existing governance doc patterns in .agents/governance/
Simplicity 5 Direct language, no unnecessary complexity

Overall: 5/5

Impact Assessment

  • Scope: Isolated (3 files changed, all documentation)
  • Risk Level: Low (no code changes, no behavior changes)
  • Affected Components: .agents/governance/, .agents/SESSION-PROTOCOL.md, .agents/AGENT-INSTRUCTIONS.md

Findings

Priority Category Finding Location
Low Documentation Session log included in PR is not relevant to the documentation change itself .agents/sessions/2025-12-31-session-112...

Recommendations

  1. The session log file documents broader session activity beyond this specific issue. Consider whether it should be part of this PR or a separate commit.

Verdict

VERDICT: PASS
MESSAGE: Well-structured governance documentation capturing lessons learned from PR #669. Evidence-based content with clear antipattern/replacement pattern structure. Cross-references properly added to related documents.
Security Review Details

Security Review: PR #711

PR Type Detection

File Category Security Scrutiny
.agents/AGENT-INSTRUCTIONS.md DOCS None required
.agents/SESSION-PROTOCOL.md DOCS None required
.agents/governance/PROTOCOL-ANTIPATTERNS.md DOCS None required
.agents/sessions/2025-12-31-session-112-autonomous-development.md DOCS None required

Classification: DOCS-only PR. All changed files are markdown documentation.

Findings

Severity Category Finding Location CWE
- - No security findings - -

Analysis

  1. Secret Detection: No credentials, API keys, or tokens present. Example code blocks contain placeholder values only.
  2. Sensitive Data: No internal URLs, endpoints, or PII disclosed.
  3. Code Examples: PowerShell and YAML snippets are illustrative patterns, not executable production code.

Recommendations

None. This is a documentation-only PR that captures lessons learned about protocol design.

Verdict

VERDICT: PASS
MESSAGE: Documentation-only PR with no security-relevant changes. No secrets, credentials, or sensitive data exposed.
Architect Review Details

Design Quality Assessment

Aspect Rating (1-5) Notes
Pattern Adherence 5 Document structure follows established governance patterns
Boundary Respect 5 Documentation stays within .agents/governance/ where protocol guidance belongs
Coupling 5 Minimal coupling; cross-references use relative links
Cohesion 5 Single focused topic: protocol antipatterns and replacement patterns
Extensibility 5 Case study format allows future antipatterns to be added

Overall Design Score: 5/5

Architectural Concerns

Severity Concern Location Recommendation
None - - -

Breaking Change Assessment

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

Technical Debt Analysis

  • Debt Added: Low (documentation only)
  • Debt Reduced: Medium (captures lessons learned, prevents future errors)
  • Net Impact: Improved

ADR Assessment

  • ADR Required: No
  • Decisions Identified: None. This documents operational lessons learned about protocol design, not architectural decisions about system structure
  • Existing ADR: ADR-034 referenced appropriately as evidence of verification-based design
  • Recommendation: N/A

Recommendations

  1. Document is well-structured with clear evidence-based examples from actual system failures.

Verdict

VERDICT: PASS
MESSAGE: Documentation-only change. Captures protocol design lessons in appropriate governance location with evidence-based case studies.

Run Details
Property Value
Run ID 20626078796
Triggered by pull_request on 711/merge
Commit 614662437a9841eae71f4a44a530f400c0e55d7e

Powered by AI Quality Gate workflow

Session completed 4 PRs from priority issues:
- PR #708: Issue #700 - ConvertFrom-Json error handling
- PR #709: Issue #699 - GITHUB_OUTPUT error handling
- PR #710: Issue #675 - Canonical source principle
- PR #711: Issue #686 - Trust-based compliance antipattern

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

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

Copy link
Copy Markdown
Contributor

Session Protocol Compliance Report

Tip

Overall Verdict: PASS

All session protocol requirements satisfied.

What is Session Protocol?

Session logs document agent work sessions and must comply with RFC 2119 requirements:

  • MUST: Required for compliance (blocking failures)
  • SHOULD: Recommended practices (warnings)
  • MAY: Optional enhancements

See .agents/SESSION-PROTOCOL.md for full specification.

Compliance Summary

Session File Verdict MUST Failures
2025-12-31-session-112-autonomous-development.md ✅ COMPLIANT 0
0

Detailed Results

2025-12-31-session-112-autonomous-development

Based on the session log content provided in the context, I can now validate protocol compliance:

MUST: Serena Initialization: PASS
MUST: HANDOFF.md Read: PASS
MUST: Session Log Created Early: PASS
MUST: Protocol Compliance Section: PASS
MUST: HANDOFF.md Unchanged: PASS
MUST: Markdown Lint: PASS
MUST: Changes Committed: PASS
SHOULD: Memory Search: SKIP
SHOULD: Git State Documented: SKIP
SHOULD: Clear Work Log: PASS

VERDICT: COMPLIANT
FAILED_MUST_COUNT: 0

Notes:

  • Serena initialization marked N/A with "MCP tools not available" which is acceptable when Serena is unavailable
  • HANDOFF.md read is documented as "Complete" with "Content in context"
  • Session log created with Protocol Compliance section present
  • All work committed per Session End Checklist
  • Markdown linting confirmed in checklist

Run Details
Property Value
Run ID 20626078793
Files Checked 1

Powered by AI Session Protocol Validator workflow

@coderabbitai

coderabbitai Bot commented Dec 31, 2025

Copy link
Copy Markdown

Caution

Review failed

The head commit changed during the review from 6554371 to fdf9b70.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/686-trust-based-compliance-antipattern

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added agent-architect Design and ADR agent agent-memory Context persistence agent area-workflows GitHub Actions workflows documentation Improvements or additions to documentation labels Dec 31, 2025
@coderabbitai

coderabbitai Bot commented Dec 31, 2025

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Three documentation files updated to introduce a new governance document on protocol antipatterns, covering trust-based compliance failures versus verification-based enforcement, with cross-references added to existing related documents.

Changes

Cohort / File(s) Summary
New governance documentation
.agents/governance/PROTOCOL-ANTIPATTERNS.md
New file documenting trust-based compliance antipattern and verification-based enforcement pattern, with case studies (branch verification, session initialization, test execution) and design guidelines.
Documentation cross-references
.agents/AGENT-INSTRUCTIONS.md, .agents/SESSION-PROTOCOL.md
Added "Related Documents" section to AGENT-INSTRUCTIONS.md with links to SESSION-PROTOCOL.md, PROTOCOL-ANTIPATTERNS.md, and PROJECT-CONSTRAINTS.md. Added link to PROTOCOL-ANTIPATTERNS.md in SESSION-PROTOCOL.md.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Suggested labels

documentation, area-workflows, agent-architect, agent-memory

Suggested reviewers

  • rjmurillo

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title follows conventional commit format with 'docs' type and clear scope about documenting the antipattern.
Description check ✅ Passed Description clearly explains the purpose of documenting the trust-based compliance antipattern and references related issues.
Linked Issues check ✅ Passed PR meets all acceptance criteria: PROTOCOL-ANTIPATTERNS.md created with antipattern definition, verification pattern documented, 3 case studies included, design checklist provided, and links added to SESSION-PROTOCOL.md and AGENT-INSTRUCTIONS.md.
Out of Scope Changes check ✅ Passed All changes directly support issue #686: new governance document, related document links, and reference updates align with stated objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/686-trust-based-compliance-antipattern

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.agents/governance/PROTOCOL-ANTIPATTERNS.md (1)

1-20: Minor: File naming convention consistency.

The file is named PROTOCOL-ANTIPATTERNS.md. Coding guidelines suggest governance documents follow pattern POLICY-NAME-UPPERCASE.md or [ACRONYM]-[POLICY-AREA].md (e.g., POLICY-ANTIPATTERNS.md or PAP-DESIGN.md). However, related governance documents (SESSION-PROTOCOL.md, PROJECT-CONSTRAINTS.md) also deviate from this pattern, so this is a minor consistency note rather than a blocker.

Consider standardizing governance file naming if this becomes a pattern.

📜 Review details

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bace947 and fdf9b70.

⛔ Files ignored due to path filters (1)
  • .agents/sessions/2025-12-31-session-112-autonomous-development.md is excluded by !.agents/sessions/**
📒 Files selected for processing (3)
  • .agents/AGENT-INSTRUCTIONS.md
  • .agents/SESSION-PROTOCOL.md
  • .agents/governance/PROTOCOL-ANTIPATTERNS.md
🧰 Additional context used
📓 Path-based instructions (11)
.agents/**/*.{md,yml,yaml,json}

📄 CodeRabbit inference engine (.agents/critique/001-agent-templating-critique.md)

For agent platform files, evaluate whether near-identical variants (99%+ overlap) can be consolidated with conditional configuration rather than maintaining separate files

Files:

  • .agents/governance/PROTOCOL-ANTIPATTERNS.md
  • .agents/AGENT-INSTRUCTIONS.md
  • .agents/SESSION-PROTOCOL.md
.agents/**/*.md

📄 CodeRabbit inference engine (.agents/retrospective/pr43-coderabbit-root-cause-analysis.md)

.agents/**/*.md: Use PREFIX-NNN naming convention (e.g., EPIC-001, CRITIQUE-001) for sequenced artifacts and type-prefixed naming (e.g., prd-, tasks-) for non-sequenced artifacts
Normalize all file paths in markdown documents to be repository-relative before committing, removing absolute machine-specific paths

.agents/**/*.md: Session logs and documentation must include Phase checklist verification (Phase 1-3 protocol compliance including agent activation, instruction reading, handoff file updates, and session logging)
Session logs must document Session ID, date, agent name, and branch information in a standardized header format

All artifact files in .agents/ must be in Markdown format

Document analysis recommendations with specific rationale when adding new governance documents like PROJECT-CONSTRAINTS.md

Maintain debugging skills documentation in .agents/ directory

Document implementation notes explaining deviations from user prompts or decisions made during development (e.g., using plural form for directory names)

Run markdown lint on all generated artifacts before completing a session

Run markdown lint validation (0 errors expected) before committing documentation files in the .agents directory

.agents/**/*.md: Use consistent absolute file paths throughout task and PRD documentation instead of mixing relative and absolute path formats
Run markdown linting with npx markdownlint-cli2 --fix on all agent-generated documentation before commit

All modifications to agent documentation and specifications must be marked with status updates (e.g., DRAFT → CONSOLIDATED) and include consolidation notes in headers

Configure GitHub MCP server in project MCP settings and create github-agent.md with agent-specific tool binding following the agent isolation pattern from superpowers-chrome

Files:

  • .agents/governance/PROTOCOL-ANTIPATTERNS.md
  • .agents/AGENT-INSTRUCTIONS.md
  • .agents/SESSION-PROTOCOL.md
**/.agents/**/*.md

📄 CodeRabbit inference engine (.agents/roadmap/epic-agent-consolidation.md)

Single-source agent files should use frontmatter markers to delineate platform-specific sections for VS Code and Copilot CLI variants

Maintain artifact synchronization markers in tracking files (.md) with status indicators ([COMPLETE], [RESOLVED], [VERIFIED]) and timestamps to document completion and verification of work

Separate domain knowledge from methodology - store domain expertise in knowledge documents, not in methodology/protocol files

Files:

  • .agents/governance/PROTOCOL-ANTIPATTERNS.md
  • .agents/AGENT-INSTRUCTIONS.md
  • .agents/SESSION-PROTOCOL.md
.agents/governance/**/*.md

📄 CodeRabbit inference engine (.agents/retrospective/phase3-p2-learnings.md)

Create canonical DRY reference documents in .agents/governance/ for multi-agent patterns instead of duplicating across individual agent files

Follow RFC 2119 compliance with MUST/SHOULD/MAY tiering for constraint documentation

All RFC 2119 keywords (MUST, SHOULD, MAY, etc.) in governance and protocol documents must follow RFC 2119 semantics as documented in SESSION-PROTOCOL.md

Files:

  • .agents/governance/PROTOCOL-ANTIPATTERNS.md
.agents/governance/*.md

📄 CodeRabbit inference engine (.agents/planning/PHASE-PROMPTS.md)

.agents/governance/*.md: Document artifact cross-reference format in governance naming conventions, establishing traceability between requirements, designs, and tasks
Document parallel execution patterns in governance, assessing when tasks can run in parallel based on independence criteria (no shared file modifications, no data dependencies, no sequence requirements, no coordination needs)
Use aggregation strategies for parallel results: merge (non-conflicting outputs), vote (redundant execution), escalate (conflicts detected), first-wins (race conditions)
Create evaluation rubric with weighted criteria (Completeness, Correctness, Clarity, Actionability each 25%) scoring 1-4 per criterion, with 70% threshold for acceptance and maximum 3 iterations before escalation

Governance policy documents should follow naming convention: POLICY-NAME-UPPERCASE.md or [ACRONYM]-[POLICY-AREA].md (e.g., COST-GOVERNANCE.md, AI-REVIEW-MODEL-POLICY.md)

Files:

  • .agents/governance/PROTOCOL-ANTIPATTERNS.md
**/.agents/**/**.md

📄 CodeRabbit inference engine (.agents/critique/001-pr365-remediation-critique.md)

Verify existence of referenced documentation files before updating them in automation procedures

Files:

  • .agents/governance/PROTOCOL-ANTIPATTERNS.md
  • .agents/AGENT-INSTRUCTIONS.md
  • .agents/SESSION-PROTOCOL.md
{**/.agents/**,**/*prompt*.{js,ts,md},**/*agent*.ps1}

📄 CodeRabbit inference engine (.agents/critique/465-spec-validation-false-positive.md)

Require explicit verdict patterns in all AI agent outputs rather than relying on substring keyword matching for verdict detection

Files:

  • .agents/governance/PROTOCOL-ANTIPATTERNS.md
  • .agents/AGENT-INSTRUCTIONS.md
  • .agents/SESSION-PROTOCOL.md
.agents/**

⚙️ CodeRabbit configuration file

Agent configuration files. Only flag security issues or broken cross-references. Ignore style, formatting, and structure.

Files:

  • .agents/governance/PROTOCOL-ANTIPATTERNS.md
  • .agents/AGENT-INSTRUCTIONS.md
  • .agents/SESSION-PROTOCOL.md
.agents/AGENT-INSTRUCTIONS.md

📄 CodeRabbit inference engine (.agents/SESSION-START-PROMPT.md)

Read .agents/AGENT-INSTRUCTIONS.md second - contains task execution protocol

Reference SESSION-PROTOCOL.md in AGENT-INSTRUCTIONS.md instead of duplicating Session Start/End checklist format requirements

Files:

  • .agents/AGENT-INSTRUCTIONS.md
.agents/SESSION-PROTOCOL.md

📄 CodeRabbit inference engine (.agents/retrospective/2025-12-18-parallel-implementation-retrospective.md)

Use verification-based BLOCKING gates in SESSION-PROTOCOL.md that require tool output rather than trust-based guidance

Establish SESSION-PROTOCOL integration for automated compliance and session automation features, building on existing SESSION-PROTOCOL.md rather than replacing it

SESSION-PROTOCOL.md Session End phase must be marked as BLOCKING with enforcement criteria and rejection conditions, not merely REQUIRED, to achieve compliance rates equivalent to Session Start (79% vs 4%)

SESSION-PROTOCOL.md MUST remain the canonical protocol definition, with Session State MCP tools reading from it for gate validation requirements

Update SESSION-PROTOCOL.md version to 1.4 documenting that agents MUST NOT update HANDOFF.md and must use session logs and Serena memory instead

Implement Phase 1.5 BLOCKING gate in session protocol requiring skill validation (Check-SkillExists.ps1) before starting work

SESSION-PROTOCOL.md must include an 'Unattended Execution Protocol' section with at least 8 MUST requirements for autonomous agent operation

SESSION-PROTOCOL.md must integrate lifecycle hooks with automated pre-session (context loading, Serena activation, HANDOFF reading) and post-session (HANDOFF update, markdownlint, skill extraction, commit) phases

Update SESSION-PROTOCOL.md to document that agents MAY skip QA validation when sessions are investigation-only by using the 'SKIPPED: investigation-only' evidence marker

Files:

  • .agents/SESSION-PROTOCOL.md
**/.agents/SESSION-PROTOCOL.md

📄 CodeRabbit inference engine (.agents/planning/PRD-agent-orchestration-mcp.md)

Session end protocol in SESSION-PROTOCOL.md MUST require agents to update HANDOFF.md with session summary, but Agent Orchestration MCP MUST aggregate parallel outputs and update HANDOFF.md once to prevent staging conflicts

Files:

  • .agents/SESSION-PROTOCOL.md
🔍 Remote MCP DeepWiki, GitHub Copilot

Perfect! I have gathered comprehensive context. Let me compile the findings.

Summary of Additional Context for PR #711 Review

Repository Context,

The PR belongs to rjmurillo/ai-agents, a multi-agent system for software development with a sophisticated governance structure. The repository maintains extensive governance documentation in the .agents/ directory including session protocols, agent instructions, and now protocol antipatterns.

PR Scope & Alignment with Objectives

PR #711 creates three files totaling 278 additions:

  • New document: .agents/governance/PROTOCOL-ANTIPATTERNS.md (210 lines)
  • Updates: .agents/AGENT-INSTRUCTIONS.md (8 additions)
  • Updates: .agents/SESSION-PROTOCOL.md (1 addition)
  • Session log: .agents/sessions/2025-12-31-session-112-autonomous-development.md (59 additions)

All changes directly address the acceptance criteria from issue #686:

  • ✅ PROTOCOL-ANTIPATTERNS.md created with evidence from PR #669
  • ✅ Trust-based compliance antipattern documented
  • ✅ Verification-based enforcement pattern documented
  • ✅ 3 case studies included (branch verification, session init, test execution)
  • ✅ Design guidelines and implementation checklist provided
  • ✅ Links added to SESSION-PROTOCOL.md and AGENT-INSTRUCTIONS.md

Evidence & Root Cause Documentation,

PR #669 (merged 2025-12-31) provides the foundational evidence:

  • Root Cause: Trust-based compliance for git operations
  • Failure Evidence: 5 PRs affected by cross-branch commit contamination; agents made commits without branch verification despite explicit instructions in CLAUDE.md
  • Failure Rate: 100% when relying on agent memory alone

Issue #684 (closed 2025-12-31) documents the replacement pattern:

  • Implements mandatory branch verification gates at session start and pre-commit
  • References the antipattern as verification-based enforcement
  • Demonstrates the design checklist approach used in the PR's documentation

Governance Document Architecture

The repository uses verification-based enforcement (not trust-based compliance) for critical operations through:

  • SESSION-PROTOCOL.md: Canonical source defining session start/end requirements with RFC 2119 keywords (MUST/SHOULD/MAY)
  • AGENT-INSTRUCTIONS.md: Task execution protocol that references SESSION-PROTOCOL.md rather than duplicating it
  • PROTOCOL-ANTIPATTERNS.md: New governance document establishing design patterns for future protocol creation

Documentation Quality Indicators

The new document includes:

  • Concrete examples: Failure modes vs. success indicators with quantified success rates (0% vs. 90%+)
  • Case studies: Three detailed examples showing trust-based failures and verification-based successes
  • Design hierarchy: Verification hierarchy table mapping mechanisms to blocking levels
  • Red flags section: Patterns that indicate vulnerable trust-based compliance
  • Implementation checklist: Four concrete questions for designing new requirements
  • RFC 2119 compliance: Uses standardized requirement language

Related Context

The PR includes Session 112 log documenting the autonomous development workflow:

  • Shows protocol compliance verification in context
  • Documents 4 other PRs created in the same session (#708, #709, #710, #711)
  • Demonstrates reproducible issue selection and PR creation workflow
🔇 Additional comments (3)
.agents/SESSION-PROTOCOL.md (1)

671-671: Use repository-relative paths instead of relative paths.

The new link uses ./governance/PROTOCOL-ANTIPATTERNS.md but should be normalized to repository-relative format: .agents/governance/PROTOCOL-ANTIPATTERNS.md. This aligns with the coding guideline: "Normalize all file paths in markdown documents to be repository-relative before committing."

Note: The existing links in this section also use inconsistent relative formats (../AGENTS.md, ./HANDOFF.md, etc.). Consider normalizing all paths in the Related Documents section during this commit.

.agents/AGENT-INSTRUCTIONS.md (1)

793-798: Normalize paths to repository-relative format.

All three links in the new Related Documents section use relative paths instead of repository-relative paths. Update to:

-## Related Documents
-
-- [SESSION-PROTOCOL.md](./SESSION-PROTOCOL.md) - Session start/end requirements
-- [PROTOCOL-ANTIPATTERNS.md](./governance/PROTOCOL-ANTIPATTERNS.md) - Protocol design antipatterns and replacement patterns
-- [PROJECT-CONSTRAINTS.md](./governance/PROJECT-CONSTRAINTS.md) - Hard constraints
+## Related Documents
+
+- [SESSION-PROTOCOL.md](.agents/SESSION-PROTOCOL.md) - Session start/end requirements
+- [PROTOCOL-ANTIPATTERNS.md](.agents/governance/PROTOCOL-ANTIPATTERNS.md) - Protocol design antipatterns and replacement patterns
+- [PROJECT-CONSTRAINTS.md](.agents/governance/PROJECT-CONSTRAINTS.md) - Hard constraints

Per coding guideline: "Normalize all file paths in markdown documents to be repository-relative before committing, removing absolute machine-specific paths."

.agents/governance/PROTOCOL-ANTIPATTERNS.md (1)

1-210: Strong documentation of antipatterns and replacement patterns.

The document comprehensively covers trust-based compliance failure modes, verification-based enforcement principles, and provides detailed evidence from PR #669. All acceptance criteria from issue #686 are met: antipattern described with evidence, replacement pattern documented, three case studies included (branch verification, session initialization, test execution), design guidelines with implementation checklist provided, and red flags identified.

RFC 2119 semantics used correctly throughout. Evidence is concrete and quantified (0% failure with trust-based, 90%+ success with verification-based).

Verify markdown linting has been run per coding guideline requirement: npx markdownlint-cli2 --fix ".agents/governance/PROTOCOL-ANTIPATTERNS.md" produces zero errors.

@rjmurillo rjmurillo merged commit 52e350f into main Dec 31, 2025
36 checks passed
@rjmurillo rjmurillo deleted the docs/686-trust-based-compliance-antipattern branch December 31, 2025 20:45
@rjmurillo rjmurillo added this to the 0.2.0 milestone Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-architect Design and ADR agent agent-memory Context persistence agent area-workflows GitHub Actions workflows documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(governance): document trust-based compliance antipattern

2 participants