Contribution Protocol
Version: 1.1.0 Type: Cross-Cutting Protocol Applies To: All RCSD-IVTR stages Max Active: 3 protocols (including base)Cross-Cutting Nature: This protocol applies across ALL stages of RCSD-IVTR. Unlike stage-specific protocols (research, consensus, etc.), contribution tracking is active whenever multi-agent coordination or attribution is needed.
Trigger Conditions
This protocol activates when the task involves:| Trigger | Keywords | Context |
|---|---|---|
| Shared File Modification | Modifying CLAUDE.md, AGENTS.md, shared configs | Multi-session files |
| PR Creation | ”pull request”, “PR”, “merge request” | Code review workflow |
| Cross-Session Work | Multiple agents on same epic | Coordination needed |
| Audit Trail | Provenance, attribution, tracking | Accountability |
--protocol contribution flag on task creation.
Requirements (RFC 2119)
MUST
| Requirement | Description |
|---|---|
| CONT-001 | MUST follow commit message conventions |
| CONT-002 | MUST include provenance tags in code comments |
| CONT-003 | MUST pass all validation gates before merge |
| CONT-004 | MUST document decisions with rationale |
| CONT-005 | MUST flag conflicts with other sessions |
| CONT-006 | MUST write contribution record to manifest |
| CONT-007 | MUST set agent_type: "implementation" in manifest |
SHOULD
| Requirement | Description |
|---|---|
| CONT-010 | SHOULD include test coverage for changes |
| CONT-011 | SHOULD link to related tasks and research |
| CONT-012 | SHOULD document rejected alternatives |
| CONT-013 | SHOULD request review for significant changes |
MAY
| Requirement | Description |
|---|---|
| CONT-020 | MAY batch related changes into single contribution |
| CONT-021 | MAY defer documentation updates |
| CONT-022 | MAY propose follow-up improvements |
Output Format
Commit Message Format
feat, fix, docs, test, refactor, chore, perf
Provenance Tag Format
Contribution Record
Validation Gates
| Gate | Check | Required |
|---|---|---|
| Schema | JSON Schema validation | MUST pass |
| Tests | All tests pass | MUST pass |
| Lint | Code style compliance | SHOULD pass |
| Security | No secrets committed | MUST pass |
| Conflicts | No unresolved conflicts | MUST resolve |
File Output
Manifest Entry
Implementation Integration
Automatic Tracking
Status: Not yet implemented Planned: Integrate withcleo complete to automatically track contributions
- Detect PR/merge commits in task completion
- Extract contribution metadata from commit messages
- Append to
.cleo/contributions/CONTRIBUTIONS.jsonl - Link contribution to completed task
Manual Tracking
Status: Not yet implemented Planned: Dedicated contribution tracking command Future CLI:Implementation Location
Library:lib/contribution-protocol.sh
Key Functions (for future integration):
contribution_create()- Record contribution metadatacontribution_track_from_task()- Extract contribution from taskcontribution_validate()- Validate contribution structurecontribution_compute_consensus()- Compute consensus from contributions
Current State
Contribution protocol is specification-only (no enforcement yet). Implementation tracking requires:- Git integration for PR detection
- Contribution manifest system
- CLI commands for manual tracking
- Orchestrator integration for multi-agent contributions
validate_contribution_protocol() in lib/protocol-validation.sh
- CONT-002: Provenance tags required
- CONT-003: Tests must pass
- CONT-007: agent_type = “implementation”
- Exit code:
EXIT_PROTOCOL_CONTRIBUTION(65)
Integration Points
Base Protocol
- Inherits task lifecycle (focus, execute, complete)
- Inherits manifest append requirement
- Inherits error handling patterns
Protocol Interactions
| Combined With | Behavior |
|---|---|
| implementation | Contribution tracks implementation work |
| consensus | Consensus resolves contribution conflicts |
| release | Contribution records feed release notes |
Conflict Detection
| Conflict Type | Detection | Resolution |
|---|---|---|
| Same file edit | File path collision | Merge or choose |
| Semantic conflict | Decision contradiction | Consensus protocol |
| Dependency conflict | Breaking change | Escalate to HITL |
Example
Task: Implement session binding for multi-agent support Commit:Provenance Validation
Overview
Contribution protocol inherits provenance requirements from implementation protocol (IMPL-003), with identical enforcement mechanisms. Requirement: CONT-002 = IMPL-003 (Provenance tags required)Pre-Commit Hook
Same as Implementation Protocol:- Extract @task tags from commit diff
- Calculate provenance coverage: 100% new, 80% existing, 50% legacy
- Block commit if thresholds not met
- Exit code:
EXIT_PROTOCOL_CONTRIBUTION(65)
Runtime Validation
Current: Available viavalidate_contribution_protocol() in lib/protocol-validation.sh
Planned CLI: cleo contribution validate [--task TASK_ID]
Checks:
- CONT-002: Provenance tags present
- CONT-003: Tests pass
- CONT-007: agent_type = “implementation”
Shared Thresholds
Identical to implementation protocol:| Code Category | Provenance Requirement |
|---|---|
| New code | 100% |
| Existing code | 80% |
| Legacy code | 50% |
Enforcement Points
- Pre-commit: Shared with implementation protocol
- Pre-merge: PR validation checks provenance
- Runtime:
cleo completevalidates contribution tasks - Orchestrator: Validates before spawning contribution agents
Anti-Patterns
| Pattern | Why Avoid |
|---|---|
| Committing without provenance | Breaks audit trail |
| Skipping validation gates | Quality regression |
| Ignoring conflicts | Creates merge debt |
| Large unfocused commits | Hard to review/revert |
| Missing decision documentation | Lost context |
Protocol Version 1.0.0 - Contribution Protocol
