Skip to content

Expose braid membership history#550

Merged
flyingrobots merged 1 commit into
mainfrom
hardening/braid-membership-history-design
Jun 16, 2026
Merged

Expose braid membership history#550
flyingrobots merged 1 commit into
mainfrom
hardening/braid-membership-history-design

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

Implements GP3-S1 from the braids/strands hardening roadmap.

  • Adds BraidMembershipEntry as a read projection for accepted braid membership facts.
  • Adds Braid::membership_history() to project accepted MemberWoven events from the append-only braid event log.
  • Keeps frontier() as the current membership projection and documents that it is not the historical model.
  • Updates the Goalpost 3 design doc, roadmap checklist, and changelog.

Why

Goalpost 3 needs a concrete source-of-truth boundary before later slices add coordinate views, diffs, replay facts, and lower-mode recorder output. This PR establishes that accepted BraidEvent::MemberWoven entries are the membership history substrate, while rejected duplicate/late/incoherent events never enter the projected history.

RED / GREEN

RED witness:

cargo test -p warp-core --test braid_public_api_tests public_braid_membership_history_is_append_only_event_history

Before the fix, this failed because BraidMembershipEntry and Braid::membership_history() did not exist.

GREEN witness:

cargo test -p warp-core --test braid_public_api_tests public_braid_membership_history_is_append_only_event_history

After the fix, the test passes and proves accepted member facts are exposed in sequence order while rejected duplicate and late member events are excluded.

Validation

cargo fmt --all -- --check
cargo test -p warp-core --test braid_public_api_tests
cargo test -p warp-core --lib braid
cargo test -p warp-core --doc
cargo clippy -p warp-core --test braid_public_api_tests -- -D warnings
cargo clippy -p warp-core --lib -- -D warnings
pnpm exec markdownlint-cli2 CHANGELOG.md docs/design/braids-and-strands-roadmap.md docs/design/braids-and-strands-hardening/goalpost-03-historical-membership-and-replay.md
scripts/check_spdx.sh
git diff --check

Pre-commit also passed cargo clippy -p warp-core --lib, cargo check -p warp-core, and markdownlint for touched docs.

Pre-push passed:

cargo fmt --all -- --check
cargo test -p warp-core --lib braid::tests
cargo test -p warp-core --lib
cargo test -p warp-core --test braid_public_api_tests
prettier --check on touched markdown files

Roadmap

  • Checks off only GP3-S1.
  • Leaves GP3-S2 through GP3-S5 unchecked for coordinate views, diffs, replay/audit facts, and Causal X-Ray / Braid Flight Recorder output.

Summary by CodeRabbit

Release Notes

  • New Features

    • Braid membership history is now accessible, providing a read-only chronological view of all accepted member events
  • Documentation

    • Design documentation updated with implementation details for historical membership access
    • Roadmap progress tracker updated to reflect feature implementation completion

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5d3d5093-ceb0-437a-afd9-82207f3850e3

📥 Commits

Reviewing files that changed from the base of the PR and between e30e4b7 and 3d33ebc.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • crates/warp-core/src/braid.rs
  • crates/warp-core/src/lib.rs
  • crates/warp-core/tests/braid_public_api_tests.rs
  • docs/design/braids-and-strands-hardening/goalpost-03-historical-membership-and-replay.md
  • docs/design/braids-and-strands-roadmap.md

📝 Walkthrough

Walkthrough

Introduces BraidMembershipEntry struct and Braid::membership_history() as a read-only projection over accepted MemberWoven events in the braid event log. Re-exports the new type from lib.rs. Tests are extended with append-only semantics verification and typed error assertions. Design docs and changelog reflect GP3-S1 as active and complete.

Changes

GP3-S1: Append-Only Braid Membership History

Layer / File(s) Summary
BraidMembershipEntry struct and membership_history() projection
crates/warp-core/src/braid.rs, crates/warp-core/src/lib.rs
Adds BraidMembershipEntry (member reference + accepted weave sequence number) and Braid::membership_history() filtering the event log to MemberWoven entries. lib.rs re-export is reformatted to surface the new type.
Public API tests: append-only semantics and typed errors
crates/warp-core/tests/braid_public_api_tests.rs
Refactors public_braid_transition_failures_are_typed to Result-based propagation. Adds public_braid_membership_history_is_append_only_event_history asserting duplicate-member errors, post-finalization transition errors, correct membership_history() ordering, and frontier() correctness.
Design docs and changelog
docs/design/braids-and-strands-hardening/goalpost-03-historical-membership-and-replay.md, docs/design/braids-and-strands-roadmap.md, CHANGELOG.md
GP3-S1 status updated to active; Implementation Design section added clarifying BraidEvent as authoritative log and BraidMembershipEntry as a derived projection. Roadmap marks GP3-S1 complete. Changelog entry added.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • flyingrobots/echo#548: Touches the same braid_public_api_tests.rs file around BraidError::InvalidTransition and BraidTransitionKind assertions, which this PR's test refactor and new membership-history test directly build on.

Poem

🧵 The braid remembers every thread it weaved,
append-only, ordered, never deceived.
membership_history() — facts, not fiction,
frontier() holds the current depiction.
The event log speaks; projections just listen. 🪢

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: exposing braid membership history via the new BraidMembershipEntry struct and Braid::membership_history() method.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 hardening/braid-membership-history-design

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.

Copy link
Copy Markdown
Owner Author

Self-Code Review

cc @codex

Verdict: no actionable findings.

Severity File Lines Infraction Recommended mitigation
N/A N/A N/A No logic, race, edge-case, nondeterminism, duplication, separation-of-concerns, API, style, typing, or Markdown violations found in git diff origin/main...HEAD. No change requested.

Evidence reviewed:

Surface Review result
crates/warp-core/src/braid.rs BraidMembershipEntry is documented as a read projection, not an admission token. membership_history() derives accepted MemberWoven facts from the event log. Admission still routes through Braid::apply(...).
crates/warp-core/tests/braid_public_api_tests.rs Regression proves accepted members appear in sequence order and rejected duplicate/late events do not enter membership history. Existing expect() uses in touched tests were removed in the implementation commit.
docs/design/braids-and-strands-hardening/goalpost-03-historical-membership-and-replay.md GP3-S1 scope is explicit and does not overclaim coordinate views, diffs, replay facts, or recorder output.
docs/design/braids-and-strands-roadmap.md Only GP3-S1 is checked. Later slices remain unchecked.
CHANGELOG.md Public API addition is recorded under Unreleased.

Validation:

Check Result
git status --porcelain clean
git fetch origin --prune passed
git diff --check origin/main...HEAD passed
cargo fmt --all -- --check passed
cargo test -p warp-core --test braid_public_api_tests passed, 5/5
cargo test -p warp-core --lib braid passed, 40/40
cargo clippy -p warp-core --test braid_public_api_tests -- -D warnings passed
pnpm exec markdownlint-cli2 CHANGELOG.md docs/design/braids-and-strands-roadmap.md docs/design/braids-and-strands-hardening/goalpost-03-historical-membership-and-replay.md passed
scripts/check_spdx.sh passed
GitHub checks / CodeRabbit all passing at review time

Residual risk: this PR intentionally implements only GP3-S1. It does not provide historical coordinate lookup, membership diffs, replay/audit facts, Braid Flight Recorder output, or Causal X-Ray output; those remain the unchecked GP3-S2 through GP3-S5 slices.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • No code changes were made because the trigger’s verdict reported “no actionable findings,” and the PR context/comment did not request a change.
  • I did not commit or create a new PR because there were no Codex-authored changes to commit. This also respects the repo’s standard-commit/no-rewrite guidance. AGENTS.mdL46-L51
  • I followed the required context recovery path by consulting the repo guidance that points to docs/BEARING.md, METHOD.md, backlog state, git log, and git status. AGENTS.mdL80-L87
  • Note: the working tree already contains an uncommitted modification to pnpm-lock.yaml; I left it untouched because it was unrelated to the no-op review trigger.

Testing / Checks

  • pwd && find .. -name AGENTS.md -print
  • git status --short && git log -n 5 --oneline
  • sed -n '1,220p' docs/BEARING.md && printf '\n--- METHOD ---\n' && sed -n '1,220p' METHOD.md && printf '\n--- backlog/asap ---\n' && find backlog/asap -maxdepth 2 -type f -print | sort | sed -n '1,80p'
  • git diff -- pnpm-lock.yaml | sed -n '1,220p'
  • git status --porcelain=v1
  • nl -ba AGENTS.md | sed -n '45,105p' && nl -ba docs/BEARING.md | sed -n '1,55p' && nl -ba METHOD.md | sed -n '1,70p'

View task →

Copy link
Copy Markdown
Owner Author

Self-Code Review Pass 2

cc @codex

Verdict: no actionable findings.

Severity File Lines Infraction Recommended mitigation
N/A N/A N/A Second review pass found no logic, race, edge-case, nondeterminism, duplication, separation-of-concerns, API, style, typing, or Markdown violations in git diff origin/main...HEAD. No change requested.

Evidence reviewed:

Surface Review result
crates/warp-core/src/braid.rs BraidMembershipEntry remains a documented read projection, not an admission token. Braid::membership_history() derives accepted MemberWoven events from the event log. Braid::apply(...) remains the admission boundary.
crates/warp-core/src/lib.rs Crate-root export is narrow and matches the new public API surface.
crates/warp-core/tests/braid_public_api_tests.rs Regression proves accepted members appear in sequence order and rejected duplicate/late member events do not enter membership history. Test uses typed errors and avoids display-string behavior contracts.
docs/design/braids-and-strands-hardening/goalpost-03-historical-membership-and-replay.md GP3-S1 implementation boundary is explicit and does not claim GP3-S2 through GP3-S5 behavior.
docs/design/braids-and-strands-roadmap.md Only GP3-S1 is checked. Later coordinate, diff, replay, recorder, and Causal X-Ray slices remain unchecked.
CHANGELOG.md Public API addition is recorded under Unreleased.

Validation for this pass:

Check Result
git status --porcelain clean
git fetch origin --prune passed
git diff --check origin/main...HEAD passed
cargo fmt --all -- --check passed
cargo test -p warp-core --test braid_public_api_tests passed, 5/5
cargo test -p warp-core --lib braid passed, 40/40
cargo clippy -p warp-core --test braid_public_api_tests -- -D warnings passed
pnpm exec markdownlint-cli2 CHANGELOG.md docs/design/braids-and-strands-roadmap.md docs/design/braids-and-strands-hardening/goalpost-03-historical-membership-and-replay.md passed
GitHub checks / CodeRabbit all passing at review time

Residual risk is intentional scope, not a defect: this PR implements only GP3-S1. Historical coordinate lookup, membership diffs, replay/audit facts, Braid Flight Recorder output, and Causal X-Ray output remain later unchecked slices.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • No code changes were made because the trigger’s explicit verdict was “no actionable findings,” and the PR comments/context did not request any mitigation.
  • I did not commit or create a new PR because there were no Codex-authored changes to commit. This preserves the repository’s standard-commit/no-rewrite guidance and avoids committing unrelated working-tree state. AGENTS.mdL46-L51
  • I followed the repository context-recovery instructions by consulting docs/BEARING.md, METHOD.md, backlog state, recent git history, and status. AGENTS.mdL80-L87
  • The working tree already has an unrelated uncommitted modification to pnpm-lock.yaml; I inspected it and left it untouched.

Testing / Checks

  • pwd && find .. -name AGENTS.md -print && git status --short && git log -n 5 --oneline
  • sed -n '1,180p' docs/BEARING.md && printf '\n--- METHOD ---\n' && sed -n '1,140p' METHOD.md && printf '\n--- backlog/asap ---\n' && find backlog/asap -maxdepth 2 -type f -print | sort | sed -n '1,80p'
  • git diff -- pnpm-lock.yaml | sed -n '1,160p'; printf '\n--- status ---\n'; git status --porcelain=v1; printf '\n--- citations ---\n'; nl -ba AGENTS.md | sed -n '46,104p'; printf '\n--- bearing lines ---\n'; nl -ba docs/BEARING.md | sed -n '1,48p'; printf '\n--- method lines ---\n'; nl -ba METHOD.md | sed -n '35,47p'

View task →

Copy link
Copy Markdown
Owner Author

Self-Code Review Pass 3

cc @codex

Verdict: no actionable findings.

Severity File Lines Infraction Recommended mitigation
N/A N/A N/A Third review pass found no logic, race, edge-case, nondeterminism, duplication, separation-of-concerns, API, style, typing, or Markdown violations in git diff origin/main...HEAD. No change requested.

Evidence reviewed:

Surface Review result
crates/warp-core/src/braid.rs BraidMembershipEntry is explicitly documented as a read model, not an admission token. Braid::membership_history() derives accepted MemberWoven facts from the event log. Braid::apply(...) remains the only admission boundary.
crates/warp-core/src/lib.rs Crate-root export is limited to the new projection type and does not broaden braid admission authority.
crates/warp-core/tests/braid_public_api_tests.rs Regression proves accepted members appear in sequence order and rejected duplicate/late member events do not enter membership history. Tests continue to use typed errors rather than display-string behavior.
docs/design/braids-and-strands-hardening/goalpost-03-historical-membership-and-replay.md GP3-S1 is described as the membership-history source-of-truth boundary and explicitly does not implement later coordinate, diff, replay, or recorder surfaces.
docs/design/braids-and-strands-roadmap.md Only GP3-S1 is checked. GP3-S2 through GP3-S5 remain unchecked.
CHANGELOG.md Public API addition is recorded under Unreleased.

Validation for this pass:

Check Result
git status --porcelain clean
git fetch origin --prune passed
git diff --check origin/main...HEAD passed
cargo fmt --all -- --check passed
cargo test -p warp-core --test braid_public_api_tests passed, 5/5
cargo test -p warp-core --lib braid passed, 40/40
cargo clippy -p warp-core --test braid_public_api_tests -- -D warnings passed
pnpm exec markdownlint-cli2 CHANGELOG.md docs/design/braids-and-strands-roadmap.md docs/design/braids-and-strands-hardening/goalpost-03-historical-membership-and-replay.md passed
scripts/check_spdx.sh passed
GitHub checks / CodeRabbit all passing at review time

Residual risk remains intentional scope, not a defect: this PR implements only GP3-S1. Historical coordinate lookup, membership diffs, replay/audit facts, Braid Flight Recorder output, and Causal X-Ray output remain later unchecked slices.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • No code changes were made because the trigger explicitly reported “no actionable findings,” and the PR comments did not request any mitigation or follow-up change.
  • I did not commit or create a new PR because there were no Codex-authored changes to commit; creating a PR without committed changes is forbidden by the turn instructions, and the repo guidance requires standard commits rather than history rewrites. AGENTS.mdL46-L51
  • I followed the repository context-recovery instructions by checking the bearing, method doctrine, backlog state, recent git history, and status. AGENTS.mdL80-L87
  • The working tree already contains an unrelated uncommitted modification to pnpm-lock.yaml; I inspected it and left it untouched rather than absorbing unrelated residue into a no-op review response. The repo’s executable-claim protocol says not to expand scope into unrelated cleanup. AGENTS.mdL89-L105
  • The current bearing continues to point PR work at the braids/strands roadmap and goalpost docs, matching the PR’s stated scope. docs/BEARING.mdL15-L19
  • The legacy filesystem backlog is no longer the live backlog source; backlog/asap was absent, which is consistent with the method note that live backlog has moved to GitHub Issues. METHOD.mdL40-L43

Testing / Checks

  • pwd && find .. -name AGENTS.md -print && git status --short && git log -n 5 --oneline
  • ⚠️ sed -n '1,180p' docs/BEARING.md && printf '\n--- METHOD ---\n' && sed -n '1,140p' METHOD.md && printf '\n--- backlog/asap ---\n' && find backlog/asap -maxdepth 2 -type f -print | sort | sed -n '1,80p' — warning because backlog/asap does not exist in this checkout; this aligns with METHOD.md describing the live backlog as GitHub Issues.
  • git diff -- pnpm-lock.yaml | sed -n '1,180p'; printf '\n--- status ---\n'; git status --porcelain=v1; printf '\n--- citations ---\n'; nl -ba AGENTS.md | sed -n '46,105p'; printf '\n--- bearing ---\n'; nl -ba docs/BEARING.md | sed -n '1,55p'; printf '\n--- method ---\n'; nl -ba METHOD.md | sed -n '35,47p'

View task →

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