@andares/pi-toolkits 0.12.3 → 0.13.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 (65) hide show
  1. package/README.md +100 -15
  2. package/README.zh-CN.md +94 -14
  3. package/package.json +19 -10
  4. package/src/features/ask/index.ts +6 -0
  5. package/src/features/init/apply.ts +32 -12
  6. package/src/features/init/audit-uat.test.ts +103 -0
  7. package/src/features/init/audit.ts +148 -0
  8. package/src/features/init/detect.ts +4 -0
  9. package/src/features/init/index.ts +47 -2
  10. package/src/features/init/plan.ts +11 -0
  11. package/src/features/init/refresh.test.ts +208 -0
  12. package/src/features/init/refresh.ts +255 -0
  13. package/src/features/init/spec.ts +20 -0
  14. package/src/features/init/templates/agents-skeleton.md +2 -0
  15. package/src/features/init/templates/uat-readme.md +53 -0
  16. package/src/features/init/templates/workflow-block.md +21 -0
  17. package/src/features/init/templates.test.ts +3 -1
  18. package/src/features/init/templates.ts +2 -0
  19. package/src/features/init/types.ts +12 -1
  20. package/src/features/permission/index.ts +32 -0
  21. package/src/features/plan/assets/index-C1YLIi4I.js +1 -0
  22. package/src/features/plan/assets/index-DMEpYC3V.css +1 -0
  23. package/src/features/plan/assets/index.html +14 -0
  24. package/src/features/plan/assets.test.ts +64 -0
  25. package/src/features/plan/blocks.test.ts +77 -0
  26. package/src/features/plan/blocks.ts +153 -0
  27. package/src/features/plan/diff.test.ts +144 -0
  28. package/src/features/plan/diff.ts +193 -0
  29. package/src/features/plan/feedback.test.ts +233 -0
  30. package/src/features/plan/feedback.ts +182 -0
  31. package/src/features/plan/index.test.ts +385 -0
  32. package/src/features/plan/index.ts +433 -0
  33. package/src/features/plan/prompt.test.ts +91 -0
  34. package/src/features/plan/prompt.ts +110 -0
  35. package/src/features/plan/render.test.ts +94 -0
  36. package/src/features/plan/render.ts +131 -0
  37. package/src/features/plan/server.test.ts +374 -0
  38. package/src/features/plan/server.ts +272 -0
  39. package/src/features/plan/store.test.ts +145 -0
  40. package/src/features/plan/store.ts +244 -0
  41. package/src/features/review/index.ts +54 -28
  42. package/src/features/review/review.test.ts +46 -1
  43. package/src/features/uat/assets/index-D-W9zj0w.css +1 -0
  44. package/src/features/uat/assets/index-DCBQCsli.js +1 -0
  45. package/src/features/uat/assets/index.html +14 -0
  46. package/src/features/uat/constants.ts +23 -0
  47. package/src/features/uat/index.test.ts +404 -0
  48. package/src/features/uat/index.ts +329 -0
  49. package/src/features/uat/item-tool.ts +280 -0
  50. package/src/features/uat/ledger.test.ts +249 -0
  51. package/src/features/uat/ledger.ts +504 -0
  52. package/src/features/uat/prompt.ts +78 -0
  53. package/src/features/uat/record-tool.ts +167 -0
  54. package/src/features/uat/records.test.ts +145 -0
  55. package/src/features/uat/records.ts +268 -0
  56. package/src/features/uat/server.ts +181 -0
  57. package/src/features/uat/state.test.ts +41 -0
  58. package/src/features/uat/state.ts +67 -0
  59. package/src/index.ts +10 -1
  60. package/src/lib/ask-control.ts +25 -0
  61. package/src/lib/opener.test.ts +72 -0
  62. package/src/lib/opener.ts +121 -0
  63. package/src/lib/permission-control.ts +39 -0
  64. package/src/lib/startup.test.ts +1 -1
  65. package/src/lib/web-review.ts +341 -0
@@ -1,18 +1,20 @@
1
1
  /**
2
- * review feature — third-review command.
2
+ * review feature — the /ask-review command.
3
3
  *
4
4
  * After a development task finishes, "summon another model" to review the
5
5
  * just-completed work: the configured review model takes over the session
6
6
  * (full tool access — this is check AND fix, not a read-only audit), runs a
7
7
  * review turn, and the session then stays on that model (no auto-restore).
8
8
  *
9
- * Trigger: the /third-review slash command. (Bare-message keyword matching
10
- * was deliberately removed — a plain "third-review" message goes to the
11
- * model as ordinary text, so an accidental send can never start a review.)
9
+ * Trigger: the /ask-review slash command. `/third-review` stays registered as
10
+ * a compatibility alias (same handler, same state, no separate behaviour).
11
+ * Bare-message keyword matching was deliberately removed — a plain
12
+ * "ask-review" message goes to the model as ordinary text, so an accidental
13
+ * send can never start a review.
12
14
  *
13
15
  * Review-model config lives in `<agent-dir>/pi-toolkits-review.json`
14
16
  * ("provider/id", see store.ts) and doubles as the picker default. Every
15
- * /third-review run opens the /model-style picker (the REAL built-in
17
+ * /ask-review run opens the /model-style picker (the REAL built-in
16
18
  * ModelSelectorComponent — height-limited scrolling list + fuzzy search)
17
19
  * with the configured model preselected and ✓-marked: one Enter accepts it
18
20
  * and starts the review. Picking a different model persists it immediately
@@ -40,14 +42,36 @@ import { REVIEW_STATUS_KEY } from "./constants.js";
40
42
  import { REVIEW_PROMPT } from "./prompt.js";
41
43
  import { getReviewStore, type ReviewStore } from "./store.js";
42
44
 
45
+ /**
46
+ * Canonical command name. Renamed from `third-review` when the `/ask-*` family
47
+ * started taking shape (ask, ask-perm, ask-init, ask-review): new entry points
48
+ * group under one prefix instead of scattering. Every user-visible notice,
49
+ * dialog and doc says this name, so using the alias still teaches the new one.
50
+ */
51
+ export const REVIEW_COMMAND = "ask-review";
52
+
53
+ /**
54
+ * Compatibility alias, registered on purpose and delegating to the same
55
+ * runner. Why it exists: older session notes, muscle memory and autostart
56
+ * configs (`/third-review` in `.pi/autostart.toml`) keep working across the
57
+ * rename — a renamed command that silently disappears would turn those config
58
+ * entries into plain chat messages sent to the model.
59
+ *
60
+ * **Slated for removal**: this is a deprecation shuttle, not a permanent
61
+ * second name. It is deliberately absent from every external doc. Delete it
62
+ * (`/third-review` constant + its `registerCommand` block + the registration
63
+ * test case) once the old spelling has been unused for a release or two.
64
+ */
65
+ export const REVIEW_COMMAND_ALIAS = "third-review";
66
+
43
67
  /**
44
68
  * Let the user pick a review model with the /model-style picker and persist
45
69
  * the choice. Returns the picked model, or undefined when cancelled.
46
70
  *
47
71
  * The configured model is the picker's default (preselected + ✓-marked +
48
72
  * first), so one Enter accepts it. Picking any other model persists it
49
- * (disk + in-memory) as the new default. /review-model doubles as a
50
- * view-and-change entry point; cancelling leaves the config untouched.
73
+ * (disk + in-memory) as the new default. Cancelling leaves the config
74
+ * untouched (and aborts the review).
51
75
  */
52
76
  export async function pickReviewModel(
53
77
  ctx: ExtensionContext,
@@ -57,7 +81,7 @@ export async function pickReviewModel(
57
81
  // headless contexts have no dialogs, so fall back to a manual-config hint.
58
82
  if (!ctx.hasUI) {
59
83
  ctx.ui.notify(
60
- "third-review: this environment has no model picker dialog — edit <agent-dir>/pi-toolkits-review.json to configure it manually.",
84
+ `${REVIEW_COMMAND}: this environment has no model picker dialog — edit <agent-dir>/pi-toolkits-review.json to configure it manually.`,
61
85
  "error",
62
86
  );
63
87
  return undefined;
@@ -66,7 +90,7 @@ export async function pickReviewModel(
66
90
  const configuredModel = resolveConfiguredModel(ctx, configured);
67
91
  if (!configuredModel && configured) {
68
92
  ctx.ui.notify(
69
- `third-review: the configured review model ${configured} does not exist or is unavailable — pick another one.`,
93
+ `${REVIEW_COMMAND}: the configured review model ${configured} does not exist or is unavailable — pick another one.`,
70
94
  "warning",
71
95
  );
72
96
  }
@@ -75,7 +99,7 @@ export async function pickReviewModel(
75
99
  "Select the review model (first entry is the current default; press Enter to use it)",
76
100
  });
77
101
  if (!model) {
78
- ctx.ui.notify("third-review: cancelled — the review model is unchanged.", "info");
102
+ ctx.ui.notify(`${REVIEW_COMMAND}: cancelled — the review model is unchanged.`, "info");
79
103
  return undefined;
80
104
  }
81
105
  const key = modelKey(model);
@@ -83,7 +107,7 @@ export async function pickReviewModel(
83
107
  // Persist immediately (disk + in-memory + footer) — next run defaults here.
84
108
  store.setModel(key);
85
109
  ctx.ui.notify(
86
- `third-review: review model saved as "${model.name}" — it will be the default next time.`,
110
+ `${REVIEW_COMMAND}: review model saved as "${model.name}" — it will be the default next time.`,
87
111
  "info",
88
112
  );
89
113
  }
@@ -91,7 +115,7 @@ export async function pickReviewModel(
91
115
  }
92
116
 
93
117
  /**
94
- * Create the third-review runner bound to a pi instance.
118
+ * Create the /ask-review runner bound to a pi instance.
95
119
  *
96
120
  * Exported separately from registerReview so tests can drive the flow with
97
121
  * fake pi/ctx objects. The returned runner serializes concurrent triggers
@@ -104,12 +128,12 @@ export function createReviewRunner(
104
128
 
105
129
  return async (ctx) => {
106
130
  if (running) {
107
- ctx.ui.notify("third-review: a review is already running — please wait.", "warning");
131
+ ctx.ui.notify(`${REVIEW_COMMAND}: a review is already running — please wait.`, "warning");
108
132
  return;
109
133
  }
110
134
  if (!ctx.isIdle()) {
111
135
  ctx.ui.notify(
112
- "third-review: the current task is still running — wait for it to finish before starting a review.",
136
+ `${REVIEW_COMMAND}: the current task is still running — wait for it to finish before starting a review.`,
113
137
  "warning",
114
138
  );
115
139
  return;
@@ -130,7 +154,7 @@ export function createReviewRunner(
130
154
  model = resolveConfiguredModel(ctx, store.getModel());
131
155
  if (!model) {
132
156
  ctx.ui.notify(
133
- "third-review: this environment has no model picker dialog — edit <agent-dir>/pi-toolkits-review.json to configure it manually.",
157
+ `${REVIEW_COMMAND}: this environment has no model picker dialog — edit <agent-dir>/pi-toolkits-review.json to configure it manually.`,
134
158
  "error",
135
159
  );
136
160
  return;
@@ -139,13 +163,13 @@ export function createReviewRunner(
139
163
  const switched = await pi.setModel(model);
140
164
  if (!switched) {
141
165
  ctx.ui.notify(
142
- `third-review: cannot switch to the review model "${model.name}" (missing API key or auth not configured).`,
166
+ `${REVIEW_COMMAND}: cannot switch to the review model "${model.name}" (missing API key or auth not configured).`,
143
167
  "error",
144
168
  );
145
169
  return;
146
170
  }
147
171
  ctx.ui.notify(
148
- `third-review: switched to the review model "${model.name}" for this review (check + fix); the session stays on it afterwards.`,
172
+ `${REVIEW_COMMAND}: switched to the review model "${model.name}" for this review (check + fix); the session stays on it afterwards.`,
149
173
  "info",
150
174
  );
151
175
  pi.sendUserMessage(REVIEW_PROMPT);
@@ -158,10 +182,11 @@ export function createReviewRunner(
158
182
  export function registerReview(pi: ExtensionAPI): void {
159
183
  const runReview = createReviewRunner(pi);
160
184
 
161
- // Slash-command trigger — the only entry point (bare-message keyword
162
- // matching was removed to avoid accidental triggers). The handler awaits
163
- // the runner, which may block on the model picker and the review turn.
164
- pi.registerCommand("third-review", {
185
+ // Slash-command triggers. The handler awaits the runner, which may block on
186
+ // the model picker and the review turn. `ask-review` is canonical;
187
+ // `third-review` is registered only as a compatibility alias (see the
188
+ // constant's comment) — both reach the same runner and the same guards.
189
+ pi.registerCommand(REVIEW_COMMAND, {
165
190
  description:
166
191
  "Pick the review model (defaults to the configured one) and review the just-completed work (check + fix)",
167
192
  handler: async (_args: string, ctx: ExtensionContext) => {
@@ -169,17 +194,18 @@ export function registerReview(pi: ExtensionAPI): void {
169
194
  },
170
195
  });
171
196
 
172
- // Manual config entry point: view and change the review model. Always
173
- // opens the /model-style picker (configured model preselected); cancelling
174
- // keeps the existing config, so it is also safe as a view-only command.
175
- pi.registerCommand("review-model", {
176
- description:
177
- "Set or change the review model used by third-review (picker preselects the current one)",
197
+ pi.registerCommand(REVIEW_COMMAND_ALIAS, {
198
+ description: "Same as /ask-review (compatibility alias)",
178
199
  handler: async (_args: string, ctx: ExtensionContext) => {
179
- await pickReviewModel(ctx, getReviewStore());
200
+ await runReview(ctx);
180
201
  },
181
202
  });
182
203
 
204
+ // Configuration has no command of its own: every /ask-review opens the
205
+ // picker with the current default preselected, so "view" and "change" both
206
+ // happen where the value is actually used. (A separate config command used
207
+ // to exist and was removed 2026-11-10 as a second way to do the same thing.)
208
+
183
209
  // Footer indicator: muted "review" while a review model is configured.
184
210
  let theme: Theme | undefined;
185
211
  let latestCtx: ExtensionContext | undefined;
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * review feature — unit tests.
3
3
  *
4
- * Covers the logic behind the third-review command:
4
+ * Covers the logic behind the /ask-review command (`third-review` is its
5
+ * compatibility alias):
5
6
  * - store: set/get persistence round-trip + corrupted-file fallback
6
7
  * - modelKey / resolveConfiguredModel: provider/id resolution, incl. ids
7
8
  * that themselves contain "/" (e.g. openrouter/openai/gpt-5)
@@ -34,6 +35,9 @@ import {
34
35
  import {
35
36
  createReviewRunner,
36
37
  pickReviewModel,
38
+ registerReview,
39
+ REVIEW_COMMAND,
40
+ REVIEW_COMMAND_ALIAS,
37
41
  } from "./index.js";
38
42
  import {
39
43
  modelKey,
@@ -458,3 +462,44 @@ describe("createReviewRunner", () => {
458
462
  expect(pi.sendUserMessage).toHaveBeenCalledTimes(1);
459
463
  });
460
464
  });
465
+
466
+ // ─── command registration ──────────────────────────────────────
467
+
468
+ describe("registerReview", () => {
469
+ it("registers /ask-review and keeps /third-review as a working alias", async () => {
470
+ type RegisteredCommand = {
471
+ description: string;
472
+ handler: (args: string, ctx: ExtensionContext) => Promise<unknown>;
473
+ };
474
+ const commands = new Map<string, RegisteredCommand>();
475
+ const pi = {
476
+ registerCommand: (name: string, def: RegisteredCommand) => {
477
+ commands.set(name, def);
478
+ },
479
+ on: vi.fn(),
480
+ setModel: vi.fn(async () => true),
481
+ sendUserMessage: vi.fn(),
482
+ } as unknown as ExtensionAPI;
483
+
484
+ registerReview(pi);
485
+
486
+ // The canonical name carries the family prefix (/ask-*); the old spelling
487
+ // stays registered so pre-rename notes and autostart configs keep working.
488
+ expect(REVIEW_COMMAND).toBe("ask-review");
489
+ expect(REVIEW_COMMAND_ALIAS).toBe("third-review");
490
+ expect([...commands.keys()]).toEqual([REVIEW_COMMAND, REVIEW_COMMAND_ALIAS]);
491
+
492
+ // `review-model` was removed 2026-11-10: every /ask-review already opens
493
+ // the picker with the configured model preselected, so a second command
494
+ // was a second way to do the same thing. Keep it gone.
495
+ expect(commands.has("review-model")).toBe(false);
496
+
497
+ // Both entry points reach the same runner: same picker, same guards, same
498
+ // review turn — the alias is a name, not a second implementation.
499
+ const { ctx } = fakeCtx({ customResult: MODELS[0] });
500
+ await commands.get(REVIEW_COMMAND)?.handler("", ctx);
501
+ expect(pi.sendUserMessage).toHaveBeenCalledTimes(1);
502
+ await commands.get(REVIEW_COMMAND_ALIAS)?.handler("", ctx);
503
+ expect(pi.sendUserMessage).toHaveBeenCalledTimes(2);
504
+ });
505
+ });
@@ -0,0 +1 @@
1
+ :root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg:#191d24;--panel:#20252e;--panel-2:#262d38;--line:#333c4a;--text:#d7dee8;--muted:#8f9bb0;--accent:#7aa2f7;--ok:#7dcf8a;--warn:#e0af68;--bad:#f07178}*{box-sizing:border-box}body{background:var(--bg);color:var(--text);margin:0;font:14px/1.6 system-ui,-apple-system,Segoe UI,sans-serif}code{background:var(--panel-2);border-radius:4px;padding:.05rem .3rem;font-size:.92em}.shell{max-width:62rem;margin:0 auto;padding:2rem 1.5rem 4rem}.head{justify-content:space-between;align-items:flex-start;gap:1rem;margin-bottom:1.25rem;display:flex}.head h1{letter-spacing:.01em;margin:0;font-size:1.35rem}.sub{color:var(--muted);margin:.25rem 0 0;font-size:.9rem}.dot{margin:0 .4rem}.banner{border:1px solid var(--line);background:var(--panel);border-radius:6px;margin:0 0 .9rem;padding:.6rem .8rem;font-size:.92rem}.banner.warn{color:#f0d8a8;background:#2c2618;border-color:#6b5628}.banner.error{color:#f3b9bd;background:#2d1e21;border-color:#6e3a3f}.empty{color:var(--muted);text-align:center;padding:2rem 0}.items{flex-direction:column;gap:.6rem;margin:0;padding:0;list-style:none;display:flex}.item{background:var(--panel);border:1px solid var(--line);border-radius:8px;gap:.8rem;padding:.9rem 1rem;display:flex}.item.done{opacity:.72}.check{padding-top:.15rem}.check input{width:1.05rem;height:1.05rem;accent-color:var(--ok);cursor:pointer}.body{flex:1;min-width:0}.row{justify-content:space-between;align-items:baseline;gap:.75rem;display:flex}.row h2{margin:0;font-size:1rem;font-weight:600}.badges{flex-wrap:wrap;justify-content:flex-end;gap:.35rem;display:flex}.badge{color:var(--muted);border:1px solid var(--line);white-space:nowrap;border-radius:999px;padding:.05rem .45rem;font-size:.72rem}.badge.reopened{color:var(--warn);border-color:#6b5628}.badge.area{color:var(--accent);border-color:#35487a}.summary{color:#c3ccda;margin:.45rem 0 0}.more{color:var(--accent);font:inherit;cursor:pointer;background:0 0;border:none;margin-top:.5rem;padding:0;font-size:.85rem}.details{border-top:1px dashed var(--line);margin-top:.7rem;padding-top:.7rem}.steps,.edge{margin:.2rem 0 .6rem 1.2rem;padding:0}.steps li,.edge li{margin:.25rem 0}.label{text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:.6rem 0 .3rem;font-size:.78rem}.skip{color:var(--muted);margin:.4rem 0 0;font-size:.88rem}.evidence{flex-wrap:wrap;gap:.35rem;display:flex}.chip{font:inherit;color:var(--text);background:var(--panel-2);border:1px solid var(--line);cursor:pointer;border-radius:5px;padding:.15rem .45rem;font-size:.76rem}.chip:hover{border-color:var(--accent)}.accepted{margin-top:1.75rem}.accepted summary{cursor:pointer;color:var(--muted);margin-bottom:.6rem;font-size:.9rem}.ghost{border:1px solid var(--line);color:var(--muted);font:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:.25rem .6rem;font-size:.82rem}.ghost:hover{color:var(--text);border-color:var(--accent)}.drawer{border-top:1px solid var(--line);background:#12161c;flex-direction:column;max-height:70vh;display:flex;position:fixed;inset:auto 0 0;box-shadow:0 -12px 40px #00000073}.drawer-head{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;padding:.6rem 1.2rem;display:flex}.drawer pre{white-space:pre-wrap;color:#c8d2e0;margin:0;padding:1rem 1.2rem 2rem;font:12.5px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace;overflow:auto}.foot{color:#5f6b7e;word-break:break-all;margin-top:2.5rem;font-size:.75rem}
@@ -0,0 +1 @@
1
+ (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}var r=(e,t)=>e===t,i=Symbol(`solid-track`),a={equals:r},o=null,s=M,c=1,l=2,u={owned:null,cleanups:null,context:null,owner:null},d=null,f=null,p=null,m=null,h=null,g=0;function _(e,t){let n=p,r=d,i=e.length===0,a=t===void 0?r:t,o=i?u:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(v(o));d=o,p=null;try{return j(s,!0)}finally{p=n,d=r}}function v(e){return()=>S(()=>P(e))}function y(e,t){t=t?Object.assign({},a,t):a;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[T.bind(n),e=>(typeof e==`function`&&(e=f&&f.running&&f.sources.has(n)?e(n.tValue):e(n.value)),E(n,e))]}function b(e,t,n){D(k(e,t,!1,c))}function ee(e,t,n){s=oe;let r=k(e,t,!1,c),i=w&&ie(w);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),h?h.push(r):D(r)}function x(e,t,n){n=n?Object.assign({},a,n):a;let r=k(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,D(r),T.bind(r)}function S(e){if(p===null)return e();let t=p;p=null;try{return e()}finally{p=t}}function te(e){ee(()=>S(e))}function C(e){return d===null||(d.cleanups===null?d.cleanups=[e]:d.cleanups.push(e)),e}var[ne,re]=y(!1);function ie(e){let t;return d&&d.context&&(t=d.context[e.id])!==void 0?t:e.defaultValue}var w;function T(){let e=f&&f.running;if(this.sources&&(e?this.tState:this.state)){if((e?this.tState:this.state)===c)D(this);else{let e=m;m=null,j(()=>N(this),!1),m=e}}if(p){let e=this.observers;if(!e||e[e.length-1]!==p){let t=e?e.length:0;p.sources?(p.sources.push(this),p.sourceSlots.push(t)):(p.sources=[this],p.sourceSlots=[t]),e?(e.push(p),this.observerSlots.push(p.sources.length-1)):(this.observers=[p],this.observerSlots=[p.sources.length-1])}}return e&&f.sources.has(this)?this.tValue:this.value}function E(e,t,n){let r=f&&f.running&&f.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(f){let r=f.running;(r||!n&&f.sources.has(e))&&(f.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&j(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=f&&f.running;r&&f.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?m.push(n):h.push(n),n.observers&&se(n)),r?n.tState=c:n.state=c)}if(m.length>1e6)throw m=[],Error()},!1)}return t}function D(e){if(!e.fn)return;P(e);let t=g;O(e,f&&f.running&&f.sources.has(e)?e.tValue:e.value,t),f&&!f.running&&f.sources.has(e)&&queueMicrotask(()=>{j(()=>{f&&(f.running=!0),p=d=e,O(e,e.tValue,t),p=d=null},!1)})}function O(e,t,n){let r,i=d,a=p;p=d=e;try{r=e.fn(t)}catch(t){return e.pure&&(f&&f.running?(e.tState=c,e.tOwned&&e.tOwned.forEach(P),e.tOwned=void 0):(e.state=c,e.owned&&e.owned.forEach(P),e.owned=null)),e.updatedAt=n+1,L(t)}finally{p=a,d=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?E(e,r,!0):f&&f.running&&e.pure?(f.sources.has(e)||(e.value=r),f.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function k(e,t,n,r=c,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:d,context:d?d.context:null,pure:n};return f&&f.running&&(a.state=0,a.tState=r),d===null||d!==u&&(f&&f.running&&d.pure?d.tOwned?d.tOwned.push(a):d.tOwned=[a]:d.owned?d.owned.push(a):d.owned=[a]),a}function A(e){let t=f&&f.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===l)return N(e);if(e.suspense&&S(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<g);){if(t&&f.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(f.disposed.has(t))return}if((t?e.tState:e.state)===c)D(e);else if((t?e.tState:e.state)===l){let t=m;m=null,j(()=>N(e,n[0]),!1),m=t}}}function j(e,t){if(m)return e();let n=!1;t||(m=[]),h?n=!0:h=[],g++;try{let t=e();return ae(n),t}catch(e){n||(h=null),m=null,L(e)}}function ae(e){if(m&&=(M(m),null),e)return;let t;if(f){if(!f.promises.size&&!f.queue.size){let e=f.sources,n=f.disposed;h.push.apply(h,f.effects),t=f.resolve;for(let e of h)`tState`in e&&(e.state=e.tState),delete e.tState;f=null,j(()=>{for(let e of n)P(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)P(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}re(!1)},!1)}else if(f.running){f.running=!1,f.effects.push.apply(f.effects,h),h=null,re(!0);return}}let n=h;h=null,n.length&&j(()=>s(n),!1),t&&t()}function M(e){for(let t=0;t<e.length;t++)A(e[t])}function oe(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:A(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)A(t[r])}function N(e,t){let n=f&&f.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===c?i!==t&&(!i.updatedAt||i.updatedAt<g)&&A(i):e===l&&N(i,t)}}}function se(e){let t=f&&f.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=l:r.state=l,r.pure?m.push(r):h.push(r),r.observers&&se(r))}}function P(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)P(e.tOwned[t]);delete e.tOwned}if(f&&f.running&&e.pure)F(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)P(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}f&&f.running?e.tState=0:e.state=0}function F(e,t){if(t||(e.tState=0,f.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)F(e.owned[t])}function ce(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function I(e,t,n){try{for(let n of t)n(e)}catch(e){L(e,n&&n.owner||null)}}function L(e,t=d){let n=o&&t&&t.context&&t.context[o],r=ce(e);if(!n)throw r;h?h.push({fn(){I(r,n,t)},state:c}):I(r,n,t)}var le=Symbol(`fallback`);function R(e){for(let t=0;t<e.length;t++)e[t]()}function ue(e,t,n={}){let r=[],a=[],o=[],s=0,c=t.length>1?[]:null;return C(()=>R(o)),()=>{let l=e()||[],u=l.length,d,f;return l[i],S(()=>{let e,t,i,m,h,g,v,y,b;if(u===0)s!==0&&(R(o),o=[],r=[],a=[],s=0,c&&=[]),n.fallback&&(r=[le],a[0]=_(e=>(o[0]=e,n.fallback())),s=1);else if(s===0){for(a=Array(u),f=0;f<u;f++)r[f]=l[f],a[f]=_(p);s=u}else{for(i=Array(u),m=Array(u),c&&(h=Array(u)),g=0,v=Math.min(s,u);g<v&&r[g]===l[g];g++);for(v=s-1,y=u-1;v>=g&&y>=g&&r[v]===l[y];v--,y--)i[y]=a[v],m[y]=o[v],c&&(h[y]=c[v]);for(e=new Map,t=Array(y+1),f=y;f>=g;f--)b=l[f],d=e.get(b),t[f]=d===void 0?-1:d,e.set(b,f);for(d=g;d<=v;d++)b=r[d],f=e.get(b),f!==void 0&&f!==-1?(i[f]=a[d],m[f]=o[d],c&&(h[f]=c[d]),f=t[f],e.set(b,f)):o[d]();for(f=g;f<u;f++)f in i?(a[f]=i[f],o[f]=m[f],c&&(c[f]=h[f],c[f](f))):a[f]=_(p);a=a.slice(0,s=u),r=l.slice(0)}return a});function p(e){if(o[f]=e,c){let[e,n]=y(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}function z(e,t){return S(()=>e(t||{}))}var de=e=>`Stale read from <${e}>.`;function B(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return x(ue(()=>e.each,e.children,t||void 0))}function V(e){let t=e.keyed,n=x(()=>e.when,void 0,void 0),r=t?n:x(n,void 0,{equals:(e,t)=>!e==!t});return x(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?S(()=>a(t?i:()=>{if(!S(r))throw de(`Show`);return n()})):a}return e.fallback},void 0,void 0)}var fe=e=>x(()=>e());function pe(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var H=`_$DX_DELEGATE`;function me(e,t,n,r={}){let i;return _(r=>{i=r,t===document?e():W(t,e(),!n&&t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function U(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>S(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function he(e,t=window.document){let n=t[H]||(t[H]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,_e))}}function W(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return G(e,t,r,n);b(r=>G(e,t(),r,n),r)}function ge(t){return!!e.context&&!e.done&&(!t||t.isConnected)}function _e(t){if(e.registry&&e.events&&e.events.find(([e,n])=>n===t))return;let n=t.target,r=`$$${t.type}`,i=t.target,a=t.currentTarget,o=e=>Object.defineProperty(t,"target",{configurable:!0,value:e}),s=()=>{let e=n[r];if(e&&!n.disabled){let i=n[`${r}Data`];if(i===void 0?e.call(n,t):e.call(n,i,t),t.cancelBubble)return}return n.host&&typeof n.host!=`string`&&!n.host._$host&&n.contains(t.target)&&o(n.host),!0},c=()=>{for(;s()&&(n=n._$host||n.parentNode||n.host););};Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}}),e.registry&&!e.done&&(e.done=_$HY.done=!0);try{if(t.composedPath){let e=t.composedPath();o(e[0]);for(let t=0;t<e.length-2&&(n=e[t],s());t++){if(n._$host){n=n._$host,c();break}if(n.parentNode===a)break}}else c();o(i)}finally{t=n=null}}function G(e,t,n,r,i){let a=ge(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=J(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=J(e,n,r)}else if(o===`function`)return b(()=>{let i=t();for(;typeof i==`function`;)i=i();n=G(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(K(o,t,n,i))return b(()=>n=G(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=J(e,n,r),s)return n}else c?n.length===0?q(e,o,r):pe(e,n,o):(n&&J(e),q(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=J(e,n,r,t);J(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function K(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=K(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=K(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function q(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function J(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}var Y=new URLSearchParams(window.location.search).get(`t`)??``;async function X(e,t={}){let n=await fetch(e,{...t,headers:{...t.body?{"content-type":`application/json`}:{},"x-plan-token":Y,...t.headers??{}}});if(!n.ok)throw Error(`${t.method??`GET`} ${e} → HTTP ${n.status}`);return await n.json()}function ve(){return X(`/api/state`)}async function ye(e,t){return(await X(`/api/toggle`,{method:`POST`,body:JSON.stringify({item:e,checked:t})})).state}function be(e){return X(`/api/report?id=${encodeURIComponent(e)}`)}function xe(e,t){let n=new EventSource(`/api/events?t=${encodeURIComponent(Y)}`);return n.addEventListener(`state`,()=>e()),n.onerror=()=>t(`connection lost — reopen the page from the extension`),()=>n.close()}var Se=U(`<p class="banner error">`),Ce=U(`<p class="banner warn"> change record<!> not clustered yet — run <code>/ask-uat</code> to turn them into acceptance items.`),we=U(`<p class=empty>Nothing to verify. Run <code>/ask-uat</code> after the next round of changes lands.`),Te=U(`<details class=accepted><summary> accepted — expand to undo a tick</summary><ul class="items compact">`),Ee=U(`<span>`),De=U(`<div class=shell><header class=head><div><h1>Acceptance</h1><p class=sub></p></div><button class=ghost>refresh</button></header><ul class=items></ul><footer class=foot>`),Oe=U(`<span> open`),Z=U(`<span class=dot>·`),ke=U(`<span> accepted`),Ae=U(`<span> records not clustered`),je=U(`<p class="banner error"> malformed ledger line(s) were skipped — check .agents/uat/ledger.jsonl.`),Me=U(`<span class="badge reopened">reopened`),Ne=U(`<span class="badge area">`),Pe=U(`<ol class=steps>`),Fe=U(`<p class=label>Edge cases`),Ie=U(`<ul class=edge>`),Le=U(`<p class=skip>Not under test: `),Re=U(`<p class=skip>Spec: `),ze=U(`<div class=details><p class=label>Evidence</p><div class=evidence>`),Be=U(`<li class=item><label class=check><input type=checkbox></label><div class=body><div class=row><h2></h2><span class=badges><span class=badge> record</span><span class=badge></span></span></div><p class=summary></p><button class=more>`),Q=U(`<li>`),Ve=U(`<button class=chip>`),He=U(`<div class=details><ol class=steps></ol><div class=evidence>`),Ue=U(`<li class="item done"><label class=check><input type=checkbox></label><div class=body><div class=row><h2></h2><span class=badges><span class=badge>accepted </span></span></div><p class=summary></p><button class=more>`),We=U(`<div class=drawer><div class=drawer-head><strong></strong><button class=ghost>close</button></div><pre>`);function Ge(){let[e,t]=y(),[n,r]=y(),[i,a]=y(new Set),[o,s]=y(),[c,l]=y();async function u(){try{t(await ve()),r(void 0)}catch(e){r(e instanceof Error?e.message:String(e))}}te(()=>{u(),C(xe(()=>void u(),e=>r(e)))});let d=x(()=>e()?.open??[]),f=x(()=>e()?.checked??[]),p=x(()=>e()?.pending??[]);function m(e){let t=new Set(i());t.has(e)?t.delete(e):t.add(e),a(t)}async function h(e,n){l(e);try{let i=await ye(e,n);t(i),r(void 0)}catch(e){r(e instanceof Error?e.message:String(e))}finally{l(void 0)}}async function g(e){try{s(await be(e))}catch(e){r(e instanceof Error?e.message:String(e))}}return(()=>{var t=De(),r=t.firstChild,a=r.firstChild,l=a.firstChild.nextSibling,_=a.nextSibling,v=r.nextSibling,y=v.nextSibling;return W(l,z(V,{get when(){return e()},fallback:`loading…`,children:e=>[(()=>{var t=Oe(),n=t.firstChild;return W(t,()=>e().counts.open,n),t})(),Z(),(()=>{var t=ke(),n=t.firstChild;return W(t,()=>e().counts.checked,n),t})(),Z(),(()=>{var t=Ae(),n=t.firstChild;return W(t,()=>e().counts.pending,n),t})()]})),_.$$click=()=>void u(),W(t,z(V,{get when(){return n()},get children(){var e=Se();return W(e,n),e}}),v),W(t,z(V,{get when(){return e()?.skipped},children:e=>(()=>{var t=je(),n=t.firstChild;return W(t,e,n),t})()}),v),W(t,z(V,{get when(){return p().length>0},get children(){var e=Ce(),t=e.firstChild,n=t.nextSibling;return n.nextSibling,W(e,()=>p().length,t),W(e,()=>p().length===1?``:`s`,n),e}}),v),W(t,z(V,{get when(){return fe(()=>!!e())()&&d().length===0},get children(){return we()}}),v),W(v,z(B,{get each(){return d()},children:e=>(()=>{var t=Be(),n=t.firstChild,r=n.firstChild,a=n.nextSibling,o=a.firstChild,s=o.firstChild,l=s.nextSibling,u=l.firstChild,d=u.firstChild,f=u.nextSibling,p=o.nextSibling,_=p.nextSibling;return r.addEventListener(`change`,()=>void h(e.id,!0)),r.checked=!1,W(s,()=>e.title),W(l,z(V,{get when(){return e.reopened},get children(){return Me()}}),u),W(u,()=>e.reports.length,d),W(u,()=>e.reports.length===1?``:`s`,null),W(f,()=>new Date(e.createdAt).toLocaleDateString()),W(l,z(V,{get when(){return e.area},get children(){var t=Ne();return W(t,()=>e.area),t}}),null),W(p,()=>e.summary),_.$$click=()=>m(e.id),W(_,()=>i().has(e.id)?`hide test plan`:`show test plan`),W(a,z(V,{get when(){return i().has(e.id)},get children(){var t=ze(),n=t.firstChild,r=n.nextSibling;return W(t,z(V,{get when(){return e.steps.length>0},get children(){var t=Pe();return W(t,z(B,{get each(){return e.steps},children:e=>(()=>{var t=Q();return W(t,e),t})()})),t}}),n),W(t,z(V,{get when(){return e.edge.length>0},get children(){return[Fe(),(()=>{var t=Ie();return W(t,z(B,{get each(){return e.edge},children:e=>(()=>{var t=Q();return W(t,e),t})()})),t})()]}}),n),W(t,z(V,{get when(){return e.skip},get children(){var t=Le();return t.firstChild,W(t,()=>e.skip,null),t}}),n),W(t,z(V,{get when(){return e.spec},get children(){var t=Re();return t.firstChild,W(t,()=>e.spec,null),t}}),n),W(r,z(B,{get each(){return e.reports},children:e=>(()=>{var t=Ve();return t.$$click=()=>void g(e),W(t,e),t})()})),t}}),null),b(()=>r.disabled=c()===e.id),t})()})),W(t,z(V,{get when(){return f().length>0},get children(){var e=Te(),t=e.firstChild,n=t.firstChild,r=t.nextSibling;return W(t,()=>f().length,n),W(r,z(B,{get each(){return f()},children:e=>(()=>{var t=Ue(),n=t.firstChild,r=n.firstChild,a=n.nextSibling,o=a.firstChild,s=o.firstChild,l=s.nextSibling.firstChild;l.firstChild;var u=o.nextSibling,d=u.nextSibling;return r.addEventListener(`change`,()=>void h(e.id,!1)),r.checked=!0,W(s,()=>e.title),W(l,()=>new Date(e.checkedAt??e.createdAt).toLocaleString(),null),W(u,()=>e.summary),d.$$click=()=>m(e.id),W(d,()=>i().has(e.id)?`hide test plan`:`show test plan`),W(a,z(V,{get when(){return i().has(e.id)},get children(){var t=He(),n=t.firstChild,r=n.nextSibling;return W(n,z(B,{get each(){return e.steps},children:e=>(()=>{var t=Q();return W(t,e),t})()})),W(r,z(B,{get each(){return e.reports},children:e=>(()=>{var t=Ve();return t.$$click=()=>void g(e),W(t,e),t})()})),t}}),null),b(()=>r.disabled=c()===e.id),t})()})),e}}),y),W(t,z(V,{get when(){return o()},children:e=>(()=>{var t=We(),n=t.firstChild,r=n.firstChild,i=r.nextSibling,a=n.nextSibling;return W(r,()=>e().id),i.$$click=()=>s(void 0),W(a,()=>e().text),t})()}),y),W(y,z(V,{get when(){return e()?.root},get children(){var t=Ee();return W(t,()=>e().root),t}})),t})()}he([`click`]);var $=document.getElementById(`root`);$&&me(()=>z(Ge,{}),$);
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <meta name="robots" content="noindex" />
7
+ <title>ask-uat — acceptance</title>
8
+ <script type="module" crossorigin src="/index-DCBQCsli.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/index-D-W9zj0w.css">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>
@@ -0,0 +1,23 @@
1
+ /**
2
+ * UAT feature — names and limits in one place.
3
+ *
4
+ * The limits are about *legibility*, not throughput: an acceptance page that
5
+ * shows sixty items is a page nobody reads. A run therefore clusters at most
6
+ * `MAX_ITEMS_PER_RUN` items from at most `MAX_CANDIDATES_PER_RUN` records, and
7
+ * says out loud how many records are still waiting.
8
+ */
9
+ export const UAT_COMMAND = "ask-uat";
10
+ export const RECORD_CHANGE_TOOL = "record_change";
11
+ export const UAT_ITEM_TOOL = "uat_item";
12
+
13
+ /** Records fed to the clustering turn in one run. */
14
+ export const MAX_CANDIDATES_PER_RUN = 40;
15
+ /** New items a single clustering turn may create. */
16
+ export const MAX_ITEMS_PER_RUN = 12;
17
+
18
+ /** Close the page server after this long without a request (2 hours). */
19
+ export const UAT_IDLE_CLOSE_MS = 2 * 60 * 60 * 1000;
20
+ /** How often the server checks the ledger for changes written by another process. */
21
+ export const UAT_WATCH_MS = 1500;
22
+ /** Footer/status key (not rendered today; kept for symmetry with other features). */
23
+ export const UAT_STATUS_KEY = "uat-mode";