bareloop 0.54.0 → 0.55.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 (139) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/bareloop.context.md +73 -12
  3. package/package.json +3 -3
  4. package/src/authorflow.js +148 -46
  5. package/src/authoring.js +21 -4
  6. package/src/authorjob.js +82 -3
  7. package/src/authorreadout.js +20 -3
  8. package/src/authorrun.js +1 -1
  9. package/src/authorscout.js +9 -6
  10. package/src/bridges.js +4 -3
  11. package/src/cardschedule.js +42 -0
  12. package/src/carrystore.js +1 -1
  13. package/src/checkpick.js +576 -0
  14. package/src/checksuggest.js +28 -0
  15. package/src/checkwords.js +25 -0
  16. package/src/cli.js +1 -1
  17. package/src/config.js +24 -1
  18. package/src/declaredclose.js +1 -1
  19. package/src/destpoint.js +149 -0
  20. package/src/draftspend.js +39 -0
  21. package/src/factwords.js +14 -1
  22. package/src/job.js +81 -1
  23. package/src/jobblock.js +9 -0
  24. package/src/labelscan.js +11 -0
  25. package/src/launcher.js +10 -6
  26. package/src/learn.js +6 -4
  27. package/src/mcpchecks.js +52 -0
  28. package/src/mcppick.js +36 -0
  29. package/src/mcpsources.js +77 -0
  30. package/src/mcpuse.js +97 -0
  31. package/src/natural.js +23 -0
  32. package/src/pagemap.js +5 -2
  33. package/src/panel/authorroutes.js +90 -15
  34. package/src/panel/authorsession.js +183 -21
  35. package/src/panel/index.html +686 -26
  36. package/src/panel/jobgrid.js +117 -0
  37. package/src/panel/jobplan.js +31 -15
  38. package/src/panel/scheduler.js +80 -13
  39. package/src/panel/schedules.js +189 -28
  40. package/src/panel/schedulestart.js +44 -13
  41. package/src/panel/server.js +438 -33
  42. package/src/panel/settingsroutes.js +133 -3
  43. package/src/panel/status.js +22 -2
  44. package/src/panel/tickets.js +44 -0
  45. package/src/pickrecord.js +145 -0
  46. package/src/plan.js +31 -2
  47. package/src/planrun.js +71 -15
  48. package/src/prcheckout.js +259 -0
  49. package/src/readshim.js +3 -2
  50. package/src/replay.js +6 -0
  51. package/src/reuse.js +3 -3
  52. package/src/revises.js +56 -0
  53. package/src/rubricstep.js +62 -16
  54. package/src/run.js +10 -1
  55. package/src/runexport.js +2 -0
  56. package/src/runlist.js +3 -2
  57. package/src/schedulewords.js +46 -4
  58. package/src/source.js +81 -7
  59. package/src/stepmcp.js +86 -0
  60. package/src/ticket.js +113 -0
  61. package/src/ticketfilter.js +76 -0
  62. package/src/ticketlabels.js +79 -0
  63. package/src/ticketmcp.js +111 -0
  64. package/src/ticketnext.js +35 -0
  65. package/src/ticketrepo.js +98 -0
  66. package/src/ticketschedule.js +32 -0
  67. package/src/ticketshape.js +45 -0
  68. package/src/tools.js +9 -0
  69. package/src/trigger.js +14 -2
  70. package/src/triggerclock.js +7 -3
  71. package/src/triggerfiles.js +19 -11
  72. package/src/triggertickets.js +244 -0
  73. package/src/u-readout.js +2 -2
  74. package/src/userrun.js +146 -10
  75. package/src/validate.js +3 -1
  76. package/src/worktree.js +43 -1
  77. package/types/authorflow.d.ts +128 -28
  78. package/types/authorjob.d.ts +16 -3
  79. package/types/authorreadout.d.ts +9 -2
  80. package/types/authorscout.d.ts +4 -2
  81. package/types/bridges.d.ts +4 -3
  82. package/types/cardschedule.d.ts +24 -0
  83. package/types/checkpick.d.ts +297 -0
  84. package/types/checksuggest.d.ts +30 -0
  85. package/types/checkwords.d.ts +14 -0
  86. package/types/config.d.ts +7 -0
  87. package/types/destpoint.d.ts +87 -0
  88. package/types/draftspend.d.ts +16 -0
  89. package/types/factwords.d.ts +7 -0
  90. package/types/job.d.ts +13 -0
  91. package/types/jobblock.d.ts +9 -0
  92. package/types/labelscan.d.ts +7 -0
  93. package/types/launcher.d.ts +7 -2
  94. package/types/mcpchecks.d.ts +8 -0
  95. package/types/mcppick.d.ts +33 -0
  96. package/types/mcpsources.d.ts +51 -0
  97. package/types/mcpuse.d.ts +15 -0
  98. package/types/natural.d.ts +2 -0
  99. package/types/pagemap.d.ts +2 -1
  100. package/types/panel/authorroutes.d.ts +11 -2
  101. package/types/panel/authorsession.d.ts +58 -3
  102. package/types/panel/jobgrid.d.ts +405 -0
  103. package/types/panel/jobplan.d.ts +10 -4
  104. package/types/panel/scheduler.d.ts +7 -2
  105. package/types/panel/schedules.d.ts +124 -4
  106. package/types/panel/schedulestart.d.ts +21 -3
  107. package/types/panel/server.d.ts +427 -6
  108. package/types/panel/settingsroutes.d.ts +4 -2
  109. package/types/panel/status.d.ts +16 -2
  110. package/types/panel/tickets.d.ts +61 -0
  111. package/types/pickrecord.d.ts +88 -0
  112. package/types/plan.d.ts +1 -0
  113. package/types/prcheckout.d.ts +151 -0
  114. package/types/readshim.d.ts +4 -3
  115. package/types/replay.d.ts +3 -0
  116. package/types/reuse.d.ts +2 -2
  117. package/types/revises.d.ts +23 -0
  118. package/types/rubricstep.d.ts +14 -5
  119. package/types/run.d.ts +18 -1
  120. package/types/runlist.d.ts +6 -3
  121. package/types/schedulewords.d.ts +29 -2
  122. package/types/source.d.ts +40 -4
  123. package/types/stepmcp.d.ts +40 -0
  124. package/types/ticket.d.ts +114 -0
  125. package/types/ticketfilter.d.ts +34 -0
  126. package/types/ticketlabels.d.ts +44 -0
  127. package/types/ticketmcp.d.ts +84 -0
  128. package/types/ticketnext.d.ts +33 -0
  129. package/types/ticketrepo.d.ts +118 -0
  130. package/types/ticketschedule.d.ts +21 -0
  131. package/types/ticketshape.d.ts +37 -0
  132. package/types/tools.d.ts +1 -0
  133. package/types/trigger.d.ts +9 -1
  134. package/types/triggerclock.d.ts +6 -2
  135. package/types/triggerfiles.d.ts +13 -5
  136. package/types/triggertickets.d.ts +110 -0
  137. package/types/userrun.d.ts +50 -0
  138. package/types/validate.d.ts +1 -0
  139. package/types/worktree.d.ts +19 -0
@@ -11,9 +11,9 @@ export function packageVersion(file?: string): string;
11
11
  * running attempt and an archived spine that never reached its own end are
12
12
  * the same fact from this read-only side: no verdict has been recorded yet.
13
13
  * @param {string|null} outcome
14
- * @returns {'✓'|'✗'|'■'|'▶'}
14
+ * @returns {'✓'|'✗'|'■'|'▶'|'–'}
15
15
  */
16
- export function glyphForOutcome(outcome: string | null): "\u2713" | "\u2717" | "\u25A0" | "\u25B6";
16
+ export function glyphForOutcome(outcome: string | null): "\u2713" | "\u2717" | "\u25A0" | "\u25B6" | "\u2013";
17
17
  /**
18
18
  * `deterministic` (green) / `rubric` (soft-green) / `unknown` (a class this
19
19
  * reader doesn't recognize) — the settled UI wording (PANEL-BUILD.md §6),
@@ -162,6 +162,16 @@ export function endedFor(summary: {
162
162
  label: string;
163
163
  }[];
164
164
  } | null;
165
+ /**
166
+ * R9 (9b.2, fwd 7a98141): did this run END BEFORE ITS FIRST STEP, at $0? The rule, from recorded facts only: the run has NO spine on disk, and its row carries a leg-1 `settled` event
167
+ * that is `refused before start` or `skipped` with `spentUsd` exactly 0 and `spendComplete` not false. Such a run never ran its plan (no step, no model call), so Reuse workflow with
168
+ * the job unchanged signs and goes with the signed job; a red run that DID run (it has a spine) still drafts.
169
+ * @param {any[]} events @param {{runid: string, spine: string}} row
170
+ */
171
+ export function neverRanPlan(events: any[], row: {
172
+ runid: string;
173
+ spine: string;
174
+ }): boolean;
165
175
  /**
166
176
  * RULED 2026-10-15 (Remove from Needs you): the ONE place a run's Needs-you state is decided. `Accept` (a live door) is never removable and never ages out.
167
177
  * A `Resume` tag leaves when the person removed it AFTER (or at) the stop it is for — a removal covers only the ending it was made on, so a later stop
@@ -335,17 +345,424 @@ export function deliveredOf(records: any[]): {
335
345
  bytes: number | null;
336
346
  sha256: string | null;
337
347
  }[];
348
+ /**
349
+ * R8 (piece 10): the ticket grid of the job a run belongs to, or `null` when that job is not a Tickets job (no run of it read a ticket) or the run is unknown. ONE row per run of the job, from
350
+ * the run list's own entry (`summarizeRow`: status, needs, money, wall, ending words), the ticket from `job-start` ({@link ticketOfStart}), the checks from {@link checksOf} and the steps from
351
+ * the run's `plan-executed` record. The page opens a row through `GET /api/runs/:runid/result` (the generic payload, one owner): this reads no diff and no branch.
352
+ * @param {string} runid @param {{ home?: string, now?: number, schedules?: ReturnType<typeof createScheduleDoor> }} [opts]
353
+ */
354
+ export function getJobGrid(runid: string, opts?: {
355
+ home?: string;
356
+ now?: number;
357
+ schedules?: ReturnType<typeof createScheduleDoor>;
358
+ }): {
359
+ groups: ({
360
+ rows: ({
361
+ anyway: boolean;
362
+ name: string;
363
+ ref: string;
364
+ bucket: "done" | "stop" | "skip" | "wait";
365
+ status: {
366
+ key: string;
367
+ sign: string;
368
+ word: string;
369
+ };
370
+ needs: "Accept" | "Resume" | null;
371
+ at: number | null;
372
+ steps: {
373
+ mark: "g" | "r" | "q" | "n";
374
+ text: string;
375
+ };
376
+ checks: {
377
+ mark: "g" | "r" | "q" | "n";
378
+ text: string;
379
+ };
380
+ cost: {
381
+ mark: string;
382
+ text: string;
383
+ };
384
+ time: {
385
+ mark: string;
386
+ text: string;
387
+ };
388
+ reason: string | null;
389
+ unsure: boolean;
390
+ unsureSay: string;
391
+ runId: string;
392
+ runNo: number | null;
393
+ number: number | null;
394
+ title: string | null;
395
+ url: string | null;
396
+ } | {
397
+ anyway: boolean;
398
+ name: string;
399
+ ref: string;
400
+ bucket: "done" | "stop" | "skip" | "wait";
401
+ status: {
402
+ key: string;
403
+ sign: string;
404
+ word: string;
405
+ };
406
+ needs: "Accept" | "Resume" | null;
407
+ at: number | null;
408
+ steps: {
409
+ mark: "g" | "r" | "q" | "n";
410
+ text: string;
411
+ };
412
+ checks: {
413
+ mark: "g" | "r" | "q" | "n";
414
+ text: string;
415
+ };
416
+ cost: {
417
+ mark: string;
418
+ text: string;
419
+ };
420
+ time: {
421
+ mark: string;
422
+ text: string;
423
+ };
424
+ reason: string | null;
425
+ unsure: boolean;
426
+ runId: string;
427
+ runNo: number | null;
428
+ number: number | null;
429
+ title: string | null;
430
+ url: string | null;
431
+ })[];
432
+ key: "wait";
433
+ label: "Needs you";
434
+ open: true;
435
+ } | {
436
+ rows: ({
437
+ anyway: boolean;
438
+ name: string;
439
+ ref: string;
440
+ bucket: "done" | "stop" | "skip" | "wait";
441
+ status: {
442
+ key: string;
443
+ sign: string;
444
+ word: string;
445
+ };
446
+ needs: "Accept" | "Resume" | null;
447
+ at: number | null;
448
+ steps: {
449
+ mark: "g" | "r" | "q" | "n";
450
+ text: string;
451
+ };
452
+ checks: {
453
+ mark: "g" | "r" | "q" | "n";
454
+ text: string;
455
+ };
456
+ cost: {
457
+ mark: string;
458
+ text: string;
459
+ };
460
+ time: {
461
+ mark: string;
462
+ text: string;
463
+ };
464
+ reason: string | null;
465
+ unsure: boolean;
466
+ unsureSay: string;
467
+ runId: string;
468
+ runNo: number | null;
469
+ number: number | null;
470
+ title: string | null;
471
+ url: string | null;
472
+ } | {
473
+ anyway: boolean;
474
+ name: string;
475
+ ref: string;
476
+ bucket: "done" | "stop" | "skip" | "wait";
477
+ status: {
478
+ key: string;
479
+ sign: string;
480
+ word: string;
481
+ };
482
+ needs: "Accept" | "Resume" | null;
483
+ at: number | null;
484
+ steps: {
485
+ mark: "g" | "r" | "q" | "n";
486
+ text: string;
487
+ };
488
+ checks: {
489
+ mark: "g" | "r" | "q" | "n";
490
+ text: string;
491
+ };
492
+ cost: {
493
+ mark: string;
494
+ text: string;
495
+ };
496
+ time: {
497
+ mark: string;
498
+ text: string;
499
+ };
500
+ reason: string | null;
501
+ unsure: boolean;
502
+ runId: string;
503
+ runNo: number | null;
504
+ number: number | null;
505
+ title: string | null;
506
+ url: string | null;
507
+ })[];
508
+ key: "stop";
509
+ label: "Stopped";
510
+ open: true;
511
+ } | {
512
+ rows: ({
513
+ anyway: boolean;
514
+ name: string;
515
+ ref: string;
516
+ bucket: "done" | "stop" | "skip" | "wait";
517
+ status: {
518
+ key: string;
519
+ sign: string;
520
+ word: string;
521
+ };
522
+ needs: "Accept" | "Resume" | null;
523
+ at: number | null;
524
+ steps: {
525
+ mark: "g" | "r" | "q" | "n";
526
+ text: string;
527
+ };
528
+ checks: {
529
+ mark: "g" | "r" | "q" | "n";
530
+ text: string;
531
+ };
532
+ cost: {
533
+ mark: string;
534
+ text: string;
535
+ };
536
+ time: {
537
+ mark: string;
538
+ text: string;
539
+ };
540
+ reason: string | null;
541
+ unsure: boolean;
542
+ unsureSay: string;
543
+ runId: string;
544
+ runNo: number | null;
545
+ number: number | null;
546
+ title: string | null;
547
+ url: string | null;
548
+ } | {
549
+ anyway: boolean;
550
+ name: string;
551
+ ref: string;
552
+ bucket: "done" | "stop" | "skip" | "wait";
553
+ status: {
554
+ key: string;
555
+ sign: string;
556
+ word: string;
557
+ };
558
+ needs: "Accept" | "Resume" | null;
559
+ at: number | null;
560
+ steps: {
561
+ mark: "g" | "r" | "q" | "n";
562
+ text: string;
563
+ };
564
+ checks: {
565
+ mark: "g" | "r" | "q" | "n";
566
+ text: string;
567
+ };
568
+ cost: {
569
+ mark: string;
570
+ text: string;
571
+ };
572
+ time: {
573
+ mark: string;
574
+ text: string;
575
+ };
576
+ reason: string | null;
577
+ unsure: boolean;
578
+ runId: string;
579
+ runNo: number | null;
580
+ number: number | null;
581
+ title: string | null;
582
+ url: string | null;
583
+ })[];
584
+ key: "done";
585
+ label: "Passed";
586
+ open: false;
587
+ } | {
588
+ rows: ({
589
+ anyway: boolean;
590
+ name: string;
591
+ ref: string;
592
+ bucket: "done" | "stop" | "skip" | "wait";
593
+ status: {
594
+ key: string;
595
+ sign: string;
596
+ word: string;
597
+ };
598
+ needs: "Accept" | "Resume" | null;
599
+ at: number | null;
600
+ steps: {
601
+ mark: "g" | "r" | "q" | "n";
602
+ text: string;
603
+ };
604
+ checks: {
605
+ mark: "g" | "r" | "q" | "n";
606
+ text: string;
607
+ };
608
+ cost: {
609
+ mark: string;
610
+ text: string;
611
+ };
612
+ time: {
613
+ mark: string;
614
+ text: string;
615
+ };
616
+ reason: string | null;
617
+ unsure: boolean;
618
+ unsureSay: string;
619
+ runId: string;
620
+ runNo: number | null;
621
+ number: number | null;
622
+ title: string | null;
623
+ url: string | null;
624
+ } | {
625
+ anyway: boolean;
626
+ name: string;
627
+ ref: string;
628
+ bucket: "done" | "stop" | "skip" | "wait";
629
+ status: {
630
+ key: string;
631
+ sign: string;
632
+ word: string;
633
+ };
634
+ needs: "Accept" | "Resume" | null;
635
+ at: number | null;
636
+ steps: {
637
+ mark: "g" | "r" | "q" | "n";
638
+ text: string;
639
+ };
640
+ checks: {
641
+ mark: "g" | "r" | "q" | "n";
642
+ text: string;
643
+ };
644
+ cost: {
645
+ mark: string;
646
+ text: string;
647
+ };
648
+ time: {
649
+ mark: string;
650
+ text: string;
651
+ };
652
+ reason: string | null;
653
+ unsure: boolean;
654
+ runId: string;
655
+ runNo: number | null;
656
+ number: number | null;
657
+ title: string | null;
658
+ url: string | null;
659
+ })[];
660
+ key: "skip";
661
+ label: "Skipped";
662
+ open: false;
663
+ })[];
664
+ scheduleLine: string | null;
665
+ stats: {
666
+ counts: {
667
+ [k: string]: number;
668
+ };
669
+ spent: string;
670
+ spentUsd: number | null;
671
+ spentComplete: boolean;
672
+ };
673
+ runid: string;
674
+ job: string;
675
+ } | null;
676
+ /**
677
+ * Is ticket `number` a skipped ticket of `job` that nobody has run since? The ONE check behind `POST /api/author/ticket-anyway`: the grid's own skipped row says so.
678
+ * @param {string} job @param {number} number @param {{ home?: string, now?: number }} [opts]
679
+ */
680
+ export function isSkippedTicket(job: string, number: number, opts?: {
681
+ home?: string;
682
+ now?: number;
683
+ }): boolean;
684
+ /**
685
+ * The run id of the skipped row {@link isSkippedTicket} means (the newest one of that ticket, with Run it anyway on it), or null. The no-schedule "Run it anyway" (am3) starts from that
686
+ * run's own saved signed job.
687
+ * @param {string} job @param {number} number @param {{ home?: string, now?: number }} [opts]
688
+ */
689
+ export function skippedRunOf(job: string, number: number, opts?: {
690
+ home?: string;
691
+ now?: number;
692
+ }): string | null;
338
693
  /**
339
694
  * `GET /api/runs/:runid/result` — the Result tab: for each rubric job line, its words and `~` rules from the signed spec, the facts it requires
340
695
  * (worded by {@link factSentence}), and — read from the run's own delivered step file, sha256-checked against its `destination-written`
341
696
  * record — one row per result with each fact's cell. `passed` is read from the run's own `check-run` record; the tab never re-decides. A red run
342
697
  * delivers nothing, so it has no rows: it carries the check's own first gap instead. `null` = no such run or no result tab for it.
698
+ * Every OTHER job (R7b item 4) that ENDED gets the generic payload from {@link genericResultOf} (`kind: 'generic'`); the rubric payload below is
699
+ * untouched and carries no `kind`.
343
700
  * @param {string} runid @param {{ home?: string }} opts
344
701
  */
345
702
  export function getRunResult(runid: string, opts?: {
346
703
  home?: string;
347
704
  sessionsRoot?: string;
348
705
  }): {
706
+ runid: string;
707
+ kind: string;
708
+ job: {
709
+ asked: any;
710
+ scope: any;
711
+ };
712
+ ticket: {
713
+ number: number;
714
+ title: string;
715
+ url: string | null;
716
+ } | null;
717
+ changed: {
718
+ head: string;
719
+ files: number;
720
+ paths: any[];
721
+ plus: number;
722
+ minus: number;
723
+ edits: number;
724
+ anyCut: boolean;
725
+ last: {
726
+ files: any;
727
+ note: string | null;
728
+ };
729
+ all: {
730
+ n: number;
731
+ step: any;
732
+ files: any;
733
+ }[];
734
+ foldWords: string;
735
+ scopeLine: string | null;
736
+ } | null;
737
+ checks: {
738
+ head: string;
739
+ passed: any;
740
+ total: any;
741
+ allPassed: boolean;
742
+ stages: any;
743
+ notes: any;
744
+ } | null;
745
+ work: {
746
+ branch: string;
747
+ finalCommit: string;
748
+ madeFrom: any;
749
+ repo: string;
750
+ merge: string;
751
+ drop: string;
752
+ note: string;
753
+ } | null;
754
+ run: {
755
+ spent: string;
756
+ spentNote: string | null;
757
+ time: string;
758
+ steps: string | null;
759
+ };
760
+ endedWords: any;
761
+ door: {
762
+ head: "waiting for you";
763
+ ask: string;
764
+ };
765
+ } | {
349
766
  runid: string;
350
767
  lines: any[];
351
768
  pages: string[];
@@ -661,7 +1078,7 @@ export function reuseLine(record: {
661
1078
  * to copy: change the job: Clear the card). `null` when the runid is not listed.
662
1079
  * @param {string} runid
663
1080
  * @param {{ home?: string, model?: string, provider?: string }} [opts] `model` = the Model box's current Name (the estimate counts only runs on that worker); absent = the card's own Model
664
- * @returns {{ok: true, origin: {runid: string, job: string}, outcome: string|null, card: Record<string, any>, from: 'signed job',
1081
+ * @returns {{ok: true, origin: {runid: string, job: string}, outcome: string|null, neverRan: boolean, card: Record<string, any>, from: 'signed job',
665
1082
  * note: string|null,
666
1083
  * specHash: string, workflowKey: string, spec: any, specPath: string, specNamesModel: boolean,
667
1084
  * specWorker: {provider: string, endpoint: string, label: string},
@@ -678,6 +1095,7 @@ export function getStartFrom(runid: string, opts?: {
678
1095
  job: string;
679
1096
  };
680
1097
  outcome: string | null;
1098
+ neverRan: boolean;
681
1099
  card: Record<string, any>;
682
1100
  from: "signed job";
683
1101
  note: string | null;
@@ -702,7 +1120,7 @@ export function getStartFrom(runid: string, opts?: {
702
1120
  * its parsed spine. The schedule door's gate (`greenFor`) reads this; nothing here builds a run context.
703
1121
  * @param {string} job
704
1122
  * @param {{ home?: string }} [opts]
705
- * @returns {{runid: string, outcome: string|null, spec: any, records: any[]}[]}
1123
+ * @returns {{runid: string, outcome: string|null, spec: any, records: any[], ticket?: number}[]}
706
1124
  */
707
1125
  export function jobRunsOf(job: string, opts?: {
708
1126
  home?: string;
@@ -711,6 +1129,7 @@ export function jobRunsOf(job: string, opts?: {
711
1129
  outcome: string | null;
712
1130
  spec: any;
713
1131
  records: any[];
1132
+ ticket?: number;
714
1133
  }[];
715
1134
  /**
716
1135
  * The Reuse workflow picker's list: one entry per JOB (same-job identity = `workflowKey`, the one `getStartFrom` uses)
@@ -785,10 +1204,11 @@ export function getStartFromImport(id: string, opts?: {
785
1204
  * only `createPanelServer` below always supplies one.
786
1205
  * @param {import('node:http').IncomingMessage} req
787
1206
  * @param {import('node:http').ServerResponse} res
788
- * @param {{ home?: string, sessionsRoot?: string, version?: string, startedAt?: string, packageJsonPath?: string, port: number, token?: string, authorRoutes?: ReturnType<typeof createAuthorRoutes>, settingsRoutes?: ReturnType<typeof createSettingsRoutes>, runRoutes?: ReturnType<typeof createRunRoutes>, importRoutes?: ReturnType<typeof createImportRoutes>, schedules?: ReturnType<typeof createScheduleDoor> }} opts
1207
+ * @param {{ home?: string, mcpHome?: string, sessionsRoot?: string, version?: string, startedAt?: string, packageJsonPath?: string, port: number, token?: string, authorRoutes?: ReturnType<typeof createAuthorRoutes>, settingsRoutes?: ReturnType<typeof createSettingsRoutes>, runRoutes?: ReturnType<typeof createRunRoutes>, importRoutes?: ReturnType<typeof createImportRoutes>, schedules?: ReturnType<typeof createScheduleDoor> }} opts
789
1208
  */
790
1209
  export function handleRequest(req: import("node:http").IncomingMessage, res: import("node:http").ServerResponse, opts: {
791
1210
  home?: string;
1211
+ mcpHome?: string;
792
1212
  sessionsRoot?: string;
793
1213
  version?: string;
794
1214
  startedAt?: string;
@@ -826,7 +1246,7 @@ export function panelUrl(boundPort: number): string;
826
1246
  * @param {{ port?: number, home?: string, env?: Record<string,string|undefined>,
827
1247
  * sessionsRoot?: string, spawnFn?: (...a: any[]) => any, bareloopBin?: string,
828
1248
  * fetchImpl?: typeof fetch, settleMs?: number, userHome?: string,
829
- * openFolderSpawn?: (cmd: string, args: string[], o: object) => any, platform?: string, packageJsonPath?: string,
1249
+ * openFolderSpawn?: (cmd: string, args: string[], o: object) => any, platform?: string, mcpHome?: string, packageJsonPath?: string,
830
1250
  * scheduleNow?: () => number, sessionDeps?: Record<string, any>, schedulerIntervalMs?: number, acceptWaitMs?: number }} [opts] `scheduleNow`, `sessionDeps` and `schedulerIntervalMs` are TEST SEAMS (the schedule clock; createSession's stubs; the scheduler's timer, 0 = none)
831
1251
  * @returns {Promise<{ server: import('node:http').Server, port: number, token: string, schedules: ReturnType<typeof createScheduleDoor>, scheduler: ReturnType<typeof createScheduler>, close: () => Promise<void> }>}
832
1252
  */
@@ -842,6 +1262,7 @@ export function createPanelServer(opts?: {
842
1262
  userHome?: string;
843
1263
  openFolderSpawn?: (cmd: string, args: string[], o: object) => any;
844
1264
  platform?: string;
1265
+ mcpHome?: string;
845
1266
  packageJsonPath?: string;
846
1267
  scheduleNow?: () => number;
847
1268
  sessionDeps?: Record<string, any>;
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * `openFolderSpawn` / `platform` are test seams for the Open keys folder button (a real caller passes
3
- * neither: `child_process.spawn` and `process.platform`).
4
- * @param {{ port: number, token: string, home?: string, env?: Record<string,string|undefined>,
3
+ * neither: `child_process.spawn` and `process.platform`). `mcpHome` is the test seam for the person's home folder the four MCP config places
4
+ * live under and where `check tools` starts a server (a real caller passes none: `os.homedir()`), so a test reads a fixture home, never the real `~`.
5
+ * @param {{ port: number, token: string, home?: string, mcpHome?: string, env?: Record<string,string|undefined>,
5
6
  * fetchImpl?: typeof fetch, now?: () => number, openFolderSpawn?: (cmd: string, args: string[], o: object) => any,
6
7
  * platform?: string }} opts
7
8
  */
@@ -9,6 +10,7 @@ export function createSettingsRoutes(opts: {
9
10
  port: number;
10
11
  token: string;
11
12
  home?: string;
13
+ mcpHome?: string;
12
14
  env?: Record<string, string | undefined>;
13
15
  fetchImpl?: typeof fetch;
14
16
  now?: () => number;
@@ -6,6 +6,16 @@
6
6
  * @returns {boolean}
7
7
  */
8
8
  export function isReusableGreen(outcome: string | null | undefined): boolean;
9
+ /**
10
+ * The plain words a skipped run carries (the `settled` event's `words`, the Ended line), from CODE. They do NOT repeat the status word: every surface prints `skipped — <words>` from the table's word (the CLI line adds its own `skipped:`): the filter decision's own reason, never model-written.
11
+ * `reason` is `decideTicket`'s ('closed' | 'priority P3, not P1' | 'no P1 label' | 'no bug label'); `filter` is the job's signed `ticketFilter`, which tells a missing
12
+ * priority label from a missing type label (the two share the `no X label` spelling).
13
+ * @param {string} reason @param {{priority?: string[], labels?: string[]}|undefined} filter @returns {string}
14
+ */
15
+ export function skipWords(reason: string, filter: {
16
+ priority?: string[];
17
+ labels?: string[];
18
+ } | undefined): string;
9
19
  /**
10
20
  * The status of one run.
11
21
  * @param {{outcome: string|null|undefined, died?: boolean, category?: string|null, moneyHalt?: boolean}} o
@@ -64,7 +74,7 @@ export function doorViewOf(door: {
64
74
  };
65
75
  /** the sentence a passed run carries as its reason (the Ended block's `line`) */
66
76
  export const GOAL_MET_LINE: "goal met";
67
- /** @typedef {'running'|'waiting'|'passed'|'failed'|'capped'|'stopped'|'died'} StatusKey */
77
+ /** @typedef {'running'|'waiting'|'passed'|'failed'|'capped'|'stopped'|'died'|'skipped'} StatusKey */
68
78
  /** the table: key -> sign + word */
69
79
  export const STATUS: Readonly<{
70
80
  running: Readonly<{
@@ -95,6 +105,10 @@ export const STATUS: Readonly<{
95
105
  sign: "?";
96
106
  word: "died";
97
107
  }>;
108
+ skipped: Readonly<{
109
+ sign: "–";
110
+ word: "skipped";
111
+ }>;
98
112
  }>;
99
113
  /**
100
114
  * PRD v1.106 Part 5 (C, choice 9): the review door's words, ONE table. The door is the only human step bareloop has; there is no "you
@@ -127,4 +141,4 @@ export const ACTOR_MARKER: Readonly<{
127
141
  model: "[model]";
128
142
  human: "[human · ask]";
129
143
  }>;
130
- export type StatusKey = "running" | "waiting" | "passed" | "failed" | "capped" | "stopped" | "died";
144
+ export type StatusKey = "running" | "waiting" | "passed" | "failed" | "capped" | "stopped" | "died" | "skipped";
@@ -0,0 +1,61 @@
1
+ /**
2
+ * `POST /api/author/ticket-anyway {job, ticket, reason}`: a SKIPPED ticket is run anyway, after a short reason. Without a reason nothing starts. `isSkipped(job, number)` says whether the
3
+ * job's grid holds that ticket as a skipped row nobody has run since; `door.arriveAnyway({job, number, reason})` is the ONE seam (production: the schedule door's).
4
+ * @param {{body: any, isSkipped: (job: string, number: number) => boolean, door: {arriveAnyway: (a: {job: string, number: number, reason: string, runid?: string}) => Promise<{ok: boolean, say: string, started?: boolean}>},
5
+ * skippedRunOf?: (job: string, number: number) => string|null}} a
6
+ * @returns {Promise<{status: number, body: Record<string, any>}>}
7
+ */
8
+ export function ticketAnyway({ body, isSkipped, door, skippedRunOf }: {
9
+ body: any;
10
+ isSkipped: (job: string, number: number) => boolean;
11
+ door: {
12
+ arriveAnyway: (a: {
13
+ job: string;
14
+ number: number;
15
+ reason: string;
16
+ runid?: string;
17
+ }) => Promise<{
18
+ ok: boolean;
19
+ say: string;
20
+ started?: boolean;
21
+ }>;
22
+ };
23
+ skippedRunOf?: (job: string, number: number) => string | null;
24
+ }): Promise<{
25
+ status: number;
26
+ body: Record<string, any>;
27
+ }>;
28
+ /** the four buckets, in the mockup's order: key, label, open at first. The page draws them; it types none of these words. */
29
+ export const TICKET_GROUPS: readonly (Readonly<{
30
+ key: "wait";
31
+ label: "Needs you";
32
+ open: true;
33
+ }> | Readonly<{
34
+ key: "stop";
35
+ label: "Stopped";
36
+ open: true;
37
+ }> | Readonly<{
38
+ key: "done";
39
+ label: "Passed";
40
+ open: false;
41
+ }> | Readonly<{
42
+ key: "skip";
43
+ label: "Skipped";
44
+ open: false;
45
+ }>)[];
46
+ /**
47
+ * A run's STATUS KEY (src/panel/status.js, the one table) -> its bucket. A running run still needs a person or is still going: Needs you. A run waiting at its review door is `passed` in the table
48
+ * but needs the person's Accept: the grid moves it to Needs you from the run list's own `needs` tag (`bucketOf`, src/panel/jobgrid.js), never from a second outcome reader.
49
+ */
50
+ export const GROUP_OF: Readonly<{
51
+ running: "wait";
52
+ waiting: "wait";
53
+ passed: "done";
54
+ failed: "stop";
55
+ capped: "stop";
56
+ stopped: "stop";
57
+ died: "stop";
58
+ skipped: "skip";
59
+ }>;
60
+ /** a "Run it anyway" reason: short, never blank. The same bar as a rerun's. */
61
+ export const ANYWAY_REASON_MAX: 500;