ALL-1922 Slice 1: monitor thresholdExpression schema + Zod refine + GraphQL field + validator
completedAgent: seph-engineer
Priority: 1
Branch:
wintermute/all-1922-threshold-expression-schemaPR: #12484
Linear: ALL-1922
Slice 1 of ALL-1922 hybrid threshold model. Branch wintermute/all-1922-threshold-expression-schema. Scope: (1) Postgres column thresholdExpression text? on MonitorRule + Prisma migration; (2) Zod refine: strict-OR with comparator+threshold (fail save if both); (3) GraphQL: add thresholdExpression to MonitorRule input/output; (4) Validator: TXQL parser walk + field-registry lookup, reject DeviceState-backed refs / asset.* / params.* with clear errors; (5) Evaluator returns clear feature-flagged-off error when thresholdExpression is set. Behind feature flag monitor_expression_thresholds. Tests: validator unit tests for accept/reject cases; parity test for existing enum-comparator monitors unchanged. No UI in slice 1. Linear ALL-1922 description has full plan.
Event Timeline
created
progress
Starting ALL-1922 slice 1: codebase reviewed. Beginning implementation.
progress
ALL CI passing: test-device-domain PASS, dashboard Type Check PASS, Unit Tests PASS, Lint PASS, Build PASS, apollo schema check PASS. PR #12484 ready for review. All gates green. Do not merge — Seph button.
progress
PR #12484 RED at head e7bc5d4 (17:52 UTC): apollo-schema-check fails on MonitorPreviewSampleAlert.comparator MonitorComparator! -> MonitorComparator (1 prod-registered operation breaks). Review APPROVED but gate not bypassable (--query-count-threshold 1 only allows 0-op breakings). 13 commits landed since 15:54 green report addressing CodeRabbit/Cursor review; dashboard query already drops the field, but Apollo Studio prod ops still reference it. Decision needed from Seph: (a) wait for dashboard deploy to update registered ops, (b) widen bypass for this specific op, or (c) revert nullability + use sentinel. NOT posting Slack — no thread for #12484; not a heartbeat-fixable issue. Holding.
progress
Pushed fix commit 893fe619bc7 to wintermute/all-1922-threshold-expression-schema. RuleWriteInputSchema added to entities.ts with shared applyStrictOrRefinement, wired into normalizeRuleInput via safeParse throwing MonitorBadInputError, mapRule has structured warning log, 9 new tests in monitorService.strictOr.test.ts. CI running (test-device-domain in_progress on run 27787294320).
status_change
in_progress → completed