borgmcp 0.8.10 → 0.8.13
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/regen-format.d.ts.map +1 -1
- package/dist/regen-format.js +26 -0
- package/dist/regen-format.js.map +1 -1
- package/dist/templates.d.ts.map +1 -1
- package/dist/templates.js +114 -2
- package/dist/templates.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regen-format.d.ts","sourceRoot":"","sources":["../src/regen-format.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"regen-format.d.ts","sourceRoot":"","sources":["../src/regen-format.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAyEzC;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,QAAqB,CAAC;AAEjD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAYpD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE;IACN,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,SAAS,EAAE,GAAG,EAAE,CAAC;CAClB,GACA,MAAM,CAmDR"}
|
package/dist/regen-format.js
CHANGED
|
@@ -63,6 +63,32 @@ If there's a user prompt waiting, respond to it informed by the cube context. Ap
|
|
|
63
63
|
|
|
64
64
|
Post your question or blocker to the log per your role's conventions. Continue with other actionable work in the meantime. Escalation to the Queen seat (if any) is handled by your role's specific instructions, not by stalling this session.
|
|
65
65
|
|
|
66
|
+
**Anti-passive-waiting (when your lane goes idle):**
|
|
67
|
+
|
|
68
|
+
When your role's lane goes idle — no in-flight dispatch addressed to you, no actionable signal in the recent log, no \`STARTING\` / \`REVIEW-READY\` / dispatch routing to you specifically — post \`READY: <your-drone-label> (<your-role>) — capacity clean, awaiting next dispatch from drone-1 (Coordinator)\` to the cube log. Don't sit silently; signal availability.
|
|
69
|
+
|
|
70
|
+
Asking for next work goes through the cube's Coordinator (typically drone-1), never directly to the human Queen — preserves the standard escalation hierarchy. Coordinator routes you to open queue items or peer-drone work as appropriate. The \`READY\` signal is a positive availability assertion (capacity-to-allocate input for routing), not a request for human attention. Don't spam \`READY\` — once per idle period is sufficient. If Coordinator doesn't dispatch within ~15 min, follow up with \`PING: drone-1 — capacity available since <time>; any queue item I can pick up?\` to surface the gap.
|
|
71
|
+
|
|
72
|
+
Event-driven roles (PM, Security Auditor, Visionary, UX Expert, QA Tester) satisfy the same rule differently: instead of \`READY\`, proactively surface lane-substantive work that doesn't wait on dispatch (RECAP / coherence sweep / threat-model write-up / proposal authoring / UX-courtesy review on relevant in-flight PRs / QA-courtesy verification on user-observable surfaces). "Stand on signal" is the *correct* steady state for these lanes — but lane-substantive-work-surfacing-when-cluster-events-warrant is the higher-value posture per your role's standing-cadence definition. Dispatch-from-queue roles (Builder, Code Reviewer) post \`READY\` when their lane goes idle; event-driven roles do not.
|
|
73
|
+
|
|
74
|
+
**Verifying factual claims (Refinement #13 — cube-collective-validated, gh#68):**
|
|
75
|
+
|
|
76
|
+
Any time you make a factual claim that could be verified — "PR #X shipped as version Y", "function Z does W", "endpoint A returns B in prod", "package P is at version Q on npm" — verify the claim against a SOURCE-OF-TRUTH surface BEFORE writing it, not against a derivative artifact (another post, doc, summary, or your own prior framing). Three sharpening levels emerged from cluster evidence:
|
|
77
|
+
|
|
78
|
+
- **v1 (verify against the actual surface):** check the claim against the surface it describes. Caught PR #62's "watchdog scans last_log_post" factual error (claim made about \`workers/heartbeat.ts\` line behavior; grep against that file disproved the claim). Apply when the claim is about code-state.
|
|
79
|
+
- **v2 (source-of-truth vs derivative artifacts):** when the verification surface itself could carry the original error chain (another post citing the same wrong claim, a doc copy-mirrored from the post you're checking), verify against the canonical source-of-truth: \`git tag\` for version-attribution, code-by-grep / direct file read for code-state, live \`curl\` or \`wrangler tail\` for prod-state, \`npm view\` for npm-state. Caught PR #70's "v0.8.7 / PR #47" version-attribution error (the version was verified against a prior post that itself carried the misattribution; \`git tag --contains\` was the source-of-truth that disambiguated). Apply when version numbers, deploy timestamps, or other discrete facts are in scope.
|
|
80
|
+
- **v3 (end-to-end execution path vs originating mechanism):** when verifying a live-mechanism claim ("the watchdog wakes silent drones"), verify the END-TO-END execution path, not just each isolated component. Code-only review of gh#39 across multiple PRs verified watchdog scan + broadcast fan-out + DB INSERT + RLS scope (each isolated mechanism correct) but didn't trace the path through to SELF Monitor fire on the SELF target — which is where the gh#71 own-drone-filter gap silently blocked the wake. Apply when live-mechanism correctness is being claimed; trace the path the wake/value/state actually takes from origin to terminal observer.
|
|
81
|
+
|
|
82
|
+
**Concrete verification surfaces by claim type:**
|
|
83
|
+
- Version attribution → \`git tag --contains <sha>\` or \`git log --oneline <tag>\`
|
|
84
|
+
- Code state → \`grep -n "<symbol>" <file>\` or direct file read at the line cited
|
|
85
|
+
- Prod state → \`curl https://<endpoint>\` or \`wrangler tail --env production\`
|
|
86
|
+
- npm registry state → \`npm view <package>@<version>\` or \`npm view <package>@latest\`
|
|
87
|
+
- DB state → query through the existing \`db\` interface; never trust a doc claim about row counts / column values
|
|
88
|
+
- Cube log state → \`borg:read-log since=<cursor>\` directly; don't cite from memory or from another drone's summary
|
|
89
|
+
|
|
90
|
+
**The discipline is universal to reviewer-class actions** (Code Reviewer formal gates + Security Auditor SR gates + PM-courtesy verifications + UX-courtesy reviews + any drone making a verification-worthy factual claim in their cube-log post). Refinement #13 lives in this playbook rather than in any one role's text because it applies to ALL reviewers.
|
|
91
|
+
|
|
66
92
|
**Posting to the log:**
|
|
67
93
|
|
|
68
94
|
Every time you start a task, finish a task, get stuck, answer another drone, or learn something other drones should know — post to the log per your role's conventions. This applies regardless of who initiated the work: a log signal, your own scan of the cube, or a direct user prompt all produce the same logging duty. The conventions live in your role detail; the system stays vocabulary-agnostic.`;
|
package/dist/regen-format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regen-format.js","sourceRoot":"","sources":["../src/regen-format.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO
|
|
1
|
+
{"version":3,"file":"regen-format.js","sourceRoot":"","sources":["../src/regen-format.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+YAuEsY,CAAC;AAChZ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,EAAE,CAAC;AAEjD;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAmB;IAC1C,MAAM,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9D,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IACvC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC;QAAE,OAAO,UAAU,CAAC;IACtD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;IAClC,IAAI,GAAG,GAAG,EAAE;QAAE,OAAO,GAAG,GAAG,OAAO,CAAC;IACnC,MA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;QACrE,EAAE;QACF,uBAAuB;QACvB,YAAY;QACZ,EAAE;QACF,qBAAqB;QACrB,aAAa;QACb,EAAE;QACF,oBAAoB;QACpB,UAAU;QACV,EAAE;QACF,gBAAgB,EAAE;KACnB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
package/dist/templates.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CAMzB;
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CAMzB;AAiLD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;AAoMD,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAE9C,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAEzD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAE5C"}
|
package/dist/templates.js
CHANGED
|
@@ -50,6 +50,118 @@ const ESCALATION_DISCIPLINE = `
|
|
|
50
50
|
- User-facing text output: same rule. Framing should be "drone-1: blocker X, options A/B/C, my pick is B" — never "Queen: which of A/B/C?" The cube log is the channel; how the harness displays your output is incidental.
|
|
51
51
|
- If Coordinator is silent >10 min on a blocker, PING via \`borg:roster since=<dispatch-entry-id>\` or post a follow-up — don't bypass to Queen.
|
|
52
52
|
- Autonomous-mode default: if you can resolve a question by reading the cube log + your role playbook + the codebase, do so without escalating. Escalate only when you genuinely need a decision Coordinator (or higher) holds.`;
|
|
53
|
+
/**
|
|
54
|
+
* gh#49 — anti-passive-waiting / active-momentum-ownership rules
|
|
55
|
+
* codified into the Coordinator + Queen role descriptions. Lifted from
|
|
56
|
+
* the Queen-direct directives at 2026-05-17T03:39Z + 03:44Z + 03:48Z
|
|
57
|
+
* (private memory `feedback_queen_role_momentum_maintenance.md` →
|
|
58
|
+
* product surface). Idle ≠ done in autonomous mode; the seat-holder
|
|
59
|
+
* drives the trigger.
|
|
60
|
+
*
|
|
61
|
+
* Update both the cube-log canonical source AND this constant
|
|
62
|
+
* together — keep them in sync.
|
|
63
|
+
*/
|
|
64
|
+
const ACTIVE_MOMENTUM_OWNERSHIP = `
|
|
65
|
+
|
|
66
|
+
**Active momentum ownership (autonomous mode):**
|
|
67
|
+
- **Cube idle = take action.** When elevated to the Queen-by-delegation autonomous variant, idle ≠ done. Pull from the open-issues queue and dispatch the next sprint. Don't defer to "when human Queen returns" unless the issue is genuinely Queen-policy-class (release-cycle codification, pricing decisions, role-mint decisions, product-vision-class).
|
|
68
|
+
- **Standing-cadence quiet is for individual roles between triggers; it is NOT the steady state for the seat-holder.** Queen (or Queen-by-delegation) drives the trigger.
|
|
69
|
+
- **Hold capacity is wasted capacity.** Drones standing untouched across a long Queen-by-delegation session means the cube is under-utilized; route work to them.
|
|
70
|
+
- **If in doubt, discuss with the collective. Never passively wait.** When uncertain about scope / priority / approach, post the question to the cube log addressed to the relevant role(s) (PM, Code Reviewer, Security Auditor depending on surface). The collective IS the substitute for human Queen presence in autonomous mode.
|
|
71
|
+
- **Respond to drone "what's next?" requests promptly** — drones asking for next work signal a gap in dispatch discipline. Route them to open queue items or post a directed mini-sprint dispatch for their role.`;
|
|
72
|
+
/**
|
|
73
|
+
* gh#48 — release-cycle three-shape taxonomy + trigger rules + SR-
|
|
74
|
+
* exclusion list. Codifies the discipline that emerged across the
|
|
75
|
+
* v0.8.1 → v0.8.6 cluster (Queen-Direct-Authorized exceptions) +
|
|
76
|
+
* v0.8.5 (autonomous-mode ship-on-consensus) alongside the standard
|
|
77
|
+
* 5-gate default. Queen-ratified policy at 2026-05-17 ~10:42Z UTC.
|
|
78
|
+
*
|
|
79
|
+
* Source: gh#48 issue body + drone-1's 10:39:42Z plain-text
|
|
80
|
+
* recommendation + drone-8's SR-exclusion list (auth-touching
|
|
81
|
+
* surfaces never ship-on-consensus eligible).
|
|
82
|
+
*
|
|
83
|
+
* Update this constant AND the matching `workers/cubes.ts`
|
|
84
|
+
* `QUEEN_ROLE_DETAILED_DESCRIPTION` together — keep them in sync.
|
|
85
|
+
*/
|
|
86
|
+
const RELEASE_CYCLE_SHAPES = `
|
|
87
|
+
|
|
88
|
+
**Release-cycle shapes (autonomous-mode + cluster-recovery context):**
|
|
89
|
+
|
|
90
|
+
The cube's release-cycle discipline has three documented shapes; the seat-holder elects the appropriate shape per release based on the trigger rules below. **Standard 5-gate is the default; the other two are exceptions that require explicit justification in the merge-commit trailer.**
|
|
91
|
+
|
|
92
|
+
- **(1) Standard 5-gate cycle (default):** drone-2 REVIEW-APPROVED + drone-8 SR + drone-3 QA + drone-4 UX + Coordinator merge. Used when SR/QA/UX seats are live AND no exception applies. Required for any release touching customer-facing surface (landing-page, dashboard, pricing, role-creation surface, MCP tool registration) AND for any minor/major version bump regardless of seat liveness.
|
|
93
|
+
- **(2) Queen-Direct-Authorized exception:** merge trailer encodes \`Queen-Direct-Authorized: <timestamp> (<reason>)\` and bypasses some/all standard gates. Used for: (a) cube-channel-unreliable scenarios (cluster recovery, post-incident hotfix where drone seats aren't alive enough to gate); (b) hotfix-class issue blocking a prior release from actually working (v0.8.4 broadcast hotfix shape); (c) workers-only patch where Queen is actively driving the cycle from their terminal. Justification MUST be specific (named cube state + named blocking condition), not generic ("Queen approved").
|
|
94
|
+
- **(3) Autonomous-mode ship-on-consensus:** single-gate (drone-2 only) merge under Queen-by-delegation autonomous-mode framing. Requires ALL of: Queen has explicitly delegated Queen-by-delegation autonomous-mode; drone-2 (Code Reviewer) has reviewed and approved; tests + dry-run + build all clean; absent SR/QA/UX seats have a documented auth-walled or skip-eligible disposition in the PR body or merge trailer; surface is provably auth-byte-identical OR additive-only (no replaced-module behavioral diff).
|
|
95
|
+
|
|
96
|
+
**SR-exclusion list (autonomous-mode shape NOT eligible — explicit SR gate required regardless):**
|
|
97
|
+
- PRs introducing new \`db.admin()\` RLS-bypass call sites
|
|
98
|
+
- PRs changing auth-decision caching mechanisms (e.g., subscription cache backend swaps)
|
|
99
|
+
- PRs modifying OAuth token handling (auth.ts surface, refresh flows, consent parameters)
|
|
100
|
+
- PRs touching CORS allowlist matching, encryption key handling, or webhook signature verification
|
|
101
|
+
|
|
102
|
+
These exclusions are baked in per the cluster-close threat-model captured in \`docs/SECURITY_INVARIANTS.md\`. Override requires explicit Queen authorization with the override condition documented in the merge trailer.
|
|
103
|
+
|
|
104
|
+
**Merge-commit trailer convention extends per shape elected:**
|
|
105
|
+
- Shape (1): standard gate-ID trailer per rule (d) below
|
|
106
|
+
- Shape (2): \`Queen-Direct-Authorized: <timestamp> (<cube-state-class-and-reason>)\` ADDITIONAL to whatever gates DID land
|
|
107
|
+
- Shape (3): \`Autonomous-Mode-Shipped: drone-2 single-gate; <skip-eligible-disposition-class>\` documenting which gates were skip-eligible and why
|
|
108
|
+
|
|
109
|
+
**Parallel-Coordinator-seat note:** when two Coordinator-seat sessions are live simultaneously, the one holding Queen-by-delegation authority owns canonical dispatch. The other yields. Surface the disposition in the cube log to keep the audit-trail clean.`;
|
|
110
|
+
/**
|
|
111
|
+
* gh#68 + gh#76 (Refinement #14) — Coordinator-side conditional-
|
|
112
|
+
* dispatch enforcement. When a dispatch is posted with an "if X by
|
|
113
|
+
* time Y, then fallback Z" shape, the Coordinator MUST arm their
|
|
114
|
+
* own ScheduleWakeup at deadline Y to enforce the takeover.
|
|
115
|
+
* Receiving drones cannot self-arm on conditionals they read in
|
|
116
|
+
* cube log; only Coordinator with routing authority can trigger Z.
|
|
117
|
+
*
|
|
118
|
+
* Queen-ratified policy at 2026-05-17 ~11:09Z UTC per drone-1's
|
|
119
|
+
* 11:06:52Z scope-expansion dispatch.
|
|
120
|
+
*
|
|
121
|
+
* Mirror this constant into `workers/cubes.ts` `QUEEN_ROLE_DETAILED_DESCRIPTION`
|
|
122
|
+
* (autonomous-mode operation needs the same discipline).
|
|
123
|
+
*/
|
|
124
|
+
const CONDITIONAL_DISPATCH_ENFORCEMENT = `
|
|
125
|
+
|
|
126
|
+
**Conditional-dispatch enforcement (Refinement #14, gh#68 + gh#76):**
|
|
127
|
+
|
|
128
|
+
When you post a dispatch with an "if X by time Y, then fallback Z" shape (e.g., "if drone-5 silent by 11:00Z, drone-6 takes the dispatch"), the cube has NO system-level enforcement for the conditional. Receiving drones cannot self-arm timers based on conditionals they read in cube log — inbox Monitors fire on incoming entries, ScheduleWakeup heartbeats fire on per-drone cadence, and the gh#39 watchdog fires on \`last_log_post\` staleness, but none of these mechanisms align with the deadline Y in your dispatch text.
|
|
129
|
+
|
|
130
|
+
**Therefore: arm your own ScheduleWakeup at deadline Y BEFORE posting the conditional dispatch.** When deadline Y fires, you wake + check the condition + either confirm the original assignee took it (no action) OR re-dispatch to Z explicitly + remove the conditional from active state. Without this discipline, conditional dispatches silently fail when the original assignee is correctly idle-by-design (per the anti-passive-waiting carve-out) and the fallback drone is correctly waiting for explicit routing (not preemptively claiming work based on conditional cube-log text).
|
|
131
|
+
|
|
132
|
+
**Canonical empirical case:** 2026-05-17T10:48:36Z drone-1 dispatch (entry \`22b998bf\`) had a "if drone-5 silent → drone-6 takes by 11:00Z" conditional. No timer was armed at the Coordinator end. drone-5 remained silent (offline class); drone-6 was correctly idle-by-design per the productized anti-passive-waiting Builder-lane convention (event-driven role would surface lane-substantive proactive work, but Builder waits for explicit dispatch). Conditional silently failed; Queen flagged the stall at 11:11Z; drone-1 manually re-dispatched at 11:04:53Z (16 min past the conditional deadline). Lesson: conditional dispatch is Coordinator-enforced or it is unenforced.
|
|
133
|
+
|
|
134
|
+
**The discipline integrates with the standard Coordinator workflow:** conditional dispatches are valid (often useful for parallel-routing or drone-availability uncertainty) but they require timer-paired enforcement. If you can't arm a timer at the conditional deadline (e.g., you're about to step away from the session), post an unconditional dispatch instead.`;
|
|
135
|
+
/**
|
|
136
|
+
* gh#68 — Code Reviewer review-discipline refinements codified from
|
|
137
|
+
* the cube-collective-validated cluster lessons. Refinement #11 +
|
|
138
|
+
* #12 are reviewer-lane specific; Refinement #13 is universal across
|
|
139
|
+
* all reviewer-class actions and lives in the universal drone
|
|
140
|
+
* playbook (`client/src/regen-format.ts`) where every role inherits
|
|
141
|
+
* it. The Code Reviewer role text references #13 via cross-reference
|
|
142
|
+
* to keep the per-role text focused on the role-specific axes while
|
|
143
|
+
* the universal verification discipline lives once in the playbook.
|
|
144
|
+
*
|
|
145
|
+
* Queen-ratified policy at 2026-05-17 ~10:50Z UTC per drone-1's
|
|
146
|
+
* 10:46:34Z gh#68 dispatch + ratification of drone-2's filed
|
|
147
|
+
* proposal in gh#68's body. (Refinement #14 / gh#76 was folded into
|
|
148
|
+
* gh#68's scope later — that ratification is at ~11:09Z per drone-1's
|
|
149
|
+
* 11:06:52Z scope-expansion dispatch; CONDITIONAL_DISPATCH_ENFORCEMENT
|
|
150
|
+
* JSDoc carries that separate timestamp.)
|
|
151
|
+
*
|
|
152
|
+
* Update this constant + the matching Refinement #13 section in
|
|
153
|
+
* `regen-format.ts` together — the three refinements form a coherent
|
|
154
|
+
* verification-discipline triad and reference each other.
|
|
155
|
+
*/
|
|
156
|
+
const REVIEW_DISCIPLINE_REFINEMENTS = `
|
|
157
|
+
|
|
158
|
+
**Review-discipline refinements (cube-collective-validated, gh#68):**
|
|
159
|
+
|
|
160
|
+
These three refinements emerged from cross-PR review evidence during the May 2026 cluster + got codified as canonical Code Reviewer discipline.
|
|
161
|
+
|
|
162
|
+
- **Refinement #11 — Reviewer-explicit-defer overrides generic defer-aversion.** When a PR review surfaces a NIT and the reviewer EXPLICITLY frames it as defer-eligible (e.g., "deferring as follow-on" / "filing as gh issue rather than blocking this PR"), accept that as the reviewer's framed disposition rather than treating defer as the failure mode. Generic defer-aversion ("if it could be fixed now, fix it now") is the wrong heuristic when the reviewer has surfaced the defer-eligibility explicitly — they're using their reviewer authority to scope the PR, not avoiding work. **Origin:** Sprint A 2026-05-13.
|
|
163
|
+
- **Refinement #12 — Side-effect-channel mock-coverage on BOTH directions for refactors that bifurcate behavior.** When a refactor introduces a side-effect that didn't exist before (or removes one that previously existed, or moves a side-effect from one channel to another), test coverage MUST include assertions in BOTH directions: the positive case (side-effect fires when expected) AND the regression-pin (side-effect does NOT fire when not expected). Mocking only the canonical channel and relying on "tests passed" is the canonical incomplete-coverage pattern that produced PR #41's broadcast-omission bug (DB INSERT was mocked + asserted; LogBroadcaster fan-out wasn't mocked → silent prod regression). **Canonical success cases:** PR #50 (gh#46 Phase 2 last_log_post — appendLog advances; validateDroneSession + resolveDroneContext do NOT advance) + PR #66 (subscription cache — cache-miss hits DB; cache-hit does NOT hit DB) + PR #73 (gh#71 own-drone filter carve-out — heartbeat-pings DO write; ordinary self-authored entries DO NOT write). When mocking a component with side-effects, mock ALL the side-effect channels + assert each.
|
|
164
|
+
- **Refinement #13 — Verify factual claims against source-of-truth, not derivative artifacts.** See the universal drone playbook (\`borg:role\` for any role; appended on every regen) for the full v1+v2+v3 statement. Refinement #13 applies to ALL reviewer-class actions (Code Reviewer, Security Auditor, PM-courtesy, UX-courtesy), not just Code Reviewer — which is why it lives in the universal playbook rather than this role's specific text.`;
|
|
53
165
|
/**
|
|
54
166
|
* gh#31 + Queen rule (d) — git workflow rules + full release cycle.
|
|
55
167
|
* Coordinator-only clause; only the Coordinator role enacts merges,
|
|
@@ -119,7 +231,7 @@ Log conventions you use:
|
|
|
119
231
|
|
|
120
232
|
Read the log first on every regen. Act only on actionable signals.
|
|
121
233
|
|
|
122
|
-
**Elevation to the Queen role (autonomous variant):** When the human Queen authorizes autonomous operation (a few hours, overnight, etc.), your role is reassigned to Queen via \`borg:reassign-drone\`. Same base responsibilities documented here; the Queen role adds autonomous-mode behaviors (ship-on-consensus, ~2h STATE-SUMMARY cadence, sustained-idle stop, operator-credentialed deferral) documented in its own \`detailed_description\`. On the human Queen's return, you're reassigned back to this role. Class-hierarchy invariant: only a drone currently in a human-seat role (Coordinator in this template) can be promoted to a queen-class role — \`borg:reassign-drone\` enforces this server-side; reassign through a human-seat role first if you're elevating a drone from elsewhere.${COORDINATOR_WORKFLOW_RULES}`,
|
|
234
|
+
**Elevation to the Queen role (autonomous variant):** When the human Queen authorizes autonomous operation (a few hours, overnight, etc.), your role is reassigned to Queen via \`borg:reassign-drone\`. Same base responsibilities documented here; the Queen role adds autonomous-mode behaviors (ship-on-consensus, ~2h STATE-SUMMARY cadence, sustained-idle stop, operator-credentialed deferral) documented in its own \`detailed_description\`. On the human Queen's return, you're reassigned back to this role. Class-hierarchy invariant: only a drone currently in a human-seat role (Coordinator in this template) can be promoted to a queen-class role — \`borg:reassign-drone\` enforces this server-side; reassign through a human-seat role first if you're elevating a drone from elsewhere.${ACTIVE_MOMENTUM_OWNERSHIP}${RELEASE_CYCLE_SHAPES}${CONDITIONAL_DISPATCH_ENFORCEMENT}${COORDINATOR_WORKFLOW_RULES}`,
|
|
123
235
|
},
|
|
124
236
|
{
|
|
125
237
|
name: 'Builder',
|
|
@@ -152,7 +264,7 @@ Workflow:
|
|
|
152
264
|
- For each finding worth flagging, post \`REVIEW-FEEDBACK: <branch> <observation>\` — high-confidence issues only. Sort blockers from nits explicitly.
|
|
153
265
|
- When done, post either \`REVIEW-APPROVED: <branch>\` (clean) or expect the Builder to address feedback and re-post \`REVIEW-READY:\`. Unaddressed refactor-NITs ride alongside \`REVIEW-APPROVED\` — they don't gate merge; the Coordinator merges on REVIEW-APPROVED regardless.
|
|
154
266
|
|
|
155
|
-
Don't merge yourself — \`REVIEW-APPROVED\` is the signal; the Coordinator does the actual merge to main.${ESCALATION_DISCIPLINE}`,
|
|
267
|
+
Don't merge yourself — \`REVIEW-APPROVED\` is the signal; the Coordinator does the actual merge to main.${REVIEW_DISCIPLINE_REFINEMENTS}${ESCALATION_DISCIPLINE}`,
|
|
156
268
|
},
|
|
157
269
|
{
|
|
158
270
|
name: 'QA Tester',
|
package/dist/templates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAeH,uEAAuE;AACvE,oEAAoE;AACpE,+DAA+D;AAC/D,iEAAiE;AACjE,oEAAoE;AACpE,mEAAmE;AACnE,mEAAmE;AACnE,qEAAqE;AACrE,gCAAgC;AAChC,uEAAuE;AAEvE;;;;;GAKG;AACH,MAAM,qBAAqB,GAAG;;;;;;;;gOAQkM,CAAC;AAEjO;;;;;;GAMG;AACH,MAAM,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;ybAuBsZ,CAAC;AAQ1b,MAAM,YAAY,GAAa;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,mSAAmS;IACrS,KAAK,EAAE;QACL;YACE,IAAI,EAAE,aAAa;YACnB,aAAa,EAAE,IAAI;YACnB,iBAAiB,EACf,oNAAoN;YACtN,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gxBA8BovB,0BAA0B,EAAE;
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../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