feat: scope file-event triggers to a specific oCIS space#31
Open
LukasHirt wants to merge 10 commits into
Open
Conversation
Wires up the existing but dead event.filters.spaceId field end to end: a new /me/spaces endpoint backed by oCIS's Graph API, persisting SpaceID through the trigger index, matching it in the SSE handler, and a space picker in the trigger config UI. Signed-off-by: Lukas Hirt <info@hirt.cz>
Eight-task plan: oCIS client + API model, the /me/spaces endpoint, persisting SpaceID through the trigger index (closing an existing bug where it's silently dropped), SSE-handler matching, backend and frontend e2e coverage, and the space picker UI, per the approved design spec. Signed-off-by: Lukas Hirt <info@hirt.cz>
Signed-off-by: Lukas Hirt <info@hirt.cz>
Signed-off-by: Lukas Hirt <info@hirt.cz>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Lukas Hirt <info@hirt.cz>
Signed-off-by: Lukas Hirt <info@hirt.cz>
… triggers Signed-off-by: Lukas Hirt <info@hirt.cz>
Signed-off-by: Lukas Hirt <info@hirt.cz>
Signed-off-by: Lukas Hirt <info@hirt.cz>
Signed-off-by: Lukas Hirt <info@hirt.cz>
LukasHirt
force-pushed
the
feature/event-trigger-space-scope
branch
from
July 24, 2026 21:06
8721660 to
6b07942
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Lets a user optionally restrict a file-event trigger (upload/move/share/lock) to fire only for events originating in one specific oCIS space, instead of matching across every space they have access to.
This closes a real pre-existing bug:
event.filters.spaceIdwas already declared in both the frontend type and the backend'sEventFiltersmodel, but was silently dropped before persistence and never matched — setting it via the raw API looked like it worked while doing nothing.ocisclient.ListDrivesproxies oCIS's Graph API (GET /graph/v1.0/me/drives), exposed through a newGET /me/spacesendpoint that filters outdriveType == "virtual"(the aggregate "Shares" pseudo-space).SpaceIDnow correctly persists through the trigger-index storage and is matched in the SSE handler alongside the existing path-prefix/extension filters.Full design rationale:
docs/superpowers/specs/2026-07-24-event-trigger-space-scope-design.mdImplementation plan:
docs/superpowers/plans/2026-07-24-event-trigger-space-scope.mdNote for anyone with an existing workflow that already had
spaceIdset via the raw API: it was previously silently ignored (matching all spaces); after this merges, it will start being enforced the next time that workflow is saved. This is the intended fix, not a regression.Test plan
go build ./... && go vet ./... && go test ./...(frombackend/) — all green, including new unit tests for the trigger-index persistence fix and the SSE space-matching logic.go test -tags=e2e ./tests/e2e/..., real oCIS instance):GET /me/spacesreturns real space data, and a real upload correctly fires a workflow scoped to the exact space it landed in — proving the Graph API's drive id and the SSE event'sspaceidare the same value in practice, not just in theory.pnpm test:unit && pnpm check:types && pnpm lint— all green.pnpm test:e2e) — all 4 specs green, including an extendedevent-trigger.spec.tsthat picks a space, saves, reloads, and confirms it persisted.🤖 Generated with Claude Code