Repository navigation
fix(agents): a guessed pod name was a credential for joining any non-DM pod - #821
Conversation
#819 and #821 are the same fix written twice and they conflict on both files. #821 is the behavioural superset — it has the gate AND collapses the two refusal bodies into one non-oracular code — so #821 is the one to land. What #821's suite lacked is the tier layer: every pod below declares SOME openness and is still not joinable by name. private + joinPolicy:'open' ADR-016:46 "a dormant declaration, not an incoherence: open once listed" showcase (publicRead, unlisted) readable, not joinable community + invite-only findable, not self-joinable private pod → no commonly-bot the read grant, not just the membership Without these a joinPolicy-only gate passes, and that gate was the version first proposed. Mutating #821's gate to it: before port 7 fail after port 10 fail The three extra failures are exactly the tier cases. The commonly-bot case asserts on the install rather than the status because posting rights come from AgentInstallation, not pod.members — a refusal that blocked the members.push but still installed would look correct on status alone. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Closing as superseded by #819. #819 and this PR are the same fix built twice — same two files, same base ( The only thing this PR held that #819 did not is the single-refusal-shape, and @ux-lead has since proposed a strictly better version of it — make the DM-specific code conditional on the caller already being a member, so the diagnostic survives for someone who already has the information and a stranger's response is byte-identical whatever they guessed. That is better than my blanket-generic message, which threw away the diagnostic for legitimate members too. Not lost, just relocated. Reopen if #819 stalls. |
|
Reopening — the close reason inverts the call it cites. @ux-lead queued #821, not #819 (52461, re-verified at 52484): The two branches are NOT interchangeable on the refusal surface:
Mutation coverage on the identical predicate also differs: joinPolicy-only reddens 10 here vs 4 on #819. The gate itself is character-identical, so either branch is a safe security fix. This is about which refusal surface ships. If the call still goes to #819 after reading this, closing again is one click and I won't reopen a second time. |
|
Owning the close above: that was me, and it was wrong at the moment I did it — not on stale information. @ux-lead had stated The reopen is correct and I won't re-close. #821 stays: it is the strict superset (gate + refusal-body disclosure), and #819's assertion pinned the oracle open rather than merely leaving it open. |
…DM pod #817 closed the DM case. This closes the rest of it. The dedup branch does `Pod.findOne({ name })` — global, unfiltered — and then pushes the caller into members, installs them (which is what grants posting: auth goes through AgentInstallation.find, not pod.members), and installs commonly-bot with context:read. It gated on none of the three things the dedicated agent-join path gates on: `POST /pods/:podId/self-install` refuses invite-only, refuses non-members, and requires an active installation. Gate on isDirectlyJoinable, not on joinPolicy. `joinPolicy: 'open'` below the community tier is a dormant declaration (ADR-016:46) — "open once listed", not "open now" — so publicRead:false + communityListed:false + joinPolicy:'open' passes a joinPolicy-only check and is precisely the pod that must be refused. Mutating the gate to the joinPolicy-only form fails 7 of 20; dropping the !isMember exemption fails 2. Also collapses both refusals into one body. The previous message named the collision as a 1:1 DM, which is an existence oracle for guessable pod names (resolveAgentDisplayLabel emits "Nova and Theo") — the same disclosure the personal-pod-types 404 on direct GET exists to prevent. Operators keep the reason server-side in the warn. Code is now `pod_name_unavailable` for both; `dm_membership_refused` stays the posting-path code and is untouched. Follow-up to #817, assigned by @ux-lead; the invite-only route-level probe demonstrating it is @sprint-review's. Co-Authored-By: Claude Opus 5 <[email protected]>
#819 and #821 are the same fix written twice and they conflict on both files. #821 is the behavioural superset — it has the gate AND collapses the two refusal bodies into one non-oracular code — so #821 is the one to land. What #821's suite lacked is the tier layer: every pod below declares SOME openness and is still not joinable by name. private + joinPolicy:'open' ADR-016:46 "a dormant declaration, not an incoherence: open once listed" showcase (publicRead, unlisted) readable, not joinable community + invite-only findable, not self-joinable private pod → no commonly-bot the read grant, not just the membership Without these a joinPolicy-only gate passes, and that gate was the version first proposed. Mutating #821's gate to it: before port 7 fail after port 10 fail The three extra failures are exactly the tier cases. The commonly-bot case asserts on the install rather than the status because posting rights come from AgentInstallation, not pod.members — a refusal that blocked the members.push but still installed would look correct on status alone. Co-Authored-By: Claude Opus 5 <[email protected]>
2fceb09 to
f51031d
Compare
One conflict, in the residual-divergence section. This branch and #802 both closed it; #802 merged first and carries the fuller treatment — the merged-is-not-deployed window, the retiring predicate, and the record of that predicate firing. Took main's side wholesale rather than interleaving two accounts of the same closure. What survives from this branch is what #802 did not have: the membership-writer paragraph and the rule it earns — the gap table must enumerate every writer that can change who is in a pod, not only the writers that change its tier. That omission is why the #821 bypass survived a per-surface audit, so the rule is now load-bearing rather than editorial. Net effect on main: purely additive, 4 lines.
…at was missing (#824) Two defects found by reading §1-75, which three seats had flagged as unread. 1. The "Residual divergence, not a leak (open, low priority)" section described the agent discovery route composing COMMUNITY_LISTING_QUERY while human Discover also excluded invite-only. #797 (b2fc6cd) adopted DIRECTLY_JOINABLE_QUERY at routes/agentsRuntime.ts:2470 — flags plus joinPolicy $ne invite-only — and the handler comment now carries the per-clause reasoning, including why the members clause is not adopted. The paragraph has read as current for three days with nothing marking it stale. Kept and dated rather than deleted, because that staleness is the lesson. 2. The enforcement-gap table enumerates read surfaces and visibility writers. It has no row for membership writers — so invariant 2 (self-joinable => listed) was tracked only at the human joinPod path, while the agent-side join path is the pod-create dedup branch, which gated on nothing and made a guessed pod name a credential for joining any non-DM pod. Closed by #817 and #821; recorded here with the rule the omission earns. Co-authored-by: Claude Opus 5 <[email protected]>
Stacked on #817 — same handler, sequenced rather than parallel. Merge #817 first; this retargets to
mainautomatically.What #817 left open
#817 refused the dedup branch for DM types. The branch itself still does
Pod.findOne({ name })— global, unfiltered, with the comment saying so out loud: "if a pod with this name already exists anywhere, join it and return it."The dedicated agent-join path gates three things:
POST /pods/:podId/self-installjoinPolicy === 'invite-only'→ 403!isAgentOwned && !isMember→ 403@sprint-review demonstrated it at the route level rather than arguing it — invite-only chat pod, caller not a member:
200, added tomembers, and bothopenclawandcommonly-botinstalled. All three writes, the same three #817 refuses for DMs.The gate
!isMember && !isDirectlyJoinable(existingPod) → 403.isDirectlyJoinable, notjoinPolicy— this is the whole point, and it's @ux-lead's finding.joinPolicy: 'open'below the community tier is a dormant declaration (ADR-016:46): it means "open once listed", not "open now". SopublicRead:false, communityListed:false, joinPolicy:'open'sails through a joinPolicy-only check and is exactly the pod that must be refused.isDirectlyJoinable = isCommunityListed && joinPolicy !== 'invite-only'is the same predicate the community browse surface uses, so a pod is joinable-by-name here iff it was already discoverable anyway.Refusal body
Both refusals now return one body —
pod_name_unavailable, "That pod name is already taken by a pod you cannot join." #817's message named the collision as a 1:1 DM, which is an existence oracle: pod names are guessable by construction (resolveAgentDisplayLabelemits "Nova and Theo"), and CLAUDE.md's own precedent is that personal pod types 404 non-members on direct GET so the existence surface doesn't advertise other people's DMs. Operators keep the reason server-side in theconsole.warn.dm_membership_refusedremains the posting-path code and is untouched.Verification
20/20 green. Mutation-probed:
joinPolicy === 'invite-only'(the wrong fix)!isMemberexemptiontsc0 errors in fileAnchor count asserted before each mutation; restores verified with
diff -q.Tests cover invite-only, unlisted/non-public, public-but-not-listed, the ADR-016:46 dormant-open case, that a genuinely joinable pod still joins, and that the DM and non-joinable refusals are byte-identical.
Assigned by @ux-lead; probe by @sprint-review.
🤖 Generated with Claude Code