Skip to content

org: ship-ready test round fixes (removal, reconnect, shared areas) - #2912

Merged
AbirAbbas merged 8 commits into
org/mainfrom
org/test-round
Nov 25, 2026
Merged

AbirAbbas merged 8 commits into
org/mainfrom
org/test-round

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

What this is

The server-side layers of the ship-ready test round on the organization line: the keyless Compose smoke, a hand run of the
terminal client against the stack, a hostile websocket client, sandbox-escape probes through a chat's own tool path (with a
control that succeeds for every probe), the reuse of a Linux user after a chat is deleted, and spend caps under concurrent
calls. Four real defects came out of it and are fixed here, each in its own commit with a test written from the behaviour;
a fifth commit corrects a stale assertion in the smoke test. The harnesses and the evidence are not in this pull request.

Defects fixed

  • Removing a person left their chats' model and git access alive for up to seven days. DELETE /v1/people/{handle}/sessions
    ended sign-ins and bots, but a hosted chat holds a minted bearer of its own, so a removed person's chat kept spending the
    organization's model key and reaching git as them. Now removal ends those bearers first (in this process), forgets the
    person's stored provider keys, and deletes their chats on the chats' host, forgetting each registry row only once the host
    confirms. A host that is down never blocks a removal.
  • A removed person's chat that the chats' host could not delete could still be woken by a guest. With the host down during a
    removal, the chat and its shares stayed, and a guest holding edit could attach and wake it, which mints a fresh model
    bearer for its removed owner. Now every chat the registry still holds for a removed person has its shares ended and is made
    private, so every door answers There is no such chat.; the row stays tracked, and removing the person again once the host
    answers deletes it.
  • A reconnect right after a connection ended could be refused as "unavailable". The sessionhost cancelled the finished
    connection before it left the chat's group, so a reconnect in that window read as a chat being stopped.
  • A deleted, stopped or recycled chat's files and System V objects stayed readable to the next chat on the same Linux user.
    /tmp, /dev/shm and /var/tmp are writable by design and only the chat's own folder was cleared. Every mode of the reap
    helper now also removes what the chat's user left there, as that user and without following links.
  • The smoke test's list-row check still expected the key set from before rows carried verbs.

Validation Contract

  • When the operator removes a person, the model door refuses the bearer of every chat they owned at once; another person's chat
    keeps its access; their chats are gone from the host and the registry; their stored keys are forgotten; a host that is down
    does not stop the removal; a chat the host could not delete is closed to everyone, guests included.
  • A connection that has just ended never makes the next attach to the same chat fail.
  • After a chat is stopped, deleted or started afresh, nothing owned by its Linux user is left in /dev/shm, /tmp, /var/tmp
    or the System V tables; nothing owned by another user is touched; a link is never followed; every reap mode sweeps.
  • A chat's list row for a person it is shared with carries exactly the verbs that person holds.

Each test names the item it checks, and the removal and sweep tests carry a control that succeeds before the change they test.

What was run

  • The keyless Compose smoke on this head, from a fresh stack with a source-built binary: 261 checks, 0 failures.
  • A hand run of the terminal client against the stack (operator claim and invites, a hosted chat shared at view, steer and
    edit, a revoke mid-session, a bot, spend and audit rows naming the asker, a personal home that shows no organization chat).
  • A raw websocket client against the live server (267 checks, 0 failures after the fixes, 6 before), sandbox-escape probes through
    a chat's own tool path, each with a control that succeeds with the protection off, Linux user reuse after a chat is deleted, and
    concurrent spend against the per-chat cap and the monthly limit.
  • Each fix was proven on the stack before and after, and each new test fails with its fix reversed.
  • make pr-ready BASE=origin/org/main on this head passes. One test, TestFactorySetupContinueEndsReadingWithoutWatchingUnreadRepos,
    failed on this branch and on org/main itself under load, so the gate reports it as already failing on the base.

The stack results and the harnesses live in the lane's notes, not in this pull request.

Not in this pull request

No documentation was edited. The notes list the doc corrections and the open calls for the owner.

🤖 Generated with Claude Code

AbirAbbas and others added 8 commits November 24, 2026 23:34
…cess

DELETE /v1/people/{handle}/sessions ended sign-ins and bots, but a hosted chat
holds a minted bearer of its own, valid for seven days. A removed person's chat
kept spending the organization's model key and reaching git as them, and their
stored provider keys and chats stayed behind.

Removal now ends those bearers first, in this process, then forgets the
person's sealed keys, then deletes their chats on the chats' host. A registry
row is forgotten only once the host confirms the delete (or answers that the
chat is not there); a host that is down never blocks the removal. The
revoke-link loop does the same for the people it removes.

Found by the hostile-client round (a bearer replayed after its owner was
removed still got a 200 from the model door).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…next attach

finishWire cancelled the finished connection before taking the lock that
removes it from the chat's group. For as long as it waited for that lock the
connection was "cancelled and still in the group", which reserveWire reads as
"the chat is being stopped", so a reconnect in that window got 503 "This chat
is unavailable right now." (a guest saw "The place chats run on is not
answering.").

The cancel now runs after the removal.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
/tmp, /dev/shm and /var/tmp are writable by every chat by design, and the reap
helper cleared only the chat's own folder. After the 24 hour quarantine a new
chat on the same Linux user found the old chat's files, FIFOs, shared memory,
message queues and semaphores, owned by "itself".

Every mode of the reap helper (clear on delete, tmp on stop, init on start) now
also removes, as the chat's own user and without following links, everything
that user owns in those three areas and every System V segment, semaphore set
and message queue it owns or created.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Rows of GET /v1/hosted/sessions carry `verbs` since 527bf1f, and the smoke
test still asserted the old key set. A shared row now asserts the verbs
['view'], the operator's metadata-only row asserts none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… to everyone

When the operator removed a person while the chats' host was down, the person's
chats were not listed, so their registry rows and shares stayed, and a guest
holding edit could still attach and wake one. Waking a chat mints a fresh model
bearer for its owner, which is the access the removal had just ended.

Every chat the registry still holds for a removed person now has its shares
ended and is made private, so every door answers "There is no such chat." The
row stays, so the chat is still tracked and removing the person again once the
host answers deletes it. The host calls also stop after the first transport
error, so a hung host does not make a removal wait once per chat.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… leftovers are cleared

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@AbirAbbas
AbirAbbas merged commit 43373a5 into org/main Nov 25, 2026
22 checks passed
@AbirAbbas
AbirAbbas deleted the org/test-round branch November 25, 2026 06:59
AbirAbbas added a commit that referenced this pull request Nov 25, 2026
…ack (#2903)

The hosted organisation line: a team-mode org server deciding every request through one access model (verbs, roles, grants and policy in SQLite), hosted chats run by the sessionhost under a per-chat uid inside a Landlock fence with minted model bearers, sealed keys and a git helper, shared chats acting through verbs, bots owned by their creator, the Hosting and chats policy settings, and a self-hosting stack (deploy/org Docker Compose, published images behind a leak gate, a Railway path).

Consolidates #2894 #2895 #2896 #2898 #2899 #2900 and the follow-ups #2904 #2905 #2907 #2908 #2910 #2911 #2912 #2913 #2915 #2916 #2918 #2927 #2936 #2944. Proven by the full suite, a keyless Compose smoke, a hostile wire client, sandbox escape probes, a real-model run and a production-style install from the published images.

Co-Authored-By: Santosh kumar <29346072+santoshkumarradha@users.noreply.github.com>
Co-Authored-By: ZeroPoint95 <329227198+ZeroPoint95@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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