Skip to content

Refactor pending stamp JSON and UUID generation#428

Merged
willwashburn merged 1 commit into
mainfrom
codex/issue-332-pending-stamps-serde
May 25, 2026
Merged

Refactor pending stamp JSON and UUID generation#428
willwashburn merged 1 commit into
mainfrom
codex/issue-332-pending-stamps-serde

Conversation

@willwashburn

Copy link
Copy Markdown
Member

Closes #332.

Summary:

  • Derive serde support for PendingStamp and serialize/parse through serde_json while preserving the TS-compatible wire shape.
  • Replace the pending-stamp UUID helper and Claude session-id hasher with uuid::Uuid::new_v4().

Tests:

  • cargo test -p relayburn-sdk pending_stamps
  • cargo test -p relayburn-cli

@coderabbitai

coderabbitai Bot commented May 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 89c0a568-e0bc-43ac-a583-8608720ba478

📥 Commits

Reviewing files that changed from the base of the PR and between 1f0c28a and 68e2db7.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • Cargo.toml
  • crates/relayburn-cli/Cargo.toml
  • crates/relayburn-cli/src/harnesses/claude.rs
  • crates/relayburn-sdk/Cargo.toml
  • crates/relayburn-sdk/src/ingest/pending_stamps.rs

📝 Walkthrough

Walkthrough

This PR integrates the uuid crate across the workspace to replace hand-rolled UUID generation and simplifies JSON serialization in the SDK's PendingStamp struct using serde derive macros, removing ~80 lines of manual JSON and UUID code.

Changes

UUID and serde refactoring

Layer / File(s) Summary
Workspace UUID dependency
Cargo.toml
Add uuid crate v1 with v4 feature to workspace-level dependencies, enabling consistent UUID generation across crates.
Claude harness UUID replacement
crates/relayburn-cli/Cargo.toml, crates/relayburn-cli/src/harnesses/claude.rs
Replace custom UUID generation in mint_session_id (time/process-id hashing + manual RFC 4122 bit-setting) with Uuid::new_v4().to_string().
SDK PendingStamp serde and UUID migration
crates/relayburn-sdk/Cargo.toml, crates/relayburn-sdk/src/ingest/pending_stamps.rs
Add serde derive with camelCase field renaming to PendingStamp; collapse hand-rolled parse_pending_stamp and serialize_stamp into serde_json::from_str and serde_json::to_string_pretty calls; replace three call sites of custom uuid_v4 generator with Uuid::new_v4() for manifest and claimed-filename generation; remove custom uuid_v4 and OS-specific randomness helpers.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A hop, skip, and UUID refactor—
Where custom hashing gave way to the v4,
And serde's camelCase marches in sweet,
While 80 lines bow to defeat!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: refactoring pending stamp JSON serialization and UUID generation logic.
Description check ✅ Passed The description is related to the changeset, identifying the issue closed and summarizing the key changes (serde support for PendingStamp and UUID replacement).
Linked Issues check ✅ Passed The PR successfully addresses all objectives from issue #332: derives Serialize/Deserialize with camelCase renaming on PendingStamp, replaces hand-rolled JSON with serde_json calls, and replaces both ad-hoc UUID generators with uuid::Uuid::new_v4().
Out of Scope Changes check ✅ Passed All changes are within scope: workspace and crate Cargo.toml updates for uuid dependency, Claude harness refactoring to use uuid crate, and pending_stamps.rs refactoring for serde support and UUID generation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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/issue-332-pending-stamps-serde

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 6 files

Re-trigger cubic

@willwashburn willwashburn merged commit 157cb9f into main May 25, 2026
12 checks passed
@willwashburn willwashburn deleted the codex/issue-332-pending-stamps-serde branch May 25, 2026 01:34
willwashburn pushed a commit that referenced this pull request May 25, 2026
Main released 2.10.0 (hotspots MCP rollup #424), 2.10.1 (#427 +
pending-stamp refactor #428), and the workspace-wide dead_code/
unused_imports cleanup #429. The latter removed ingest_claude_projects
from the public re-export and switched orchestration_tests to
`crate::ingest::ingest::*` deep imports.

Conflict resolution:
- crates/relayburn-sdk/src/ingest.rs: keep main's narrowed re-export
  (no ingest_claude_projects) and add ingest_claude_transcript_path.
- crates/relayburn-sdk/src/ingest/orchestration_tests.rs: keep main's
  deep imports and add ingest_claude_transcript_path next to its
  sibling verbs.
- CHANGELOG.md: slot this branch's items under [Unreleased] above
  main's new 2.10.0 release section.

https://claude.ai/code/session_011ubB69Zxijqb1BsYVYL9iQ
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.

Rust refactor: derive Serialize/Deserialize on PendingStamp; drop hand-rolled JSON

1 participant