Contribution Format Specification
Version: 1.0.0 Status: ACTIVE Epic: T2308 - Contribution Protocol System v2 Created: 2026-01-26 Last Updated: 2026-01-26 Implementation Report: CONTRIBUTION-FORMAT-IMPLEMENTATION-REPORT.mdPreamble
Purpose
This specification defines the JSON-first contribution format for multi-agent consensus workflows in CLEO. The format enables machine-parseable decision documentation, automated conflict detection, and programmatic consensus computation.Authority
This specification is AUTHORITATIVE for:- Contribution JSON object structure
- Decision object format and validation
- Confidence score semantics and weighting
- Evidence reference format
- Conflict detection structures
- JSONL manifest format
- SPEC-BIBLE-GUIDELINES.md for document structure
- contribution.schema.json for JSON Schema validation
- CONSENSUS-FRAMEWORK-SPEC.md for consensus protocol rules
Design Philosophy
JSON-First: All contribution data MUST be machine-parseable. Markdown is prohibited for decision content. Weighted Consensus: Confidence scores enable proportional voting rather than binary agreement. Traceability: Evidence references create audit trails from decisions to source material. Automation-Ready: Format enables automated conflict detection and consensus aggregation without human parsing.RFC 2119 Conformance
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 RFC 2119 RFC 8174 when, and only when, they appear in all capitals, as shown here.Overview
This specification defines the data formats for the CLEO Contribution Protocol, enabling multi-agent coordination through structured decision tracking and consensus computation. Two Components:- Contribution Format (Part 1): Individual contribution JSON structure
- JSONL Manifest (Part 2): Append-only index for querying and validation
Part 1: Contribution Format
1.1 Top-Level Schema
A contribution object MUST conform to the following structure:1.2 Metadata Object (_meta)
The _meta object MUST contain contribution tracking information:
| Field | Type | Required | Description |
|---|---|---|---|
contributionId | string | MUST | Unique identifier: contrib_{8 hex chars} |
protocolVersion | string | SHOULD | Semver of contribution protocol (default: “1.0.0”) |
createdAt | string | MUST | ISO 8601 timestamp of creation |
completedAt | string|null | MAY | ISO 8601 timestamp when finalized |
agentId | string | MUST | Contributing agent identifier (e.g., “opus-1”) |
checksum | string|null | MAY | SHA-256 truncated hash (16 hex chars) for integrity |
consensusReady | boolean | SHOULD | Whether contribution is ready for consensus computation |
contributionIdMUST match:^contrib_[a-f0-9]{8}$agentIdMUST match:^[a-zA-Z0-9_-]{1,50}$checksumMUST match:^[a-f0-9]{16}$when present
1.3 Session Context Fields
| Field | Type | Required | Description |
|---|---|---|---|
sessionId | string | MUST | Active CLEO session identifier |
sessionLabel | string | SHOULD | Human-readable label (e.g., “Session B”) |
epicId | string | MUST | Parent epic task ID |
epicTitle | string | SHOULD | Epic title for context |
taskId | string | MUST | Contribution task ID |
markerLabel | string | MUST | Discovery label for cross-session queries |
sessionIdMUST match:^session_\d{8}_\d{6}_[a-f0-9]{6}$epicIdandtaskIdMUST match:^T\d{3,}$markerLabelMUST match:^[a-z][a-z0-9-]*$(3-50 chars)
1.4 Decision Object Structure
1.4.1 Decision Schema
Each decision MUST document a single question-answer pair:1.4.2 Decision Fields
| Field | Type | Required | Description |
|---|---|---|---|
questionId | string | MUST | Unique question identifier (e.g., “RCSD-001”) |
question | string | MUST | The decision question (10-300 chars) |
answer | string | MUST | Concrete decision value (5-1000 chars) |
confidence | number | MUST | Confidence score 0.0-1.0 |
rationale | string | MUST | Decision reasoning (20-2000 chars) |
evidence | array | MUST | Evidence references (min 1 item) |
uncertaintyNote | string|null | SHOULD | Uncertainty explanation when confidence < 0.7 |
alternatives | array | MAY | Rejected alternatives with reasons |
questionIdMUST match:^[A-Z]+-\d{3}$
1.4.3 Confidence Score Semantics
Confidence scores MUST follow these semantic ranges:| Range | Level | Meaning | Requirements |
|---|---|---|---|
| 0.90-1.00 | Very High | Near-certain based on strong evidence | MUST have 2+ independent evidence sources |
| 0.70-0.89 | High | Confident with minor uncertainty | MUST have at least 1 evidence source |
| 0.50-0.69 | Medium | Balanced uncertainty, reasonable basis | SHOULD include uncertaintyNote |
| 0.30-0.49 | Low | Significant uncertainty, best guess | MUST include uncertaintyNote |
| 0.00-0.29 | Tentative | Speculative, needs validation | MUST include uncertaintyNote, SHOULD NOT be used for critical decisions |
vote_direction is +1 (agreement) or -1 (disagreement) for binary questions.
1.4.4 Answer Requirements
Answers MUST be:- Concrete: Specific, actionable statements
- Unambiguous: Single interpretation possible
- Testable: Verifiable against implementation
- Use hedging language (“maybe”, “possibly”, “could be”)
- Be self-contradictory
- Reference other answers without explicit resolution
1.5 Evidence Reference Structure
1.5.1 Evidence Object Schema
Each evidence reference MUST document the source:1.5.2 Evidence Fields
| Field | Type | Required | Description |
|---|---|---|---|
file | string | MUST* | Relative path to source file |
section | string | MUST | Section identifier or description |
quote | string | SHOULD | Exact quote supporting the decision (max 500 chars) |
line | number | SHOULD | Line number for code references |
url | string | MUST* | URL for external sources |
type | string | SHOULD | Evidence classification |
file or url MUST be present.
1.5.3 Evidence Types
| Type | Use Case | Verification Method |
|---|---|---|
code | Implementation evidence | Line number + file path |
documentation | Specification or guide evidence | Section heading + file |
research | Research output reference | Research manifest ID |
external | External URL or documentation | URL + access timestamp |
1.5.4 Evidence Quality Requirements
Evidence MUST be:- Traceable: Locatable by another agent using the reference
- Current: Reflect the state at decision time
- Relevant: Directly support the decision rationale
- Direct quotes when the exact wording matters
- Line numbers for code references
- Section anchors for long documents
1.6 Conflict Structure
1.6.1 Conflict Object Schema
Conflicts document disagreements requiring resolution:1.6.2 Conflict Fields
| Field | Type | Required | Description |
|---|---|---|---|
questionId | string | MUST | Question where conflict exists |
conflictId | string | MUST | Unique conflict identifier |
severity | enum | MUST | Impact severity |
conflictType | enum | MUST | Classification of conflict |
thisSession | object | MUST | Current session’s position |
otherSession | object | MUST | Conflicting session’s position |
rationale | string | MUST | Why positions differ |
resolution | object | SHOULD | Resolution proposal and votes |
requiresConsensus | boolean | MUST | Whether multi-session consensus needed |
escalatedToHITL | boolean | SHOULD | Whether escalated to human |
1.6.3 Severity Levels
| Severity | Definition | Action Required |
|---|---|---|
critical | Mutually exclusive positions on core design | MUST resolve before merge |
high | Significant impact on implementation | SHOULD resolve before merge |
medium | Different approaches, both viable | MAY defer resolution |
low | Minor preference differences | MAY accept either position |
1.6.4 Conflict Types
| Type | Definition | Detection Method |
|---|---|---|
contradiction | Mutually exclusive answers | Semantic analysis |
partial-overlap | Answers agree on some aspects, disagree on others | Field-by-field comparison |
scope-difference | Different interpretation of question scope | Question normalization |
priority-difference | Agreement on options, disagreement on ranking | Confidence comparison |
evidence-conflict | Same evidence, different conclusions | Evidence cross-reference |
1.6.5 Resolution Object
| Type | Description |
|---|---|
merge | Combine elements from both positions |
choose-a | Accept this session’s position |
choose-b | Accept other session’s position |
new | Neither position; create new answer |
defer | Postpone resolution |
escalate | Requires human decision (HITL) |
1.7 Research Outputs
| Field | Type | Required | Description |
|---|---|---|---|
filePath | string | MUST | Relative path to research file |
researchId | string | SHOULD | Research manifest ID for cross-reference |
type | enum | MUST | Output classification |
title | string | SHOULD | Document title |
createdAt | string | SHOULD | Creation timestamp |
linkedAt | string | SHOULD | When linked to task |
summary | string | SHOULD | Brief content summary (max 500 chars) |
1.8 Status Lifecycle
| Status | Description | Transitions To |
|---|---|---|
draft | Work in progress, editable | complete |
complete | Finalized by agent, awaiting validation | validated, draft |
validated | Passed schema and semantic validation | merged, complete |
merged | Incorporated into consensus synthesis | Terminal |
validated to draft is prohibited).
1.9 Validation Requirements
1.9.1 Schema Validation
All contributions MUST pass JSON Schema validation againstcontribution.schema.json.
1.9.2 Semantic Validation
Beyond schema validation, implementations SHOULD enforce:| Rule ID | Level | Requirement |
|---|---|---|
CONTRIB-001 | MUST | sessionId matches active CLEO session |
CONTRIB-002 | MUST | markerLabel present on task for discovery |
CONTRIB-003 | MUST | All research files exist at specified paths |
CONTRIB-004 | MUST | Research outputs linked to task notes |
CONTRIB-005 | MUST | All key questions have decisions |
CONTRIB-006 | MUST | Explicit conflicts flagged with baseline |
CONTRIB-007 | MUST | Decisions include rationale and evidence |
CONTRIB-010 | MUST | Conflicts include comparison rationale |
CONTRIB-011 | MUST NOT | Answers use vague or ambiguous language |
CONTRIB-012 | SHOULD | File paths follow YYYY-MM-DD_topic-slug.md |
CONTRIB-013 | SHOULD | Evidence references specific sections |
CONTRIB-014 | SHOULD | Conflicts propose resolution |
CONTRIB-015 | SHOULD | Low confidence includes uncertainty note |
1.9.3 Integrity Validation
Whenchecksum is present:
- Compute SHA-256 hash of contribution (excluding
_meta.checksum) - Truncate to first 16 hex characters
- Compare with stored checksum
- Validation MUST fail on mismatch
1.10 Examples
1.10.1 Minimal Valid Contribution
1.10.2 Full Contribution with Conflict
1.10.3 Low-Confidence Tentative Contribution
1.11 Machine Processing Guidelines
1.11.1 Conflict Detection Algorithm
Automated conflict detection SHOULD follow this algorithm:- Load contributions with matching
epicIdandmarkerLabel - Group by
questionIdacross all contributions - Compare answers:
- Exact string match: No conflict
- Semantic equivalence check: No conflict if equivalent
- Different answers: Potential conflict
- Classify conflict type based on answer structure
- Calculate severity based on confidence differential and question criticality
- Generate conflict object with both positions and evidence
1.11.2 Consensus Aggregation
For eachquestionId:
- Collect all decisions with that
questionId - Group by normalized answer (semantic equivalence)
- Calculate weighted support:
- Determine verdict:
percentage >= 0.8: PROVEN (strong consensus)percentage >= 0.6: LIKELY (moderate consensus)percentage >= 0.4: CONTESTED (split decision)percentage < 0.4: MINORITY (insufficient support)
1.11.3 Query Patterns
Common query patterns for contribution data:Part 2: JSONL Manifest Specification
2.1 Purpose
The JSONL manifest provides:- Audit Trail: Immutable log of all contributions
- Query Index: Efficient filtering by epic, session, status, agent
- Conflict Aggregation: Quick identification of tasks needing consensus
- Integrity Validation: Checksum verification for contribution files
2.2 Manifest Location
2.3 Entry Structure
Each line is a self-contained JSON object (single-line, no trailing comma):2.4 Field Definitions
| Field | Type | Required | Description |
|---|---|---|---|
id | string | MUST | Unique identifier: contrib_{uuid8} |
sessionId | string | MUST | Session that created this contribution |
epicId | string | MUST | Parent epic task ID |
taskId | string | MUST | Task this contribution addresses |
agentId | string | MUST | Agent identifier (e.g., opus-1, sonnet-2) |
status | enum | MUST | Contribution status (see 2.5) |
createdAt | string | MUST | ISO-8601 creation timestamp |
updatedAt | string | MUST | ISO-8601 last update timestamp |
decisionCount | integer | MUST | Total decisions in contribution |
conflictCount | integer | MUST | Decisions conflicting with existing |
filePath | string | MUST | Relative path to contribution file |
checksum | string | MUST | SHA-256 first 8 characters of file content |
2.5 Status Enum
| Status | Semantics | Next Action |
|---|---|---|
complete | All decisions made, contribution finalized | Ready for consensus computation |
partial | Some decisions pending, work in progress | Agent continues or handoff needed |
blocked | Cannot proceed without external input | Requires HITL intervention |
complete to other states. If changes needed, create new contribution entry.
2.6 Operations
2.6.1 Append
Add entry when a contribution file is saved or updated.- Compute checksum before appending
- Use file locking or atomic append to prevent corruption
- Validate JSON before appending
- Modify existing entries (append-only)
- Remove entries (use archival instead)
2.6.2 Query
Find contributions by various criteria usingjq or equivalent JSON stream processor.
All contributions for an epic:
2.6.3 Validate
Verify checksum matches contribution file content.2.7 Integrity Rules
2.7.1 Append-Only Semantics
MUST:- Only append new entries to manifest
- Never modify or delete existing entries
- Create new entry for any contribution update (with new
id, updated timestamps)
2.7.2 Checksum Validation
MUST:- Compute SHA-256 checksum of contribution file content
- Store first 8 characters in manifest entry
- Validate checksum before processing contribution
- Log validation error
- Mark contribution as potentially corrupted
- Attempt recovery from backup if available
- Require HITL intervention if unrecoverable
2.7.3 Archival Policy
When to Archive:- Epic marked complete
- Contribution count exceeds threshold (configurable, default: 1000)
- Manual archival request
- Create archive directory:
.cleo/contributions/archive/{epicId}/ - Move contribution files to archive
- Filter manifest entries to archive manifest
- Remove archived entries from active manifest (only operation that removes entries)
2.8 Concurrency Handling
2.8.1 Multi-Agent Writes
Multiple agents may append to manifest simultaneously. MUST:- Use atomic append operations (single write syscall or file locking)
- Generate unique
idvalues (UUID-based) - Tolerate duplicate entries (idempotent processing)
2.8.2 Read Consistency
SHOULD:- Read entire manifest before processing
- Use
-s(slurp) mode with jq for consistent view - Handle partial last line (truncated write)
2.9 Error Handling
| Error | Detection | Recovery |
|---|---|---|
| Malformed JSON line | jq parse error | Skip line, log warning |
| Missing contribution file | filePath not found | Mark entry as orphaned |
| Checksum mismatch | Validation failure | Require HITL review |
Duplicate id | Query returns multiple | Use latest by updatedAt |
2.10 Example Manifest
taskId (T2310) represent contribution history. Latest entry (by updatedAt) reflects current state.
Part 3: Integration Points
3.1 Consensus Computation
Manifest provides input for consensus:- Query all
completecontributions for epic - Group by
taskId - Identify tasks with
conflictCount > 0 - Feed to consensus algorithm
3.2 Session Protocol
Contributions link to sessions viasessionId:
- Session start: Initialize contribution tracking
- Session end: Finalize pending contributions
- Session resume: Load contributions for session scope
3.3 HITL Escalation
blocked status triggers HITL workflow:
- Manifest query identifies blocked contributions
- HITL resolves blocker
- New contribution entry with resolved decisions
Related Specifications
| Document | Relationship |
|---|---|
| contribution.schema.json | AUTHORITATIVE for JSON Schema validation rules |
| CONSENSUS-FRAMEWORK-SPEC.md | Related: Consensus voting thresholds and evidence standards |
| SPEC-BIBLE-GUIDELINES.md | AUTHORITATIVE for specification document structure |
| LLM-AGENT-FIRST-SPEC.md | Related: Agent behavior standards for contributions |
| CONTRIBUTION-FORMAT-IMPLEMENTATION-REPORT.md | Tracks implementation status |
Appendix A: JSON Schema for Manifest Entry
Appendix B: CLI Integration
Futurecleo commands for contribution management:
Appendix C: Changelog
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0.0 | 2026-01-26 | T2309 | Part 1: Contribution JSON format (decision objects, confidence scores, evidence references, conflict structure) |
| 1.0.0 | 2026-01-26 | T2310 | Part 2: JSONL Manifest specification |
End of Specification
