GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(id/groups): let the membership layer arbitrate removals tangled in concurrent removals (#3787) by dezren39 · Pull Request #3871 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 1, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

What

Fixes #3787: voiding_scenarios fails 3 of 12 in the id package's nix checkPhase at main — test_s2_mutual_removal_removes_both, test_s2_concurrent_re_add_is_voided, test_s2_three_cycle_removes_every_member — which cascades to the toplevel and blocks nixos-rebuild switch (and with it the code#3720 fold activation).

One file changes: pkgs/id/src/groups/fold.rs (+56/−2).

Root cause

Not a sandbox/environment effect: the same three tests fail identically under a host cargo test on the laptop, at the identity arrival order. It is a logic divergence introduced when #3725 wired the groups fold into the event store's resolution as a gate and roster source.

The fold's member judge (Engine::member) evaluates a removal against the state built by the canonically earlier events. For removals tangled in concurrent removals, that sequential view is the wrong one — the membership layer is the design's authority on strong-remove concurrency (resolve.rs rule 2: it judges authority at an operation's causal position, with the resolver's mutual-removal exemption and cycle handling), and it passes these exact scenarios standalone (membership_scenarios). Measured fold verdicts for the failing scenarios:

  • Mutual removal — B's removal of A: Refused(NotActive), because A's concurrent removal of B had already committed in canonical order. Fold roster {A, C} instead of {C}.
  • Three-cycle — C's removal of A: Refused(NotAdmin), the creator-Admin policy firing on an author whose standing is a concurrent-removal tangle. Fold roster {A, C} instead of {}.
  • Concurrent re-add — C's removal of B: Refused(NotAMember), because A's concurrent removal of B struck first; that refusal then poisoned the dependent re-add's frontier in the fold's own layer (Membership(Invalid("attempted to add a member who is already active"))). Fold verdict for A's removal also fed back into the store layer, flipping applied flags.

Fix

In Engine::member, a removal in a non-friendship group whose author or target is named by another removal concurrent with it — neither in the other's causal past — is handed to the membership layer as a plain decision, with none of the judge's current-state pre-checks (NotActive / NotAMember / NotManager / NotAdmin). The layer arbitrates the tangle. manage_chain still applies afterwards (it already judges at the event's position).

The discriminator is true concurrency, so the pinned #168 policy behaviors are untouched:

  • A manager's unilateral removal of an Admin is still refused (the Admin's answering removal is causally later, not concurrent) — test_a_fold_refused_removal_does_not_strip_the_admins_authority and the rest of the ingest gate tests pass.
  • Role changes stay Admin-only; friendships keep their dissolve path (deferral is scoped to non-friendship groups).

Verification (host, laptop)

  • cargo test --test voiding_scenarios: 12 passed, 0 failed (was 9/3).
  • cargo test --lib: 1678 passed, 0 failed — includes the groups fold/delegation/friendship suites and the event-store fold-gate tests.
  • cargo test --test membership_scenarios --test voiding_properties --test production_ingest --test content_removal: all pass.
  • cargo fmt --check: the changed file is clean.
  • Nix build of #id-web with checkPhase: verification in progress on the laptop; results will be posted here and on build(id): voiding_scenarios tests fail at main — nixos-rebuild switch cannot complete (blocks code#3720 fold) #3787 (build run twice, the failure class is concurrency-flavored).

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Muse Sweep
fix(id/groups): let the membership layer arbitrate removals tangled i…
fea193a
…n concurrent removals (#3787)

Since the groups fold was wired into the event store's resolution
(#3725), its member judge has pre-empted the membership layer on
concurrent removals: it judges a removal against the state built by
the canonically earlier events, so the second half of a concurrent
removal tangle is refused by whichever side the ID order struck
first — NotActive for a removed author (mutual removal), NotAdmin
for a removal of the creator by a concurrently removed manager
(three-cycle), NotAMember for a target a concurrent removal already
struck (concurrent re-add, whose refusal then corrupts the dependent
re-add's frontier in the fold's own layer). The fold's roster and
voiding verdicts then disagree with the S2 outcomes the membership
layer reaches on its own, and voiding_scenarios fails 3 of 12 in the
nix build's checkPhase, blocking nixos-rebuild switch.

A removal in a non-friendship group whose author or target is named
by another removal concurrent with it — neither in the other's
causal past — is now handed to the membership layer with none of the
judge's current-state pre-checks; the layer judges authority at the
operation's position and arbitrates the tangle. Unilateral removals
keep every existing check: a manager's removal of an Admin is still
refused, because the Admin's answering removal is causally later,
not concurrent.
@dezren39
dezren39 requested a review from a team as a code owner November 1, 2026 17:17
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 86f359c3-2083-4199-963a-224751460ce7
Commits

Reviewing files that changed from the base of the PR and between 064ce9e and fea193a.

Files selected for processing: 1
  • pkgs/id/src/groups/fold.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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
  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T17:21:07.971737Z fea193a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Nov 1, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fea193a497

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/id/src/groups/fold.rs
Comment on lines +934 to +935
if entangled {
return Ok(Decision {

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 1, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve Admin protection for concurrent removals

When two non-Admin managers concurrently remove the same Admin, removal_entangled returns true for both because they share a target, and this early return bypasses the NotAdmin guard below. Neither downstream layer restores that protection: manage_chain checks only Manage authority, and the membership layer represents Admin as Manage (access_level/access_for). Consequently, managers can remove an Admin simply by issuing concurrent removals, even though either removal alone is forbidden. Preserve the Admin-versus-manager restriction at the operation's causal position instead of dropping it for every entangled removal.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/id/src/groups/fold.rs
Comment on lines +1021 to +1022
&& !causal_past(by_id, &other.after).contains(&event.id)
&& matches!(removed_member(other), Some(target) if target == event.author || target == member)

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 1, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Filter removal candidates before traversing their ancestry

For a group with one early removal followed by N causally chained policy events, this predicate rebuilds the complete causal past of every subsequent policy event before checking whether it is even a removal. Those descendants pass !past.contains(&other.id) because past belongs to the earlier removal, and causal_past traverses the whole chain before testing containment. This adds approximately N²/2 ancestor visits per fold round—about 50 million for 10,000 later events—even though there are no other removals to entangle. Check removed_member(other) and the matching target before computing its ancestry so unrelated group events do not introduce this quadratic replay cost.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39 dezren39 mentioned this pull request Nov 1, 2026
build(id): voiding_scenarios tests fail at main — nixos-rebuild switch cannot complete (blocks code#3720 fold) #3787
Closed
@dezren39

dezren39 commented Nov 1, 2026

Copy link
Copy Markdown
Member Author

Nix verification complete — both runs green

  • Build test #1 (nix build .#id-web, laptop): succeeded. checkPhase log: 41 test suites ok, 0 failed; test_s2_mutual_removal_removes_both, test_s2_three_cycle_removes_every_member, and test_s2_concurrent_re_add_is_voided all ok. Output: /nix/store/qhnanvlf9sh3qy572ip6w00m2q5040x2-id-0.1.0.
  • Build Bump checkmarx/ast-github-action from 2.0.11 to 2.0.18 #2 (nix build .#id-web --rebuild): full re-execution of build + checkPhase — 41 ok, 0 failed again, and the rebuild reproduced the identical output path (deterministic).
  • Full root-cause + verification writeup posted on build(id): voiding_scenarios tests fail at main — nixos-rebuild switch cannot complete (blocks code#3720 fold) #3787.

Pre-existing red checks (unchanged by this PR, no findings in groups/fold.rs): id-clippy-lint fails at main on deny-level lints in web/markdown.rs:311, web/world_ws.rs:208, world/tests.rs:1569, web/identity.rs:984 (tracked in #2401); id-rustfmt-check reports diffs in 16 files at main, none of them touched here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 merged commit 2250410 into main Nov 1, 2026
1 check passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the fix/id-voiding-scenarios-3787 branch November 1, 2026 19:19
This was referenced Nov 1, 2026
build(id): id-core lib test cannot find crate vt100 — nixos-rebuild switch cannot complete (blocks code#3720 fold) #3951
Closed
build(id): two test failures at main — stale shell-contract v1.3 expectation + sqlx-sqlite back in the lock (blocks code#3720 fold) #4015
Closed
Fold script-installed laptop user units into the flake (github-backup, worktree-reaper, quota exports, dashboard-backup, oc-password-sync) #3720
Closed
id: build: stable note identity and revision graph #3814
Closed
@dezren39 dezren39 mentioned this pull request Nov 21, 2026
Closure audit: every closed issue/PR verified; unmerged branches + unpushed worktrees inventoried #7079
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

build(id): voiding_scenarios tests fail at main — nixos-rebuild switch cannot complete (blocks code#3720 fold)

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.