Skip to content

docs(iam): WS event org filtering — intent, spec, plan (#3679) - #3683

Draft
olafkfreund wants to merge 24 commits into
mainfrom
docs/3679-ws-event-org-filtering
Draft

olafkfreund wants to merge 24 commits into
mainfrom
docs/3679-ws-event-org-filtering

Conversation

@olafkfreund

Copy link
Copy Markdown
Owner

Intent, spec and plan for #3679: org filtering on the /ws/events feeds in AIFactory, PFactory and TFactory.

What I measured: none of the three factories has a caller of send_to_org, so every /ws/events event was broadcast to every org.

The user decided (2026-11-07):

  • ship broadcast filtering first, and defer the multi-org cockpit key;
  • send org-less events only to the user who started them;
  • re-check acw_ keys every 5 minutes;
  • option A: acw_ key sockets are always confined to their org, and JWT sockets follow each factory's REST mode.

Reviews:

  • codex: confirmed findings fixed at each stage (intent 6 of 7, spec 6 of 7, plan 5 of 7).
  • agy: on the intent it restated the intent with no findings. On the spec it failed twice: "jetski: no output produced — a tool required the "command" permission that headless mode cannot prompt for, so it was auto-denied." On the plan, all its findings were refuted against the code.

Status: draft. Implementation was stopped by the user at the 16:01 deadline; see "Stopping point" in the plan. It builds on Factory#3680 (this branch is cut from it), so merge after it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1

olafkfreund and others added 24 commits November 7, 2026 14:48
Approved unseen by user 2026-11-07, bulk run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
Refs #312

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
…312)

Codex spec review: /ws/events broadcast/user scopes and TFactory's feed do
not filter by org for any principal, so 'never more than REST' was not
enforceable without a routing rewrite. State the enforceable boundary and
name the pre-existing gap. Re-approved unseen by user 2026-11-07, bulk run.

Refs #312

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
#312)

Reuse the REST principal builders, cover the rmux caller, independent WS
exception policy, delivery-level org test, name the unfiltered paths.

Refs #312

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
Approved unseen by user 2026-11-07, bulk run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
…-keys (#312)

Refs #312

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
Approved unseen by user 2026-11-07, bulk run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
Deviation found by the final Opus review: keys are org-bound at mint, so
membership in many orgs does not widen the cockpit's view.

Refs #312

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
…ltering (#3679)

TFactory lacks the #312 narrowing too; relay is Redis/Postgres/local per factory;
initiating-user option for auth events; revocation question; softer compat wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
…-filtering (#3679)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
Approved unseen by user 2026-11-07, bulk run wave 2. Owner decisions recorded in the previous commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
…ering (#3679)

Single delivery predicate (key org wins over org_ids), legacy broadcast relays
filtered, service-initiated logins, key sockets fail closed on user events,
notify_org org override, emitter-level tests. Shadow-mode question pending owner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
…ent-org-filtering (#3679)

JWT sockets follow REST mode (AIF strict; PF/TF strict only with
RBAC_ENFORCE_TASK_ROUTES); key sockets always strict; flag test added.
Residual: PF/TF shadow mode JWT users still receive unresolved events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
Approved unseen by user 2026-11-07, bulk run wave 2. Shadow-mode design choice (option A) made by the user 2026-11-07.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
…ering (#3679)

Endpoint-level and same-socket flag tests, cache/notify_org/raising-validator
cases, absolute venv paths for worktrees, honest TF scope and rollback.
agy findings checked against code: all refuted (see PR).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1
Approved unseen by user 2026-11-07, bulk run wave 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WtDyDqabJ8SR4gD3ubwYx1

This branch has not been deployed

No deployments
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