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
@@ -117,12 +117,14 @@ export function schemaCoverage(catalogue?: Record<string, any>): {
117
117
  * `kinds` (Part 1a) narrows the branches to the kinds a language may use (`catalogueForLang`) WITHOUT narrowing the coverage check,
118
118
  * which stays over the whole catalogue; null (the default) = no narrowing.
119
119
  * @param {Record<string, any>} [catalogue]
120
- * @param {{verdictType?: string|null, questions?: boolean, kinds?: string[]|null}} [o]
120
+ * `ticket` (MCP + tickets piece 2) adds the optional top-level `ticketFilter` property for a job that reads tickets; absent, the schema is byte-identical.
121
+ * @param {{verdictType?: string|null, questions?: boolean, kinds?: string[]|null, ticket?: boolean}} [o]
121
122
  */
122
- export function declarationSchema(catalogue?: Record<string, any>, { verdictType, questions, kinds }?: {
123
+ export function declarationSchema(catalogue?: Record<string, any>, { verdictType, questions, kinds, ticket }?: {
123
124
  verdictType?: string | null;
124
125
  questions?: boolean;
125
126
  kinds?: string[] | null;
127
+ ticket?: boolean;
126
128
  }): {
127
129
  type: string;
128
130
  properties: {
@@ -144,6 +146,28 @@ export function declarationSchema(catalogue?: Record<string, any>, { verdictType
144
146
  };
145
147
  description: string;
146
148
  } | undefined;
149
+ ticketFilter?: {
150
+ type: string;
151
+ properties: {
152
+ priority: {
153
+ type: string;
154
+ items: {
155
+ type: string;
156
+ enum: string[];
157
+ };
158
+ description: string;
159
+ };
160
+ labels: {
161
+ type: string;
162
+ items: {
163
+ type: string;
164
+ };
165
+ description: string;
166
+ };
167
+ };
168
+ additionalProperties: boolean;
169
+ description: string;
170
+ } | undefined;
147
171
  stages: {
148
172
  type: string;
149
173
  minItems: number;
@@ -252,15 +276,16 @@ export function declarationSchema(catalogue?: Record<string, any>, { verdictType
252
276
  * The output channel. It records and acknowledges; it takes no action, which is
253
277
  * why handing it to a toolless authoring call does not reopen D3.
254
278
  * @param {{calls: any[]}} box
255
- * @param {{catalogue?: Record<string, any>, verdictType?: string|null, questions?: boolean, kinds?: string[]|null}} [o]
279
+ * @param {{catalogue?: Record<string, any>, verdictType?: string|null, questions?: boolean, kinds?: string[]|null, ticket?: boolean}} [o]
256
280
  */
257
281
  export function declarationTool(box: {
258
282
  calls: any[];
259
- }, { catalogue, verdictType, questions, kinds }?: {
283
+ }, { catalogue, verdictType, questions, kinds, ticket }?: {
260
284
  catalogue?: Record<string, any>;
261
285
  verdictType?: string | null;
262
286
  questions?: boolean;
263
287
  kinds?: string[] | null;
288
+ ticket?: boolean;
264
289
  }): {
265
290
  name: string;
266
291
  description: string;
@@ -285,6 +310,28 @@ export function declarationTool(box: {
285
310
  };
286
311
  description: string;
287
312
  } | undefined;
313
+ ticketFilter?: {
314
+ type: string;
315
+ properties: {
316
+ priority: {
317
+ type: string;
318
+ items: {
319
+ type: string;
320
+ enum: string[];
321
+ };
322
+ description: string;
323
+ };
324
+ labels: {
325
+ type: string;
326
+ items: {
327
+ type: string;
328
+ };
329
+ description: string;
330
+ };
331
+ };
332
+ additionalProperties: boolean;
333
+ description: string;
334
+ } | undefined;
288
335
  stages: {
289
336
  type: string;
290
337
  minItems: number;
@@ -520,10 +567,10 @@ export function jobLineTagBlock(count: number, guardNames?: string[]): string;
520
567
  * writeScope?: string[]|null,
521
568
  * jobLines?: {n: number}[]|null, inputs?: {n: number, label: string, value: string}[]|null,
522
569
  * confirmed?: {checks: string[], checkItems?: {text: string, fromLine: number[]|null}[], protections: string[], openQuestions?: string[], notChecked?: string[], answeredQuestions?: string[]}|null,
523
- * labelLists?: string[]|null,
570
+ * labelLists?: string[]|null, settled?: {line: number, rule: number, text: string}[]|null,
524
571
  * }} o
525
572
  */
526
- export function authorPrompt({ answers, questions, facts, listingBlock, lang, verdictType, guards, ownedEnvNames, mode, catalogue: catalogueIn, writeScope, jobLines, inputs, confirmed, labelLists, }: {
573
+ export function authorPrompt({ answers, questions, facts, listingBlock, lang, verdictType, guards, ownedEnvNames, mode, catalogue: catalogueIn, writeScope, jobLines, inputs, confirmed, labelLists, settled, }: {
527
574
  answers: Record<string | number, string>;
528
575
  questions?: Record<string | number, string>;
529
576
  facts: any;
@@ -560,7 +607,22 @@ export function authorPrompt({ answers, questions, facts, listingBlock, lang, ve
560
607
  answeredQuestions?: string[];
561
608
  } | null;
562
609
  labelLists?: string[] | null;
610
+ settled?: {
611
+ line: number;
612
+ rule: number;
613
+ text: string;
614
+ }[] | null;
563
615
  }): string;
616
+ /**
617
+ * R10: the `~` rules code settles from the person's own picks, as the composer is told them. The drafter writes no check for these and lists nothing for them under
618
+ * "refused": code puts the picked check, or the Not checked row, on the stage itself.
619
+ * @param {{line: number, rule: number, text: string}[]} settled @returns {string}
620
+ */
621
+ export function settledBlock(settled: {
622
+ line: number;
623
+ rule: number;
624
+ text: string;
625
+ }[]): string;
564
626
  /**
565
627
  * The composer prompt for a rubric job on local files (Part 1a, docs/product/ITEM33-BUILD.md). There is no repository
566
628
  * and no survey: the facts are the numbered inputs and the listing is the frozen tree (input/ files, output/). It states
@@ -569,11 +631,11 @@ export function authorPrompt({ answers, questions, facts, listingBlock, lang, ve
569
631
  * verdictType: string, guards: {name: string, kind: string, params: Record<string, any>, fill: string[]}[],
570
632
  * mode?: 'tool'|'text', catalogue?: Record<string, any>, writeScope?: string[]|null,
571
633
  * jobLines?: {n: number}[]|null, inputs?: {n: number, label: string, value: string}[]|null, confirmed?: any,
572
- * labelLists?: string[]|null,
634
+ * labelLists?: string[]|null, settled?: {line: number, rule: number, text: string}[]|null,
573
635
  * }} o
574
636
  * @returns {string}
575
637
  */
576
- export function rubricAuthorPrompt({ answers, questions, facts, listingBlock, verdictType, guards, mode, catalogue, writeScope, jobLines, inputs, confirmed, labelLists, }: {
638
+ export function rubricAuthorPrompt({ answers, questions, facts, listingBlock, verdictType, guards, mode, catalogue, writeScope, jobLines, inputs, confirmed, labelLists, settled, }: {
577
639
  answers: Record<string | number, string>;
578
640
  questions?: Record<string | number, string>;
579
641
  facts: any;
@@ -598,6 +660,11 @@ export function rubricAuthorPrompt({ answers, questions, facts, listingBlock, ve
598
660
  }[] | null;
599
661
  confirmed?: any;
600
662
  labelLists?: string[] | null;
663
+ settled?: {
664
+ line: number;
665
+ rule: number;
666
+ text: string;
667
+ }[] | null;
601
668
  }): string;
602
669
  /**
603
670
  * The seed read, as the model sees it: mechanical labels, no editorial. Per-stage
@@ -737,7 +804,7 @@ export function resolveSourcePrefixes({ workdir, sourcePaths, seedFiles }: {
737
804
  */
738
805
  /**
739
806
  * @param {{ceilingUsd?: number|null,
740
- * onCall?: (call: {label: string, costUsd: number|null, unpricedRounds: number, thinkingStatus?: string}) => void}} [o]
807
+ * onCall?: (call: {label: string, costUsd: number|null, unpricedRounds: number, thinkingStatus?: string, raw?: string}) => void}} [o]
741
808
  * `ceilingUsd` is the OPERATOR's ceiling; `null`/absent is UNBOUNDED.
742
809
  * `onCall` is a REPORTING seam fired as each metered call lands — the shell's
743
810
  * only chance to know what has been spent while the run is still alive. It is
@@ -754,6 +821,7 @@ export function makeCostBook({ ceilingUsd, onCall }?: {
754
821
  costUsd: number | null;
755
822
  unpricedRounds: number;
756
823
  thinkingStatus?: string;
824
+ raw?: string;
757
825
  }) => void;
758
826
  }): {
759
827
  /** @param {string} label @param {any} r a bare-agent run result @param {number} [attempt] */
@@ -912,9 +980,10 @@ export function confirmTool(box: {
912
980
  * @param {{answers: Record<string|number, string>, questions: Record<string|number, string>,
913
981
  * labels?: Record<string|number, string>, facts?: any, listing?: string|null,
914
982
  * writeScope?: string[]|null, isRepo: boolean, lang: string, worseThanBefore?: string,
915
- * fixText?: string|null, protections?: string[], inputs?: {n: number, label: string, value: string}[]|null}} o
983
+ * fixText?: string|null, protections?: string[], inputs?: {n: number, label: string, value: string}[]|null, ticket?: boolean,
984
+ * settled?: {line: number, rule: number, text: string}[]|null}} o
916
985
  */
917
- export function confirmPrompt({ answers, questions, labels, facts, listing, writeScope, isRepo, lang, worseThanBefore, fixText, protections, inputs }: {
986
+ export function confirmPrompt({ answers, questions, labels, facts, listing, writeScope, isRepo, lang, worseThanBefore, fixText, protections, inputs, ticket, settled }: {
918
987
  answers: Record<string | number, string>;
919
988
  questions: Record<string | number, string>;
920
989
  labels?: Record<string | number, string>;
@@ -931,6 +1000,12 @@ export function confirmPrompt({ answers, questions, labels, facts, listing, writ
931
1000
  label: string;
932
1001
  value: string;
933
1002
  }[] | null;
1003
+ ticket?: boolean;
1004
+ settled?: {
1005
+ line: number;
1006
+ rule: number;
1007
+ text: string;
1008
+ }[] | null;
934
1009
  }): string;
935
1010
  /**
936
1011
  * THE CONFIRM TURN: the $0 half (worse-than-before for a repo, a language
@@ -955,7 +1030,7 @@ export function confirmPrompt({ answers, questions, labels, facts, listing, writ
955
1030
  * ask: (step: {kind: string, [k: string]: any}) => Promise<string|null>,
956
1031
  * onPhase?: (phase: string, data?: any) => void, mode?: 'tool'|'text',
957
1032
  * worseThanBefore?: string, inputs?: {n: number, label: string, value: string}[]|null,
958
- * jobLines?: {n: number}[]|null}} o retired field (hamr's ruling 2026-09-28):
1033
+ * jobLines?: {n: number}[]|null, ticket?: boolean, settled?: {line: number, rule: number, text: string}[]|null}} o retired field (hamr's ruling 2026-09-28):
959
1034
  * `worseThanBefore` is never asked any more and defaults to `''` — a
960
1035
  * caller may still pass a string through (kept for a future, non-ask
961
1036
  * source of the same constraint), it just never comes from an ask() step.
@@ -966,7 +1041,7 @@ export function confirmPrompt({ answers, questions, labels, facts, listing, writ
966
1041
  * worseThanBefore: string, openQuestions: string[], notChecked: string[], answeredQuestions?: string[]}|null,
967
1042
  * reds: Red[], cost: any}>}
968
1043
  */
969
- export function runConfirmTurn({ verdictType, answers, questions, labels, facts, listing, writeScope, isRepo, lang, generate, book, ask, onPhase, mode, worseThanBefore: presetWorseThanBefore, inputs, jobLines, }: {
1044
+ export function runConfirmTurn({ verdictType, answers, questions, labels, facts, listing, writeScope, isRepo, lang, generate, book, ask, onPhase, mode, worseThanBefore: presetWorseThanBefore, inputs, jobLines, ticket, settled, }: {
970
1045
  verdictType: string;
971
1046
  answers: Record<string | number, string>;
972
1047
  questions: Record<string | number, string>;
@@ -997,6 +1072,12 @@ export function runConfirmTurn({ verdictType, answers, questions, labels, facts,
997
1072
  jobLines?: {
998
1073
  n: number;
999
1074
  }[] | null;
1075
+ ticket?: boolean;
1076
+ settled?: {
1077
+ line: number;
1078
+ rule: number;
1079
+ text: string;
1080
+ }[] | null;
1000
1081
  }): Promise<{
1001
1082
  ok: boolean;
1002
1083
  stop: null | "cap-halt" | "pricing-red" | "provider-red" | "artifact-red" | "confirm-abandoned" | "confirm-restart";
@@ -1018,6 +1099,25 @@ export function runConfirmTurn({ verdictType, answers, questions, labels, facts,
1018
1099
  reds: Red[];
1019
1100
  cost: any;
1020
1101
  }>;
1102
+ /**
1103
+ * PRD v1.131 tick 4 (rubric jobs, the LAST try only; the caller gates both): the last try failed the gate, so the AI's own broken parts are dropped to Not checked (`dropExtras`) and the plan
1104
+ * is bound and checked ONCE more with the same gate (`redo`). Returns the new settled declaration and its result when that passes; `null` = nothing dropped, the plan is refused as today (the
1105
+ * try passed already, a red sits on a part the picks built or on no part, or the re-check is still red).
1106
+ * @param {{pre: any, v: {ok: boolean, reds: any[]}, jobLines: any[]|null|undefined, redo: (d: any) => any}} o
1107
+ * @returns {{pre: any, v: any}|null}
1108
+ */
1109
+ export function dropAfterLastTry({ pre, v, jobLines, redo }: {
1110
+ pre: any;
1111
+ v: {
1112
+ ok: boolean;
1113
+ reds: any[];
1114
+ };
1115
+ jobLines: any[] | null | undefined;
1116
+ redo: (d: any) => any;
1117
+ }): {
1118
+ pre: any;
1119
+ v: any;
1120
+ } | null;
1021
1121
  /**
1022
1122
  * THE AUTHORING FLOW.
1023
1123
  *
@@ -1064,10 +1164,10 @@ export function runConfirmTurn({ verdictType, answers, questions, labels, facts,
1064
1164
  * priorCalls?: {label: string, costUsd: number|null, unpricedRounds: number}[]|null,
1065
1165
  * priorRaws?: any[]|null,
1066
1166
  * jobLines?: {n: number, text: string}[]|null, inputs?: {n: number, label: string, value: string}[]|null,
1067
- * offerQuestions?: boolean,
1167
+ * offerQuestions?: boolean, ticket?: boolean, checkPicks?: {rules: {line: number, rule: number, text: string}[], picks: any[], left: {line: number, rule: number}[]}|null,
1068
1168
  * confirmed?: {checks: string[], checkItems?: {text: string, fromLine: number[]|null}[], protections: string[], openQuestions?: string[], notChecked?: string[], answeredQuestions?: string[]}|null}} o
1069
1169
  */
1070
- export function authorClose({ workdir, seedRef, lang, verdictType, answers, questions, writeScope, scout, listing, priorCalls, priorRaws, confirmed, jobLines, inputs, generate, seedReadFn, closeCtx, ceilingUsd, onPhase, onCall, maxRevisions, structureRetries, structuredMode, catalogue: catalogueIn, offerQuestions, }: {
1170
+ export function authorClose({ workdir, seedRef, lang, verdictType, answers, questions, writeScope, scout, listing, priorCalls, priorRaws, confirmed, jobLines, inputs, generate, seedReadFn, closeCtx, ceilingUsd, onPhase, onCall, maxRevisions, structureRetries, structuredMode, catalogue: catalogueIn, offerQuestions, ticket, checkPicks, }: {
1071
1171
  workdir: string;
1072
1172
  seedRef: string;
1073
1173
  lang: string;
@@ -1121,6 +1221,19 @@ export function authorClose({ workdir, seedRef, lang, verdictType, answers, ques
1121
1221
  value: string;
1122
1222
  }[] | null;
1123
1223
  offerQuestions?: boolean;
1224
+ ticket?: boolean;
1225
+ checkPicks?: {
1226
+ rules: {
1227
+ line: number;
1228
+ rule: number;
1229
+ text: string;
1230
+ }[];
1231
+ picks: any[];
1232
+ left: {
1233
+ line: number;
1234
+ rule: number;
1235
+ }[];
1236
+ } | null;
1124
1237
  confirmed?: {
1125
1238
  checks: string[];
1126
1239
  checkItems?: {
@@ -1672,19 +1785,6 @@ export const PARAM_SCHEMAS: Readonly<{
1672
1785
  minimum: number;
1673
1786
  description: string;
1674
1787
  };
1675
- names: {
1676
- type: string;
1677
- minItems: number;
1678
- items: {
1679
- type: string;
1680
- minLength: number;
1681
- };
1682
- description: string;
1683
- };
1684
- wordsPerSection: {
1685
- type: string;
1686
- minimum: number;
1687
- };
1688
1788
  source: {
1689
1789
  type: string;
1690
1790
  minLength: number;
@@ -93,14 +93,15 @@ export function refuseLockedKind(kind: string): Refusal;
93
93
  * signerFix?: Function|any, proposeFn?: Function, compileOpts?: object,
94
94
  * ask?: ((step: {kind: string, [k: string]: any}) => Promise<string|null>)|null,
95
95
  * answerQuestions?: ((o: {questions: {line: number, question: string, rule?: number, source?: string, ask?: string, reading?: string}[], dropped: {reason: string, raw: any}[], confirmed: any}) =>
96
- * Promise<{jobLines: {n: number, text: string, rule?: string}[], answers: Record<string|number, any>, left?: {line: number, rule: number}[]}|null>)|null,
96
+ * Promise<{jobLines: {n: number, text: string, rule?: string}[], answers: Record<string|number, any>, left?: {line: number, rule: number}[], picks?: any[]}|null>)|null,
97
+ * pickGenerate?: Function|null, carriedPicks?: any[]|null, onPicks?: (o: {entries: any[], kept: {line: number, rule: number, entry: any}[]}) => void,
97
98
  * confirmGenerate?: Function|null, isRepo?: boolean,
98
99
  * langResult?: {kind: string, candidates?: string[], [k: string]: any}|null}} o
99
100
  * @returns {Promise<{ok: boolean, refusal: Refusal|null, verdictType: string|null,
100
101
  * closeDecl: any, seedRef: string|null, authoring: any, judged: any, reds: Red[],
101
- * stop: string|null, cost: any, interview: any, confirmed: any}>}
102
+ * stop: string|null, cost: any, interview: any, confirmed: any, checkPicks?: any}>}
102
103
  */
103
- export function authorCloseForJob({ answers, repoPath, lang, verdictType, questions, jobLines, inputs, generate, provider, seedRef, scout, listing, ceilingUsd, rates, draftThinking, writeScope, judgeModel, onPhase, onCall, seedFn, scoutFn, listingFn, lookFn, fitFn, fitAsk, onFit, authorFn, authorOpts, signerFix, proposeFn, compileOpts, ask, confirmGenerate, isRepo, langResult, answerQuestions, }: {
104
+ export function authorCloseForJob({ answers, repoPath, lang, verdictType, questions, jobLines, inputs, generate, provider, seedRef, scout, listing, ceilingUsd, rates, draftThinking, writeScope, judgeModel, onPhase, onCall, seedFn, scoutFn, listingFn, lookFn, fitFn, fitAsk, onFit, authorFn, authorOpts, pickGenerate, carriedPicks, onPicks, signerFix, proposeFn, compileOpts, ask, confirmGenerate, isRepo, langResult, answerQuestions, }: {
104
105
  answers: Record<string | number, any>;
105
106
  repoPath?: string | null;
106
107
  lang: string;
@@ -180,7 +181,18 @@ export function authorCloseForJob({ answers, repoPath, lang, verdictType, questi
180
181
  line: number;
181
182
  rule: number;
182
183
  }[];
184
+ picks?: any[];
183
185
  } | null>) | null;
186
+ pickGenerate?: Function | null;
187
+ carriedPicks?: any[] | null;
188
+ onPicks?: (o: {
189
+ entries: any[];
190
+ kept: {
191
+ line: number;
192
+ rule: number;
193
+ entry: any;
194
+ }[];
195
+ }) => void;
184
196
  confirmGenerate?: Function | null;
185
197
  isRepo?: boolean;
186
198
  langResult?: {
@@ -201,6 +213,7 @@ export function authorCloseForJob({ answers, repoPath, lang, verdictType, questi
201
213
  cost: any;
202
214
  interview: any;
203
215
  confirmed: any;
216
+ checkPicks?: any;
204
217
  }>;
205
218
  /**
206
219
  * Fold an authored close into the OPERATOR's own half of the spec.
@@ -257,6 +257,12 @@ export function draftStopText({ stop, reds, refusal, spend, wholeJob }: {
257
257
  } | null;
258
258
  wholeJob?: boolean;
259
259
  }): string;
260
+ /**
261
+ * Code's reading of a declared close: a rubric (text-lang) close with no real check, only always-on stages such as
262
+ * files-changed, or rubric-step stages holding no part. Decided from the close alone, never by a model.
263
+ * @param {any} closeDecl @returns {boolean}
264
+ */
265
+ export function isNoCheckRubricClose(closeDecl: any): boolean;
260
266
  /**
261
267
  * Plain sentences for the reds of a refused signing, one or more per red. Card and practice-case reds reuse the
262
268
  * proposal table; an unknown code is a generic sentence that quotes the code.
@@ -276,16 +282,17 @@ export function signingReasons(reds: PlainRed[], { cases }?: {
276
282
  export function signingKinds(): string[];
277
283
  /**
278
284
  * THE MESSAGE a person reads when the signing gates refuse. The panel's failed step and the CLI print exactly this.
279
- * @param {{reds: PlainRed[], refusal?: {detail?: string}|null, cases?: any,
285
+ * @param {{reds: PlainRed[], refusal?: {detail?: string}|null, cases?: any, closeDecl?: any,
280
286
  * spend?: {knownUsd?: number|null, spendComplete?: boolean|null}|null}} o
281
287
  * @returns {string}
282
288
  */
283
- export function signingStopText({ reds, refusal, cases, spend }: {
289
+ export function signingStopText({ reds, refusal, cases, spend, closeDecl }: {
284
290
  reds: PlainRed[];
285
291
  refusal?: {
286
292
  detail?: string;
287
293
  } | null;
288
294
  cases?: any;
295
+ closeDecl?: any;
289
296
  spend?: {
290
297
  knownUsd?: number | null;
291
298
  spendComplete?: boolean | null;
@@ -92,7 +92,7 @@ export function defaultSurveyor({ workdir, granted, auditPath, ctx }: {
92
92
  * @param {{workdir: string, provider?: any,
93
93
  * rounds?: number, minBytes?: number, blobMax?: number, maxTokens?: number, ctx?: boolean,
94
94
  * attempts?: number, ceilingUsd?: number|null, callTimeoutMs?: number,
95
- * onCall?: (call: {label: string, costUsd: number|null, unpricedRounds: number, thinkingStatus?: string}) => void,
95
+ * onCall?: (call: {label: string, costUsd: number|null, unpricedRounds: number, thinkingStatus?: string, raw?: string}) => void,
96
96
  * createLoop?: (o: {system: string, policy: any, onLlmResult: any, provider: any, rates?: {in: number, out: number}}) => any,
97
97
  * rates?: {in: number, out: number}|null, callOptions?: Record<string, any>,
98
98
  * createSurveyor?: (o: {workdir: string, granted: readonly string[], ctx: boolean}) => Promise<any>}} o
@@ -116,6 +116,7 @@ export function runAuthorScout({ workdir, provider, rounds, minBytes, blobMax, m
116
116
  costUsd: number | null;
117
117
  unpricedRounds: number;
118
118
  thinkingStatus?: string;
119
+ raw?: string;
119
120
  }) => void;
120
121
  createLoop?: (o: {
121
122
  system: string;
@@ -151,7 +152,7 @@ export function runAuthorScout({ workdir, provider, rounds, minBytes, blobMax, m
151
152
  * Run the look. `createLoop` is the same seam the repo scout has; nothing else here needs a live process.
152
153
  * @param {{texts: Record<string, string>, inputs: {n: number, label: string}[], jobLines: {n: number, text: string, rule?: string, rules?: string[]}[],
153
154
  * provider?: any, rounds?: number, maxTokens?: number, ceilingUsd?: number|null, callTimeoutMs?: number,
154
- * onCall?: (call: {label: string, costUsd: number|null, unpricedRounds: number, thinkingStatus?: string}) => void,
155
+ * onCall?: (call: {label: string, costUsd: number|null, unpricedRounds: number, thinkingStatus?: string, raw?: string}) => void,
155
156
  * createLoop?: (o: {system: string, policy: any, onLlmResult: any, provider: any, rates?: {in: number, out: number}}) => any,
156
157
  * rates?: {in: number, out: number}|null, callOptions?: Record<string, any>,
157
158
  * prove?: (source: string, phrase: string) => number}} o
@@ -181,6 +182,7 @@ export function runInputLook({ texts, inputs, jobLines, provider, rounds, maxTok
181
182
  costUsd: number | null;
182
183
  unpricedRounds: number;
183
184
  thinkingStatus?: string;
185
+ raw?: string;
184
186
  }) => void;
185
187
  createLoop?: (o: {
186
188
  system: string;
@@ -1,4 +1,4 @@
1
- /** does a green under this verdict class earn its learning credit at the close, or
1
+ /** does a green under this verdict class earn its reuse credit at the close, or
2
2
  * does it wait for a person? Absent/unknown means green's behaviour, byte for byte
3
3
  * — the pre-softgreen path is the default and stays untouched.
4
4
  * @param {unknown} verdictType @returns {boolean} */
@@ -112,7 +112,7 @@ export function reuseEligibility(bridge: unknown): {
112
112
  /**
113
113
  * THE REVIEW DOOR, written down (PRD v1.71 §3). The person read the finished run
114
114
  * and said one of three things; this records that on the run's own row, and — for
115
- * `accept` on a HELD green — releases the learning credit that green has been
115
+ * `accept` on a HELD green — releases the reuse credit that green has been
116
116
  * carrying unspent.
117
117
  *
118
118
  * Three properties, and each is a ruling rather than a convenience:
@@ -272,7 +272,8 @@ export const BRIDGE_SCHEMA: "bridge-v1";
272
272
  * SOFTGREEN MODULE 6 — the verdict classes whose greens are minted QUARANTINED.
273
273
  *
274
274
  * The standing ruling (PRD v1.53, given a mechanism by v1.71 §3): *softgreen
275
- * passes are quarantined from learning credit until the judged floor is proven*,
275
+ * passes are quarantined from learning credit until the judged floor is proven*
276
+ * (learning credit = reuse/bridge credit),
276
277
  * and **the signer's `accept` at the review door is what releases it**.
277
278
  *
278
279
  * `soft-green` and NOT `hitl`: the hold is about the young JUDGE, not about every
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @param {any} card the card as submitted (`card.schedule` = {kind, hour?, minute?, day?} or absent / null / {kind: 'hand'})
3
+ * @param {{ flowType: 'plain'|'mcp'|'tickets', pick: {server: string, tools: string[]}|null, inputs: Array<{label: string, value: string}>, hasSchedule?: (job: string) => boolean }} o
4
+ * `hasSchedule(job)` = the job (by the card's name) already has a schedule file: the card does not overwrite it
5
+ * @returns {{ok: true, trigger: import('./trigger.js').Trigger|null} | {ok: false, error: string}}
6
+ */
7
+ export function cardScheduleOf(card: any, o: {
8
+ flowType: "plain" | "mcp" | "tickets";
9
+ pick: {
10
+ server: string;
11
+ tools: string[];
12
+ } | null;
13
+ inputs: Array<{
14
+ label: string;
15
+ value: string;
16
+ }>;
17
+ hasSchedule?: (job: string) => boolean;
18
+ }): {
19
+ ok: true;
20
+ trigger: import("./trigger.js").Trigger | null;
21
+ } | {
22
+ ok: false;
23
+ error: string;
24
+ };