@sentry/junior 0.312.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 (115) hide show
  1. package/dist/{adapter-iIq7ihf7.js → adapter-JARQvoLw.js} +1 -2
  2. package/dist/{adapter-context-BRjEWRy1.js → adapter-context-B4BrJZuS.js} +2 -2
  3. package/dist/{admin-DhInw5K9.js → admin-BXGAySz0.js} +1 -1
  4. package/dist/{agent-runner-C9iDurwX.js → agent-runner-qZU5TR8i.js} +865 -138
  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 +340 -106
  11. package/dist/{app-DRFrC8Mw.d.ts → app-D7tKnw9a.d.ts} +4 -21
  12. package/dist/app.d.ts +2 -2
  13. package/dist/app.js +80 -171
  14. package/dist/{background-compaction-queue-DrKi7w3d.js → background-compaction-queue-C_uIBUvS.js} +6 -17
  15. package/dist/{callback-mFlTUWWx.js → callback-C8SdXCwr.js} +4 -11
  16. package/dist/{catalog-runtime-D7xapBAX.js → catalog-runtime-BLKtnUL3.js} +1 -1
  17. package/dist/{channel-access-CJGfNTdn.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-kXB2Y5tl.js → config-BIfHKNXN.js} +40 -35
  27. package/dist/{continue-in-slack-O6pV5004.js → continue-in-slack-fnmD2Ifb.js} +5 -7
  28. package/dist/{conversation-feed-uNOv_x68.js → conversation-feed-DdFQuQDR.js} +13 -2
  29. package/dist/{logging-dQ9ZRGQ8.js → conversation-privacy-DtZhI91r.js} +188 -2
  30. package/dist/{conversation-turn-CeLbHqdw.js → conversation-turn-DScuDYmN.js} +465 -62
  31. package/dist/create-CrNt4Ewu.js +212 -0
  32. package/dist/{credential-sync-I8VBGk05.js → credential-sync-CtqsGjj1.js} +14 -18
  33. package/dist/{credentialed-Cb6E2phL.js → credentialed-dWRA3-oJ.js} +911 -429
  34. package/dist/{db-LAyyX8tk.js → db-BTmLKZrp.js} +2245 -50
  35. package/dist/{db-BbC5stfa.d.ts → db-DcmzbA55.d.ts} +2 -2
  36. package/dist/{history-CYstOMKX.js → history-CneKY7_V.js} +19 -1
  37. package/dist/{html-BCZ3Xtb_.js → html-B8rBt7F4.js} +5 -7
  38. package/dist/{install-DCFJFkC0.js → install-OtFboxOM.js} +2 -2
  39. package/dist/instrumentation.js +2 -2
  40. package/dist/{lineage-B_m-4TJw.js → lineage-EULJkGO1.js} +1 -2
  41. package/dist/{list-CN2QA2R9.js → list-C5400AlJ.js} +284 -113
  42. package/dist/{thread-state-DhPndWi1.js → mailbox-turn-DL3Lvsm0.js} +4830 -485
  43. package/dist/markers-DUP8aBOp.js +323 -0
  44. package/dist/{media-CYm1QD8T.js → media-FYM-Bl3H.js} +42 -14
  45. package/dist/{message-DSXGj1hM.js → message-DuDelZFr.js} +16 -15
  46. package/dist/{model-input--TrP9hYV.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-DHCZC6B4.js → oauth-callback-server-DX2fQ7Nq.js} +2 -2
  50. package/dist/{oauth-relay-pPMGnDZt.js → oauth-relay-PwPMdZJv.js} +1 -1
  51. package/dist/{plugins-Bkk0XRo2.js → plugins-BXMdNdyA.js} +1 -1
  52. package/dist/{registry-CZOzddwu.js → registry-D6kS6xYH.js} +1402 -64
  53. package/dist/{statuses-_cRJHXK7.js → reporting-window-C4dbzDiR.js} +1 -27
  54. package/dist/{resolve-cKOQ14Dh.js → resolve-D8CPJcNK.js} +3 -3
  55. package/dist/result-D090hxr5.js +402 -0
  56. package/dist/{runner-DBfUW44l.js → runner-BU7fgrm-.js} +7 -8
  57. package/dist/{sandbox-egress-signals-BVF_xAm1.js → sandbox-egress-signals-BUmVrsoG.js} +1 -1
  58. package/dist/{schema-Bk9Nm2E8.js → schema-7gW9vBpJ.js} +91 -10
  59. package/dist/{schema-BEHKxr4I.d.ts → schema-BB6E0wyV.d.ts} +2105 -2753
  60. package/dist/{service-account-CVYsFjty.js → service-account-plA-uzIB.js} +6 -5
  61. package/dist/{skills-VTnhAJWm.js → skills-CIosT6bS.js} +3 -3
  62. package/dist/{slack-conversation-unfurl-fuLnF1jE.js → slack-conversation-unfurl-CBgZqth6.js} +8 -10
  63. package/dist/spawn-DRjdzh3R.js +46 -0
  64. package/dist/{start-conversation-CEn2KH1A.js → start-conversation-a4NXH4X9.js} +13 -202
  65. package/dist/{store-DFZaN-Ix.js → store-BuhF1QDm.js} +2 -4
  66. package/dist/{task-queue-Cx4Lmjyk.js → task-queue-CrRjFzOh.js} +5 -16
  67. package/dist/{task-runner-CbTwFA6k.js → task-runner-C-pXsgHM.js} +105 -51
  68. package/dist/{thread-context-BkAZDTX2.js → thread-context-CDX4dSZd.js} +8 -10
  69. package/dist/turn-session-routing-CZTRU8IY.js +116 -0
  70. package/dist/turn-wake-Bzq1Efrm.js +154 -0
  71. package/dist/user-customization-B27StpVQ.js +9 -0
  72. package/dist/{validation-nIzMtAVJ.js → validation-bTq88sya.js} +1 -1
  73. package/dist/{vercel-queue-hW90XzbG.js → vercel-queue-nL0Hq3hr.js} +32 -147
  74. package/dist/{version-Brbtz4Qf.js → version-DGUa1dZK.js} +1 -1
  75. package/dist/version.js +1 -1
  76. package/dist/{warmup-BDA5myRK.js → warmup-CCOuIwAS.js} +831 -3254
  77. package/dist/{worker-D63RcaVD.js → worker-AkZg7Dg1.js} +5 -6
  78. package/migrations/0158_keep_legacy_archive_columns.sql +5 -0
  79. package/migrations/0159_conversation_embeddings_fk_validate.sql +5 -0
  80. package/migrations/0160_money_micro_usd_repair.sql +99 -0
  81. package/migrations/0161_agent_config_backfill.sql +34 -0
  82. package/migrations/0162_inbox_item_deliveries.sql +15 -0
  83. package/migrations/0163_pg_trgm.sql +2 -0
  84. package/migrations/0164_search_indexes.sql +4 -0
  85. package/migrations/0165_drop_legacy_archive_columns.sql +4 -0
  86. package/migrations/0166_memory_prefix_index.sql +1 -0
  87. package/migrations/0167_todo_search_indexes.sql +2 -0
  88. package/migrations/0168_todo_inbox_items.sql +4 -0
  89. package/migrations/0169_drop_code_urls.sql +2 -0
  90. package/migrations/meta/0158_snapshot.json +6515 -0
  91. package/migrations/meta/0159_snapshot.json +6515 -0
  92. package/migrations/meta/0160_snapshot.json +6515 -0
  93. package/migrations/meta/0161_snapshot.json +6278 -0
  94. package/migrations/meta/0162_snapshot.json +6404 -0
  95. package/migrations/meta/0163_snapshot.json +6404 -0
  96. package/migrations/meta/0164_snapshot.json +6466 -0
  97. package/migrations/meta/0165_snapshot.json +6466 -0
  98. package/migrations/meta/0166_snapshot.json +6494 -0
  99. package/migrations/meta/0167_snapshot.json +6525 -0
  100. package/migrations/meta/0168_snapshot.json +6525 -0
  101. package/migrations/meta/0169_snapshot.json +6513 -0
  102. package/migrations/meta/_journal.json +84 -0
  103. package/package.json +9 -18
  104. package/skills/design-automation-skill/SKILL.md +2 -3
  105. package/dist/actor-BsBdxDXQ.js +0 -208
  106. package/dist/child-message-DcsritGf.js +0 -179
  107. package/dist/conversation-privacy-L4ja1_W6.js +0 -189
  108. package/dist/executor-SCub-fAq.js +0 -1860
  109. package/dist/fan-out-Cod-yEHG.js +0 -10
  110. package/dist/ingest-BDf3D50j.js +0 -3836
  111. package/dist/result-DcvEOe1r.js +0 -574
  112. package/dist/result-event-type-BdIJuZxg.js +0 -48
  113. package/dist/service-account-Ts4ulcrV.js +0 -931
  114. package/dist/spawn-vxAarlX5.js +0 -73
  115. package/dist/state-C1P3_Ywk.js +0 -161
@@ -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-kXB2Y5tl.js";
3
- import { T as withLogContext, b as setSpanAttributes, h as logWarn, m as logInfo, p as logException } from "./logging-dQ9ZRGQ8.js";
4
- import { A as saveHeldInput, D as getConversationStoppedAtMs } from "./ingest-BDf3D50j.js";
5
- import { n as getTurnRequestDeadline } from "./callback-mFlTUWWx.js";
6
- import { i as ConversationQueueMessageRejectedError, s as nudgeIdempotencyKey } from "./vercel-queue-hW90XzbG.js";
7
- import { A as requestAnotherSlice, D as recordAttemptFailure, M as startConversationWork, O as recordConversationRetry, S as ensureConversationWake, _ as completeConversationStop, an as isInvalidConversationRecordError, b as drainConversationMailbox, en as countPendingConversationMessages, f as checkInConversationWork, h as clearConsumedConversationWake, in as isFinalAttempt, k as releaseConversationWork, mn as selectAttemptMessages, nn as hasConversationStop, p as claimConversationAttempt, pn as isAttemptInterrupt, s as ackMessages, u as beginConversationResume, v as completeConversationWork, w as getConversationWorkState, y as deadLetterAttempt } from "./thread-state-DhPndWi1.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,5 @@
1
+ -- The snapshot no longer has junior_conversation_participants.archived_at or
2
+ -- junior_conversations.child_archived_at. Runtime code stopped reading and
3
+ -- writing them in #2900. They stay in the database for one release, because
4
+ -- old workers still name them in every insert while this migration runs. The
5
+ -- next release drops them with DROP COLUMN IF EXISTS, as 0101 does.
@@ -0,0 +1,5 @@
1
+ -- 0149 added this FK as NOT VALID. VALIDATE CONSTRAINT takes only SHARE UPDATE
2
+ -- EXCLUSIVE, so reads and writes keep going during the scan. Keep it alone in
3
+ -- this migration: each migration runs in one transaction, and a stronger lock
4
+ -- in the same file would be held for the whole scan.
5
+ ALTER TABLE "junior_conversation_embeddings" VALIDATE CONSTRAINT "junior_conversation_embeddings_conversation_fk";
@@ -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";