@bongos/core 1.21.115 → 1.21.116

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.
@@ -824,8 +824,8 @@
824
824
  "text": "Allow new releases and move to {…}",
825
825
  "occurrences": 2,
826
826
  "at": [
827
- "modules/hall-ui/public/deploy.js:252",
828
- "modules/hall-ui/public/deploy.js:680"
827
+ "modules/hall-ui/public/deploy.js:254",
828
+ "modules/hall-ui/public/deploy.js:682"
829
829
  ]
830
830
  },
831
831
  {
@@ -1494,8 +1494,8 @@
1494
1494
  "text": "Move to {…}",
1495
1495
  "occurrences": 2,
1496
1496
  "at": [
1497
- "modules/hall-ui/public/deploy.js:564",
1498
- "modules/hall-ui/public/deploy.js:726"
1497
+ "modules/hall-ui/public/deploy.js:566",
1498
+ "modules/hall-ui/public/deploy.js:728"
1499
1499
  ]
1500
1500
  },
1501
1501
  {
@@ -2084,8 +2084,8 @@
2084
2084
  "text": "Waiting to try core {…} again at {…}.",
2085
2085
  "occurrences": 2,
2086
2086
  "at": [
2087
- "modules/hall-ui/public/deploy.js:212",
2088
- "modules/hall-ui/public/deploy.js:215"
2087
+ "modules/hall-ui/public/deploy.js:214",
2088
+ "modules/hall-ui/public/deploy.js:217"
2089
2089
  ]
2090
2090
  },
2091
2091
  {
@@ -2679,7 +2679,7 @@
2679
2679
  "surface": "builders-hall",
2680
2680
  "text": "(checked {…})",
2681
2681
  "file": "modules/hall-ui/public/deploy.js",
2682
- "line": 460,
2682
+ "line": 462,
2683
2683
  "origin": "js-markup",
2684
2684
  "confidence": "certain"
2685
2685
  },
@@ -3003,7 +3003,7 @@
3003
3003
  "surface": "builders-hall",
3004
3004
  "text": "A known snag stopped the move to core {…}:",
3005
3005
  "file": "modules/hall-ui/public/deploy.js",
3006
- "line": 209,
3006
+ "line": 211,
3007
3007
  "origin": "js-markup",
3008
3008
  "confidence": "certain"
3009
3009
  },
@@ -3021,7 +3021,7 @@
3021
3021
  "surface": "builders-hall",
3022
3022
  "text": "A move to core {…} failed{…} — this project has moved on since, and is serving {…} now. Whatever stopped that one may or may not still apply; the check above is the live answer.",
3023
3023
  "file": "modules/hall-ui/public/deploy.js",
3024
- "line": 369,
3024
+ "line": 371,
3025
3025
  "origin": "js-markup",
3026
3026
  "confidence": "certain"
3027
3027
  },
@@ -3381,7 +3381,7 @@
3381
3381
  "surface": "builders-hall",
3382
3382
  "text": "Allow new releases and move to {…}",
3383
3383
  "file": "modules/hall-ui/public/deploy.js",
3384
- "line": 252,
3384
+ "line": 254,
3385
3385
  "origin": "js-markup",
3386
3386
  "confidence": "certain"
3387
3387
  },
@@ -3390,7 +3390,7 @@
3390
3390
  "surface": "builders-hall",
3391
3391
  "text": "Allow new releases and move to {…}",
3392
3392
  "file": "modules/hall-ui/public/deploy.js",
3393
- "line": 680,
3393
+ "line": 682,
3394
3394
  "origin": "js-text-assign",
3395
3395
  "confidence": "certain"
3396
3396
  },
@@ -3426,7 +3426,7 @@
3426
3426
  "surface": "builders-hall",
3427
3427
  "text": "An earlier attempt did not land.",
3428
3428
  "file": "modules/hall-ui/public/deploy.js",
3429
- "line": 369,
3429
+ "line": 371,
3430
3430
  "origin": "js-markup",
3431
3431
  "confidence": "certain"
3432
3432
  },
@@ -4200,7 +4200,7 @@
4200
4200
  "surface": "builders-hall",
4201
4201
  "text": "Change to",
4202
4202
  "file": "modules/hall-ui/public/deploy.js",
4203
- "line": 297,
4203
+ "line": 299,
4204
4204
  "origin": "js-markup",
4205
4205
  "confidence": "certain"
4206
4206
  },
@@ -4254,7 +4254,7 @@
4254
4254
  "surface": "builders-hall",
4255
4255
  "text": "Changing the rule…",
4256
4256
  "file": "modules/hall-ui/public/deploy.js",
4257
- "line": 674,
4257
+ "line": 676,
4258
4258
  "origin": "js-text-assign",
4259
4259
  "confidence": "certain"
4260
4260
  },
@@ -4308,7 +4308,7 @@
4308
4308
  "surface": "builders-hall",
4309
4309
  "text": "Checked against {…} — nothing blocks this move.{…}",
4310
4310
  "file": "modules/hall-ui/public/deploy.js",
4311
- "line": 463,
4311
+ "line": 465,
4312
4312
  "origin": "js-markup",
4313
4313
  "confidence": "certain"
4314
4314
  },
@@ -4344,7 +4344,7 @@
4344
4344
  "surface": "builders-hall",
4345
4345
  "text": "Checking what this would do, and what it would bring in. The answer comes from the machine itself, so it can take a couple of minutes.",
4346
4346
  "file": "modules/hall-ui/public/deploy.js",
4347
- "line": 452,
4347
+ "line": 454,
4348
4348
  "origin": "js-markup",
4349
4349
  "confidence": "certain"
4350
4350
  },
@@ -5289,7 +5289,7 @@
5289
5289
  "surface": "builders-hall",
5290
5290
  "text": "Could not read this project's deploy state: {…}",
5291
5291
  "file": "modules/hall-ui/public/deploy.js",
5292
- "line": 619,
5292
+ "line": 621,
5293
5293
  "origin": "js-markup",
5294
5294
  "confidence": "certain"
5295
5295
  },
@@ -5298,7 +5298,7 @@
5298
5298
  "surface": "builders-hall",
5299
5299
  "text": "Could not read what this would bring in: {…}. The check below still applies.",
5300
5300
  "file": "modules/hall-ui/public/deploy.js",
5301
- "line": 537,
5301
+ "line": 539,
5302
5302
  "origin": "js-markup",
5303
5303
  "confidence": "certain"
5304
5304
  },
@@ -5766,7 +5766,7 @@
5766
5766
  "surface": "builders-hall",
5767
5767
  "text": "Database behind.",
5768
5768
  "file": "modules/hall-ui/public/deploy.js",
5769
- "line": 582,
5769
+ "line": 584,
5770
5770
  "origin": "js-markup",
5771
5771
  "confidence": "certain"
5772
5772
  },
@@ -7620,7 +7620,7 @@
7620
7620
  "surface": "builders-hall",
7621
7621
  "text": "If you own this project,",
7622
7622
  "file": "modules/hall-ui/public/deploy.js",
7623
- "line": 419,
7623
+ "line": 421,
7624
7624
  "origin": "js-markup",
7625
7625
  "confidence": "certain"
7626
7626
  },
@@ -8682,7 +8682,7 @@
8682
8682
  "surface": "builders-hall",
8683
8683
  "text": "Move to {…}",
8684
8684
  "file": "modules/hall-ui/public/deploy.js",
8685
- "line": 564,
8685
+ "line": 566,
8686
8686
  "origin": "js-markup",
8687
8687
  "confidence": "certain"
8688
8688
  },
@@ -8691,7 +8691,7 @@
8691
8691
  "surface": "builders-hall",
8692
8692
  "text": "Move to {…}",
8693
8693
  "file": "modules/hall-ui/public/deploy.js",
8694
- "line": 726,
8694
+ "line": 728,
8695
8695
  "origin": "js-text-assign",
8696
8696
  "confidence": "certain"
8697
8697
  },
@@ -8700,7 +8700,7 @@
8700
8700
  "surface": "builders-hall",
8701
8701
  "text": "Moved {…}, and the box confirmed it. The project’s repository on GitHub still names the old core, so changes pushed there may not reach the live site until the two match.",
8702
8702
  "file": "modules/hall-ui/public/deploy.js",
8703
- "line": 385,
8703
+ "line": 387,
8704
8704
  "origin": "js-markup",
8705
8705
  "confidence": "certain"
8706
8706
  },
@@ -8709,7 +8709,7 @@
8709
8709
  "surface": "builders-hall",
8710
8710
  "text": "Moving to core",
8711
8711
  "file": "modules/hall-ui/public/deploy.js",
8712
- "line": 333,
8712
+ "line": 335,
8713
8713
  "origin": "js-markup",
8714
8714
  "confidence": "certain"
8715
8715
  },
@@ -9177,7 +9177,7 @@
9177
9177
  "surface": "builders-hall",
9178
9178
  "text": "No running box to deploy.",
9179
9179
  "file": "modules/hall-ui/public/deploy.js",
9180
- "line": 703,
9180
+ "line": 705,
9181
9181
  "origin": "js-markup",
9182
9182
  "confidence": "certain"
9183
9183
  },
@@ -9222,7 +9222,7 @@
9222
9222
  "surface": "builders-hall",
9223
9223
  "text": "No shipped work is recorded between core {…} and {…}.",
9224
9224
  "file": "modules/hall-ui/public/deploy.js",
9225
- "line": 544,
9225
+ "line": 546,
9226
9226
  "origin": "js-markup",
9227
9227
  "confidence": "certain"
9228
9228
  },
@@ -9447,7 +9447,7 @@
9447
9447
  "surface": "builders-hall",
9448
9448
  "text": "Not checked yet — the runner takes this reading on its own tick.",
9449
9449
  "file": "modules/hall-ui/public/deploy.js",
9450
- "line": 458,
9450
+ "line": 460,
9451
9451
  "origin": "js-markup",
9452
9452
  "confidence": "certain"
9453
9453
  },
@@ -9744,7 +9744,7 @@
9744
9744
  "surface": "builders-hall",
9745
9745
  "text": "Nothing newer is published that this box can take. There is nothing to deploy.",
9746
9746
  "file": "modules/hall-ui/public/deploy.js",
9747
- "line": 599,
9747
+ "line": 601,
9748
9748
  "origin": "js-markup",
9749
9749
  "confidence": "certain"
9750
9750
  },
@@ -9798,7 +9798,7 @@
9798
9798
  "surface": "builders-hall",
9799
9799
  "text": "Now running core {…}",
9800
9800
  "file": "modules/hall-ui/public/deploy.js",
9801
- "line": 395,
9801
+ "line": 397,
9802
9802
  "origin": "js-markup",
9803
9803
  "confidence": "certain"
9804
9804
  },
@@ -9807,7 +9807,7 @@
9807
9807
  "surface": "builders-hall",
9808
9808
  "text": "Now running core {…} — but GitHub was not updated.",
9809
9809
  "file": "modules/hall-ui/public/deploy.js",
9810
- "line": 385,
9810
+ "line": 387,
9811
9811
  "origin": "js-markup",
9812
9812
  "confidence": "certain"
9813
9813
  },
@@ -11670,7 +11670,7 @@
11670
11670
  "surface": "builders-hall",
11671
11671
  "text": "Save rule",
11672
11672
  "file": "modules/hall-ui/public/deploy.js",
11673
- "line": 297,
11673
+ "line": 299,
11674
11674
  "origin": "js-markup",
11675
11675
  "confidence": "certain"
11676
11676
  },
@@ -11886,7 +11886,7 @@
11886
11886
  "surface": "builders-hall",
11887
11887
  "text": "See what would change",
11888
11888
  "file": "modules/hall-ui/public/deploy.js",
11889
- "line": 425,
11889
+ "line": 427,
11890
11890
  "origin": "js-markup",
11891
11891
  "confidence": "certain"
11892
11892
  },
@@ -11985,7 +11985,7 @@
11985
11985
  "surface": "builders-hall",
11986
11986
  "text": "Serving {…} — read from the box itself, {…}.",
11987
11987
  "file": "modules/hall-ui/public/deploy.js",
11988
- "line": 602,
11988
+ "line": 604,
11989
11989
  "origin": "js-markup",
11990
11990
  "confidence": "certain"
11991
11991
  },
@@ -12714,7 +12714,7 @@
12714
12714
  "surface": "builders-hall",
12715
12715
  "text": "Still working on core {…}. It keeps going without this page — reload to see where it got to.",
12716
12716
  "file": "modules/hall-ui/public/deploy.js",
12717
- "line": 764,
12717
+ "line": 766,
12718
12718
  "origin": "js-notice",
12719
12719
  "confidence": "certain"
12720
12720
  },
@@ -13065,7 +13065,7 @@
13065
13065
  "surface": "builders-hall",
13066
13066
  "text": "Technical detail — what the upgrade said",
13067
13067
  "file": "modules/hall-ui/public/deploy.js",
13068
- "line": 365,
13068
+ "line": 367,
13069
13069
  "origin": "js-markup",
13070
13070
  "confidence": "certain"
13071
13071
  },
@@ -14037,7 +14037,7 @@
14037
14037
  "surface": "builders-hall",
14038
14038
  "text": "The upgrade checked {…} and refused:{…}",
14039
14039
  "file": "modules/hall-ui/public/deploy.js",
14040
- "line": 468,
14040
+ "line": 470,
14041
14041
  "origin": "js-markup",
14042
14042
  "confidence": "certain"
14043
14043
  },
@@ -14424,7 +14424,7 @@
14424
14424
  "surface": "builders-hall",
14425
14425
  "text": "This project's code expects {…} database change{…} that its database has not applied yet. Anything that relies on {…} may fail until the migrations run.",
14426
14426
  "file": "modules/hall-ui/public/deploy.js",
14427
- "line": 582,
14427
+ "line": 584,
14428
14428
  "origin": "js-markup",
14429
14429
  "confidence": "certain"
14430
14430
  },
@@ -14433,7 +14433,7 @@
14433
14433
  "surface": "builders-hall",
14434
14434
  "text": "This restarts {…} onto core",
14435
14435
  "file": "modules/hall-ui/public/deploy.js",
14436
- "line": 564,
14436
+ "line": 566,
14437
14437
  "origin": "js-markup",
14438
14438
  "confidence": "certain"
14439
14439
  },
@@ -14505,7 +14505,7 @@
14505
14505
  "surface": "builders-hall",
14506
14506
  "text": "This would fail.",
14507
14507
  "file": "modules/hall-ui/public/deploy.js",
14508
- "line": 468,
14508
+ "line": 470,
14509
14509
  "origin": "js-markup",
14510
14510
  "confidence": "certain"
14511
14511
  },
@@ -14559,7 +14559,7 @@
14559
14559
  "surface": "builders-hall",
14560
14560
  "text": "Try again",
14561
14561
  "file": "modules/hall-ui/public/deploy.js",
14562
- "line": 268,
14562
+ "line": 270,
14563
14563
  "origin": "js-markup",
14564
14564
  "confidence": "certain"
14565
14565
  },
@@ -14568,7 +14568,7 @@
14568
14568
  "surface": "builders-hall",
14569
14569
  "text": "Try now",
14570
14570
  "file": "modules/hall-ui/public/deploy.js",
14571
- "line": 217,
14571
+ "line": 219,
14572
14572
  "origin": "js-markup",
14573
14573
  "confidence": "certain"
14574
14574
  },
@@ -14775,7 +14775,7 @@
14775
14775
  "surface": "builders-hall",
14776
14776
  "text": "Update rule: {…}",
14777
14777
  "file": "modules/hall-ui/public/deploy.js",
14778
- "line": 297,
14778
+ "line": 299,
14779
14779
  "origin": "js-markup",
14780
14780
  "confidence": "certain"
14781
14781
  },
@@ -14955,7 +14955,7 @@
14955
14955
  "surface": "builders-hall",
14956
14956
  "text": "Waiting to try core {…} again at {…}.",
14957
14957
  "file": "modules/hall-ui/public/deploy.js",
14958
- "line": 212,
14958
+ "line": 214,
14959
14959
  "origin": "js-markup",
14960
14960
  "confidence": "certain"
14961
14961
  },
@@ -14964,7 +14964,7 @@
14964
14964
  "surface": "builders-hall",
14965
14965
  "text": "Waiting to try core {…} again at {…}.",
14966
14966
  "file": "modules/hall-ui/public/deploy.js",
14967
- "line": 215,
14967
+ "line": 217,
14968
14968
  "origin": "js-markup",
14969
14969
  "confidence": "certain"
14970
14970
  },
@@ -15243,7 +15243,7 @@
15243
15243
  "surface": "builders-hall",
15244
15244
  "text": "What this brings in",
15245
15245
  "file": "modules/hall-ui/public/deploy.js",
15246
- "line": 553,
15246
+ "line": 555,
15247
15247
  "origin": "js-markup",
15248
15248
  "confidence": "certain"
15249
15249
  },
@@ -15711,7 +15711,7 @@
15711
15711
  "surface": "builders-hall",
15712
15712
  "text": "You can still press Move — the runner will refuse it the same way, and the box is left where it is.",
15713
15713
  "file": "modules/hall-ui/public/deploy.js",
15714
- "line": 468,
15714
+ "line": 470,
15715
15715
  "origin": "js-markup",
15716
15716
  "confidence": "certain"
15717
15717
  },
@@ -16260,7 +16260,7 @@
16260
16260
  "surface": "builders-hall",
16261
16261
  "text": "access: the hub keeps a key of its own for this repository, so this change and every later upgrade are saved to GitHub without asking you again.",
16262
16262
  "file": "modules/hall-ui/public/deploy.js",
16263
- "line": 419,
16263
+ "line": 421,
16264
16264
  "origin": "js-markup",
16265
16265
  "confidence": "certain"
16266
16266
  },
@@ -17097,7 +17097,7 @@
17097
17097
  "surface": "builders-hall",
17098
17098
  "text": "is published and this box is not on it yet.",
17099
17099
  "file": "modules/hall-ui/public/deploy.js",
17100
- "line": 425,
17100
+ "line": 427,
17101
17101
  "origin": "js-markup",
17102
17102
  "confidence": "certain"
17103
17103
  },
@@ -17673,7 +17673,7 @@
17673
17673
  "surface": "builders-hall",
17674
17674
  "text": "reads the control plane's own observation · ADR 0293 · every move is recorded with who asked",
17675
17675
  "file": "modules/hall-ui/public/deploy.js",
17676
- "line": 707,
17676
+ "line": 709,
17677
17677
  "origin": "js-markup",
17678
17678
  "confidence": "certain"
17679
17679
  },
@@ -17682,7 +17682,7 @@
17682
17682
  "surface": "builders-hall",
17683
17683
  "text": "reconnect GitHub with repository access",
17684
17684
  "file": "modules/hall-ui/public/deploy.js",
17685
- "line": 419,
17685
+ "line": 421,
17686
17686
  "origin": "js-markup",
17687
17687
  "confidence": "certain"
17688
17688
  },
@@ -18213,7 +18213,7 @@
18213
18213
  "surface": "builders-hall",
18214
18214
  "text": "the owner’s blockers",
18215
18215
  "file": "modules/hall-ui/public/deploy.js",
18216
- "line": 229,
18216
+ "line": 231,
18217
18217
  "origin": "js-markup",
18218
18218
  "confidence": "certain"
18219
18219
  },
@@ -18825,7 +18825,7 @@
18825
18825
  "surface": "builders-hall",
18826
18826
  "text": "{…} Nothing needs doing — this page shows the result when it lands.",
18827
18827
  "file": "modules/hall-ui/public/deploy.js",
18828
- "line": 217,
18828
+ "line": 219,
18829
18829
  "origin": "js-markup",
18830
18830
  "confidence": "certain"
18831
18831
  },
@@ -19464,7 +19464,7 @@
19464
19464
  "surface": "builders-hall",
19465
19465
  "text": "— moved {…}, and the box confirmed it.",
19466
19466
  "file": "modules/hall-ui/public/deploy.js",
19467
- "line": 395,
19467
+ "line": 397,
19468
19468
  "origin": "js-markup",
19469
19469
  "confidence": "certain"
19470
19470
  },
@@ -19554,7 +19554,7 @@
19554
19554
  "surface": "builders-hall",
19555
19555
  "text": "— {…} {…} of work landed between core {…} and {…}{…}:",
19556
19556
  "file": "modules/hall-ui/public/deploy.js",
19557
- "line": 553,
19557
+ "line": 555,
19558
19558
  "origin": "js-markup",
19559
19559
  "confidence": "certain"
19560
19560
  },
@@ -19572,7 +19572,7 @@
19572
19572
  "surface": "builders-hall",
19573
19573
  "text": "— {…}. The project restarts as part of this, and puts itself back on {…} if the new core does not answer. This page is watching and will say when it lands.",
19574
19574
  "file": "modules/hall-ui/public/deploy.js",
19575
- "line": 333,
19575
+ "line": 335,
19576
19576
  "origin": "js-markup",
19577
19577
  "confidence": "certain"
19578
19578
  },
@@ -19599,7 +19599,7 @@
19599
19599
  "surface": "builders-hall",
19600
19600
  "text": "…and {…} more, not listed.",
19601
19601
  "file": "modules/hall-ui/public/deploy.js",
19602
- "line": 551,
19602
+ "line": 553,
19603
19603
  "origin": "js-markup",
19604
19604
  "confidence": "certain"
19605
19605
  },
@@ -3067,5 +3067,7 @@ is load-bearing: the script throws rather than guess if it is missing, and
3067
3067
  landed since 1.21.113 with no explicit bump. run 38515161804. (task 1002620)
3068
3068
  1.21.115 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
3069
3069
  landed since 1.21.114 with no explicit bump. run 38516937959. (task 1002620)
3070
+ 1.21.116 — CI auto-patch (publish-on-merge, ADR 0161): carrier for merges
3071
+ landed since 1.21.115 with no explicit bump. run 38545604578. (task 1002620)
3070
3072
  ---------------------------------------------------------------------------
3071
3073
  ```
@@ -485,7 +485,7 @@
485
485
  "surface": "builders",
486
486
  "title": "Deploy",
487
487
  "states_read": ["work","out"],
488
- "files_hash": "58c2ba633fd0e80c",
488
+ "files_hash": "e556930736d4e0b1",
489
489
  "reading_hash": "ba271ca64d71e7b3",
490
490
  "counts": {"lines":19,"placed":5,"shared":8,"unplaced":6},
491
491
  "omitted": {"data":3},
@@ -156,6 +156,8 @@
156
156
  remedy_failed: 'the automatic fix itself did not work',
157
157
  health: 'the project did not answer after restarting on the new core',
158
158
  migrate: 'updating the project’s database failed',
159
+ // task 1004734: the new core adds a rule some of the project's existing records break
160
+ migrate_check_violation: 'updating the project’s database failed: some records the project already has break a rule the new core adds',
159
161
  restart: 'the project would not restart',
160
162
  rollback_failed: 'the new core failed, and putting the old one back failed too',
161
163
  no_target: 'the move did not say which version to go to',
package/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bongos/core",
3
- "version": "1.21.115",
3
+ "version": "1.21.116",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bongos/core",
9
- "version": "1.21.115",
9
+ "version": "1.21.116",
10
10
  "license": "AGPL-3.0-or-later",
11
11
  "dependencies": {
12
12
  "express": "^4.21.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bongos/core",
3
- "version": "1.21.115",
3
+ "version": "1.21.116",
4
4
  "description": "Cloud Bongos — the AI-first build platform core (GDS + platform surfaces + module system), installed as a versioned dependency (ADR 0108).",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "main": "src/platform-server.js",
@@ -9664,5 +9664,11 @@
9664
9664
  "id": "1004671",
9665
9665
  "text": "When you start a new project, \"Where are you?\" now starts on United States and is a search box instead of a long dropdown. Type a few letters and the list narrows to matching countries; capitals and accents don't matter, so \"c"
9666
9666
  }
9667
+ ],
9668
+ "1.21.116": [
9669
+ {
9670
+ "id": "1004734",
9671
+ "text": "When a project's update fails while updating its database, the deploy page and the auto-filed blocker now say which database change failed and why, so nobody has to log into the machine to find out."
9672
+ }
9667
9673
  ]
9668
9674
  }
@@ -27,7 +27,7 @@
27
27
 
28
28
  const fs = require('node:fs');
29
29
  const path = require('node:path');
30
- const { spawnSync } = require('node:child_process');
30
+ const { spawn, spawnSync } = require('node:child_process');
31
31
 
32
32
  // Relative to the instance root, POSIX on purpose: it is an argument to bash, and it
33
33
  // must stay byte-identical to the scaffold's script (tests/upgrade_migrate.mjs pins it
@@ -161,4 +161,64 @@ function preflightDbIdentity({ instanceDir, db, account = null }, run = spawnSyn
161
161
  };
162
162
  }
163
163
 
164
- module.exports = { migratePlan, preflightDbIdentity, asAccount, ACCOUNT_RE, CORE_MIGRATE_SCRIPT };
164
+ // ── what a FAILED migrate says, so nobody needs SSH to read it (task 1004734) ────────────
165
+ //
166
+ // Seen 2026-10-14: toast's move 1.21.20 → 1.21.115 rolled back and the hub kept exactly
167
+ // "migrate failed (exit 3)". Exit 3 is psql under ON_ERROR_STOP: ONE statement failed on
168
+ // that project's real data. Which file, and which error, reached only the box's journal,
169
+ // because runMigrate spawned with stdio 'inherit'. migrate.sh prints `apply <version>`
170
+ // before each file, and psql -f prefixes its ERROR with the file too, so the output
171
+ // already names both; it just never came back.
172
+ //
173
+ // teeSpawn: the child's stdout/stderr are piped and WRITTEN THROUGH as they arrive — the
174
+ // journal still reads live, exactly as under 'inherit' — while the last TEE_TAIL chars are
175
+ // kept for migrateFailureDetail. Async, because a sync spawn cannot write through.
176
+ const TEE_TAIL = 64 * 1024;
177
+ function teeSpawn(cmd, args, opts = {}, { spawnImpl = spawn, out = process.stdout, err = process.stderr } = {}) {
178
+ return new Promise((resolve) => {
179
+ let output = '';
180
+ const keep = (c) => { output = (output + c).slice(-TEE_TAIL); };
181
+ let child;
182
+ try { child = spawnImpl(cmd, args, { ...opts, stdio: ['inherit', 'pipe', 'pipe'] }); } catch (e) { resolve({ error: e }); return; }
183
+ for (const [pipe, sink] of [[child.stdout, out], [child.stderr, err]]) {
184
+ pipe.setEncoding('utf8');
185
+ pipe.on('data', (c) => { sink.write(c); keep(c); });
186
+ }
187
+ child.on('error', (e) => resolve({ error: e }));
188
+ child.on('close', (status) => resolve({ status, output }));
189
+ });
190
+ }
191
+
192
+ // The failing migration and psql's ERROR line, as " at <file>: ERROR: …" — or '' when the
193
+ // output names neither. Secret-scrubbed (the line is stored on the hub and shown to the
194
+ // owner) and capped. The LAST `apply` line is the file it stopped in: migrate.sh stops at
195
+ // the first failure. PURE.
196
+ const DETAIL_MAX = 300;
197
+ function migrateFailureDetail(text) {
198
+ const lines = String(text || '').split(/\r?\n/);
199
+ const last = (re) => { for (let i = lines.length - 1; i >= 0; i--) { const m = re.exec(lines[i]); if (m) return m; } return null; };
200
+ const err = last(/\b((?:ERROR|FATAL):\s+.*)$/);
201
+ const file = (last(/^apply\s+(\S+)\s*$/) || (err && /^psql:(?:.*[\\/])?([^\\/:]+?)(?:\.sql)?:\d+:/.exec(err.input)) || [])[1] || '';
202
+ let msg = err ? err[1].trim() : '';
203
+ if (msg) {
204
+ // No scrubber, no error text: a credential in a psql line must never reach the hub.
205
+ try { msg = require('../../modules/security/secret-scrub.js').scrubSecrets(msg); } catch { msg = ''; }
206
+ }
207
+ const cap = (s, n) => (s.length > n ? `${s.slice(0, n - 1)}…` : s);
208
+ return (file ? ` at ${cap(file, 80)}` : '') + (msg ? `: ${cap(msg, DETAIL_MAX)}` : '');
209
+ }
210
+
211
+ /** runMigrate's spawn result → { ok, code, detail } | { ok:false, reason }. PURE. */
212
+ function migrateResult(r) {
213
+ if (!r || r.error) return { ok: false, reason: r && r.error ? r.error.message : 'spawn failed' };
214
+ if (r.status === 0) return { ok: true, code: 0 };
215
+ // r.output from teeSpawn; stdout/stderr from a spawnSync-shaped run (tests, any injected run)
216
+ return { ok: false, code: r.status, detail: migrateFailureDetail([r.output, r.stdout, r.stderr].filter(Boolean).join('\n')) };
217
+ }
218
+
219
+ /** The sentence runUpgrade fails with; its "migrate failed" prefix is what upgrade-outcome.js keys on. PURE. */
220
+ function migrateError(mig) {
221
+ return `migrate failed (${mig.reason || `exit ${mig.code}`})${mig.detail || ''}`;
222
+ }
223
+
224
+ module.exports = { migratePlan, preflightDbIdentity, asAccount, ACCOUNT_RE, CORE_MIGRATE_SCRIPT, teeSpawn, migrateFailureDetail, migrateResult, migrateError };
@@ -63,6 +63,9 @@ const REASON_CLASS = Object.freeze({
63
63
  npm_install: 'transient',
64
64
  integrity_pin: 'unknown',
65
65
  migrate: 'unknown',
66
+ // a migration's CHECK constraint is broken by rows the project already has (task 1004734): a
67
+ // retry fails identically and no remedy may rewrite the owner's data, so a person decides.
68
+ migrate_check_violation: 'unknown',
66
69
  restart: 'unknown',
67
70
  health: 'unknown',
68
71
  // the runner's one automatic fix did not clear it, or itself failed (task 1004448)
@@ -86,6 +89,7 @@ const UPGRADE_REASONS = [
86
89
  [/^(--registry and --from|--from tarball not found|no core tarball at)/, 'core_source'],
87
90
  [/^npm install failed/, 'npm_install'],
88
91
  [/^integrity pin/, 'integrity_pin'],
92
+ [/^migrate failed .*\bERROR: .*check constraint/, 'migrate_check_violation'], // upgrade-migrate.js migrateError (task 1004734)
89
93
  [/^migrate failed/, 'migrate'],
90
94
  [/^restart failed/, 'restart'],
91
95
  [/^(health check failed after restart|served core version did not change)/, 'health'],