- Fix MCP entry path resolution in mcp.ts (1 level up, not 2) - Remove stale v3/ directory references in 10-workers.ts - Fix CRLF line endings in 170+ skill files breaking frontmatter parsing - Add CRLF→LF safety net in prepare-assets.sh - Rewrite README.md for clarity (1097→280 lines, outcome-focused) - Sync assets from .claude/skills via prepare-assets.sh Fixes issues reported in v3.7.9 upgrade (skill-lint failures, MCP errors) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5.6 KiB
AQE Fleet v3 Constitution
Version: 1.0.0 Date: 2026-02-03 Authority: Architecture Team ADR Reference: ADR-058
Purpose
This Constitution defines unbreakable invariants for the Agentic QE Fleet v3. These rules are mechanically enforced by the @claude-flow/guidance governance system and cannot be overridden by any agent, task, or user request.
Section I: Unbreakable Invariants
Invariant 1: Test Execution Integrity
INVARIANT test_execution_integrity:
FOR ALL task IN tasks:
IF task.claims_tests_passed THEN
EXISTS execution_proof WHERE
execution_proof.task_id = task.id AND
execution_proof.all_tests_executed = true AND
execution_proof.timestamp IS NOT NULL
Enforcement: ContinueGate blocks claims of test success without execution proof.
Invariant 2: Security Scan Requirement
INVARIANT security_scan_required:
FOR ALL change IN code_changes:
IF change.affects_auth_code OR change.affects_security_code THEN
EXISTS security_scan WHERE
security_scan.change_id = change.id AND
security_scan.status = 'complete' AND
security_scan.critical_vulnerabilities = 0
Enforcement: Quality gates block deployment without security scan.
Invariant 3: Backup Before Delete
INVARIANT backup_before_delete:
FOR ALL operation IN operations:
IF operation.type = 'delete' AND
operation.target IN ['memory.db', 'coverage/*', '*.db'] THEN
EXISTS backup WHERE
backup.source = operation.target AND
backup.timestamp < operation.timestamp AND
backup.verified = true
Enforcement: MemoryWriteGate blocks destructive operations without backup.
Invariant 4: Loop Detection
INVARIANT loop_detection:
FOR ALL agent IN active_agents:
agent.consecutive_identical_actions < MAX_IDENTICAL_ACTIONS (default: 3) AND
agent.rework_ratio < MAX_REWORK_RATIO (default: 0.5)
Enforcement: ContinueGate throttles or blocks agents exceeding limits.
Invariant 5: Budget Enforcement
INVARIANT budget_enforcement:
FOR ALL session IN sessions:
session.total_cost <= session.budget_limit AND
session.token_usage <= session.token_limit
Enforcement: BudgetMeter blocks operations exceeding budget.
Invariant 6: Memory Consistency
INVARIANT memory_consistency:
FOR ALL pattern IN patterns:
NOT EXISTS conflicting_pattern WHERE
conflicting_pattern.domain = pattern.domain AND
conflicting_pattern.contradicts(pattern) AND
conflicting_pattern.supersession_marker IS NULL
Enforcement: MemoryWriteGate blocks contradictory patterns.
Invariant 7: Verification Before Claim
INVARIANT verification_before_claim:
FOR ALL claim IN success_claims:
EXISTS verification WHERE
verification.claim_id = claim.id AND
verification.method IN ['test_execution', 'manual_review', 'automated_check'] AND
verification.result = 'passed'
Enforcement: All success claims require proof of verification.
Section II: Agent Governance
Agent Loop Protection
All agents are subject to ContinueGate enforcement:
- Max consecutive retries: 3 (configurable via
GOVERNANCE_MAX_RETRIES) - Rework ratio threshold: 0.5 (configurable via
GOVERNANCE_REWORK_THRESHOLD) - Idle timeout: 5 minutes (configurable via
GOVERNANCE_IDLE_TIMEOUT)
Memory Write Protection
All memory writes are subject to MemoryWriteGate enforcement:
- Contradiction detection: Enabled
- Temporal decay: Patterns older than 30 days with <3 uses may be archived
- Authority scope: Domain-specific (agents can only write to their domain namespace)
Trust-Based Routing
Agent selection is influenced by trust scores:
- Performance history: 50% weight
- Task similarity: 30% weight
- Capability match: 20% weight
- Minimum trust score for critical tasks: 0.7
Section III: Domain Rules
Domain-specific rules are loaded from shards located at:
.claude/guidance/shards/{domain}.shard.md
Available Domains
- test-generation
- test-execution
- coverage-analysis
- quality-assessment
- defect-intelligence
- requirements-validation
- code-intelligence
- security-compliance
- contract-testing
- visual-accessibility
- chaos-resilience
- learning-optimization
Section IV: Escalation Procedures
When Invariant Violation Detected
- Log violation with full context to audit trail
- Block operation that would violate invariant
- Notify coordinator (Queen Coordinator for critical violations)
- Create remediation task if automated fix possible
- Escalate to human if no automated remediation
When Agent Exceeds Limits
- Throttle agent (reduce priority, increase delays)
- Log pattern for future learning
- Consider agent demotion if repeated violations
- Route future tasks to alternative agents
Section V: Amendment Process
This Constitution may only be amended through:
- ADR proposal with architectural review
- Consensus from Architecture Team
- Implementation verification that new rules are enforceable
- Gradual rollout with feature flags
No agent, task, or emergency can bypass these invariants without formal amendment.
Revision History
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0.0 | 2026-02-03 | Architecture Team | Initial Constitution for ADR-058 |
This Constitution is enforced by @claude-flow/guidance governance system.