bareloop 0.54.1 → 0.56.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 (149) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/bareloop.context.md +67 -6
  3. package/package.json +3 -3
  4. package/src/authorflow.js +217 -238
  5. package/src/authoring.js +22 -6
  6. package/src/authorjob.js +138 -30
  7. package/src/authorreadout.js +15 -4
  8. package/src/authorrun.js +13 -4
  9. package/src/authorscout.js +9 -6
  10. package/src/behaviour.js +14 -0
  11. package/src/blockasks.js +43 -0
  12. package/src/cardschedule.js +42 -0
  13. package/src/checkblock.js +772 -0
  14. package/src/checklist.js +128 -0
  15. package/src/checkpick.js +294 -0
  16. package/src/checksuggest.js +28 -0
  17. package/src/checkwords.js +27 -0
  18. package/src/cli.js +1 -1
  19. package/src/config.js +24 -1
  20. package/src/declaredclose.js +30 -1
  21. package/src/destpoint.js +151 -0
  22. package/src/draftspend.js +85 -0
  23. package/src/facts.js +8 -1
  24. package/src/factwords.js +14 -1
  25. package/src/fitcheck.js +5 -3
  26. package/src/job.js +81 -1
  27. package/src/jobblock.js +9 -0
  28. package/src/labelscan.js +11 -0
  29. package/src/launcher.js +3 -2
  30. package/src/mcpchecks.js +52 -0
  31. package/src/mcppick.js +36 -0
  32. package/src/mcpsources.js +77 -0
  33. package/src/mcpuse.js +97 -0
  34. package/src/natural.js +23 -0
  35. package/src/pagemap.js +20 -5
  36. package/src/panel/authorroutes.js +105 -18
  37. package/src/panel/authorsession.js +293 -44
  38. package/src/panel/index.html +873 -41
  39. package/src/panel/jobgrid.js +117 -0
  40. package/src/panel/jobplan.js +103 -35
  41. package/src/panel/scheduler.js +80 -13
  42. package/src/panel/schedules.js +189 -28
  43. package/src/panel/schedulestart.js +44 -13
  44. package/src/panel/server.js +471 -39
  45. package/src/panel/settingsroutes.js +133 -3
  46. package/src/panel/status.js +19 -1
  47. package/src/panel/tickets.js +44 -0
  48. package/src/pickrecord.js +163 -0
  49. package/src/placerule.js +355 -0
  50. package/src/plan.js +31 -2
  51. package/src/planrun.js +71 -15
  52. package/src/prcheckout.js +259 -0
  53. package/src/promptregisters.js +11 -0
  54. package/src/questionbox.js +112 -0
  55. package/src/readshim.js +3 -2
  56. package/src/revises.js +56 -0
  57. package/src/rowedit.js +115 -0
  58. package/src/rubricstep.js +265 -132
  59. package/src/run.js +19 -2
  60. package/src/runexport.js +2 -0
  61. package/src/runlist.js +3 -2
  62. package/src/schedulewords.js +46 -4
  63. package/src/source.js +81 -7
  64. package/src/stepmcp.js +86 -0
  65. package/src/ticket.js +113 -0
  66. package/src/ticketfilter.js +76 -0
  67. package/src/ticketlabels.js +79 -0
  68. package/src/ticketmcp.js +111 -0
  69. package/src/ticketnext.js +35 -0
  70. package/src/ticketrepo.js +98 -0
  71. package/src/ticketschedule.js +32 -0
  72. package/src/ticketshape.js +45 -0
  73. package/src/tools.js +9 -0
  74. package/src/trigger.js +14 -2
  75. package/src/triggerclock.js +7 -3
  76. package/src/triggerfiles.js +19 -11
  77. package/src/triggertickets.js +244 -0
  78. package/src/userrun.js +191 -10
  79. package/src/validate.js +3 -1
  80. package/src/worktree.js +43 -1
  81. package/types/authorflow.d.ts +86 -93
  82. package/types/authorjob.d.ts +35 -4
  83. package/types/authorreadout.d.ts +4 -3
  84. package/types/authorscout.d.ts +4 -2
  85. package/types/behaviour.d.ts +12 -0
  86. package/types/blockasks.d.ts +37 -0
  87. package/types/cardschedule.d.ts +24 -0
  88. package/types/checkblock.d.ts +361 -0
  89. package/types/checklist.d.ts +134 -0
  90. package/types/checkpick.d.ts +160 -0
  91. package/types/checksuggest.d.ts +30 -0
  92. package/types/checkwords.d.ts +14 -0
  93. package/types/config.d.ts +7 -0
  94. package/types/declaredclose.d.ts +4 -0
  95. package/types/destpoint.d.ts +89 -0
  96. package/types/draftspend.d.ts +37 -0
  97. package/types/factwords.d.ts +7 -0
  98. package/types/fitcheck.d.ts +7 -1
  99. package/types/job.d.ts +13 -0
  100. package/types/jobblock.d.ts +9 -0
  101. package/types/labelscan.d.ts +7 -0
  102. package/types/launcher.d.ts +2 -2
  103. package/types/mcpchecks.d.ts +8 -0
  104. package/types/mcppick.d.ts +33 -0
  105. package/types/mcpsources.d.ts +51 -0
  106. package/types/mcpuse.d.ts +15 -0
  107. package/types/natural.d.ts +2 -0
  108. package/types/pagemap.d.ts +6 -1
  109. package/types/panel/authorroutes.d.ts +11 -2
  110. package/types/panel/authorsession.d.ts +69 -3
  111. package/types/panel/jobgrid.d.ts +405 -0
  112. package/types/panel/jobplan.d.ts +55 -11
  113. package/types/panel/scheduler.d.ts +7 -2
  114. package/types/panel/schedules.d.ts +124 -4
  115. package/types/panel/schedulestart.d.ts +21 -3
  116. package/types/panel/server.d.ts +432 -10
  117. package/types/panel/settingsroutes.d.ts +4 -2
  118. package/types/panel/status.d.ts +16 -2
  119. package/types/panel/tickets.d.ts +61 -0
  120. package/types/pickrecord.d.ts +100 -0
  121. package/types/placerule.d.ts +194 -0
  122. package/types/plan.d.ts +1 -0
  123. package/types/prcheckout.d.ts +151 -0
  124. package/types/questionbox.d.ts +87 -0
  125. package/types/readshim.d.ts +4 -3
  126. package/types/revises.d.ts +23 -0
  127. package/types/rowedit.d.ts +32 -0
  128. package/types/rubricstep.d.ts +100 -48
  129. package/types/run.d.ts +27 -1
  130. package/types/runlist.d.ts +6 -3
  131. package/types/schedulewords.d.ts +29 -2
  132. package/types/source.d.ts +40 -4
  133. package/types/stepmcp.d.ts +40 -0
  134. package/types/ticket.d.ts +114 -0
  135. package/types/ticketfilter.d.ts +34 -0
  136. package/types/ticketlabels.d.ts +44 -0
  137. package/types/ticketmcp.d.ts +84 -0
  138. package/types/ticketnext.d.ts +33 -0
  139. package/types/ticketrepo.d.ts +118 -0
  140. package/types/ticketschedule.d.ts +21 -0
  141. package/types/ticketshape.d.ts +37 -0
  142. package/types/tools.d.ts +1 -0
  143. package/types/trigger.d.ts +9 -1
  144. package/types/triggerclock.d.ts +6 -2
  145. package/types/triggerfiles.d.ts +13 -5
  146. package/types/triggertickets.d.ts +110 -0
  147. package/types/userrun.d.ts +50 -0
  148. package/types/validate.d.ts +1 -0
  149. 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,11 +345,358 @@ 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" | "skip" | "stop" | "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" | "skip" | "stop" | "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" | "skip" | "stop" | "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" | "skip" | "stop" | "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" | "skip" | "stop" | "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" | "skip" | "stop" | "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" | "skip" | "stop" | "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" | "skip" | "stop" | "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?: {
@@ -347,10 +704,65 @@ export function getRunResult(runid: string, opts?: {
347
704
  sessionsRoot?: string;
348
705
  }): {
349
706
  runid: string;
350
- lines: any[];
351
- pages: string[];
352
- pageNote: string | null;
353
- notChecked: 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
+ } | {
354
766
  readNotes: string[];
355
767
  door: {
356
768
  head: "waiting for you";
@@ -369,6 +781,12 @@ export function getRunResult(runid: string, opts?: {
369
781
  more: number;
370
782
  moreText: string | null;
371
783
  } | null;
784
+ notCheckedBy?: Record<string, "you" | "agent" | "default"> | undefined;
785
+ runid: string;
786
+ lines: any[];
787
+ pages: string[];
788
+ pageNote: string | null;
789
+ notChecked: string[];
372
790
  } | null;
373
791
  /**
374
792
  * `GET /api/runs/:runid/download?i=<n>` — delivered file `n` (an index into the run's own `destination-written` list), or why not. The path is
@@ -661,7 +1079,7 @@ export function reuseLine(record: {
661
1079
  * to copy: change the job: Clear the card). `null` when the runid is not listed.
662
1080
  * @param {string} runid
663
1081
  * @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',
1082
+ * @returns {{ok: true, origin: {runid: string, job: string}, outcome: string|null, neverRan: boolean, card: Record<string, any>, from: 'signed job',
665
1083
  * note: string|null,
666
1084
  * specHash: string, workflowKey: string, spec: any, specPath: string, specNamesModel: boolean,
667
1085
  * specWorker: {provider: string, endpoint: string, label: string},
@@ -678,6 +1096,7 @@ export function getStartFrom(runid: string, opts?: {
678
1096
  job: string;
679
1097
  };
680
1098
  outcome: string | null;
1099
+ neverRan: boolean;
681
1100
  card: Record<string, any>;
682
1101
  from: "signed job";
683
1102
  note: string | null;
@@ -702,7 +1121,7 @@ export function getStartFrom(runid: string, opts?: {
702
1121
  * its parsed spine. The schedule door's gate (`greenFor`) reads this; nothing here builds a run context.
703
1122
  * @param {string} job
704
1123
  * @param {{ home?: string }} [opts]
705
- * @returns {{runid: string, outcome: string|null, spec: any, records: any[]}[]}
1124
+ * @returns {{runid: string, outcome: string|null, spec: any, records: any[], ticket?: number}[]}
706
1125
  */
707
1126
  export function jobRunsOf(job: string, opts?: {
708
1127
  home?: string;
@@ -711,6 +1130,7 @@ export function jobRunsOf(job: string, opts?: {
711
1130
  outcome: string | null;
712
1131
  spec: any;
713
1132
  records: any[];
1133
+ ticket?: number;
714
1134
  }[];
715
1135
  /**
716
1136
  * The Reuse workflow picker's list: one entry per JOB (same-job identity = `workflowKey`, the one `getStartFrom` uses)
@@ -785,10 +1205,11 @@ export function getStartFromImport(id: string, opts?: {
785
1205
  * only `createPanelServer` below always supplies one.
786
1206
  * @param {import('node:http').IncomingMessage} req
787
1207
  * @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
1208
+ * @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
1209
  */
790
1210
  export function handleRequest(req: import("node:http").IncomingMessage, res: import("node:http").ServerResponse, opts: {
791
1211
  home?: string;
1212
+ mcpHome?: string;
792
1213
  sessionsRoot?: string;
793
1214
  version?: string;
794
1215
  startedAt?: string;
@@ -826,7 +1247,7 @@ export function panelUrl(boundPort: number): string;
826
1247
  * @param {{ port?: number, home?: string, env?: Record<string,string|undefined>,
827
1248
  * sessionsRoot?: string, spawnFn?: (...a: any[]) => any, bareloopBin?: string,
828
1249
  * fetchImpl?: typeof fetch, settleMs?: number, userHome?: string,
829
- * openFolderSpawn?: (cmd: string, args: string[], o: object) => any, platform?: string, packageJsonPath?: string,
1250
+ * openFolderSpawn?: (cmd: string, args: string[], o: object) => any, platform?: string, mcpHome?: string, packageJsonPath?: string,
830
1251
  * 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
1252
  * @returns {Promise<{ server: import('node:http').Server, port: number, token: string, schedules: ReturnType<typeof createScheduleDoor>, scheduler: ReturnType<typeof createScheduler>, close: () => Promise<void> }>}
832
1253
  */
@@ -842,6 +1263,7 @@ export function createPanelServer(opts?: {
842
1263
  userHome?: string;
843
1264
  openFolderSpawn?: (cmd: string, args: string[], o: object) => any;
844
1265
  platform?: string;
1266
+ mcpHome?: string;
845
1267
  packageJsonPath?: string;
846
1268
  scheduleNow?: () => number;
847
1269
  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;