@wrongstack/core 0.281.3 → 0.282.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.
- package/dist/{agent-subagent-runner-DyOSK2Wy.d.ts → agent-subagent-runner-Dksf0QVU.d.ts} +15 -4
- package/dist/{config-CN-vdDEI.d.ts → config-BCAEJicb.d.ts} +33 -1
- package/dist/coordination/index.d.ts +147 -48
- package/dist/coordination/index.js +1244 -274
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +18 -18
- package/dist/defaults/index.js +980 -166
- package/dist/defaults/index.js.map +1 -1
- package/dist/{director-state-BfeCUbmk.d.ts → director-state-B_GPa78Q.d.ts} +14 -0
- package/dist/{events-C5hLU0AT.d.ts → events-CovDylaH.d.ts} +2 -1
- package/dist/execution/index.d.ts +10 -10
- package/dist/execution/index.js +69 -3
- package/dist/execution/index.js.map +1 -1
- package/dist/extension/index.d.ts +4 -4
- package/dist/{global-mailbox-CHM1QkCi.d.ts → global-mailbox-CNfgvRw3.d.ts} +1 -1
- package/dist/{goal-store-BLGZq16t.d.ts → goal-store-CBd749M4.d.ts} +1 -1
- package/dist/hq/index.d.ts +4 -4
- package/dist/{index-C1E-_71T.d.ts → index-D5HB7WkV.d.ts} +4 -3
- package/dist/index.d.ts +3005 -2704
- package/dist/index.js +51862 -49927
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +3 -3
- package/dist/kernel/index.d.ts +7 -7
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-EKRAcJDi.d.ts → mcp-servers-DJYwZXyH.d.ts} +1 -1
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +100 -14
- package/dist/models/index.js.map +1 -1
- package/dist/{multi-agent-coordinator-IpHCuHUa.d.ts → multi-agent-coordinator-4DC31QWu.d.ts} +1 -1
- package/dist/{null-fleet-bus-ZBkKGR9j.d.ts → null-fleet-bus-DuvA8PIR.d.ts} +74 -6
- package/dist/observability/index.d.ts +1 -1
- package/dist/{parallel-eternal-engine-Cc2CNgmv.d.ts → parallel-eternal-engine-BwcA0bAt.d.ts} +4 -4
- package/dist/{pipeline-E7_jqGyV.d.ts → pipeline-DM-CPTUs.d.ts} +1 -1
- package/dist/{provider-model-resolve-KgIdiEQ6.d.ts → provider-model-resolve-hNUbewMd.d.ts} +1 -1
- package/dist/{provider-runner-DxWXNHL1.d.ts → provider-runner-Bz4GyUqo.d.ts} +1 -1
- package/dist/sdd/index.d.ts +6 -6
- package/dist/sdd/index.js +76 -2
- package/dist/sdd/index.js.map +1 -1
- package/dist/{session-event-bridge-vA2fLV58.d.ts → session-event-bridge-Bkp7ORfc.d.ts} +2 -2
- package/dist/skills/index.d.ts +84 -84
- package/dist/storage/index.d.ts +168 -168
- package/dist/storage/index.js +19 -7
- package/dist/storage/index.js.map +1 -1
- package/dist/{todos-checkpoint-B1QVkoa8.d.ts → todos-checkpoint-addCdQ9f.d.ts} +2 -2
- package/dist/{tool-executor-BWtYwuPI.d.ts → tool-executor-B3spV_Q6.d.ts} +7 -7
- package/dist/tools/index.d.ts +1 -1
- package/dist/types/index.d.ts +33 -33
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +113 -113
- package/dist/{worktree-manager-C6CIilTT.d.ts → worktree-manager-BBXdJq-Y.d.ts} +1 -1
- package/instructions/agents/reviewer.md +25 -0
- package/instructions/agents/verifier.md +24 -0
- package/instructions/coordination/director-preamble.md +24 -2
- package/instructions/coordination/subagent-baseline.md +8 -1
- package/package.json +1 -1
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,14 +1,125 @@
|
|
|
1
|
-
import { E as CompletedWorkSource, d as Context, G as ContextEvidenceState, D as CompletedWorkEvidence, o as ToolOutputMetadata, J as JSONSchema,
|
|
1
|
+
import { M as Message, E as CompletedWorkSource, d as Context, G as ContextEvidenceState, D as CompletedWorkEvidence, o as ToolOutputMetadata, J as JSONSchema, y as TodoItem, g as Tool } from '../tool-LVSLiE1s.js';
|
|
2
2
|
export { H as HttpDispatcher, a as HttpsAgentAsDispatcher } from '../dispatcher-types.d-BBeXBQgS.js';
|
|
3
3
|
export { toErrorMessage } from './error.js';
|
|
4
4
|
export { expectDefined } from './expect-defined.js';
|
|
5
|
-
import { y as CustomModelDefinition, c as ModelsDevPayload, a3 as ToolDescriptionMode, a4 as ToolDescriptionModeConfig, T as ToolResultRenderMode, a5 as ToolResultRenderModeConfig } from '../config-
|
|
5
|
+
import { y as CustomModelDefinition, c as ModelsDevPayload, a3 as ToolDescriptionMode, a4 as ToolDescriptionModeConfig, T as ToolResultRenderMode, a5 as ToolResultRenderModeConfig } from '../config-BCAEJicb.js';
|
|
6
6
|
export { T as TaskItem, c as computeTaskItemProgress, f as formatTaskList, a as formatTaskProgress } from '../task-format-vGOIftmK.js';
|
|
7
7
|
export { a as WstackPathOptions, W as WstackPaths, p as projectHash, b as projectSlug, r as resolveWstackPaths, w as wstackGlobalRoot } from '../wstack-paths-C3K40Qst.js';
|
|
8
8
|
export { a as TaskPriority, b as TaskStatus, T as TaskType } from '../task-graph-u1q9Jkyk.js';
|
|
9
9
|
import 'node:https';
|
|
10
10
|
import 'undici';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Estimate tokens for a tool_use block input.
|
|
14
|
+
* Caches the stringified result keyed by the stable string representation
|
|
15
|
+
* to avoid repeated JSON.stringify calls during context window checks.
|
|
16
|
+
*/
|
|
17
|
+
declare function estimateToolInputTokens(input: unknown): number;
|
|
18
|
+
/**
|
|
19
|
+
* Estimate tokens for a tool_result content.
|
|
20
|
+
*/
|
|
21
|
+
declare function estimateToolResultTokens(content: string | unknown): number;
|
|
22
|
+
/**
|
|
23
|
+
* Estimate tokens for a text block.
|
|
24
|
+
*/
|
|
25
|
+
declare function estimateTextTokens(text: string): number;
|
|
26
|
+
/**
|
|
27
|
+
* Compute and cache the token estimate for a single message. This is the
|
|
28
|
+
* canonical per-message estimator — called once by ConversationState on
|
|
29
|
+
* append/replace so the O(n·m) content-block walk happens at mutation time,
|
|
30
|
+
* not on every context-pressure check.
|
|
31
|
+
*/
|
|
32
|
+
declare function computeMessageTokens(msg: Message): number;
|
|
33
|
+
/**
|
|
34
|
+
* Estimate tokens for an array of messages (text + tool I/O), using the shared
|
|
35
|
+
* 3.5 chars/token basis. This is the single canonical message-array estimator —
|
|
36
|
+
* compactors, the context_manager tool, and the `/context` display all route
|
|
37
|
+
* through it so the number a user sees matches the number compaction decides on.
|
|
38
|
+
*
|
|
39
|
+
* When a message carries a pre-computed `_estTokens` field (set by
|
|
40
|
+
* ConversationState on append/replace), it is used directly instead of
|
|
41
|
+
* re-walking the content blocks — turning the O(n·m) scan into an O(n)
|
|
42
|
+
* sum for fully-cached arrays.
|
|
43
|
+
*/
|
|
44
|
+
declare function estimateMessageTokens(messages: readonly Message[]): number;
|
|
45
|
+
/**
|
|
46
|
+
* Rough estimate of tokens in a tool definition (name + description + schema).
|
|
47
|
+
* Accounts for the JSON-serialized inputSchema which is sent to the API
|
|
48
|
+
* but NOT included in roughEstimate(content).
|
|
49
|
+
*/
|
|
50
|
+
declare function estimateToolDefTokens(tool: {
|
|
51
|
+
name: string;
|
|
52
|
+
description?: string | undefined;
|
|
53
|
+
inputSchema: unknown;
|
|
54
|
+
}): number;
|
|
55
|
+
/**
|
|
56
|
+
* Estimate the total API request token count: system prompt + tool definitions
|
|
57
|
+
* + conversation messages. Use this for context-window bar calculations
|
|
58
|
+
* instead of roughEstimate (which only counts messages).
|
|
59
|
+
*
|
|
60
|
+
* The overhead ratio (overhead / messages) varies by conversation length:
|
|
61
|
+
* - Short conversations (< 10 messages): ~30-50% overhead (large system+tools)
|
|
62
|
+
* - Medium (10-50 messages): ~15-30%
|
|
63
|
+
* - Long (> 50 messages): ~5-15%
|
|
64
|
+
*
|
|
65
|
+
* Returns { messages, systemPrompt, tools, total } for debugging display.
|
|
66
|
+
*/
|
|
67
|
+
interface RequestTokenBreakdown {
|
|
68
|
+
messages: number;
|
|
69
|
+
systemPrompt: number;
|
|
70
|
+
tools: number;
|
|
71
|
+
total: number;
|
|
72
|
+
}
|
|
73
|
+
declare function estimateRequestTokens(messages: unknown, systemPrompt: unknown, tools: {
|
|
74
|
+
name: string;
|
|
75
|
+
description?: string | undefined;
|
|
76
|
+
inputSchema: unknown;
|
|
77
|
+
}[], calibrationKey?: string): RequestTokenBreakdown;
|
|
78
|
+
/**
|
|
79
|
+
* Record the actual API input token count after a provider call so
|
|
80
|
+
* `estimateRequestTokensCalibrated` can self-correct on subsequent calls.
|
|
81
|
+
*
|
|
82
|
+
* Prefer passing `estimatedInputTokens` explicitly (the calibrated pre-flight
|
|
83
|
+
* estimate from the middleware) — this avoids race conditions when other code
|
|
84
|
+
* also calls `estimateRequestTokens` between the pre-flight and this call
|
|
85
|
+
* (e.g. audit logging in agent.ts).
|
|
86
|
+
*
|
|
87
|
+
* When `estimatedInputTokens` is omitted, falls back to the keyed bucket's
|
|
88
|
+
* `prevEst` for backward compatibility with callers that don't have the
|
|
89
|
+
* pre-flight value. `calibrationKey` selects the per-(provider,model) bucket
|
|
90
|
+
* (defaults to the shared global bucket).
|
|
91
|
+
*/
|
|
92
|
+
declare function recordActualUsage(actualInputTokens: number, estimatedInputTokens?: number, calibrationKey?: string): void;
|
|
93
|
+
/**
|
|
94
|
+
* Returns the current calibration state for a bucket. Exposed for debugging
|
|
95
|
+
* and tests — not needed by normal callers.
|
|
96
|
+
*/
|
|
97
|
+
declare function getCalibrationState(calibrationKey?: string): {
|
|
98
|
+
ratio: number;
|
|
99
|
+
count: number;
|
|
100
|
+
calibrated: boolean;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Like `estimateRequestTokens` but applies the rolling calibration factor
|
|
104
|
+
* so context pressure readings converge on reality within a few iterations.
|
|
105
|
+
*
|
|
106
|
+
* Before any `recordActualUsage` samples are collected, returns the same
|
|
107
|
+
* result as `estimateRequestTokens` (ratio = 1.0, no distortion).
|
|
108
|
+
* After `MIN_SAMPLES_FOR_CALIBRATION` samples, applies the calibrated
|
|
109
|
+
* multiplier capped to the range [0.5, 1.5] as a sanity bound.
|
|
110
|
+
*/
|
|
111
|
+
declare function estimateRequestTokensCalibrated(messages: unknown, systemPrompt: unknown, tools: {
|
|
112
|
+
name: string;
|
|
113
|
+
description?: string | undefined;
|
|
114
|
+
inputSchema: unknown;
|
|
115
|
+
}[], calibrationKey?: string): RequestTokenBreakdown;
|
|
116
|
+
/**
|
|
117
|
+
* Resets calibration state. Primarily for tests that run in the same
|
|
118
|
+
* process and need a clean slate between suites. With no argument it clears
|
|
119
|
+
* every bucket (including the global one); pass a key to reset just that bucket.
|
|
120
|
+
*/
|
|
121
|
+
declare function resetCalibration(calibrationKey?: string): void;
|
|
122
|
+
|
|
12
123
|
/**
|
|
13
124
|
* Exhaustiveness check for discriminated union switches.
|
|
14
125
|
* Place in the `default` branch of a switch over a union type
|
|
@@ -638,117 +749,6 @@ declare function normalizePathSubject(value: string): string;
|
|
|
638
749
|
declare function isPathSubjectKey(subjectKey: string): boolean;
|
|
639
750
|
declare function subjectForToolInput(toolName: string, input: unknown, subjectKey?: string): string | undefined;
|
|
640
751
|
|
|
641
|
-
/**
|
|
642
|
-
* Estimate tokens for a tool_use block input.
|
|
643
|
-
* Caches the stringified result keyed by the stable string representation
|
|
644
|
-
* to avoid repeated JSON.stringify calls during context window checks.
|
|
645
|
-
*/
|
|
646
|
-
declare function estimateToolInputTokens(input: unknown): number;
|
|
647
|
-
/**
|
|
648
|
-
* Estimate tokens for a tool_result content.
|
|
649
|
-
*/
|
|
650
|
-
declare function estimateToolResultTokens(content: string | unknown): number;
|
|
651
|
-
/**
|
|
652
|
-
* Estimate tokens for a text block.
|
|
653
|
-
*/
|
|
654
|
-
declare function estimateTextTokens(text: string): number;
|
|
655
|
-
/**
|
|
656
|
-
* Compute and cache the token estimate for a single message. This is the
|
|
657
|
-
* canonical per-message estimator — called once by ConversationState on
|
|
658
|
-
* append/replace so the O(n·m) content-block walk happens at mutation time,
|
|
659
|
-
* not on every context-pressure check.
|
|
660
|
-
*/
|
|
661
|
-
declare function computeMessageTokens(msg: Message): number;
|
|
662
|
-
/**
|
|
663
|
-
* Estimate tokens for an array of messages (text + tool I/O), using the shared
|
|
664
|
-
* 3.5 chars/token basis. This is the single canonical message-array estimator —
|
|
665
|
-
* compactors, the context_manager tool, and the `/context` display all route
|
|
666
|
-
* through it so the number a user sees matches the number compaction decides on.
|
|
667
|
-
*
|
|
668
|
-
* When a message carries a pre-computed `_estTokens` field (set by
|
|
669
|
-
* ConversationState on append/replace), it is used directly instead of
|
|
670
|
-
* re-walking the content blocks — turning the O(n·m) scan into an O(n)
|
|
671
|
-
* sum for fully-cached arrays.
|
|
672
|
-
*/
|
|
673
|
-
declare function estimateMessageTokens(messages: readonly Message[]): number;
|
|
674
|
-
/**
|
|
675
|
-
* Rough estimate of tokens in a tool definition (name + description + schema).
|
|
676
|
-
* Accounts for the JSON-serialized inputSchema which is sent to the API
|
|
677
|
-
* but NOT included in roughEstimate(content).
|
|
678
|
-
*/
|
|
679
|
-
declare function estimateToolDefTokens(tool: {
|
|
680
|
-
name: string;
|
|
681
|
-
description?: string | undefined;
|
|
682
|
-
inputSchema: unknown;
|
|
683
|
-
}): number;
|
|
684
|
-
/**
|
|
685
|
-
* Estimate the total API request token count: system prompt + tool definitions
|
|
686
|
-
* + conversation messages. Use this for context-window bar calculations
|
|
687
|
-
* instead of roughEstimate (which only counts messages).
|
|
688
|
-
*
|
|
689
|
-
* The overhead ratio (overhead / messages) varies by conversation length:
|
|
690
|
-
* - Short conversations (< 10 messages): ~30-50% overhead (large system+tools)
|
|
691
|
-
* - Medium (10-50 messages): ~15-30%
|
|
692
|
-
* - Long (> 50 messages): ~5-15%
|
|
693
|
-
*
|
|
694
|
-
* Returns { messages, systemPrompt, tools, total } for debugging display.
|
|
695
|
-
*/
|
|
696
|
-
interface RequestTokenBreakdown {
|
|
697
|
-
messages: number;
|
|
698
|
-
systemPrompt: number;
|
|
699
|
-
tools: number;
|
|
700
|
-
total: number;
|
|
701
|
-
}
|
|
702
|
-
declare function estimateRequestTokens(messages: unknown, systemPrompt: unknown, tools: {
|
|
703
|
-
name: string;
|
|
704
|
-
description?: string | undefined;
|
|
705
|
-
inputSchema: unknown;
|
|
706
|
-
}[], calibrationKey?: string): RequestTokenBreakdown;
|
|
707
|
-
/**
|
|
708
|
-
* Record the actual API input token count after a provider call so
|
|
709
|
-
* `estimateRequestTokensCalibrated` can self-correct on subsequent calls.
|
|
710
|
-
*
|
|
711
|
-
* Prefer passing `estimatedInputTokens` explicitly (the calibrated pre-flight
|
|
712
|
-
* estimate from the middleware) — this avoids race conditions when other code
|
|
713
|
-
* also calls `estimateRequestTokens` between the pre-flight and this call
|
|
714
|
-
* (e.g. audit logging in agent.ts).
|
|
715
|
-
*
|
|
716
|
-
* When `estimatedInputTokens` is omitted, falls back to the keyed bucket's
|
|
717
|
-
* `prevEst` for backward compatibility with callers that don't have the
|
|
718
|
-
* pre-flight value. `calibrationKey` selects the per-(provider,model) bucket
|
|
719
|
-
* (defaults to the shared global bucket).
|
|
720
|
-
*/
|
|
721
|
-
declare function recordActualUsage(actualInputTokens: number, estimatedInputTokens?: number, calibrationKey?: string): void;
|
|
722
|
-
/**
|
|
723
|
-
* Returns the current calibration state for a bucket. Exposed for debugging
|
|
724
|
-
* and tests — not needed by normal callers.
|
|
725
|
-
*/
|
|
726
|
-
declare function getCalibrationState(calibrationKey?: string): {
|
|
727
|
-
ratio: number;
|
|
728
|
-
count: number;
|
|
729
|
-
calibrated: boolean;
|
|
730
|
-
};
|
|
731
|
-
/**
|
|
732
|
-
* Like `estimateRequestTokens` but applies the rolling calibration factor
|
|
733
|
-
* so context pressure readings converge on reality within a few iterations.
|
|
734
|
-
*
|
|
735
|
-
* Before any `recordActualUsage` samples are collected, returns the same
|
|
736
|
-
* result as `estimateRequestTokens` (ratio = 1.0, no distortion).
|
|
737
|
-
* After `MIN_SAMPLES_FOR_CALIBRATION` samples, applies the calibrated
|
|
738
|
-
* multiplier capped to the range [0.5, 1.5] as a sanity bound.
|
|
739
|
-
*/
|
|
740
|
-
declare function estimateRequestTokensCalibrated(messages: unknown, systemPrompt: unknown, tools: {
|
|
741
|
-
name: string;
|
|
742
|
-
description?: string | undefined;
|
|
743
|
-
inputSchema: unknown;
|
|
744
|
-
}[], calibrationKey?: string): RequestTokenBreakdown;
|
|
745
|
-
/**
|
|
746
|
-
* Resets calibration state. Primarily for tests that run in the same
|
|
747
|
-
* process and need a clean slate between suites. With no argument it clears
|
|
748
|
-
* every bucket (including the global one); pass a key to reset just that bucket.
|
|
749
|
-
*/
|
|
750
|
-
declare function resetCalibration(calibrationKey?: string): void;
|
|
751
|
-
|
|
752
752
|
/**
|
|
753
753
|
* Tool output serialization utilities.
|
|
754
754
|
* Extracted from Agent.executeTools to allow reuse and consistent output handling.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
You are the Reviewer agent. Your job is independent quality control over
|
|
2
|
+
another agent's work. You do not implement; you inspect the output, evidence,
|
|
3
|
+
and changed files, then decide whether the work is safe to accept.
|
|
4
|
+
|
|
5
|
+
Scope:
|
|
6
|
+
- Review changed code, tests, commands run, and the implementer's final report
|
|
7
|
+
- Look for correctness bugs, missing edge cases, weak verification, and scope creep
|
|
8
|
+
- Identify uncertainty explicitly instead of smoothing it over
|
|
9
|
+
- Reduce correlated error risk by challenging assumptions the implementer likely made
|
|
10
|
+
|
|
11
|
+
Input format you accept:
|
|
12
|
+
{ "task": "review", "implementation": "<summary or task id>", "targets": ["src/x.ts"], "evidence": "<tests/logs/diff>" }
|
|
13
|
+
|
|
14
|
+
Output: Markdown review:
|
|
15
|
+
- ## Verdict (approve / request changes / needs verification)
|
|
16
|
+
- ## Must Fix (file:line, bug, concrete fix)
|
|
17
|
+
- ## Verification Gaps (checks that must run before acceptance)
|
|
18
|
+
- ## Uncertainty Flags (assumptions, missing context, confidence)
|
|
19
|
+
- ## Notes (non-blocking observations)
|
|
20
|
+
|
|
21
|
+
Working rules:
|
|
22
|
+
- Read-only: never edit files or run mutating commands
|
|
23
|
+
- Treat "tests not run" or vague verification as a finding
|
|
24
|
+
- Every blocking finding needs a file:line or a reproducible missing check
|
|
25
|
+
- If you cannot prove a claim, mark it as uncertain and say what would prove it
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
You are the Verifier agent. Your job is to prove whether a change works by
|
|
2
|
+
running the right checks and turning failures into actionable feedback.
|
|
3
|
+
|
|
4
|
+
Scope:
|
|
5
|
+
- Identify the smallest meaningful verification set for the task
|
|
6
|
+
- Run lint, typecheck, unit, integration, or smoke checks as appropriate
|
|
7
|
+
- Re-run checks after an implementer fixes failures until the gate is green
|
|
8
|
+
- Report exact failures when the gate is not green
|
|
9
|
+
|
|
10
|
+
Input format you accept:
|
|
11
|
+
{ "task": "verify", "targets": ["src/x.ts"], "commands": ["pnpm test"], "expected": "<behavior>" }
|
|
12
|
+
|
|
13
|
+
Output: Markdown verification report:
|
|
14
|
+
- ## Verdict (pass / fail / blocked)
|
|
15
|
+
- ## Commands Run (command, cwd, result)
|
|
16
|
+
- ## Failures (exact failing test/error and likely owner)
|
|
17
|
+
- ## Evidence (relevant output excerpts, durations)
|
|
18
|
+
- ## Uncertainty Flags (missing env, skipped checks, flaky behavior)
|
|
19
|
+
|
|
20
|
+
Working rules:
|
|
21
|
+
- Do not edit code. Verification is independent of implementation.
|
|
22
|
+
- Prefer project-native commands over invented ones.
|
|
23
|
+
- If a check fails, stop claiming completion and return the precise failure.
|
|
24
|
+
- If no reliable command exists, describe the manual or missing verification gate.
|
|
@@ -36,12 +36,34 @@ Working rules:
|
|
|
36
36
|
6. Never claim a subagent's work as your own without verifying it. If a
|
|
37
37
|
result looks wrong, ask_subagent for clarification before passing it
|
|
38
38
|
to the user.
|
|
39
|
-
7.
|
|
39
|
+
7. Treat implementation as a quality-gated loop, not a one-shot. For
|
|
40
|
+
code-changing work, "done" means: implementer report received,
|
|
41
|
+
verifier evidence is green (tests/typecheck/lint/smoke as relevant),
|
|
42
|
+
and reviewer has no must-fix findings. If verification or review fails,
|
|
43
|
+
feed the concrete failures back to the implementer and repeat until the
|
|
44
|
+
gate passes or a real blocker is identified. Prefer `quality_gate` for
|
|
45
|
+
this standard reviewer+verifier loop; use low-level spawn/assign/await
|
|
46
|
+
only when you need custom choreography.
|
|
47
|
+
8. Prefer isolated git worktrees for side-effectful parallel subagents so
|
|
48
|
+
two agents do not write the same checkout at the same time. This is a
|
|
49
|
+
preference, not a law: read-only review/research agents can stay on the
|
|
50
|
+
shared cwd, and the host may disable worktrees for workflows that cannot
|
|
51
|
+
use them. Use the `worktree` spawn override only when there is a reason
|
|
52
|
+
(`required` for risky parallel editing, `off` for truly read-only work).
|
|
53
|
+
9. Use the dedicated `verifier` role for independent proof and the
|
|
54
|
+
dedicated `reviewer` role for independent AI review. Prefer pinning
|
|
55
|
+
reviewer with `/setmodel set reviewer <provider>/<model>` or a review
|
|
56
|
+
phase route; otherwise WrongStack will try to avoid using the same
|
|
57
|
+
provider/model as the implementation lane.
|
|
58
|
+
10. Self-flag uncertainty. When you or a subagent are guessing, missing
|
|
59
|
+
evidence, or relying on an assumption, surface that as an uncertainty
|
|
60
|
+
flag and route it to reviewer/verifier instead of presenting it as fact.
|
|
61
|
+
11. **Act on subagent mail immediately**. Subagent messages (result, ask,
|
|
40
62
|
assign, note) are injected inline before every step — even mid-task.
|
|
41
63
|
When you see one, address it before continuing: reply to asks, factor
|
|
42
64
|
in results, act on assignments. Use `mailbox action=ack` to mark
|
|
43
65
|
completed messages.
|
|
44
|
-
|
|
66
|
+
12. Wind down when satisfied. When the results are good enough, call
|
|
45
67
|
work_complete — no new subagents will spawn and queued tasks complete
|
|
46
68
|
as aborted. Running subagents finish naturally. Call terminate_subagent
|
|
47
69
|
only for ones you need to stop immediately.
|
|
@@ -8,6 +8,9 @@ Capabilities & operating rules:
|
|
|
8
8
|
permission to read, edit, or build.
|
|
9
9
|
- Stay inside the project root. Do not touch machine config, credentials,
|
|
10
10
|
or global state — those require an explicit grant you do not have.
|
|
11
|
+
- Respect your current working directory. When the Director gives you an
|
|
12
|
+
isolated git worktree, all reads/writes/build commands for this task belong
|
|
13
|
+
in that checkout; do not switch back to the parent checkout to edit files.
|
|
11
14
|
- Prefer the least-destructive path. No irreversible commands (`rm -rf`,
|
|
12
15
|
`git push --force`, history rewrites, dropping databases, mass deletes)
|
|
13
16
|
unless the task explicitly requires it and names the target.
|
|
@@ -15,6 +18,10 @@ Capabilities & operating rules:
|
|
|
15
18
|
tests and fix what you broke before reporting done.
|
|
16
19
|
- Make only the changes the task calls for — no unrelated refactors or
|
|
17
20
|
reformatting.
|
|
21
|
+
- Self-flag uncertainty. If your conclusion depends on an assumption,
|
|
22
|
+
skipped check, flaky result, missing file, or incomplete evidence, include
|
|
23
|
+
an "Uncertainty Flags" section in your final output instead of smoothing
|
|
24
|
+
it over.
|
|
18
25
|
|
|
19
26
|
Bridge contract:
|
|
20
27
|
- You may call `request` on the parent bridge to ask the Director a
|
|
@@ -24,7 +31,7 @@ Bridge contract:
|
|
|
24
31
|
- Your final task output is all the Director sees. Be concise, structured,
|
|
25
32
|
and self-contained — assume it is pasted into the Director's context.
|
|
26
33
|
Cover: what you accomplished, what you changed (files/commands), how it
|
|
27
|
-
was verified, and any blockers or leftovers. Never end with a bare
|
|
34
|
+
was verified, uncertainty flags, and any blockers or leftovers. Never end with a bare
|
|
28
35
|
"done" — an unverifiable report forces the Director to redo your work.
|
|
29
36
|
|
|
30
37
|
CRITICAL CONSTRAINT — NO FURTHER DELEGATION:
|