@staff0rd/assist 0.1181.0 → 0.1181.2

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 (148) hide show
  1. package/dist/.build-files +141 -141
  2. package/dist/{add-JTT7SYLD.js → add-APRLXI54.js} +2 -3
  3. package/dist/{add-X5XZOF5D.js → add-SFVVGCUV.js} +5 -6
  4. package/dist/{add-2HU7IFVK.js → add-TXOQ6PA3.js} +6 -7
  5. package/dist/{addActivity-LQRZAU4B.js → addActivity-R5IWEZ3P.js} +5 -6
  6. package/dist/{addPhase-EQ4KN2KX.js → addPhase-PMIJDJ3T.js} +6 -7
  7. package/dist/{askCheck-JCJ3CKBH.js → askCheck-LJDGEXJ3.js} +4 -5
  8. package/dist/{associateGithub-YJB4Y5WH.js → associateGithub-IDNGVOXD.js} +5 -6
  9. package/dist/{associateJira-S4QII5CS.js → associateJira-SS5WNCXV.js} +5 -6
  10. package/dist/{backup-DPULICRH.js → backup-OJZTV5G7.js} +3 -4
  11. package/dist/{branch-3Z5TU6QI.js → branch-ZJECWDMF.js} +5 -6
  12. package/dist/built-version +1 -1
  13. package/dist/{chunk-WJ3SPOMO.js → chunk-22S53B4I.js} +2 -2
  14. package/dist/{chunk-QW2RFAM7.js → chunk-2JYJEYRY.js} +1 -1
  15. package/dist/{chunk-DMFIET7U.js → chunk-2ZOUWEB5.js} +1 -1
  16. package/dist/{chunk-R4T3LMQB.js → chunk-3CEQMNDU.js} +4 -4
  17. package/dist/{chunk-75AGXVCY.js → chunk-3WN7B2HM.js} +2 -2
  18. package/dist/{chunk-QV63A5FN.js → chunk-6D6WQN2W.js} +2 -2
  19. package/dist/{chunk-NT2NEXYJ.js → chunk-6FDUCI2A.js} +1 -1
  20. package/dist/{chunk-TSZZEGKF.js → chunk-6HL6WMRH.js} +1 -1
  21. package/dist/{chunk-T4V7CRSJ.js → chunk-6KLKCT2Y.js} +3 -3
  22. package/dist/{chunk-ZGLYAU3P.js → chunk-6LAPNHGZ.js} +1 -1
  23. package/dist/{chunk-BF4SX5XG.js → chunk-AF5V5BLB.js} +4 -2
  24. package/dist/{chunk-KDH4MEQM.js → chunk-AKK5R727.js} +1 -1
  25. package/dist/{chunk-6OURFIED.js → chunk-BAGXDIAT.js} +1 -1
  26. package/dist/{chunk-ZBE76KOT.js → chunk-BHJKAMY7.js} +1 -1
  27. package/dist/{chunk-O4OZ5AWE.js → chunk-BQET6EXK.js} +3 -3
  28. package/dist/{chunk-LFZQMX5H.js → chunk-BQRWKDLW.js} +1 -1
  29. package/dist/{chunk-3W4Q57KM.js → chunk-D2VCDC22.js} +2 -2
  30. package/dist/{chunk-DJ6XDGDA.js → chunk-DYFRR4T3.js} +1 -1
  31. package/dist/{chunk-H7POEH22.js → chunk-E5Q2VCB4.js} +2 -2
  32. package/dist/{chunk-C7VWMDKW.js → chunk-EA4YBEFH.js} +2 -2
  33. package/dist/{chunk-JXXDGQDA.js → chunk-ESJG46YM.js} +7 -7
  34. package/dist/{chunk-DEWZBK7G.js → chunk-FTENYGYF.js} +1 -1
  35. package/dist/{chunk-WRSL4R3I.js → chunk-GLO6466J.js} +1 -1
  36. package/dist/{chunk-2FK5COQT.js → chunk-H7CW5H7Q.js} +1 -1
  37. package/dist/{chunk-PKSSJOSU.js → chunk-HCNRMHDD.js} +2 -2
  38. package/dist/{chunk-CE56L3HC.js → chunk-HGAUF3E4.js} +1 -1
  39. package/dist/{chunk-SWCHACNU.js → chunk-HJVRE3TH.js} +8 -74
  40. package/dist/{chunk-YJE2WTYI.js → chunk-IRN3AQ6C.js} +2 -2
  41. package/dist/{chunk-UKO64UKG.js → chunk-J6ULAU7G.js} +37 -7
  42. package/dist/{chunk-4JQ7EMEY.js → chunk-KWPM2HNG.js} +4 -4
  43. package/dist/{chunk-XMAFKQ2T.js → chunk-MPHPF3VF.js} +3 -3
  44. package/dist/{chunk-V32YJXLE.js → chunk-NCUJ2K55.js} +7 -5
  45. package/dist/{chunk-BI6FQU3N.js → chunk-OGOH3VWW.js} +5 -5
  46. package/dist/{chunk-YQ6Z6GTY.js → chunk-OM7BENAP.js} +1 -1
  47. package/dist/{chunk-TWPKKQRI.js → chunk-ONQWTOFT.js} +3 -3
  48. package/dist/{chunk-46AUR324.js → chunk-P2PVG6BU.js} +1 -1
  49. package/dist/{chunk-H2AFCYRR.js → chunk-P45FMBMV.js} +2 -2
  50. package/dist/{chunk-SSV3LA2E.js → chunk-QQDPM6LG.js} +1 -1
  51. package/dist/{chunk-JOPVPSE7.js → chunk-RJERQDBE.js} +6 -6
  52. package/dist/{chunk-TSA2X3T5.js → chunk-RMJ7HG7P.js} +2 -2
  53. package/dist/{chunk-OHGHP7ZX.js → chunk-S7MIJZ2I.js} +1 -1
  54. package/dist/{chunk-G5CQNJIF.js → chunk-SKZNXP23.js} +1 -1
  55. package/dist/{chunk-DMAXROSE.js → chunk-SQ267ODX.js} +2 -2
  56. package/dist/{chunk-GG5VACLX.js → chunk-STLXHLXG.js} +1 -1
  57. package/dist/{chunk-EJDPSXRR.js → chunk-STX635TX.js} +2 -2
  58. package/dist/{chunk-QJWBSQBP.js → chunk-TFGYF3FQ.js} +23 -23
  59. package/dist/{chunk-NCBBUKK3.js → chunk-TVYPHGC5.js} +2 -2
  60. package/dist/{chunk-IPAUA7K7.js → chunk-UUYDA4WG.js} +1 -1
  61. package/dist/{chunk-VYSH7YED.js → chunk-VCHKJGJT.js} +1 -1
  62. package/dist/{chunk-EA4K7ALH.js → chunk-X3ZC7AXI.js} +1 -1
  63. package/dist/{chunk-OX2NIH7D.js → chunk-XCGNWAOF.js} +1 -1
  64. package/dist/{chunk-7FHYJQRQ.js → chunk-XOHRHHGI.js} +1 -1
  65. package/dist/{chunk-LGAAB6XW.js → chunk-XYYJ4EDQ.js} +2 -2
  66. package/dist/{chunk-YFF3TI37.js → chunk-YGQKTDZC.js} +1 -1
  67. package/dist/chunk-YMLRM7AU.js +77 -0
  68. package/dist/{chunk-DFUY7QQB.js → chunk-YQAQAP4O.js} +1 -1
  69. package/dist/{chunk-PC7WQHNP.js → chunk-ZFJKBH6D.js} +1 -1
  70. package/dist/{cliHook-FGUQDWDO.js → cliHook-JJ7NLUHE.js} +5 -5
  71. package/dist/{codexHook-EBHHOS3N.js → codexHook-IM5PLOV5.js} +5 -5
  72. package/dist/commands/sessions/web/bundle.js +1 -1
  73. package/dist/{comment-5NZM3RQR.js → comment-HBKFSNWP.js} +5 -6
  74. package/dist/{comments-DRP6WYRC.js → comments-E4NTYOGL.js} +4 -5
  75. package/dist/{commit-RQSCSKDT.js → commit-MVTQCBBJ.js} +8 -7
  76. package/dist/{configGet-FWYLGU55.js → configGet-SCEFYI6M.js} +4 -5
  77. package/dist/{configImportRepos-QB5ZFZWD.js → configImportRepos-WABC4EGI.js} +4 -5
  78. package/dist/{configImportUser-IAO2R5F7.js → configImportUser-XUR54SGS.js} +4 -5
  79. package/dist/{configList-VVLV66AP.js → configList-I2GSVJGS.js} +4 -5
  80. package/dist/{configSet-4WU64F2P.js → configSet-536TZ32Y.js} +9 -10
  81. package/dist/{configUnset-6HGW46VY.js → configUnset-ZVVQH7MD.js} +8 -9
  82. package/dist/{del-F7OMMCID.js → del-PZJXA3WM.js} +4 -5
  83. package/dist/{deleteCommentCmd-3HKL42TF.js → deleteCommentCmd-YZ445YDX.js} +5 -6
  84. package/dist/{docsConfirm-OLF7ATQC.js → docsConfirm-B2D2IN2S.js} +6 -7
  85. package/dist/{docsScreenshots-S2DJ3C44.js → docsScreenshots-A66RQSZQ.js} +4 -5
  86. package/dist/{docsUnlock-4Z57S7Z2.js → docsUnlock-4FNY2CR7.js} +4 -5
  87. package/dist/{doctorNodes-N5IY46KY.js → doctorNodes-PHKGVIBX.js} +3 -3
  88. package/dist/{done-X46X6AQ6.js → done-YFKFZK2S.js} +5 -6
  89. package/dist/{editHook-RG5FVEUW.js → editHook-MCWMYI33.js} +5 -5
  90. package/dist/{exportBacklog-DK77QLQL.js → exportBacklog-LRCARQJA.js} +3 -4
  91. package/dist/{harnessFollowUps-5EDAKKA7.js → harnessFollowUps-ZBUSHLXG.js} +4 -5
  92. package/dist/{importBacklog-VKVQKYH6.js → importBacklog-Z4AJBLV4.js} +2 -3
  93. package/dist/index.js +91 -91
  94. package/dist/{launchMode-ZKJCTXOV.js → launchMode-4A6U3LTB.js} +16 -17
  95. package/dist/{link-7DYOFYOE.js → link-ILBSDWHM.js} +4 -5
  96. package/dist/{list-PTCQS6QP.js → list-HWT66EGA.js} +2 -3
  97. package/dist/{list-HTZJUTS7.js → list-IYTEKSBT.js} +4 -5
  98. package/dist/{list-4364VCMP.js → list-KAAEQ2RR.js} +3 -4
  99. package/dist/migrate-VCF2RZBJ.js +142 -0
  100. package/dist/{movePhase-O7OZX5VO.js → movePhase-ATCM4NEX.js} +5 -6
  101. package/dist/{moveRepo-XBOTGKGK.js → moveRepo-2FECYKSF.js} +4 -5
  102. package/dist/{next-V2SV5TD3.js → next-4R4VQJMS.js} +14 -15
  103. package/dist/{phaseDone-Q654PSRR.js → phaseDone-W2BGSGHG.js} +7 -8
  104. package/dist/{piHook-IFT2N55C.js → piHook-K6TRWGI6.js} +5 -5
  105. package/dist/{plan-6YGSOJNG.js → plan-YUHDUPTJ.js} +4 -5
  106. package/dist/{propose-AZ5BUX22.js → propose-RXJXCUTN.js} +8 -9
  107. package/dist/{raise-X2QA5FGK.js → raise-5B2UUOA4.js} +4 -5
  108. package/dist/{recordSlack-6GI5PG6N.js → recordSlack-YMFRV354.js} +4 -5
  109. package/dist/{refine-KLLDBG2K.js → refine-F3AJECLF.js} +18 -19
  110. package/dist/{refreshDocs-EQFOBQX6.js → refreshDocs-R7ZSK5TD.js} +5 -6
  111. package/dist/{releasesConfigure-GG4DN3ZX.js → releasesConfigure-Y5HBC6LQ.js} +6 -7
  112. package/dist/{remove-3IGWPHHU.js → remove-SK64TMDG.js} +6 -7
  113. package/dist/{remove-NUYPNAOA.js → remove-V4GA5762.js} +2 -3
  114. package/dist/{removePhase-GA72LSRL.js → removePhase-TLRSRRVM.js} +6 -7
  115. package/dist/{restartNode-HE32CL2M.js → restartNode-MPZX4HVH.js} +5 -5
  116. package/dist/{review-SO5T6NAX.js → review-DMJXENPP.js} +6 -7
  117. package/dist/{rewindPhase-CXASEYYS.js → rewindPhase-UL5XEEXE.js} +7 -8
  118. package/dist/{rulesAdd-GTSX6UKS.js → rulesAdd-GHYEXNKI.js} +8 -9
  119. package/dist/{run-YIWDPH2I.js → run-424NNNIR.js} +13 -14
  120. package/dist/{run-A7LQ6OMR.js → run-O3YG35JS.js} +13 -14
  121. package/dist/{runDaemon-3LVAUYKP.js → runDaemon-GMOEHQDZ.js} +10 -11
  122. package/dist/{runExtract-WTDQSZZZ.js → runExtract-SL3BFDYB.js} +6 -7
  123. package/dist/{runParallelPhase-XEG4OME5.js → runParallelPhase-U3XEBOB7.js} +9 -10
  124. package/dist/{runRefine-EKYR3KCH.js → runRefine-6UTTU6UY.js} +18 -19
  125. package/dist/{scan-AZIPFEWO.js → scan-A2ZOGLRX.js} +4 -5
  126. package/dist/{schemaConfirm-C5MQYUS7.js → schemaConfirm-TT3IW6HJ.js} +6 -7
  127. package/dist/{schemaUnlock-U3UF5N7H.js → schemaUnlock-JAUWH3X2.js} +4 -5
  128. package/dist/{search-B4LW6DPC.js → search-BGDVCDVG.js} +4 -5
  129. package/dist/{setStatusCommand-LGPGWPZU.js → setStatusCommand-3EXNYTZP.js} +4 -5
  130. package/dist/{show-GDYG6Z3T.js → show-HLQOAXQE.js} +6 -7
  131. package/dist/{signExtension-H3IL7263.js → signExtension-AY3CE4W4.js} +1 -1
  132. package/dist/{skip-RVS3ENSL.js → skip-N7GXJXOH.js} +6 -7
  133. package/dist/{star-CP6NNIEB.js → star-GAUFTLYQ.js} +6 -7
  134. package/dist/{start-K5UIPVEU.js → start-VDVGGTEQ.js} +4 -5
  135. package/dist/{status-KWBZOVTH.js → status-FL6EWV6X.js} +1 -2
  136. package/dist/{stop-7IGMJJGV.js → stop-GTVNVIEY.js} +4 -5
  137. package/dist/{unlink-G44Z6Y43.js → unlink-B6JU7IDK.js} +4 -5
  138. package/dist/{unstar-2CWCILXK.js → unstar-6O4HZ7SA.js} +6 -7
  139. package/dist/{update-IZ5MHZJA.js → update-352CIG7N.js} +4 -5
  140. package/dist/{updateNode-5ADCDAMM.js → updateNode-RDBBEXOS.js} +5 -5
  141. package/dist/{updatePhase-Y6DUY2DG.js → updatePhase-6RHPMYTZ.js} +5 -6
  142. package/dist/{updatePlan-DLEMOZMS.js → updatePlan-PEZI7BK5.js} +7 -8
  143. package/dist/{web-4RE3ERSK.js → web-R5BHN57Z.js} +31 -32
  144. package/dist/{web-BRNL5ERI.js → web-U2YNXKH6.js} +31 -32
  145. package/dist/{wontdo-M32ZQ2CC.js → wontdo-6QXFMDRS.js} +5 -6
  146. package/package.json +1 -1
  147. package/dist/chunk-ZBLXDYGO.js +0 -39
  148. package/dist/migrate-R6FJ63AX.js +0 -37
@@ -1,10 +1,6 @@
1
1
  import {
2
- phaseUnlockSuffix
3
- } from "./chunk-CUOHHT2F.js";
4
- import {
5
- currentExecutionIdentity,
6
- getSchemaSessionApprovalPath
7
- } from "./chunk-AWPYXTCV.js";
2
+ hasOpenPhaseUnlock
3
+ } from "./chunk-YMLRM7AU.js";
8
4
  import {
9
5
  resolveSessionItemId
10
6
  } from "./chunk-FPWL4VRC.js";
@@ -14,40 +10,17 @@ import {
14
10
  import {
15
11
  closeDb,
16
12
  getDb,
17
- itemGitRefs,
18
- items,
19
13
  links
20
- } from "./chunk-V32YJXLE.js";
14
+ } from "./chunk-NCUJ2K55.js";
21
15
  import {
22
16
  getProjectRoot
23
17
  } from "./chunk-EGHUOQR6.js";
24
18
 
25
19
  // src/commands/backlog/isDocsLocked.ts
26
- import { and as and2, eq as eq2 } from "drizzle-orm";
27
-
28
- // src/commands/backlog/hasOpenPhaseUnlock.ts
29
- import { and, eq, notInArray, sql } from "drizzle-orm";
30
- async function hasOpenPhaseUnlock(itemId, kind, harness) {
31
- const orm = await getDb();
32
- const suffix = phaseUnlockSuffix(harness);
33
- const [row] = await orm.select({ itemId: itemGitRefs.itemId }).from(itemGitRefs).innerJoin(items, eq(items.id, itemGitRefs.itemId)).where(
34
- and(
35
- eq(itemGitRefs.itemId, itemId),
36
- eq(itemGitRefs.kind, kind),
37
- eq(
38
- itemGitRefs.ref,
39
- sql`'phase-' || coalesce(${items.currentPhase}, 1) || ${suffix}`
40
- ),
41
- notInArray(items.status, ["done", "wontdo"])
42
- )
43
- ).limit(1);
44
- return row !== void 0;
45
- }
46
-
47
- // src/commands/backlog/isDocsLocked.ts
20
+ import { and, eq } from "drizzle-orm";
48
21
  async function isDocsRefreshItem(itemId) {
49
22
  const orm = await getDb();
50
- const [row] = await orm.select({ itemId: links.itemId }).from(links).where(and2(eq2(links.itemId, itemId), eq2(links.type, "docs-refresh"))).limit(1);
23
+ const [row] = await orm.select({ itemId: links.itemId }).from(links).where(and(eq(links.itemId, itemId), eq(links.type, "docs-refresh"))).limit(1);
51
24
  return row !== void 0;
52
25
  }
53
26
  async function isDocsLocked() {
@@ -65,44 +38,6 @@ async function isDocsLocked() {
65
38
  }
66
39
  }
67
40
 
68
- // src/commands/schema/isSchemaLocked.ts
69
- import { existsSync, readFileSync } from "fs";
70
- function approvalMatches(path, identity) {
71
- try {
72
- const approval = JSON.parse(
73
- readFileSync(path, "utf8")
74
- );
75
- const conversation = approval.conversationId ?? approval.claudeSessionId;
76
- if (approval.harness !== void 0 && approval.harness !== identity.harness)
77
- return false;
78
- return conversation === void 0 || conversation === identity.conversationId;
79
- } catch {
80
- return false;
81
- }
82
- }
83
- function hasSessionApproval(identity) {
84
- const { harness, conversationId } = identity;
85
- if (!conversationId) return false;
86
- const path = getSchemaSessionApprovalPath({ harness, conversationId });
87
- return path !== void 0 && existsSync(path) && approvalMatches(path, identity);
88
- }
89
- async function isSchemaLocked(identity = currentExecutionIdentity()) {
90
- if (!identity) return false;
91
- if (identity.itemId === null) return !hasSessionApproval(identity);
92
- try {
93
- return !await hasOpenPhaseUnlock(
94
- identity.itemId,
95
- "schema-unlock",
96
- identity.harness
97
- );
98
- } catch {
99
- return true;
100
- } finally {
101
- await closeDb().catch(() => {
102
- });
103
- }
104
- }
105
-
106
41
  // src/commands/backlog/isDocsPath.ts
107
42
  import { relative, resolve } from "path";
108
43
  var LOCKED_DOCS_DIRS = ["docs/src/content/docs/", "docs/public/screenshots/"];
@@ -129,14 +64,14 @@ function mentionsDocsPath(command, root = getProjectRoot()) {
129
64
  }
130
65
 
131
66
  // src/commands/schema/isSchemaPath.ts
132
- import { readFileSync as readFileSync2 } from "fs";
67
+ import { readFileSync } from "fs";
133
68
  import { relative as relative2, resolve as resolve2 } from "path";
134
69
  var SCHEMA_LOCK_REASON = "Database schema files (src/shared/db/migrations/migrationNNNN*.ts, src/shared/db/migrations.ts, src/shared/db/schema.ts and any src/shared/db/*.ts that defines a pgTable) are locked: a schema change needs the user's sign-off (see src/shared/db/CLAUDE.md). Confirm the schema change with the user first, then run `assist schema unlock` to request a PIN and wait for the user to confirm it with `assist schema confirm <pin>` before retrying. In a backlog item session the unlock lasts for the current phase on this harness; otherwise it lasts for this conversation only.";
135
70
  var FIXED_SCHEMA_PATH = /^src\/shared\/db\/(?:migrations\/migration\d{4}[^/]*\.ts|migrations\.ts|schema\.ts)$/;
136
71
  var DB_MODULE = /^src\/shared\/db\/[^/]+\.ts$/;
137
72
  function readOrEmpty(path) {
138
73
  try {
139
- return readFileSync2(path, "utf8");
74
+ return readFileSync(path, "utf8");
140
75
  } catch {
141
76
  return "";
142
77
  }
@@ -165,6 +100,5 @@ export {
165
100
  mentionsDocsPath,
166
101
  SCHEMA_LOCK_REASON,
167
102
  isSchemaRelativePath,
168
- isSchemaPath,
169
- isSchemaLocked
103
+ isSchemaPath
170
104
  };
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  resolveSharedRepoBlock,
7
7
  saveSharedRepoBlock
8
- } from "./chunk-QV63A5FN.js";
8
+ } from "./chunk-6D6WQN2W.js";
9
9
  import {
10
10
  validateConfig
11
11
  } from "./chunk-KNRK4XIM.js";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-B5ZOANOD.js";
15
15
  import {
16
16
  getDb
17
- } from "./chunk-V32YJXLE.js";
17
+ } from "./chunk-NCUJ2K55.js";
18
18
  import {
19
19
  loadProjectConfig,
20
20
  saveConfig
@@ -1,10 +1,38 @@
1
- import {
2
- APPLIED_MIGRATIONS_TABLE
3
- } from "./chunk-ZBLXDYGO.js";
4
1
  import {
5
2
  migrations
6
3
  } from "./chunk-MYH4MQX2.js";
7
4
 
5
+ // src/shared/db/migrations/applyMigrations.ts
6
+ var APPLIED_MIGRATIONS_TABLE = "applied_migrations";
7
+ var CREATE_APPLIED_MIGRATIONS = `
8
+ CREATE TABLE IF NOT EXISTS ${APPLIED_MIGRATIONS_TABLE} (
9
+ id INTEGER PRIMARY KEY,
10
+ name TEXT NOT NULL,
11
+ applied_at TIMESTAMPTZ NOT NULL DEFAULT now()
12
+ );
13
+ `;
14
+ async function readAppliedIds(exec) {
15
+ const rows = await exec.query(
16
+ `SELECT id FROM ${APPLIED_MIGRATIONS_TABLE} ORDER BY id`
17
+ );
18
+ return new Set(rows.map((row) => Number(row.id)));
19
+ }
20
+ async function applyMigrations(exec) {
21
+ await exec.exec(CREATE_APPLIED_MIGRATIONS);
22
+ const applied = await readAppliedIds(exec);
23
+ const newlyApplied = [];
24
+ for (const migration of migrations) {
25
+ if (applied.has(migration.id)) continue;
26
+ await exec.exec(migration.sql);
27
+ await exec.query(
28
+ `INSERT INTO ${APPLIED_MIGRATIONS_TABLE} (id, name) VALUES ($1, $2) ON CONFLICT (id) DO NOTHING`,
29
+ [migration.id, migration.name]
30
+ );
31
+ newlyApplied.push({ id: migration.id, name: migration.name });
32
+ }
33
+ return newlyApplied;
34
+ }
35
+
8
36
  // src/shared/db/migrations/getMigrationStatus.ts
9
37
  var maxId = (ids) => ids.reduce((max, id) => Math.max(max, id), 0);
10
38
  function compareMigrations(appliedIds) {
@@ -13,14 +41,14 @@ function compareMigrations(appliedIds) {
13
41
  const bundledSet = new Set(bundledIds);
14
42
  const applied = maxId(appliedIds);
15
43
  const expected = maxId(bundledIds);
16
- const ahead = appliedIds.filter((id) => !bundledSet.has(id));
17
- if (ahead.length > 0) return { state: "ahead", applied, expected };
18
44
  const pending = bundledIds.filter((id) => !appliedSet.has(id));
19
45
  if (pending.length > 0)
20
46
  return { state: "behind", applied, expected, pending };
47
+ const ahead = appliedIds.filter((id) => !bundledSet.has(id));
48
+ if (ahead.length > 0) return { state: "ahead", applied, expected };
21
49
  return { state: "in-sync", version: expected };
22
50
  }
23
- async function readAppliedIds(exec) {
51
+ async function readAppliedIds2(exec) {
24
52
  const present = await exec.query(
25
53
  `SELECT to_regclass('public.${APPLIED_MIGRATIONS_TABLE}') AS reg`
26
54
  );
@@ -31,9 +59,11 @@ async function readAppliedIds(exec) {
31
59
  return rows.map((row) => Number(row.id));
32
60
  }
33
61
  async function getMigrationStatus(exec) {
34
- return compareMigrations(await readAppliedIds(exec));
62
+ return compareMigrations(await readAppliedIds2(exec));
35
63
  }
36
64
 
37
65
  export {
66
+ applyMigrations,
67
+ readAppliedIds2 as readAppliedIds,
38
68
  getMigrationStatus
39
69
  };
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  launchMode
3
- } from "./chunk-JOPVPSE7.js";
3
+ } from "./chunk-RJERQDBE.js";
4
4
  import {
5
5
  typeLabel
6
6
  } from "./chunk-XQNV6F74.js";
7
7
  import {
8
8
  loadBacklogSummaries
9
- } from "./chunk-PKSSJOSU.js";
9
+ } from "./chunk-HCNRMHDD.js";
10
10
  import {
11
11
  getReady
12
- } from "./chunk-NCBBUKK3.js";
12
+ } from "./chunk-TVYPHGC5.js";
13
13
  import {
14
14
  loadItem
15
- } from "./chunk-QW2RFAM7.js";
15
+ } from "./chunk-2JYJEYRY.js";
16
16
  import {
17
17
  formatItemId,
18
18
  parseItemId
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-YS3HSXSJ.js";
4
4
  import {
5
5
  dependsOnError
6
- } from "./chunk-OHGHP7ZX.js";
6
+ } from "./chunk-S7MIJZ2I.js";
7
7
  import {
8
8
  requestAssistSession
9
9
  } from "./chunk-F4XCHVD7.js";
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-QNVYNVAM.js";
16
16
  import {
17
17
  toStoredDependsOn
18
- } from "./chunk-NCBBUKK3.js";
18
+ } from "./chunk-TVYPHGC5.js";
19
19
  import {
20
20
  formatItemId
21
21
  } from "./chunk-N65VOEFI.js";
@@ -23,7 +23,7 @@ import {
23
23
  items,
24
24
  planPhases,
25
25
  planTasks
26
- } from "./chunk-V32YJXLE.js";
26
+ } from "./chunk-NCUJ2K55.js";
27
27
 
28
28
  // src/commands/backlog/updatePlan/replacePlan.ts
29
29
  import { eq as eq2 } from "drizzle-orm";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getMigrationStatus
3
- } from "./chunk-UKO64UKG.js";
3
+ } from "./chunk-J6ULAU7G.js";
4
4
  import {
5
5
  createPool,
6
6
  pgExecutor
@@ -499,14 +499,16 @@ function makeOrmFromPool(pool) {
499
499
  // src/shared/db/migrations/assertMigrationsInSync.ts
500
500
  var behindMessage = (applied, expected) => `Assist database is behind this build (applied migration ${applied}, build expects ${expected}).
501
501
  Run \`assist db migrate\` to apply the pending migrations.`;
502
- var aheadMessage = (applied, expected) => `Assist database is ahead of this build (applied migration ${applied}, build knows ${expected}).
503
- Update assist (\`assist update\`) to a build that includes the newer migrations.`;
502
+ var aheadWarning = (applied, expected) => `Assist database is ahead of this build (applied migration ${applied}, build knows ${expected}); continuing because migrations are additive. Update assist (\`assist update\`) to a build that includes the newer migrations.`;
503
+ var warnedAhead = false;
504
504
  async function assertMigrationsInSync(exec) {
505
505
  const status = await getMigrationStatus(exec);
506
506
  if (status.state === "behind")
507
507
  throw new Error(behindMessage(status.applied, status.expected));
508
- if (status.state === "ahead")
509
- throw new Error(aheadMessage(status.applied, status.expected));
508
+ if (status.state === "ahead" && !warnedAhead) {
509
+ warnedAhead = true;
510
+ console.warn(aheadWarning(status.applied, status.expected));
511
+ }
510
512
  }
511
513
 
512
514
  // src/shared/db/initDb.ts
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  backlogPhaseActivity,
3
3
  recordPhaseSession
4
- } from "./chunk-LFZQMX5H.js";
4
+ } from "./chunk-BQRWKDLW.js";
5
5
  import {
6
6
  resumeNudge
7
7
  } from "./chunk-7NZOH4LN.js";
@@ -23,19 +23,19 @@ import {
23
23
  } from "./chunk-5H7EHZ3J.js";
24
24
  import {
25
25
  appendComment
26
- } from "./chunk-EA4K7ALH.js";
26
+ } from "./chunk-X3ZC7AXI.js";
27
27
  import {
28
28
  buildPhasePrompt
29
29
  } from "./chunk-PX5NZMZE.js";
30
30
  import {
31
31
  getReady
32
- } from "./chunk-NCBBUKK3.js";
32
+ } from "./chunk-TVYPHGC5.js";
33
33
  import {
34
34
  loadItem
35
- } from "./chunk-QW2RFAM7.js";
35
+ } from "./chunk-2JYJEYRY.js";
36
36
  import {
37
37
  phaseUsage
38
- } from "./chunk-V32YJXLE.js";
38
+ } from "./chunk-NCUJ2K55.js";
39
39
  import {
40
40
  harnessAdapter
41
41
  } from "./chunk-XI3WAFFQ.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-XSJGIJEE.js";
5
5
  import {
6
6
  withDbClient
7
- } from "./chunk-V32YJXLE.js";
7
+ } from "./chunk-NCUJ2K55.js";
8
8
 
9
9
  // src/commands/backlog/exportBacklog.ts
10
10
  import { writeFile } from "fs/promises";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  updateUserConfig,
3
3
  userDbKeyError
4
- } from "./chunk-VYSH7YED.js";
4
+ } from "./chunk-VCHKJGJT.js";
5
5
  import {
6
6
  validateConfig
7
7
  } from "./chunk-KNRK4XIM.js";
8
8
  import {
9
9
  refreshRepoConfigCache
10
- } from "./chunk-OX2NIH7D.js";
10
+ } from "./chunk-XCGNWAOF.js";
11
11
  import {
12
12
  getNestedValue
13
13
  } from "./chunk-OU6Q5ZS3.js";
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-B5ZOANOD.js";
17
17
  import {
18
18
  getDb
19
- } from "./chunk-V32YJXLE.js";
19
+ } from "./chunk-NCUJ2K55.js";
20
20
 
21
21
  // src/commands/config/applyUserConfigSet.ts
22
22
  async function applyUserConfigSet(key, coerced) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildDoctorProbes,
3
3
  diagnoseLink
4
- } from "./chunk-PC7WQHNP.js";
4
+ } from "./chunk-ZFJKBH6D.js";
5
5
  import {
6
6
  queryNodes
7
7
  } from "./chunk-B7VOTF5Q.js";
@@ -9,12 +9,12 @@ import {
9
9
  inboxConnectorRun,
10
10
  inboxScanSchema,
11
11
  readInboxLastScan
12
- } from "./chunk-DJ6XDGDA.js";
12
+ } from "./chunk-DYFRR4T3.js";
13
13
  import {
14
14
  inboxMessages,
15
15
  jobRuns,
16
16
  metadata
17
- } from "./chunk-V32YJXLE.js";
17
+ } from "./chunk-NCUJ2K55.js";
18
18
  import {
19
19
  emptyScanUsage,
20
20
  harnessAdapter,
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-WYNRHOR7.js";
11
11
  import {
12
12
  jobRuns
13
- } from "./chunk-V32YJXLE.js";
13
+ } from "./chunk-NCUJ2K55.js";
14
14
  import {
15
15
  backlogRunMarkers,
16
16
  codexRolloutMeta,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  next
3
- } from "./chunk-LGAAB6XW.js";
3
+ } from "./chunk-XYYJ4EDQ.js";
4
4
  import {
5
5
  pullIfConfigured
6
6
  } from "./chunk-AODN5R7L.js";
7
7
  import {
8
8
  run
9
- } from "./chunk-JXXDGQDA.js";
9
+ } from "./chunk-ESJG46YM.js";
10
10
  import {
11
11
  launchBlocker
12
12
  } from "./chunk-AFQMD7AO.js";
@@ -15,7 +15,7 @@ import {
15
15
  readSignal,
16
16
  stopWatching,
17
17
  watchForMarker
18
- } from "./chunk-BI6FQU3N.js";
18
+ } from "./chunk-OGOH3VWW.js";
19
19
  import {
20
20
  resumeNudge
21
21
  } from "./chunk-7NZOH4LN.js";
@@ -34,14 +34,14 @@ import {
34
34
  } from "./chunk-XQNV6F74.js";
35
35
  import {
36
36
  loadItemSummaries
37
- } from "./chunk-WRSL4R3I.js";
37
+ } from "./chunk-GLO6466J.js";
38
38
  import {
39
39
  getOrigin,
40
40
  getReady
41
- } from "./chunk-NCBBUKK3.js";
41
+ } from "./chunk-TVYPHGC5.js";
42
42
  import {
43
43
  loadItem
44
- } from "./chunk-QW2RFAM7.js";
44
+ } from "./chunk-2JYJEYRY.js";
45
45
  import {
46
46
  InvalidItemIdError,
47
47
  formatItemId,
@@ -4,13 +4,13 @@ import {
4
4
  import {
5
5
  resolveSharedRepoBlock,
6
6
  saveSharedRepoBlock
7
- } from "./chunk-QV63A5FN.js";
7
+ } from "./chunk-6D6WQN2W.js";
8
8
  import {
9
9
  validateConfig
10
10
  } from "./chunk-KNRK4XIM.js";
11
11
  import {
12
12
  getDb
13
- } from "./chunk-V32YJXLE.js";
13
+ } from "./chunk-NCUJ2K55.js";
14
14
  import {
15
15
  repoConfigSchema
16
16
  } from "./chunk-QLS4OPRA.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  differingDependsOn,
3
3
  formatDependsOn
4
- } from "./chunk-7FHYJQRQ.js";
4
+ } from "./chunk-XOHRHHGI.js";
5
5
 
6
6
  // src/commands/backlog/renderPhaseSection.ts
7
7
  function renderPhaseSection(phase, idx) {
@@ -2,7 +2,7 @@ import {
2
2
  items,
3
3
  planPhases,
4
4
  planTasks
5
- } from "./chunk-V32YJXLE.js";
5
+ } from "./chunk-NCUJ2K55.js";
6
6
 
7
7
  // src/commands/backlog/reindexPhases.ts
8
8
  import { and, asc, count, eq } from "drizzle-orm";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  resolveSharedRepoBlock,
6
6
  saveSharedRepoBlock
7
- } from "./chunk-QV63A5FN.js";
7
+ } from "./chunk-6D6WQN2W.js";
8
8
  import {
9
9
  validateConfig
10
10
  } from "./chunk-KNRK4XIM.js";
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-B5ZOANOD.js";
14
14
  import {
15
15
  getDb
16
- } from "./chunk-V32YJXLE.js";
16
+ } from "./chunk-NCUJ2K55.js";
17
17
  import {
18
18
  repoConfigSchema
19
19
  } from "./chunk-QLS4OPRA.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  inboxMessages
3
- } from "./chunk-V32YJXLE.js";
3
+ } from "./chunk-NCUJ2K55.js";
4
4
 
5
5
  // src/shared/db/listInboxMessages.ts
6
6
  import { desc, isNull, sql } from "drizzle-orm";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  findOneItem
3
- } from "./chunk-NCBBUKK3.js";
3
+ } from "./chunk-TVYPHGC5.js";
4
4
  import {
5
5
  formatItemId
6
6
  } from "./chunk-N65VOEFI.js";
7
7
  import {
8
8
  planPhases
9
- } from "./chunk-V32YJXLE.js";
9
+ } from "./chunk-NCUJ2K55.js";
10
10
 
11
11
  // src/commands/backlog/findPhase.ts
12
12
  import chalk from "chalk";