Skip to content

feat(protocol): add planning journal envelopes#39

Merged
glittercowboy merged 1 commit intomainfrom
codex/planning-journal-protocol
Apr 30, 2026
Merged

feat(protocol): add planning journal envelopes#39
glittercowboy merged 1 commit intomainfrom
codex/planning-journal-protocol

Conversation

@glittercowboy
Copy link
Copy Markdown
Contributor

@glittercowboy glittercowboy commented Apr 30, 2026

Summary

  • add planningEvent and planningEventAck message contracts
  • register envelope parsing for both message types
  • document source sequencing, idempotency, payload, and ack behavior

Verification

  • go test ./...

Dependency order

Merge this PR before bumping protocol-go consumers in daemon or cloud relay. After merge, tag protocol/v0.5.0.

Summary by CodeRabbit

  • New Features
    • Added planning event messaging to the relay for tracking distributed operations
    • Planning events support idempotent delivery with causation tracking and correlation identifiers
    • Relay acknowledges event acceptance, indicating successful persistence or idempotent replay with optional error details

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces two new message types for planning journal workflows: planningEvent for append-only events emitted by source runtimes with identity, ordering, correlation, and timing metadata; and planningEventAck for relay acknowledgements indicating event persistence or idempotent replay status.

Changes

Cohort / File(s) Summary
Protocol Documentation
PROTOCOL.md
Defines two new message types: planningEvent with identity, ordering (sourceSeq), idempotency (idempotencyKey, causationId), timing (occurredAt), and structured data fields; and planningEventAck for relay acknowledgement with acceptance status and optional error details.
Message Type Definitions
messages.go
Introduces MsgTypePlanningEvent and MsgTypePlanningEventAck message type constants, plus corresponding struct types PlanningEvent and PlanningEventAck with full field schemas including identifiers, sequencing, and payload/evidence metadata.
Envelope Parsing
envelope.go
Updates payloadForType function to recognize the two new message types and return their respective payload struct instances instead of defaulting to unknown message type error.
Unit Tests
messages_test.go
Adds round-trip marshal/parse tests validating that PlanningEvent and PlanningEventAck preserve key fields (identity, sequencing, acceptance status) through JSON serialization and envelope parsing with proper type assertions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 Events now plan with careful grace,
Through relay's warm and nested space,
Each ack confirms the journey's trace,
With source and seq in their right place! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(protocol): add planning journal envelopes' accurately describes the main change: adding two new message types (planningEvent and planningEventAck) to the protocol with supporting documentation and envelope parsing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/planning-journal-protocol

Review rate limit: 2/10 reviews remaining, refill in 42 minutes and 47 seconds.

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

@glittercowboy glittercowboy merged commit 7f0109e into main Apr 30, 2026
1 of 2 checks passed
@glittercowboy glittercowboy deleted the codex/planning-journal-protocol branch April 30, 2026 15:43
@coderabbitai coderabbitai Bot mentioned this pull request May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant