chatroom-cli 1.149.0 → 1.149.2

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.
package/dist/index.js CHANGED
@@ -71356,7 +71356,15 @@ var init_architect = __esm(() => {
71356
71356
  });
71357
71357
 
71358
71358
  // ../../services/backend/prompts/utils/code-change-verification.ts
71359
- var CODE_CHANGE_VERIFICATION_CONFIRMATION = "- [ ] I confirm that I have run typecheck and tests for the project (only required if code changes were made)";
71359
+ var CODE_CHANGE_VERIFICATION_CONFIRMATION = "- [ ] I confirm that I have run typecheck and tests for the project (only required if code changes were made)", BUILDER_CODE_CHANGE_VERIFICATION_CONFIRMATION;
71360
+ var init_code_change_verification = __esm(() => {
71361
+ BUILDER_CODE_CHANGE_VERIFICATION_CONFIRMATION = [
71362
+ "- [ ] I confirm that the lightweight checks (typecheck and lint) ran on the code I changed",
71363
+ "- [ ] I confirm that every verification kind the brief marked `required` ran, and I recorded its command and result below",
71364
+ "- [ ] I confirm that every verification kind the brief marked `not applicable` is recorded below with the brief's reason"
71365
+ ].join(`
71366
+ `);
71367
+ });
71360
71368
 
71361
71369
  // ../../services/backend/prompts/utils/delegation-disclosure.ts
71362
71370
  function getDelegationBriefDisclosureComment(briefSourceRole) {
@@ -71456,7 +71464,70 @@ ${getRoleGuidanceDisclosureComment(params)}`;
71456
71464
  var ROLE_GUIDANCE_DISCLOSURE_CHECKBOX = "- [ ] I confirm that I've read and followed the role guidance before starting any work";
71457
71465
  var init_role_guidance_disclosure = () => {};
71458
71466
 
71467
+ // ../../services/backend/prompts/utils/verification-kinds.ts
71468
+ var VERIFICATION_KINDS;
71469
+ var init_verification_kinds = __esm(() => {
71470
+ VERIFICATION_KINDS = [
71471
+ {
71472
+ id: "typecheck",
71473
+ label: "typecheck",
71474
+ timingLabel: "Typecheck",
71475
+ lightweight: true,
71476
+ command: "pnpm turbo run typecheck --filter=<package>"
71477
+ },
71478
+ {
71479
+ id: "lint",
71480
+ label: "lint",
71481
+ timingLabel: "Lint",
71482
+ lightweight: true,
71483
+ command: "pnpm exec eslint <files in scope>"
71484
+ },
71485
+ {
71486
+ id: "unit",
71487
+ label: "unit tests",
71488
+ timingLabel: "Unit tests",
71489
+ lightweight: false,
71490
+ command: "pnpm --dir <workspace> exec vitest run <test files in scope>"
71491
+ },
71492
+ {
71493
+ id: "integration",
71494
+ label: "integration tests",
71495
+ timingLabel: "Integration tests",
71496
+ lightweight: false,
71497
+ command: "pnpm --dir <workspace> exec vitest run <integration specs in scope>",
71498
+ note: "The chatroom-cli suite is `pnpm --filter chatroom-cli test:integration`."
71499
+ },
71500
+ {
71501
+ id: "e2e",
71502
+ label: "e2e",
71503
+ timingLabel: "E2E",
71504
+ lightweight: false,
71505
+ command: "pnpm --dir apps/webapp exec playwright test --config=tests/e2e/playwright.config.ts <specs in scope> --project=chromium"
71506
+ }
71507
+ ];
71508
+ });
71509
+
71459
71510
  // ../../services/backend/prompts/teams/builder-handback-handoff-templates.ts
71511
+ function getVerificationKindResultLine(kind) {
71512
+ const outcomes = kind.lightweight ? "<ran: command → result>" : "<ran: command → result | not run: reason | not applicable: the brief's reason>";
71513
+ return `- \`${kind.label}\` — ${outcomes}`;
71514
+ }
71515
+ function getVerificationKindTimingLine(kind) {
71516
+ return kind.lightweight ? `- ${kind.timingLabel}: <duration>` : `- ${kind.timingLabel}: <duration | not run | not applicable>`;
71517
+ }
71518
+ function getTimingReportSection() {
71519
+ return `## Timing report
71520
+ <!-- REQUIRED. Record the wall-clock duration of each activity you performed, as m:ss or h:mm:ss. Measure with timestamps (for example \`date +%s\` before and after each step). Write \`not run\` for an activity you did not perform and \`not applicable\` when it does not apply to this brief. Do not omit a row. Typecheck and lint always run, so record their duration; if either cannot run, it is a blocker under \`## Blockers / questions\`, not a \`not run\` row. -->
71521
+ - Brief reading: <duration | not run>
71522
+ - Implementation (code and tests written): <duration | not run>
71523
+ ${VERIFICATION_KINDS.map(getVerificationKindTimingLine).join(`
71524
+ `)}
71525
+ - Commits: <duration | not run>
71526
+ - Push and PR: <duration | not run | not applicable>
71527
+ - Other activities: <name — duration, one line each | not applicable>
71528
+ - Slowest activity and why: <one phrase>
71529
+ - Total: <duration>`;
71530
+ }
71460
71531
  function getBuilderHandbackTemplate(query) {
71461
71532
  const recipientRole = query.toRole;
71462
71533
  return getBuilderHandbackBody({
@@ -71484,7 +71555,12 @@ ${getFileReferenceProofOfCompletionExample()}
71484
71555
  <evidence the goal was met — list every file you modified; for each behavior the brief's \`## Test seams\` section names a seam for: the test name, the seam it calls, the failure output observed before the implementation, and the passing output after>
71485
71556
 
71486
71557
  ## Code Change Verification
71487
- ${CODE_CHANGE_VERIFICATION_CONFIRMATION}
71558
+ ${BUILDER_CODE_CHANGE_VERIFICATION_CONFIRMATION}
71559
+ Record each kind below, in this order, with its command and result. Typecheck and lint always run: record their command and result only. If either cannot run, put the blocker under \`## Blockers / questions\` and do not write \`not run\` here. For every other kind, write \`not run: <reason>\` or \`not applicable: <the brief's reason>\`.
71560
+ ${VERIFICATION_KINDS.map(getVerificationKindResultLine).join(`
71561
+ `)}
71562
+
71563
+ ${getTimingReportSection()}
71488
71564
 
71489
71565
  ## Blockers / questions
71490
71566
  ${getHandoffNotApplicableSectionComment("List blockers")}
@@ -71496,8 +71572,10 @@ ${getHandoffNotApplicableSectionComment("List review notes")}
71496
71572
  \`\`\``;
71497
71573
  }
71498
71574
  var init_builder_handback_handoff_templates = __esm(() => {
71575
+ init_code_change_verification();
71499
71576
  init_handoff_quality_principles();
71500
71577
  init_role_guidance_disclosure();
71578
+ init_verification_kinds();
71501
71579
  });
71502
71580
 
71503
71581
  // ../../services/backend/prompts/teams/duo/handoff-templates/builder-planner-code.ts
@@ -71789,8 +71867,43 @@ var init_planner_architect_chat = __esm(() => {
71789
71867
  });
71790
71868
 
71791
71869
  // ../../services/backend/prompts/teams/builder-delegation-handoff-templates.ts
71870
+ function getVerificationKindFlagLine(kind) {
71871
+ const choice = kind.lightweight ? "**required**. Lightweight: the builder always runs it, so never mark it `not applicable`." : "**required** or **not applicable: <reason>**.";
71872
+ const note = kind.note ? ` ${kind.note}` : "";
71873
+ return `- \`${kind.label}\` — ${choice} Command: \`${kind.command}\`${note}`;
71874
+ }
71875
+ function getScopeLines(batching) {
71876
+ const focused = "`focused` — each run covers only the test files and workspaces that touch this brief's files.";
71877
+ const roundFinal = batching ? "`round-final` — each run covers the full scope: the full unit suite and full integration suite of every workspace the round changed, typecheck and lint of those workspaces (`pnpm lint` for the whole repository), and every e2e spec the round affects." : "`round-final` — each run covers the full scope: the full unit suite and full integration suite of every workspace this brief changed, typecheck and lint of those workspaces (`pnpm lint` for the whole repository), and every e2e spec this brief affects.";
71878
+ return [
71879
+ "Scope: <`focused` | `round-final`> — replace the placeholder with this brief's scope and keep only that definition below.",
71880
+ `- ${focused}`,
71881
+ `- ${roundFinal}`
71882
+ ];
71883
+ }
71884
+ function getVerificationFlagsSection(batching) {
71885
+ return [
71886
+ "## Verification flags",
71887
+ "Mark each kind `required` or `not applicable: <reason>`. The builder runs every `required` kind with the command shown, always runs typecheck and lint, and records each `not applicable` kind in its hand-back.",
71888
+ ...getScopeLines(batching),
71889
+ ...VERIFICATION_KINDS.map(getVerificationKindFlagLine),
71890
+ WORKSPACE_PROSE_LINE,
71891
+ "",
71892
+ ""
71893
+ ].join(`
71894
+ `);
71895
+ }
71896
+ function getBatchingFragments(batching) {
71897
+ const roundGuidance = batching ? "A builder round trip is slow — implement, commit, verify. Group phases when one verification pass covers them, and land a risky or contract-changing phase alone. You decide the grouping. In the brief body, set the `## Verification flags` scope to `round-final` for the round's final brief and `focused` for the others." : "Keep one slice ≈ one focused review surface. Delegate slices incrementally — one at a time, not all at once. In the brief body, set the `## Verification flags` scope to `focused` for each slice and to `round-final` for the final slice, which runs the full pass once.";
71898
+ const endToEndRequirement = batching ? "- Name at least one end-to-end evidence for the feature on the round's final brief: a CLI run, an API call, a UI action, or the template render. Earlier briefs need focused evidence only; the round as a whole must be end-to-end verified. When the brief marks `e2e` `not applicable`, the Requirements must name which of these alternatives is the end-to-end evidence." : "- Name at least one end-to-end evidence that the feature works: a CLI run, an API call, a UI action, or the template render. Unit tests alone are insufficient for new features. When the brief marks `e2e` `not applicable`, the Requirements must name which of these alternatives is the end-to-end evidence.";
71899
+ return {
71900
+ roundGuidance,
71901
+ endToEndRequirement,
71902
+ verificationFlagsSection: getVerificationFlagsSection(batching)
71903
+ };
71904
+ }
71792
71905
  function getBuilderDelegationBriefTemplate(options) {
71793
- const { delegatorRole, gatesOwner } = options;
71906
+ const { delegatorRole, gatesOwner, batching = false } = options;
71794
71907
  const prelude = gatesOwner === "self" ? `**Before you delegate:** if this slice introduces anything not yet grounded in the repository (a new library, API, external platform behavior, or an unresolved choice that depends on missing facts), hand off to \`researcher\` first and delegate only after its brief returns. Skip this when the \`researcher\` template's skip condition applies. The \`researcher\` handoff template defines the criteria.
71795
71908
 
71796
71909
  **Bug fixes:** if this slice fixes a reported bug, delegate only after a \`triage\` report for that bug has returned, and build the brief from its root cause and proposed fix. The \`triage\` handoff template defines the investigation.
@@ -71798,6 +71911,7 @@ function getBuilderDelegationBriefTemplate(options) {
71798
71911
  **Division of labor:** For backend contract, API, or schema/persistence changes, the architect designs first and you delegate only after its design returns. You (${delegatorRole}) own slicing and sequencing of builder work. The UI/UX engineer owns UI/UX design. Include its target markup, classes, styles, and screen and flow drawings in UI implementation briefs; the builder implements the components.` : `**Before you delegate:** the \`${gatesOwner}\` clears research, triage, architecture, UI/UX, and asset gates before work reaches you. If a slice depends on a fact, design decision, or bug diagnosis that the work package does not settle, hand back to \`${gatesOwner}\` with the open question instead of guessing. Do not hand off to \`researcher\`, \`triage\`, \`architect\`, or any other specialist yourself.
71799
71912
 
71800
71913
  **Division of labor:** You (${delegatorRole}) own turning the work package into file-level builder slices and sequencing them. Copy any UI/UX target markup, classes, styles, and drawings from the work package into UI implementation briefs; the builder implements the components.`;
71914
+ const { roundGuidance, endToEndRequirement, verificationFlagsSection } = getBatchingFragments(batching);
71801
71915
  return `${getDelegationBriefIntro()}
71802
71916
 
71803
71917
  ${prelude}
@@ -71806,7 +71920,7 @@ ${prelude}
71806
71920
 
71807
71921
  **Test seams:** Fill \`## Test seams\` in the brief body for each behavior the slice changes. See the \`test-seam\` glossary term for what a seam is.
71808
71922
 
71809
- Guidance for you (not part of the message): Keep one slice ≈ one focused review surface. Delegate slices incrementally — one at a time, not all at once.
71923
+ Guidance for you (not part of the message): ${roundGuidance}
71810
71924
 
71811
71925
  \`\`\`\`markdown
71812
71926
  ## Summary
@@ -71858,14 +71972,14 @@ Cross-file types, interfaces, or patterns that apply beyond a single file. Omit
71858
71972
 
71859
71973
  ## Requirements (acceptance criteria)
71860
71974
  - <verifiable outcome the builder can self-check>
71861
- - Include at least one check that the feature is **verified end-to-end**. Unit tests alone are insufficient for new features.
71975
+ ${endToEndRequirement}
71862
71976
 
71863
71977
  ## Test seams
71864
71978
  - <behavior>: seam <public interface or port>; catches <what>; misses <what>
71865
71979
  - or: no test seam — <reason>
71866
71980
  - For each named seam: write a failing test first, then make it pass (red-green). If the seam is \`no test seam\`, delete this line.
71867
71981
 
71868
- ## What to avoid
71982
+ ${verificationFlagsSection}## What to avoid
71869
71983
  - <anti-patterns, recurring mistakes, or scope creep for this slice — be explicit>
71870
71984
  - Do not test private methods or mock internal collaborators. A test that breaks on refactor while behavior is unchanged is wrong.
71871
71985
  - Do not derive expected values by re-running the code's own formula. Take them from a known-good literal, a worked example, or the spec.
@@ -71879,7 +71993,10 @@ Cross-file types, interfaces, or patterns that apply beyond a single file. Omit
71879
71993
 
71880
71994
  \`\`\`\``;
71881
71995
  }
71882
- var init_builder_delegation_handoff_templates = () => {};
71996
+ var WORKSPACE_PROSE_LINE = "`<workspace>` is a directory: `services/backend`, `apps/webapp`, `packages/cli`, or `packages/shared`. `--filter` takes the package name: `@workspace/backend`, `@workspace/webapp`, `chatroom-cli`, or `@workspace/shared`.";
71997
+ var init_builder_delegation_handoff_templates = __esm(() => {
71998
+ init_verification_kinds();
71999
+ });
71883
72000
 
71884
72001
  // ../../services/backend/prompts/teams/duo/handoff-templates/planner-builder-code.ts
71885
72002
  function getPlannerBuilderCodeTemplate(_query) {
@@ -72637,6 +72754,7 @@ ${getHandoffNotApplicableSectionComment("List manual steps outside the system")}
72637
72754
  </handoff-action>`;
72638
72755
  }
72639
72756
  var init_handoff_report_template_body = __esm(() => {
72757
+ init_code_change_verification();
72640
72758
  init_context_disclosure();
72641
72759
  init_handoff_quality_principles();
72642
72760
  init_proof_of_verification();
@@ -73469,14 +73587,13 @@ var init_command3 = __esm(() => {
73469
73587
 
73470
73588
  // ../../services/backend/prompts/teams/trio/handoff-templates/coordinator-specifier-code.ts
73471
73589
  function getCoordinatorSpecifierCodeTemplate(query) {
73472
- const readPhaseCommand = planReadCommand({
73590
+ const readPlanCommand = planReadCommand({
73473
73591
  cliEnvPrefix: query.cliEnvPrefix ?? "",
73474
73592
  chatroomId: query.chatroomId,
73475
73593
  role: "specifier",
73476
- planId: "<planId>",
73477
- phase: "<Pn>"
73594
+ planId: "<planId>"
73478
73595
  });
73479
- return `Instructions (not part of the message): Delegate ONE work package to the \`specifier\`. The specifier plans the package as file-level builder slices, drives the builder through ONE slice, and hands a slice report back to you that names the slices still to do. The first package for a request carries \`Plan ID: None — first pass: publish the plan\`; the specifier publishes the phased plan and builds its first phase. Every later package names the phase to build under \`## Plan reference\` instead of restating the plan. Clear every required gate first (researcher, triage, architect, uiux-engineer, game-asset-designer) and include the decisions from their briefs, citing message ids — the specifier cannot contact those roles. Do not write file-level code instructions yourself; state outcomes, constraints, and acceptance criteria. Each package starts the specifier in a fresh session: include everything it needs, or name the message ids it must read with \`chatroom messages download\`.
73596
+ return `Instructions (not part of the message): Delegate one work package to the \`specifier\`. State the outcome, the user's requirements and constraints, the specialist decisions, the delivery expectations, and what the plan has already delivered. The specifier plans the slices, decides which phases it delegates in this round, drives the builder through them, and reports back. Builder rounds are slow — it may be a while before you hear back. Do not size its rounds or write file-level code instructions. Clear every required gate first (researcher, triage, architect, uiux-engineer, game-asset-designer) and include the decisions from their briefs, citing message ids — the specifier cannot contact those roles. Each package starts the specifier in a fresh session: include everything it needs, or name the message ids it must read with \`chatroom messages download\`.
73480
73597
 
73481
73598
  ${getDelegationBriefIntro()}
73482
73599
 
@@ -73500,8 +73617,8 @@ ${getFileReferenceGuidanceComment()}
73500
73617
 
73501
73618
  ## Plan reference
73502
73619
  Plan ID: <planId>, or \`None — first pass: publish the plan\`
73503
- Phase: <Pn>, or \`None — first pass: publish the plan\`
73504
- When \`Phase\` names a phase, read it before you brief the builder: \`${readPhaseCommand}\`
73620
+ Delivered so far: <phases the plan already landed and anything left open; or \`Nothing yet.\`>
73621
+ Read the plan when useful: \`${readPlanCommand}\`
73505
73622
 
73506
73623
  ## Rework findings (prior round)
73507
73624
  <message id of the specifier, reviewer, or verifier report and the blocking findings to fix (paste each with file and line where known); or \`None.\`>
@@ -73513,7 +73630,7 @@ When \`Phase\` names a phase, read it before you brief the builder: \`${readPhas
73513
73630
  <commit, branch, push, and PR expectations from the user; or \`None stated.\`>
73514
73631
 
73515
73632
  ## History pointers
73516
- <message ids or a \`--since-message-id\` anchor the specifier should download for context, including the prior slice report when this package continues a slice plan; or \`None.\`>
73633
+ <message ids or a \`--since-message-id\` anchor the specifier should download for context, including the prior round report when this package continues a plan; or \`None.\`>
73517
73634
  \`\`\``;
73518
73635
  }
73519
73636
  var init_coordinator_specifier_code = __esm(() => {
@@ -73806,7 +73923,8 @@ var init_reviewer2 = __esm(() => {
73806
73923
  function getSpecifierBuilderCodeTemplate(_query) {
73807
73924
  return getBuilderDelegationBriefTemplate({
73808
73925
  delegatorRole: "specifier",
73809
- gatesOwner: "coordinator"
73926
+ gatesOwner: "coordinator",
73927
+ batching: true
73810
73928
  });
73811
73929
  }
73812
73930
  var init_specifier_builder_code = __esm(() => {
@@ -73822,12 +73940,12 @@ var init_specifier_builder_chat = __esm(() => {
73822
73940
  function getSpecifierCoordinatorChatTemplate(_query) {
73823
73941
  return `Instructions (not part of the message): chat response for the coordinator —
73824
73942
  \`\`\`markdown
73825
- <write only the concise status the coordinator needs: what this slice delivered, the slices still to do, blockers, and decisions it must make; do not add handoff XML sections, proofs, or report headings>
73943
+ <write only the concise status the coordinator needs: what this round delivered, what the plan still has, blockers, and decisions it must make; do not add handoff XML sections, proofs, or report headings>
73826
73944
 
73827
73945
  Plan reference:
73828
73946
  Plan ID: <planId> (newly published | unchanged | superseded by <planId>)
73829
- Phases delivered: <P1, …, Pn>
73830
- Next phase: <Pn, or None — plan complete>
73947
+ Phases delivered so far: <P1, …, Pn>
73948
+ What remains: <phases not yet delivered, or None — plan complete>
73831
73949
  \`\`\``;
73832
73950
  }
73833
73951
 
@@ -73837,7 +73955,7 @@ function getSpecifierCoordinatorCodeTemplate(query) {
73837
73955
 
73838
73956
  \`\`\`markdown
73839
73957
  ## Summary
73840
- <what this slice delivered, or why it stopped, in plain terms; say which slice of the package this report covers>
73958
+ <what this round delivered, and why the round ended where it did, in plain terms>
73841
73959
 
73842
73960
  ## Template Disclosure Confirmation
73843
73961
  - [ ] I confirm that I have seen this template at the start of this work package, before driving the builder
@@ -73848,25 +73966,28 @@ ${getRoleGuidanceDisclosureBlock({
73848
73966
  })}
73849
73967
 
73850
73968
  ## What exists today
73851
- ${getHandoffNotApplicableSectionComment("Describe current state after this slice")}
73852
- <current state after this slice: what the user can now do, what is in place, how the system behaves>
73969
+ ${getHandoffNotApplicableSectionComment("Describe current state after this round")}
73970
+ <current state after this round: what the user can now do, what is in place, how the system behaves>
73971
+
73972
+ ## What this round delivered
73973
+ <one line per phase: phase id and title, builder handoff message id, commits, files changed, rework rounds>
73853
73974
 
73854
- ## Slice delivered
73855
- <the one builder slice this report covers: builder handoff message id, commits, files changed, rework rounds>
73975
+ ## Verification run
73976
+ <what ran at which stage: focused tests per phase, full suite / typecheck / lint / e2e at the round's end, with the command and result; and anything that did not run, and why (blocked or early stop)>
73856
73977
 
73857
- ## Slices still to do
73858
- <the remaining slices of this work package, in build order, each with its goal and the files it touches; or \`None — the package is complete.\`>
73978
+ ## What the plan still has
73979
+ <a reminder for the next round, not an assignment: the phases not yet delivered, in plan order, each with its title; or \`None — the plan is complete.\`>
73859
73980
 
73860
73981
  ## Plan reference
73861
73982
  Plan ID: <planId> (newly published | unchanged | superseded by <planId>)
73862
- Phases delivered: <P1, …, Pn>
73863
- Next phase: <Pn, or None — plan complete>
73983
+ Phases delivered so far: <P1, …, Pn>
73984
+ What remains: <the phases not yet delivered, or \`None — plan complete\`>
73864
73985
 
73865
73986
  ${getHandoffQualityPrinciplesSectionBlock("work")}
73866
73987
 
73867
73988
  ## Proof of Completion
73868
73989
  ${getFileReferenceProofOfCompletionExample()}
73869
- <for each acceptance criterion in the work package: met / not met / left to a remaining slice, with evidence (test names and output, commands run, commits)>
73990
+ <for each acceptance criterion in the work package: met / not met / left to a later round, with evidence (test names and output, commands run, commits)>
73870
73991
 
73871
73992
  ## Code Change Verification
73872
73993
  ${CODE_CHANGE_VERIFICATION_CONFIRMATION}
@@ -73900,6 +74021,7 @@ ${getHandoffNotApplicableSectionComment("List review notes")}
73900
74021
  \`\`\``;
73901
74022
  }
73902
74023
  var init_specifier_coordinator_code = __esm(() => {
74024
+ init_code_change_verification();
73903
74025
  init_handoff_quality_principles();
73904
74026
  init_role_guidance_disclosure();
73905
74027
  init_unresolved_decisions();
@@ -123650,4 +123772,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
123650
123772
  });
123651
123773
  program2.parse();
123652
123774
 
123653
- //# debugId=31A28C453A0672B464756E2164756E21
123775
+ //# debugId=0FE2B8362AD6B80B64756E2164756E21