@wrongstack/core 0.308.7 → 0.309.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.
@@ -1,7 +1,7 @@
1
1
  import type { SubagentConfig } from '../../types/multi-agent.js';
2
2
  import type { Tool } from '../../types/tool.js';
3
- import { makeAskResultTool, makeAskTool, makeAssignTool, makeAwaitTasksTool, makeCollabDebugTool, makeFleetEmitTool, makeFleetTool, makeKanbanQueueTool, makeQualityGateTool, makeRollUpTool, makeSpawnTool, makeTerminateAllTool, makeTerminateTool, makeWorkCompleteTool } from '../director-tools.js';
4
- type DirectorToolsetHost = Parameters<typeof makeSpawnTool>[0] & Parameters<typeof makeAssignTool>[0] & Parameters<typeof makeKanbanQueueTool>[0] & Parameters<typeof makeAwaitTasksTool>[0] & Parameters<typeof makeAskTool>[0] & Parameters<typeof makeAskResultTool>[0] & Parameters<typeof makeRollUpTool>[0] & Parameters<typeof makeQualityGateTool>[0] & Parameters<typeof makeTerminateTool>[0] & Parameters<typeof makeTerminateAllTool>[0] & Parameters<typeof makeFleetTool>[0] & Parameters<typeof makeCollabDebugTool>[0] & Parameters<typeof makeFleetEmitTool>[0] & Parameters<typeof makeWorkCompleteTool>[0];
3
+ import { makeAskResultTool, makeAskTool, makeAssignTool, makeAwaitTasksTool, makeCollabDebugTool, makeFleetEmitTool, makeFleetTool, makeKanbanQueueTool, makeMutationTestTool, makeQualityGateTool, makeRollUpTool, makeSpawnTool, makeTerminateAllTool, makeTerminateTool, makeWorkCompleteTool } from '../director-tools.js';
4
+ type DirectorToolsetHost = Parameters<typeof makeSpawnTool>[0] & Parameters<typeof makeAssignTool>[0] & Parameters<typeof makeKanbanQueueTool>[0] & Parameters<typeof makeAwaitTasksTool>[0] & Parameters<typeof makeAskTool>[0] & Parameters<typeof makeAskResultTool>[0] & Parameters<typeof makeRollUpTool>[0] & Parameters<typeof makeQualityGateTool>[0] & Parameters<typeof makeMutationTestTool>[0] & Parameters<typeof makeTerminateTool>[0] & Parameters<typeof makeTerminateAllTool>[0] & Parameters<typeof makeFleetTool>[0] & Parameters<typeof makeCollabDebugTool>[0] & Parameters<typeof makeFleetEmitTool>[0] & Parameters<typeof makeWorkCompleteTool>[0];
5
5
  export declare function buildDirectorToolset(director: DirectorToolsetHost, roster?: Record<string, SubagentConfig>): Tool[];
6
6
  export {};
7
7
  //# sourceMappingURL=director-toolset.d.ts.map
@@ -0,0 +1,29 @@
1
+ /**
2
+ * `mutation_test` — director-facing tool behind the Chaos Monkey
3
+ * ("Kaos Maymunu") mutation-testing flow.
4
+ *
5
+ * Green tests prove nothing if they cannot detect sabotage. This tool:
6
+ * 1. Reads each target file in-process and computes a DETERMINISTIC
7
+ * mutation plan (`mutation-engine.ts`) — boundary relax/tighten,
8
+ * `+`↔`-`, boolean flips, `return null`.
9
+ * 2. Spawns ONE chaos-monkey subagent with the exact plan. The subagent
10
+ * applies each mutant one at a time in its checkout, runs the test
11
+ * command, records killed/survived, and restores byte-for-byte.
12
+ * 3. Parses the structured report and, when survivors exist and a
13
+ * `repairSubagentId` was supplied, loops: strengthen-tests task →
14
+ * re-run the surviving mutants only. A mutant that survives twice
15
+ * is reported as `suspected-equivalent` — a code smell, not a test
16
+ * bug — so the loop always terminates without ping-ponging.
17
+ *
18
+ * The LLM never invents mutants: the plan is mechanical, so two runs over
19
+ * the same source produce the same ids and the comparison is honest.
20
+ *
21
+ * @module coordination/director-mutation-test-tool
22
+ */
23
+ import type { SubagentConfig } from '../types/multi-agent.js';
24
+ import type { Tool } from '../types/tool.js';
25
+ import type * as Host from './director-host-contracts.js';
26
+ export declare function makeMutationTestTool(director: Host.DirectorRepairPort, roster?: Record<string, SubagentConfig>, opts?: {
27
+ projectRoot?: string | undefined;
28
+ }): Tool;
29
+ //# sourceMappingURL=director-mutation-test-tool.d.ts.map
@@ -4,6 +4,8 @@ import type * as Host from './director-host-contracts.js';
4
4
  export { makeAskResultTool, makeAskTool, makeAssignTool, makeAwaitTasksTool, makeFleetTool, makeRollUpTool, makeTerminateAllTool, makeTerminateTool, } from './director-basic-tools.js';
5
5
  export { makeCollabDebugTool, makeFleetEmitTool, makeWorkCompleteTool, } from './director-collab-tools.js';
6
6
  export { makeQualityGateTool } from './director-quality-gate-tool.js';
7
+ export { makeMutationTestTool } from './director-mutation-test-tool.js';
8
+ export { applyMutation, type MutationKind, type MutationPlanItem, parseMutationReport, planMutations, } from './mutation-engine.js';
7
9
  export declare function makeSpawnTool(director: Host.DirectorAdmissionPort, roster?: Record<string, SubagentConfig>): Tool;
8
10
  export declare function makeKanbanQueueTool(director: Host.DirectorLeaseRecoveryPort, roster?: Record<string, SubagentConfig>): Tool;
9
11
  //# sourceMappingURL=director-tools.d.ts.map
@@ -92,6 +92,15 @@ export declare class Director implements DirectorFleetHost, ICoordinator {
92
92
  extensionsFor(subagentId: string): number;
93
93
  workComplete(): void;
94
94
  isWorkComplete(): boolean;
95
+ /**
96
+ * Ask every running background subagent that opted into `gracefulFinish`
97
+ * to finish its task in its own turn. In-band notification between tool
98
+ * batches — no interrupt, no abort; each subagent keeps its time budget and
99
+ * accelerates. Session shutdown calls this before draining Chimera work so
100
+ * the post-session reviewer is nudged to complete rather than killed.
101
+ * Returns the number of subagents notified.
102
+ */
103
+ requestFinish(reason: string): number;
95
104
  setLeaderBtwNote(note: string): number;
96
105
  getLeaderBtwNotes(): string[];
97
106
  peekLeaderBtwNotes(): string[];
@@ -38,6 +38,18 @@ export declare const SECURITY_SCANNER_AGENT: SubagentConfig;
38
38
  * awaited; idle reaping comes from the FLEET_ROSTER_BUDGETS entry.
39
39
  */
40
40
  export declare const EXPLORE_COMPANION_AGENT: SubagentConfig;
41
+ /**
42
+ * Chaos Monkey ("Kaos Maymunu") — one-shot mutation-testing saboteur.
43
+ * Use for: proving whether tests actually pin down the code they cover.
44
+ *
45
+ * Operational role — deliberately NOT in ALL_AGENT_DEFINITIONS (like
46
+ * `shadow-agent` and `explore-companion`), so the free-form dispatcher
47
+ * never routes to it and the phase-catalog count stays intact. The
48
+ * `mutation_test` director tool computes the deterministic mutation plan
49
+ * and hands this agent an exact apply/run/restore checklist; the agent
50
+ * never invents mutants.
51
+ */
52
+ export declare const CHAOS_MONKEY_AGENT: SubagentConfig;
41
53
  /** Generic template used directly or cloned into project-specific roles. */
42
54
  export declare const GENERIC_AGENT: SubagentConfig;
43
55
  export declare const FLEET_ROSTER: Record<string, SubagentConfig>;
@@ -15,7 +15,7 @@ export { attachDepWatcherBridge, type DepWatcherBridgeOptions, } from './dep-wat
15
15
  export { Director, FleetCostCapError, FleetSpawnBudgetError, FleetTokenCapError, type TaskResultNotification, } from './director.js';
16
16
  export { composeDirectorPrompt, composeSubagentPrompt, DEFAULT_DIRECTOR_PREAMBLE, DEFAULT_SUBAGENT_BASELINE, type DirectorPromptParts, rosterSummaryFromConfigs, type SubagentPromptParts, } from './director-prompts.js';
17
17
  export { type DirectorSessionFactory, type DirectorSessionFactoryOptions, makeDirectorSessionFactory, } from './director-session.js';
18
- export { makeAskResultTool, makeAskTool, makeAssignTool, makeAwaitTasksTool, makeCollabDebugTool, makeFleetEmitTool, makeFleetTool, makeKanbanQueueTool, makeQualityGateTool, makeRollUpTool, makeSpawnTool, makeTerminateAllTool, makeTerminateTool, makeWorkCompleteTool, } from './director-tools.js';
18
+ export { makeAskResultTool, makeAskTool, makeAssignTool, makeAwaitTasksTool, makeCollabDebugTool, makeFleetEmitTool, makeFleetTool, makeKanbanQueueTool, makeMutationTestTool, makeQualityGateTool, makeRollUpTool, makeSpawnTool, makeTerminateAllTool, makeTerminateTool, makeWorkCompleteTool, } from './director-tools.js';
19
19
  export { DEFAULT_DISPATCH_ROLE, type DispatchCandidate, type DispatchClassifier, type DispatchMethod, type DispatchOptions, type DispatchResult, dispatchAgent, makeLLMClassifier, scoreAgents, } from './dispatcher.js';
20
20
  export { type FileAuthorTrackerOptions, recordFileAction } from './file-author-tracker.js';
21
21
  export { ACP_AGENTS, ALL_FLEET_AGENTS, AUDIT_LOG_AGENT, applyRosterBudget, BUG_HUNTER_AGENT, FLEET_ROSTER, FLEET_ROSTER_BUDGETS, FLEET_ROSTER_WITHACP, type FleetRosterBudget, GENERIC_AGENT, REFACTOR_PLANNER_AGENT, SECURITY_SCANNER_AGENT, } from './fleet.js';