bareloop 0.34.0 → 0.35.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 (53) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/bareloop.context.md +241 -13
  3. package/package.json +1 -1
  4. package/src/bundlerun.js +13 -4
  5. package/src/draftspend.js +82 -0
  6. package/src/exits.js +10 -1
  7. package/src/interviewrun.js +7 -7
  8. package/src/job.js +37 -0
  9. package/src/judged.js +2 -2
  10. package/src/kinds.js +2 -1
  11. package/src/ledger.js +101 -5
  12. package/src/legs.js +171 -0
  13. package/src/monthly.js +111 -72
  14. package/src/panel/authorroutes.js +84 -14
  15. package/src/panel/authorsession.js +408 -113
  16. package/src/panel/importroutes.js +359 -0
  17. package/src/panel/importrun.js +203 -0
  18. package/src/panel/index.html +1071 -184
  19. package/src/panel/runroutes.js +219 -0
  20. package/src/panel/server.js +839 -70
  21. package/src/panel/status.js +51 -0
  22. package/src/planrun.js +60 -26
  23. package/src/providerrows.js +17 -0
  24. package/src/ralph.js +3 -0
  25. package/src/replay.js +139 -19
  26. package/src/replayio.js +11 -4
  27. package/src/reuse.js +20 -3
  28. package/src/run.js +6 -3
  29. package/src/runlist.js +75 -7
  30. package/src/text.js +20 -0
  31. package/src/u-readout.js +9 -1
  32. package/src/u-watchdog.mjs +4 -2
  33. package/src/userrun.js +138 -57
  34. package/types/draftspend.d.ts +53 -0
  35. package/types/job.d.ts +25 -0
  36. package/types/ledger.d.ts +44 -0
  37. package/types/legs.d.ts +103 -0
  38. package/types/monthly.d.ts +23 -18
  39. package/types/panel/authorroutes.d.ts +23 -1
  40. package/types/panel/authorsession.d.ts +109 -2
  41. package/types/panel/importroutes.d.ts +129 -0
  42. package/types/panel/importrun.d.ts +77 -0
  43. package/types/panel/runroutes.d.ts +32 -0
  44. package/types/panel/server.d.ts +255 -2
  45. package/types/panel/status.d.ts +51 -0
  46. package/types/planrun.d.ts +13 -21
  47. package/types/providerrows.d.ts +12 -0
  48. package/types/replay.d.ts +25 -1
  49. package/types/replayio.d.ts +2 -2
  50. package/types/reuse.d.ts +5 -0
  51. package/types/run.d.ts +6 -2
  52. package/types/runlist.d.ts +52 -2
  53. package/types/text.d.ts +19 -0
package/types/text.d.ts CHANGED
@@ -200,6 +200,25 @@ export function stampRaw<T extends {
200
200
  cause?: string | null;
201
201
  reason?: string | null;
202
202
  }): T;
203
+ /**
204
+ * BA-21 — the WRITE side of the pricing-provenance signal (read side: `rateProvenance` /
205
+ * `spendProvenance` in src/ledger.js). bare-agent >=0.37 rides `rateSource` beside
206
+ * `pricing` on every metering payload; both metering callbacks below forward it onto the
207
+ * spine through THIS one helper, because two sites spelling one rule are two instruments
208
+ * (the ripgrep fix that landed in ci.yml but not publish.yml).
209
+ *
210
+ * Forwarded VERBATIM — the write side reports what upstream said, and src/ledger.js is
211
+ * the one place that decides what counts as a guess. And an ABSENT provenance stays
212
+ * absent: a payload carrying no `rateSource` (bare-agent <0.37, and every round already
213
+ * in the archive) emits no field at all, so a reader sees UNKNOWN rather than a label we
214
+ * invented. Never defaulted to `null` here — `null` is upstream saying "nothing was
215
+ * priced", which is a different fact from "nobody told us".
216
+ * @param {any} arg an `onLlmResult` / `onTurn` payload
217
+ * @returns {{rateSource?: string|null}} the field to spread into the spine record
218
+ */
219
+ export function rateSourceFields(arg: any): {
220
+ rateSource?: string | null;
221
+ };
203
222
  /**
204
223
  * The ceiling on ONE persisted raw. Sized to the survey's own prompt-ingredient
205
224
  * cap (`AUTHOR_SCOUT_BLOB_MAX`, 8000) rather than picked: the largest raw this