@sentry/junior 0.313.0 → 0.314.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/{adapter-CYAvJzZS.js → adapter-JARQvoLw.js} +1 -2
  2. package/dist/{adapter-context-CVsHoVSf.js → adapter-context-B4BrJZuS.js} +2 -2
  3. package/dist/{admin-Cyhb4TwZ.js → admin-BXGAySz0.js} +1 -1
  4. package/dist/{agent-runner-B5y9MsT-.js → agent-runner-qZU5TR8i.js} +797 -118
  5. package/dist/agent-update-cS7Z9mnG.js +26 -0
  6. package/dist/agent-update-delivery-CZ5M8RDa.js +85 -0
  7. package/dist/api/schema.d.ts +2 -2
  8. package/dist/api/schema.js +6 -6
  9. package/dist/api.d.ts +1 -1
  10. package/dist/api.js +334 -100
  11. package/dist/{app-DA8-hCMj.d.ts → app-D7tKnw9a.d.ts} +4 -21
  12. package/dist/app.d.ts +2 -2
  13. package/dist/app.js +80 -169
  14. package/dist/{background-compaction-queue-iZXadLV3.js → background-compaction-queue-C_uIBUvS.js} +6 -67
  15. package/dist/callback-C8SdXCwr.js +68 -0
  16. package/dist/{catalog-runtime-kkE3hvCX.js → catalog-runtime-BLKtnUL3.js} +1 -1
  17. package/dist/{channel-access-mt7K6dPh.js → channel-access-BOL29BG3.js} +6 -6
  18. package/dist/child-message--2G3Ft26.js +19 -0
  19. package/dist/cli/chat.js +18 -21
  20. package/dist/cli/check.js +4 -4
  21. package/dist/cli/main.js +2 -2
  22. package/dist/cli/plugins.js +5 -5
  23. package/dist/cli/snapshot-create.js +5 -5
  24. package/dist/cli/upgrade.d.ts +1 -1
  25. package/dist/cli/upgrade.js +23 -4
  26. package/dist/{config-CWbwKj0j.js → config-BIfHKNXN.js} +40 -35
  27. package/dist/{continue-in-slack-CxyFzdlF.js → continue-in-slack-fnmD2Ifb.js} +5 -7
  28. package/dist/{conversation-feed-BEXLD3Me.js → conversation-feed-DdFQuQDR.js} +1 -1
  29. package/dist/{logging-DNt-qOIO.js → conversation-privacy-DtZhI91r.js} +188 -2
  30. package/dist/{conversation-turn-B35eu0uz.js → conversation-turn-DScuDYmN.js} +418 -33
  31. package/dist/create-CrNt4Ewu.js +212 -0
  32. package/dist/{credential-sync-DWTOEQrm.js → credential-sync-CtqsGjj1.js} +14 -17
  33. package/dist/{credentialed-Dyv8b-lu.js → credentialed-dWRA3-oJ.js} +910 -426
  34. package/dist/{db-PwSRzWWn.js → db-BTmLKZrp.js} +2235 -38
  35. package/dist/{db-DYGcXYl3.d.ts → db-DcmzbA55.d.ts} +2 -2
  36. package/dist/{history-CYstOMKX.js → history-CneKY7_V.js} +19 -1
  37. package/dist/{html-DidUcRhI.js → html-B8rBt7F4.js} +5 -7
  38. package/dist/{install-2urLLXNt.js → install-OtFboxOM.js} +2 -2
  39. package/dist/instrumentation.js +2 -2
  40. package/dist/{lineage-BXplQAVH.js → lineage-EULJkGO1.js} +1 -2
  41. package/dist/{list-DyIyReSV.js → list-C5400AlJ.js} +235 -77
  42. package/dist/{turn-membership-DTR3SaKD.js → mailbox-turn-DL3Lvsm0.js} +4698 -587
  43. package/dist/markers-DUP8aBOp.js +323 -0
  44. package/dist/{media-B0pZJ0bG.js → media-FYM-Bl3H.js} +33 -8
  45. package/dist/{message-Z5YKC-Af.js → message-DuDelZFr.js} +16 -29
  46. package/dist/{model-input-BhPJYdSV.js → model-input-0osF3pBS.js} +3 -3
  47. package/dist/nitro.d.ts +2 -4
  48. package/dist/nitro.js +340 -13
  49. package/dist/{oauth-callback-server-ByvDdcdY.js → oauth-callback-server-DX2fQ7Nq.js} +2 -2
  50. package/dist/{oauth-relay-D-kK0yoN.js → oauth-relay-PwPMdZJv.js} +1 -1
  51. package/dist/{plugins-Bkk0XRo2.js → plugins-BXMdNdyA.js} +1 -1
  52. package/dist/{registry-POH4bZC4.js → registry-D6kS6xYH.js} +1402 -64
  53. package/dist/{resolve-CWtBNSKP.js → resolve-D8CPJcNK.js} +3 -3
  54. package/dist/result-D090hxr5.js +402 -0
  55. package/dist/{runner-CsZ_VRxp.js → runner-BU7fgrm-.js} +7 -8
  56. package/dist/{sandbox-egress-signals-FbCk1FkN.js → sandbox-egress-signals-BUmVrsoG.js} +1 -1
  57. package/dist/{schema-DojR2uCL.js → schema-7gW9vBpJ.js} +90 -9
  58. package/dist/{schema-DBf18QPS.d.ts → schema-BB6E0wyV.d.ts} +138 -5
  59. package/dist/{service-account-CDYb9hfX.js → service-account-plA-uzIB.js} +6 -5
  60. package/dist/{skills-B0jP4whm.js → skills-CIosT6bS.js} +3 -3
  61. package/dist/{slack-conversation-unfurl-D26t9kBC.js → slack-conversation-unfurl-CBgZqth6.js} +8 -10
  62. package/dist/{spawn-BjljgExZ.js → spawn-DRjdzh3R.js} +9 -17
  63. package/dist/{start-conversation-DbVujrwO.js → start-conversation-a4NXH4X9.js} +12 -15
  64. package/dist/{store-CjXrp-Up.js → store-BuhF1QDm.js} +2 -4
  65. package/dist/{task-queue-Cwlatjz3.js → task-queue-CrRjFzOh.js} +5 -16
  66. package/dist/{task-runner--Ke8KSMf.js → task-runner-C-pXsgHM.js} +104 -50
  67. package/dist/{thread-context-B8exINEe.js → thread-context-CDX4dSZd.js} +8 -9
  68. package/dist/turn-session-routing-CZTRU8IY.js +116 -0
  69. package/dist/turn-wake-Bzq1Efrm.js +154 -0
  70. package/dist/user-customization-B27StpVQ.js +9 -0
  71. package/dist/{validation-Ce0qbMlT.js → validation-bTq88sya.js} +1 -1
  72. package/dist/{vercel-queue-q4z8w5QO.js → vercel-queue-nL0Hq3hr.js} +32 -147
  73. package/dist/{version-DFh4n9nr.js → version-DGUa1dZK.js} +1 -1
  74. package/dist/version.js +1 -1
  75. package/dist/{warmup-D5hzqTcp.js → warmup-CCOuIwAS.js} +639 -137
  76. package/dist/{worker-CDg9Lbpg.js → worker-AkZg7Dg1.js} +5 -6
  77. package/migrations/0160_money_micro_usd_repair.sql +99 -0
  78. package/migrations/0161_agent_config_backfill.sql +34 -0
  79. package/migrations/0162_inbox_item_deliveries.sql +15 -0
  80. package/migrations/0163_pg_trgm.sql +2 -0
  81. package/migrations/0164_search_indexes.sql +4 -0
  82. package/migrations/0165_drop_legacy_archive_columns.sql +4 -0
  83. package/migrations/0166_memory_prefix_index.sql +1 -0
  84. package/migrations/0167_todo_search_indexes.sql +2 -0
  85. package/migrations/0168_todo_inbox_items.sql +4 -0
  86. package/migrations/0169_drop_code_urls.sql +2 -0
  87. package/migrations/meta/0160_snapshot.json +6515 -0
  88. package/migrations/meta/0161_snapshot.json +6278 -0
  89. package/migrations/meta/0162_snapshot.json +6404 -0
  90. package/migrations/meta/0163_snapshot.json +6404 -0
  91. package/migrations/meta/0164_snapshot.json +6466 -0
  92. package/migrations/meta/0165_snapshot.json +6466 -0
  93. package/migrations/meta/0166_snapshot.json +6494 -0
  94. package/migrations/meta/0167_snapshot.json +6525 -0
  95. package/migrations/meta/0168_snapshot.json +6525 -0
  96. package/migrations/meta/0169_snapshot.json +6513 -0
  97. package/migrations/meta/_journal.json +70 -0
  98. package/package.json +9 -18
  99. package/skills/design-automation-skill/SKILL.md +2 -3
  100. package/dist/actor-BsBdxDXQ.js +0 -208
  101. package/dist/conversation-privacy-BrMiDN61.js +0 -189
  102. package/dist/executor-CgWyWfYz.js +0 -1858
  103. package/dist/fan-out-Cod-yEHG.js +0 -10
  104. package/dist/ingest-B0AggUEC.js +0 -7931
  105. package/dist/request-deadline-BUiRYQYj.js +0 -24
  106. package/dist/service-account-o15pZWcJ.js +0 -931
  107. package/dist/state-BTawTCme.js +0 -161
  108. package/dist/statuses-BKwqCPhj.js +0 -69
@@ -1,10 +1,9 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
2
- import { ft as isProviderRetryError, r as getChatConfig } from "./config-CWbwKj0j.js";
3
- import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-DNt-qOIO.js";
4
- import { Ft as getConversationStoppedAtMs, Lt as saveHeldInput } from "./ingest-B0AggUEC.js";
5
- import { t as getTurnRequestDeadline } from "./request-deadline-BUiRYQYj.js";
6
- import { i as ConversationQueueMessageRejectedError, s as nudgeIdempotencyKey } from "./vercel-queue-q4z8w5QO.js";
7
- import { D as completeConversationWork, E as completeConversationStop, I as recordAttemptFailure, L as recordConversationRetry, N as getConversationWorkState, O as deadLetterAttempt, R as releaseConversationWork, S as claimConversationAttempt, Sn as selectAttemptMessages, V as startConversationWork, cn as countPendingConversationMessages, fn as isFinalAttempt, h as ackMessages, j as ensureConversationWake, k as drainConversationMailbox, pn as isInvalidConversationRecordError, un as hasConversationStop, w as clearConsumedConversationWake, x as checkInConversationWork, xn as isAttemptInterrupt, y as beginConversationResume, z as requestAnotherSlice } from "./turn-membership-DTR3SaKD.js";
2
+ import { ft as isProviderRetryError, r as getChatConfig } from "./config-BIfHKNXN.js";
3
+ import { C as logInfo, P as withLogContext, S as logException, k as setSpanAttributes, w as logWarn } from "./conversation-privacy-DtZhI91r.js";
4
+ import { Bt as getConversationWorkState, Ct as ackMessages, Et as beginConversationResume, Ft as deadLetterAttempt, Gt as releaseConversationWork, It as drainConversationMailbox, J as saveHeldInput, Jt as startConversationWork, K as getConversationStoppedAtMs, Kt as requestAnotherSlice, Nt as completeConversationStop, Ot as checkInConversationWork, Pt as completeConversationWork, Rt as ensureConversationWake, Ut as recordAttemptFailure, Wt as recordConversationRetry, ai as countPendingConversationMessages, jt as clearConsumedConversationWake, kt as claimConversationAttempt, li as isFinalAttempt, si as hasConversationStop, ui as isInvalidConversationRecordError, vi as isAttemptInterrupt, yi as selectAttemptMessages } from "./mailbox-turn-DL3Lvsm0.js";
5
+ import { n as getTurnRequestDeadline } from "./callback-C8SdXCwr.js";
6
+ import { i as ConversationQueueMessageRejectedError, s as nudgeIdempotencyKey } from "./vercel-queue-nL0Hq3hr.js";
8
7
  // src/chat/task-execution/lost-lease.ts
9
8
  /**
10
9
  * Count a slice that lost its Conversation Lease as a failed attempt, then
@@ -0,0 +1,99 @@
1
+ -- While 0119 and 0120 rolled out, the runtime before micro-USD still wrote
2
+ -- money in the old units. This converts those rows. Each statement changes
3
+ -- only old-unit rows, and the statements remove them, so a second run changes
4
+ -- nothing.
5
+ --
6
+ -- Convert each old cost row; when the new runtime also wrote the Run, the
7
+ -- later row wins. A Conversation with an old cost row got a usage cost from
8
+ -- one runtime that did not see the other runtime's rows, so sum each Run's
9
+ -- latest cost row into its usage cost again, and copy it to the Conversation's
10
+ -- Automation runs, as costMicroUsdExpr does for a usage cost with only a total.
11
+ -- The metrics table is large and has no index on 'cost_usd', so one statement
12
+ -- scans it once. Every CTE reads the rows from before the statement, so
13
+ -- "run_costs" still sees the old rows that "old" deletes.
14
+ -- junior:bounded-backfill: changes only old cost rows and the Conversations and runs that have one, which the old runtime wrote during one rollout, so few rows match; the reads by Conversation use the primary key.
15
+ WITH "old" AS (
16
+ DELETE FROM "junior_conversation_metrics"
17
+ WHERE "metric" = 'cost_usd'
18
+ RETURNING "conversation_id", "run_id", "actor_identity_id", "value", "occurred_at", "updated_at"
19
+ ),
20
+ "converted" AS (
21
+ INSERT INTO "junior_conversation_metrics"
22
+ ("conversation_id", "run_id", "metric", "actor_identity_id", "value", "occurred_at", "updated_at")
23
+ SELECT "conversation_id", "run_id", 'cost_micro_usd', "actor_identity_id", round("value" * 1000000), "occurred_at", "updated_at"
24
+ FROM "old"
25
+ ON CONFLICT ("conversation_id", "run_id", "metric") DO UPDATE
26
+ SET "value" = excluded."value", "updated_at" = excluded."updated_at"
27
+ WHERE "junior_conversation_metrics"."updated_at" < excluded."updated_at"
28
+ ),
29
+ "run_costs" AS (
30
+ SELECT DISTINCT ON ("m"."conversation_id", "m"."run_id")
31
+ "m"."conversation_id",
32
+ CASE
33
+ WHEN "m"."metric" = 'cost_usd' THEN round("m"."value" * 1000000)
34
+ ELSE "m"."value"
35
+ END AS "micro_usd"
36
+ FROM "junior_conversation_metrics" AS "m"
37
+ WHERE "m"."conversation_id" IN (SELECT "conversation_id" FROM "old")
38
+ AND "m"."metric" IN ('cost_usd', 'cost_micro_usd')
39
+ ORDER BY "m"."conversation_id", "m"."run_id", "m"."updated_at" DESC
40
+ ),
41
+ "totals" AS (
42
+ SELECT "conversation_id", sum("micro_usd") AS "micro_usd"
43
+ FROM "run_costs"
44
+ GROUP BY "conversation_id"
45
+ ),
46
+ "repaired" AS (
47
+ UPDATE "junior_conversations" AS "c"
48
+ SET
49
+ "usage_json" = jsonb_set(
50
+ coalesce("c"."usage_json", '{}'::jsonb),
51
+ '{cost}',
52
+ jsonb_build_object('total', "t"."micro_usd" / 1000000.0::double precision)
53
+ ),
54
+ "detail_version" = "c"."detail_version" + 1
55
+ FROM "totals" AS "t"
56
+ WHERE "c"."conversation_id" = "t"."conversation_id"
57
+ RETURNING "c"."conversation_id", "c"."usage_json"
58
+ )
59
+ UPDATE "junior_automation_runs" AS "r"
60
+ SET "cost_micro_usd" = round(("c"."usage_json"->'cost'->>'total')::double precision * 1000000)::bigint
61
+ FROM "repaired" AS "c"
62
+ WHERE "c"."conversation_id" = "r"."conversation_id";--> statement-breakpoint
63
+ -- Brief versions that the old runtime appended have only a USD cost.
64
+ -- junior:bounded-backfill: changes only Brief versions that the old runtime appended during one rollout, so few rows match; Brief versions are append-only, so no app write waits.
65
+ UPDATE "junior_conversation_briefs"
66
+ SET "cost_micro_usd" = round("cost_usd" * 1000000)::bigint
67
+ WHERE "cost_micro_usd" IS NULL
68
+ AND "cost_usd" IS NOT NULL;--> statement-breakpoint
69
+ -- The old runtime added to `count`, which 0119 set to 0. Add those amounts to
70
+ -- `value`, under the micro-USD name for cache warming dollar counters, which
71
+ -- stored 100 micro-USD per unit. Only the counters of the rollout days match,
72
+ -- and the app does not write those days now.
73
+ INSERT INTO "junior_stats" ("date", "namespace", "metric", "name", "value")
74
+ SELECT
75
+ "date",
76
+ "namespace",
77
+ CASE
78
+ WHEN "namespace" = 'cache_warming'
79
+ AND "metric" IN ('oracle_savings', 'saved', 'unwarmed_oracle_savings', 'warmup_cost')
80
+ THEN "metric" || '_micro_usd'
81
+ ELSE "metric"
82
+ END,
83
+ "name",
84
+ CASE
85
+ WHEN "namespace" = 'cache_warming'
86
+ AND "metric" IN ('oracle_savings', 'saved', 'unwarmed_oracle_savings', 'warmup_cost')
87
+ THEN "count"::bigint * 100
88
+ ELSE "count"
89
+ END
90
+ FROM "junior_stats"
91
+ WHERE "count" <> 0
92
+ ON CONFLICT ("date", "namespace", "metric", "name") DO UPDATE
93
+ SET "value" = "junior_stats"."value" + excluded."value";--> statement-breakpoint
94
+ -- junior:bounded-backfill: changes only counters that the old runtime added to during one rollout, so few rows match; the app does not write those days now.
95
+ UPDATE "junior_stats" SET "count" = 0 WHERE "count" <> 0;--> statement-breakpoint
96
+ -- junior:bounded-backfill: deletes only cache warming counters under old names, which the old runtime wrote during one rollout, so few rows match.
97
+ DELETE FROM "junior_stats"
98
+ WHERE "namespace" = 'cache_warming'
99
+ AND "metric" IN ('oracle_savings', 'saved', 'unwarmed_oracle_savings', 'warmup_cost');
@@ -0,0 +1,34 @@
1
+ -- Child agents now run only from parent messages, and every reader finds a
2
+ -- child agent by its stored agent config. A child that an Agent invocation
3
+ -- started before #3435 has no agent config, so copy it from the first
4
+ -- invocation of that child, the one that its spawn wrote. A legacy child from
5
+ -- before the kind column reads as a Task.
6
+ --
7
+ -- The snapshot no longer has junior_agent_invocations, and runtime code no
8
+ -- longer reads or writes it. The table stays in the database until a check
9
+ -- shows that no invocation in it still waits to run or to report. A later
10
+ -- migration drops it with DROP TABLE IF EXISTS.
11
+ -- junior:bounded-backfill: runs once and changes only child Conversations that an Agent invocation names, which no release writes since #3435. The update sets only columns that are null.
12
+ WITH "spawn" AS (
13
+ SELECT DISTINCT ON ("child_conversation_id")
14
+ "child_conversation_id",
15
+ "agent_type",
16
+ "fork",
17
+ "reasoning_level",
18
+ "title"
19
+ FROM "junior_agent_invocations"
20
+ ORDER BY "child_conversation_id", "created_at"
21
+ )
22
+ UPDATE "junior_conversations" AS "conversations"
23
+ SET
24
+ "agent_config_json" = jsonb_strip_nulls(jsonb_build_object(
25
+ 'agentType', "spawn"."agent_type",
26
+ 'fork', CASE WHEN "spawn"."fork" THEN true END,
27
+ 'reasoningLevel', "spawn"."reasoning_level"
28
+ )),
29
+ "kind" = COALESCE("conversations"."kind", 'task'),
30
+ "title" = COALESCE("conversations"."title", "spawn"."title"),
31
+ "detail_version" = "conversations"."detail_version" + 1
32
+ FROM "spawn"
33
+ WHERE "spawn"."child_conversation_id" = "conversations"."conversation_id"
34
+ AND "conversations"."agent_config_json" IS NULL;
@@ -0,0 +1,15 @@
1
+ CREATE TABLE "junior_inbox_item_deliveries" (
2
+ "item_id" text NOT NULL,
3
+ "user_id" text NOT NULL,
4
+ "channel" text NOT NULL,
5
+ "event" text NOT NULL,
6
+ "status" text NOT NULL,
7
+ "skip_reason" text,
8
+ "created_at" timestamp with time zone NOT NULL,
9
+ "updated_at" timestamp with time zone NOT NULL,
10
+ CONSTRAINT "junior_inbox_item_deliveries_item_id_user_id_channel_event_pk" PRIMARY KEY("item_id","user_id","channel","event")
11
+ );
12
+ --> statement-breakpoint
13
+ ALTER TABLE "junior_inbox_item_deliveries" ADD CONSTRAINT "junior_inbox_item_deliveries_item_id_junior_inbox_items_id_fk" FOREIGN KEY ("item_id") REFERENCES "public"."junior_inbox_items"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
14
+ ALTER TABLE "junior_inbox_item_deliveries" ADD CONSTRAINT "junior_inbox_item_deliveries_user_id_junior_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."junior_users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
15
+ CREATE INDEX "junior_inbox_item_deliveries_user_status_idx" ON "junior_inbox_item_deliveries" USING btree ("user_id","status","updated_at");
@@ -0,0 +1,2 @@
1
+ -- Trigram matching lets search find a title through a typo.
2
+ CREATE EXTENSION IF NOT EXISTS pg_trgm;
@@ -0,0 +1,4 @@
1
+ CREATE INDEX CONCURRENTLY IF NOT EXISTS "junior_automations_search_idx" ON "junior_automations" USING gin ((setweight(to_tsvector('simple', coalesce("title", '')), 'A') || setweight(to_tsvector('simple', coalesce("instruction", '') || ' ' || coalesce("skill", '') || ' ' || case when "kind" = 'event' then coalesce("identifier", '') || ' ' || coalesce("record"->'trigger'->>'label', '') || ' ' || coalesce("namespace", '') else '' end), 'B'))) WHERE "junior_automations"."status" <> 'deleted';--> statement-breakpoint
2
+ CREATE INDEX CONCURRENTLY IF NOT EXISTS "junior_automations_title_trgm_idx" ON "junior_automations" USING gin (lower(coalesce("title", '')) gin_trgm_ops) WHERE "junior_automations"."status" <> 'deleted';--> statement-breakpoint
3
+ CREATE INDEX CONCURRENTLY IF NOT EXISTS "junior_inbox_items_search_idx" ON "junior_inbox_items" USING gin ((setweight(to_tsvector('simple', "title"), 'A') || setweight(to_tsvector('simple', "body"), 'B')));--> statement-breakpoint
4
+ CREATE INDEX CONCURRENTLY IF NOT EXISTS "junior_inbox_items_title_trgm_idx" ON "junior_inbox_items" USING gin (lower("title") gin_trgm_ops);
@@ -0,0 +1,4 @@
1
+ -- 0158_keep_legacy_archive_columns removed these from the snapshot and kept
2
+ -- them in the database for one release.
3
+ ALTER TABLE "junior_conversation_participants" DROP COLUMN IF EXISTS "archived_at";--> statement-breakpoint
4
+ ALTER TABLE "junior_conversations" DROP COLUMN IF EXISTS "child_archived_at";
@@ -0,0 +1 @@
1
+ CREATE INDEX CONCURRENTLY IF NOT EXISTS "junior_memory_memories_prefix_idx" ON "junior_memory_memories" USING gin ("scope","scope_key",to_tsvector('simple', "content")) WHERE "junior_memory_memories"."archived_at_ms" IS NULL AND "junior_memory_memories"."superseded_at_ms" IS NULL AND "junior_memory_memories"."superseded_by_id" IS NULL;
@@ -0,0 +1,2 @@
1
+ CREATE INDEX CONCURRENTLY IF NOT EXISTS "junior_todos_search_idx" ON "junior_todos" USING gin (to_tsvector('simple', "title"));--> statement-breakpoint
2
+ CREATE INDEX CONCURRENTLY IF NOT EXISTS "junior_todos_title_trgm_idx" ON "junior_todos" USING gin (lower("title") gin_trgm_ops);
@@ -0,0 +1,4 @@
1
+ ALTER TABLE "junior_inbox_items" DROP CONSTRAINT "junior_inbox_items_kind_check";--> statement-breakpoint
2
+ -- The new check only adds an allowed key prefix, so every row already meets
3
+ -- it. NOT VALID skips the scan under lock and still checks every new write.
4
+ ALTER TABLE "junior_inbox_items" ADD CONSTRAINT "junior_inbox_items_kind_check" CHECK (("junior_inbox_items"."kind" = 'notice' and "junior_inbox_items"."request" is null and "junior_inbox_items"."answer" is null) or ("junior_inbox_items"."kind" = 'action' and ("junior_inbox_items"."request" is not null or (("junior_inbox_items"."dedupe_key" like 'plugin:%' or "junior_inbox_items"."dedupe_key" like 'automation:%' or "junior_inbox_items"."dedupe_key" like 'todo:%') and "junior_inbox_items"."answer" is null)))) NOT VALID;
@@ -0,0 +1,2 @@
1
+ ALTER TABLE "junior_code_changes" DROP COLUMN "url";--> statement-breakpoint
2
+ ALTER TABLE "junior_code_repositories" DROP COLUMN "url";