ALL-1989 PR #12706 follow-up: guarded predicate variant + auth verification + CI watch
completedAgent: seph-engineer
Priority: 1
Branch:
wintermute/all-1989-device-filter-es-translationPR: #12706
Linear: ALL-1989
Seph's 14:36 UTC security review on PR #12706 raised three non-blocking observations. He approved shipping a follow-up commit on the same PR (his 14:45 UTC reply: 'Ship as a follow-up commit on this PR'). Work:
1. EXPOSE deviceFilterPredicateToEsGuarded in domains/device/src/services/monitor/deviceFilterPredicateToEs.ts that returns [{ match_none: {} }] when input is empty (instead of fail-OPEN current behavior). Update the docstring on the existing deviceFilterPredicateToEsClauses to NOT bless fail-open — make it clear callers MUST layer a match_none guard if they use the raw variant. Update unit tests in deviceFilterPredicateToEs.test.ts to cover the new guarded variant.
2. VERIFY observation #2: preview path in monitorService.ts builds boolQuery.filter = clauses.filter directly. Read the preview resolver upstream to confirm input.workspaceId is auth-validated before reaching this code. If yes: post a one-line ack in the PR security review thread (or PR comment) noting the upstream auth check. If no: that becomes a real finding, escalate via Slack thread to Seph before merge.
3. ACK observation #3 in the PR thread (the (t as unknown as Record<string,unknown>).targetFilter cast in evaluator.ts) — no code change needed, just confirm we'll drop the cast on next Prisma regen.
4. Local checks per ~/shared-knowledge/POST-PUSH-PROTOCOL.md before push.
5. PUSH to branch wintermute/all-1989-device-filter-es-translation.
6. WATCH CI through terminal state (every gate reports green/red). Specifically: test-device-domain, DeepSource JS, DeepSource coverage, build, Apollo. Note: the 'reconcile missing path-excluded statuses' check is currently failing across the repo (MODULE_NOT_FOUND on .github/scripts/required-status-reconciler.mjs) — that is CI infra unrelated to our changes; not a blocker.
7. POST progress event with final terminal CI state. If green: ONE post in the existing PR thread (1782398490.871299 in #wintermute-seph C0B1AFH70K1) with the new commit SHA + green confirmation + ack of observation #2 result + ack of observation #3. If red: fix and re-push, repeat watch.
DO NOT merge. Seph holds the merge button (MEMORY.md MERGE POLICY).
Current HEAD: 67eab7dd (doc-only commit already pushed at 14:49 UTC, in flight). The guarded-variant commit will be on top of that.
Linear: ALL-1989. PR: https://github.com/TextureHQ/mono/pull/12706. Slack thread root ts: 1782398490.871299 in C0B1AFH70K1.
Event Timeline
created
progress
Pushed 3d12b5869f to wintermute/all-1989-device-filter-es-translation. Added deviceFilterPredicateToEsClausesGuarded (fail-closed match_none on empty input), updated docstring to stop blessing fail-open, refactored targetResolver DEVICE_FILTER arm to call guarded variant, added 4 unit tests. Observation #2 verified: monitorPreview resolver calls authorizeWorkspaceRead before previewMonitor — input.workspaceId is auth-validated upstream. Observation #3: Prisma cast becomes redundant on next regen, no code change. Local tsc + biome clean on changed files. Jest blocked locally by pre-existing worktree Prisma client init failure — same failure on HEAD before changes; relying on CI test-device-domain. CI watch active on 3d12b5869f.
progress
CI terminal GREEN on 541629d8 (merge of main into branch on top of 3d12b5869f). All material gates green including reconcile path-excluded statuses (which now finds the script after the merge-in pulled in #12681 + #12770). Bugbot NEUTRAL. Posted single ready-for-merge confirmation in PR thread 1782398490.871299 at 15:39Z. Seph holds merge button — task body satisfied (steps 1-7 done).
status_change
PR #12706 merged 2026-06-25T16:01:43Z by sephcoster (merge commit 3817468185424b41ee525a7a341968e9390f5f10). Guarded fail-closed predicate variant shipped on 3d12b5869f, terminal CI green on 541629d8. Obs #2 verified upstream. Obs #3 ack as no-op. Seph approved + merged at 16:01:34Z.
status_change
in_progress → completed