claude-flow-novice 1.6.1 ā 1.6.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/.claude/agents/cfn-loop/product-owner.md +54 -4
- package/.claude/commands/cfn-claude-sync.md +303 -0
- package/.claude/commands/cfn-loop-epic.md +290 -0
- package/.claude/commands/cfn-loop-single.md +168 -0
- package/.claude/commands/cfn-loop-sprints.md +384 -0
- package/.claude/commands/cfn-loop.md +180 -0
- package/.claude/commands/metrics-summary.md +58 -0
- package/.claude/commands/parse-epic.md +357 -0
- package/.claude/settings.json +4 -4
- package/.claude/settings.local.json +9 -2
- package/.claude-flow-novice/.claude/agents/cfn-loop/product-owner.md +792 -0
- package/.claude-flow-novice/dist/mcp/server.js +21 -2
- package/.claude-flow-novice/dist/src/api/claude-client.js +138 -3
- package/.claude-flow-novice/dist/src/api/claude-client.js.map +1 -1
- package/.claude-flow-novice/dist/src/cfn-loop/phase-orchestrator-example.js +1 -1
- package/.claude-flow-novice/dist/src/cfn-loop/scope-control.js +247 -0
- package/.claude-flow-novice/dist/src/cfn-loop/scope-control.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/swarm.js +32 -15
- package/.claude-flow-novice/dist/src/cli/commands/swarm.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/commands/transparency.js +455 -0
- package/.claude-flow-novice/dist/src/cli/commands/transparency.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/simple-commands/init/templates/CLAUDE.md +129 -13
- package/.claude-flow-novice/dist/src/components/visualizations/index.js +9 -0
- package/.claude-flow-novice/dist/src/components/visualizations/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js +462 -0
- package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/config-translator.js +248 -0
- package/.claude-flow-novice/dist/src/coordination/config-translator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js +287 -0
- package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/distributed-consensus.js +68 -9
- package/.claude-flow-novice/dist/src/coordination/distributed-consensus.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/feature-flags.js +166 -0
- package/.claude-flow-novice/dist/src/coordination/feature-flags.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/queen-agent.js +18 -4
- package/.claude-flow-novice/dist/src/coordination/queen-agent.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/role-assignment.js +6 -110
- package/.claude-flow-novice/dist/src/coordination/role-assignment.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/cache/artifact-cache-optimizer.js +632 -0
- package/.claude-flow-novice/dist/src/coordination/v2/cache/artifact-cache-optimizer.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/cache/index.js +11 -0
- package/.claude-flow-novice/dist/src/coordination/v2/cache/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/checkpoints/checkpoint-compressor.js +318 -0
- package/.claude-flow-novice/dist/src/coordination/v2/checkpoints/checkpoint-compressor.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.example.js +364 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.example.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.js +492 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/cascading-shutdown.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/hierarchical-coordinator.js +786 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/hierarchical-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/index.js +16 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/parent-child-manager.js +342 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/parent-child-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/swarm-coordinator-v2.js +601 -0
- package/.claude-flow-novice/dist/src/coordination/v2/coordinators/swarm-coordinator-v2.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/help-request-metrics.js +211 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/help-request-metrics.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/index.js +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/core/message-broker.js +365 -6
- package/.claude-flow-novice/dist/src/coordination/v2/core/message-broker.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/core/resource-manager-safe.js +478 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/resource-manager-safe.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine-config.js +5 -2
- package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine-config.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine.js +189 -0
- package/.claude-flow-novice/dist/src/coordination/v2/core/state-machine.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/deadlock/deadlock-detector.js +424 -0
- package/.claude-flow-novice/dist/src/coordination/v2/deadlock/deadlock-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/deadlock/index.js +9 -0
- package/.claude-flow-novice/dist/src/coordination/v2/deadlock/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/deadlock/resource-manager.js +669 -0
- package/.claude-flow-novice/dist/src/coordination/v2/deadlock/resource-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/artifact-storage.js +451 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/artifact-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/cycle-detector.js +271 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/cycle-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-graph.js +335 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-graph.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-manager.js +439 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-request.js +92 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/dependency-request.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/index.js +21 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/topological-sort.js +223 -0
- package/.claude-flow-novice/dist/src/coordination/v2/dependency/topological-sort.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-coordinator.js +436 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-matcher.js +278 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-matcher.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request-handler.js +317 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request-handler.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request.js +273 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/help-request.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/index.js +15 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/waiting-agent-pool.js +512 -0
- package/.claude-flow-novice/dist/src/coordination/v2/help-system/waiting-agent-pool.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/index.js +6 -0
- package/.claude-flow-novice/dist/src/coordination/v2/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/integration/help-deadlock-integration.js +557 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/help-deadlock-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/index.js +14 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.example.js +212 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.example.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.js +552 -0
- package/.claude-flow-novice/dist/src/coordination/v2/integration/message-bus-completion-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/memory/dependency-storage.js +367 -0
- package/.claude-flow-novice/dist/src/coordination/v2/memory/dependency-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/memory/index.js +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/memory/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channel.js +371 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/dependency-channel.js +355 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/dependency-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/help-channel.js +424 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/help-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/index.js +16 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/state-channel.js +295 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/state-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/task-channel.js +411 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/channels/task-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/index.js +14 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-bus.js +387 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-bus.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-persistence.js +589 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-persistence.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-router.js +444 -0
- package/.claude-flow-novice/dist/src/coordination/v2/messaging/message-router.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/checkpoint-manager.js +29 -8
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/checkpoint-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/help-coordinator.js +470 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/help-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/hierarchical-background-integration.js +450 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/hierarchical-background-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/index.js +5 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/multi-level-control.js +545 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/multi-level-control.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-controller.js +44 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-controller.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-message-integration.js +415 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/query-message-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/session-pool-optimizer.js +615 -0
- package/.claude-flow-novice/dist/src/coordination/v2/sdk/session-pool-optimizer.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/security/payload-validator.js +259 -0
- package/.claude-flow-novice/dist/src/coordination/v2/security/payload-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/transparency/index.js +17 -0
- package/.claude-flow-novice/dist/src/coordination/v2/transparency/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-integration.js +357 -0
- package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-system.js +679 -0
- package/.claude-flow-novice/dist/src/coordination/v2/transparency/transparency-system.js.map +1 -0
- package/.claude-flow-novice/dist/src/core/agent-manager.js +30 -0
- package/.claude-flow-novice/dist/src/core/agent-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/mcp/server.js +21 -2
- package/.claude-flow-novice/dist/src/mcp/server.js.map +1 -1
- package/.claude-flow-novice/dist/src/observability/metrics-counter.js +268 -0
- package/.claude-flow-novice/dist/src/observability/metrics-counter.js.map +1 -0
- package/.claude-flow-novice/dist/src/observability/metrics-storage.js +265 -0
- package/.claude-flow-novice/dist/src/observability/metrics-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/observability/telemetry.js +26 -0
- package/.claude-flow-novice/dist/src/observability/telemetry.js.map +1 -1
- package/.claude-flow-novice/dist/src/providers/tiered-router.js +64 -10
- package/.claude-flow-novice/dist/src/providers/tiered-router.js.map +1 -1
- package/.claude-flow-novice/dist/src/providers/zai-provider.js +196 -97
- package/.claude-flow-novice/dist/src/providers/zai-provider.js.map +1 -1
- package/.claude-flow-novice/dist/src/slash-commands/cfn-claude-sync.js +533 -0
- package/.claude-flow-novice/dist/src/slash-commands/index.js +5 -0
- package/.claude-flow-novice/dist/src/slash-commands/metrics-summary-class.js +74 -0
- package/.claude-flow-novice/dist/src/slash-commands/metrics-summary.js +335 -0
- package/.claude-flow-novice/dist/src/slash-commands/register-all-commands.js +12 -0
- package/.claude-flow-novice/dist/src/verification/checkpoint-compression-demo.js +96 -0
- package/.claude-flow-novice/dist/src/verification/checkpoint-compression-demo.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/checkpoint-compression.js +406 -0
- package/.claude-flow-novice/dist/src/verification/checkpoint-compression.js.map +1 -0
- package/.claude-flow-novice/dist/src/verification/checkpoint-manager.js +35 -5
- package/.claude-flow-novice/dist/src/verification/checkpoint-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/web/api/config/api-config.js +186 -0
- package/.claude-flow-novice/dist/src/web/api/config/api-config.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/auth.js +205 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/auth.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/cache.js +262 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/cache.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/error-handler.js +250 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/error-handler.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/request-logger.js +217 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/request-logger.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/validation.js +325 -0
- package/.claude-flow-novice/dist/src/web/api/middleware/validation.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/routes/events.js +465 -0
- package/.claude-flow-novice/dist/src/web/api/routes/events.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/routes/hierarchy.js +302 -0
- package/.claude-flow-novice/dist/src/web/api/routes/hierarchy.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/routes/index.js +14 -0
- package/.claude-flow-novice/dist/src/web/api/routes/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/routes/metrics.js +561 -0
- package/.claude-flow-novice/dist/src/web/api/routes/metrics.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/routes/status.js +450 -0
- package/.claude-flow-novice/dist/src/web/api/routes/status.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/api/server.js +451 -0
- package/.claude-flow-novice/dist/src/web/api/server.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/dashboard/hooks/useWebSocket.js +385 -0
- package/.claude-flow-novice/dist/src/web/dashboard/hooks/useWebSocket.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/dashboard/index.js +87 -0
- package/.claude-flow-novice/dist/src/web/dashboard/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/web/dashboard/types.js +6 -0
- package/.claude-flow-novice/dist/src/web/dashboard/types.js.map +1 -0
- package/.claude-flow-novice/metrics.db +0 -0
- package/.claude-flow-novice/metrics.db-shm +0 -0
- package/.claude-flow-novice/metrics.db-wal +0 -0
- package/CLAUDE.md +29 -0
- package/README.md +27 -0
- package/config/hooks/post-edit-pipeline.js +36 -2
- package/examples/metrics-counter-demo.ts +106 -0
- package/examples/persistent-metrics-demo.ts +83 -0
- package/examples/phase-5-multi-level-control.ts +282 -0
- package/examples/session-pool-optimizer-example.ts +311 -0
- package/package.json +15 -3
- package/scripts/check-routing-stats.cjs +122 -0
- package/scripts/pre-publish-validation.cjs +212 -0
- package/scripts/test-provider-routing.cjs +228 -0
- package/scripts/test-routing-telemetry.cjs +147 -0
- package/scripts/test-zai-10k.cjs +81 -0
- package/scripts/test-zai-api.cjs +191 -0
- package/scripts/test-zai-diagnostic.cjs +151 -0
- package/scripts/test-zai-final.cjs +128 -0
- package/scripts/test-zai-with-env.cjs +85 -0
- package/scripts/validate-coordination-cli.js +69 -0
- package/scripts/validate-coordination-toggle-integration.cjs +501 -0
- package/src/cli/simple-commands/init/templates/CLAUDE.md +29 -0
- package/src/observability/metrics-counter.ts +347 -0
- package/src/observability/metrics-storage.ts +356 -0
- package/src/observability/telemetry.ts +658 -0
- package/src/slash-commands/cfn-claude-sync.js +533 -0
- package/src/slash-commands/index.js +5 -0
- package/src/slash-commands/metrics-summary-class.js +74 -0
- package/src/slash-commands/metrics-summary.js +335 -0
- package/src/slash-commands/register-all-commands.js +12 -0
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standalone validation script for Phase 11 Coordination Toggle Integration
|
|
3
|
+
*
|
|
4
|
+
* Validates:
|
|
5
|
+
* 1. CoordinationToggle version detection
|
|
6
|
+
* 2. V1CoordinatorAdapter interface compatibility
|
|
7
|
+
* 3. ConfigTranslator config mapping
|
|
8
|
+
* 4. Feature flags rollout logic
|
|
9
|
+
* 5. CLI version flag parsing
|
|
10
|
+
*
|
|
11
|
+
* Exit codes:
|
|
12
|
+
* - 0: All validations passed (ā„90% consensus)
|
|
13
|
+
* - 1: Validations failed (<90% consensus)
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const assert = require('assert');
|
|
17
|
+
|
|
18
|
+
// ===========================
|
|
19
|
+
// Test Suite
|
|
20
|
+
// ===========================
|
|
21
|
+
|
|
22
|
+
const results = {
|
|
23
|
+
totalTests: 0,
|
|
24
|
+
passingTests: 0,
|
|
25
|
+
failingTests: 0,
|
|
26
|
+
tests: []
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function test(name, fn) {
|
|
30
|
+
results.totalTests++;
|
|
31
|
+
try {
|
|
32
|
+
fn();
|
|
33
|
+
results.passingTests++;
|
|
34
|
+
results.tests.push({ name, status: 'PASS' });
|
|
35
|
+
console.log(`ā
${name}`);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
results.failingTests++;
|
|
38
|
+
results.tests.push({ name, status: 'FAIL', error: error.message });
|
|
39
|
+
console.error(`ā ${name}`);
|
|
40
|
+
console.error(` Error: ${error.message}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ===========================
|
|
45
|
+
// 1. CoordinationToggle Version Detection
|
|
46
|
+
// ===========================
|
|
47
|
+
|
|
48
|
+
console.log('\nš Testing CoordinationToggle Version Detection...\n');
|
|
49
|
+
|
|
50
|
+
test('should default to v2 when no config.version or env var is set', () => {
|
|
51
|
+
delete process.env.COORDINATION_VERSION;
|
|
52
|
+
|
|
53
|
+
// Simulate detectVersion logic
|
|
54
|
+
const detectVersion = (config) => {
|
|
55
|
+
if (config.version) return config.version;
|
|
56
|
+
const envVersion = process.env.COORDINATION_VERSION?.toLowerCase();
|
|
57
|
+
if (envVersion === 'v1' || envVersion === 'v2') return envVersion;
|
|
58
|
+
return 'v2';
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const version = detectVersion({ topology: 'mesh', maxAgents: 5 });
|
|
62
|
+
assert.strictEqual(version, 'v2');
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('should use explicit config.version when provided', () => {
|
|
66
|
+
delete process.env.COORDINATION_VERSION;
|
|
67
|
+
|
|
68
|
+
const detectVersion = (config) => {
|
|
69
|
+
if (config.version) return config.version;
|
|
70
|
+
const envVersion = process.env.COORDINATION_VERSION?.toLowerCase();
|
|
71
|
+
if (envVersion === 'v1' || envVersion === 'v2') return envVersion;
|
|
72
|
+
return 'v2';
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const version = detectVersion({ version: 'v1', topology: 'mesh' });
|
|
76
|
+
assert.strictEqual(version, 'v1');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test('should use COORDINATION_VERSION env var when config.version is omitted', () => {
|
|
80
|
+
process.env.COORDINATION_VERSION = 'v1';
|
|
81
|
+
|
|
82
|
+
const detectVersion = (config) => {
|
|
83
|
+
if (config.version) return config.version;
|
|
84
|
+
const envVersion = process.env.COORDINATION_VERSION?.toLowerCase();
|
|
85
|
+
if (envVersion === 'v1' || envVersion === 'v2') return envVersion;
|
|
86
|
+
return 'v2';
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const version = detectVersion({ topology: 'mesh' });
|
|
90
|
+
assert.strictEqual(version, 'v1');
|
|
91
|
+
|
|
92
|
+
delete process.env.COORDINATION_VERSION;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test('should prioritize explicit config.version over env var', () => {
|
|
96
|
+
process.env.COORDINATION_VERSION = 'v1';
|
|
97
|
+
|
|
98
|
+
const detectVersion = (config) => {
|
|
99
|
+
if (config.version) return config.version;
|
|
100
|
+
const envVersion = process.env.COORDINATION_VERSION?.toLowerCase();
|
|
101
|
+
if (envVersion === 'v1' || envVersion === 'v2') return envVersion;
|
|
102
|
+
return 'v2';
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const version = detectVersion({ version: 'v2', topology: 'mesh' });
|
|
106
|
+
assert.strictEqual(version, 'v2');
|
|
107
|
+
|
|
108
|
+
delete process.env.COORDINATION_VERSION;
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// ===========================
|
|
112
|
+
// 2. V1CoordinatorAdapter Interface Compatibility
|
|
113
|
+
// ===========================
|
|
114
|
+
|
|
115
|
+
console.log('\nš Testing V1CoordinatorAdapter Interface...\n');
|
|
116
|
+
|
|
117
|
+
test('should have ICoordinator interface methods', () => {
|
|
118
|
+
const requiredMethods = [
|
|
119
|
+
'spawnAgent',
|
|
120
|
+
'pauseAgent',
|
|
121
|
+
'resumeAgent',
|
|
122
|
+
'terminateAgent',
|
|
123
|
+
'getAgentState',
|
|
124
|
+
'getAgentSession',
|
|
125
|
+
'createCheckpoint',
|
|
126
|
+
'restoreCheckpoint',
|
|
127
|
+
'listCheckpoints',
|
|
128
|
+
'getMetrics',
|
|
129
|
+
'getActiveAgents',
|
|
130
|
+
'getPausedAgents',
|
|
131
|
+
'updateTokenUsage',
|
|
132
|
+
'initialize',
|
|
133
|
+
'cleanup',
|
|
134
|
+
'isReady'
|
|
135
|
+
];
|
|
136
|
+
|
|
137
|
+
// Mock V1CoordinatorAdapter structure
|
|
138
|
+
class MockV1Adapter {
|
|
139
|
+
async spawnAgent() {}
|
|
140
|
+
async pauseAgent() {}
|
|
141
|
+
async resumeAgent() {}
|
|
142
|
+
async terminateAgent() {}
|
|
143
|
+
async getAgentState() {}
|
|
144
|
+
async getAgentSession() {}
|
|
145
|
+
async createCheckpoint() {}
|
|
146
|
+
async restoreCheckpoint() {}
|
|
147
|
+
async listCheckpoints() { return []; }
|
|
148
|
+
getMetrics() { return {}; }
|
|
149
|
+
getActiveAgents() { return []; }
|
|
150
|
+
getPausedAgents() { return []; }
|
|
151
|
+
async updateTokenUsage() {}
|
|
152
|
+
async initialize() {}
|
|
153
|
+
async cleanup() {}
|
|
154
|
+
isReady() { return true; }
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const adapter = new MockV1Adapter();
|
|
158
|
+
requiredMethods.forEach(method => {
|
|
159
|
+
assert.ok(typeof adapter[method] === 'function', `Missing method: ${method}`);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
test('should translate V1 metrics to V2 CoordinatorMetrics format', () => {
|
|
164
|
+
const v2MetricsKeys = [
|
|
165
|
+
'totalAgentsSpawned',
|
|
166
|
+
'activeAgents',
|
|
167
|
+
'pausedAgents',
|
|
168
|
+
'totalTerminations',
|
|
169
|
+
'totalCheckpoints',
|
|
170
|
+
'totalRestores',
|
|
171
|
+
'averageCheckpointTimeMs',
|
|
172
|
+
'averageRestoreTimeMs',
|
|
173
|
+
'p99RestoreTimeMs',
|
|
174
|
+
'tokensSaved',
|
|
175
|
+
'totalTokensUsed',
|
|
176
|
+
'uptimeMs'
|
|
177
|
+
];
|
|
178
|
+
|
|
179
|
+
const mockMetrics = {
|
|
180
|
+
totalAgentsSpawned: 10,
|
|
181
|
+
activeAgents: 5,
|
|
182
|
+
pausedAgents: 0,
|
|
183
|
+
totalTerminations: 3,
|
|
184
|
+
totalCheckpoints: 0,
|
|
185
|
+
totalRestores: 0,
|
|
186
|
+
averageCheckpointTimeMs: 0,
|
|
187
|
+
averageRestoreTimeMs: 0,
|
|
188
|
+
p99RestoreTimeMs: 0,
|
|
189
|
+
tokensSaved: 0,
|
|
190
|
+
totalTokensUsed: 50000,
|
|
191
|
+
uptimeMs: 60000
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
v2MetricsKeys.forEach(key => {
|
|
195
|
+
assert.ok(key in mockMetrics, `Missing metrics key: ${key}`);
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// ===========================
|
|
200
|
+
// 3. ConfigTranslator Config Mapping
|
|
201
|
+
// ===========================
|
|
202
|
+
|
|
203
|
+
console.log('\nš Testing ConfigTranslator Config Mapping...\n');
|
|
204
|
+
|
|
205
|
+
test('should translate unified config to V1 mesh config', () => {
|
|
206
|
+
const unified = {
|
|
207
|
+
topology: 'mesh',
|
|
208
|
+
maxAgents: 5,
|
|
209
|
+
strategy: 'balanced',
|
|
210
|
+
enableConsensus: true
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
// Simulate ConfigTranslator.toV1Config
|
|
214
|
+
const v1Config = {
|
|
215
|
+
topology: unified.topology,
|
|
216
|
+
maxAgents: unified.maxAgents,
|
|
217
|
+
strategy: unified.strategy,
|
|
218
|
+
mesh: {
|
|
219
|
+
maxAgents: unified.maxAgents,
|
|
220
|
+
maxConnections: Math.floor(unified.maxAgents / 3),
|
|
221
|
+
taskDistributionStrategy: 'capability-based'
|
|
222
|
+
},
|
|
223
|
+
consensus: unified.enableConsensus ? {
|
|
224
|
+
protocol: 'quorum',
|
|
225
|
+
timeout: 5000
|
|
226
|
+
} : undefined
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
assert.strictEqual(v1Config.topology, 'mesh');
|
|
230
|
+
assert.strictEqual(v1Config.maxAgents, 5);
|
|
231
|
+
assert.strictEqual(v1Config.mesh.maxConnections, 1);
|
|
232
|
+
assert.strictEqual(v1Config.consensus.protocol, 'quorum');
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
test('should translate unified config to V1 hierarchical config', () => {
|
|
236
|
+
const unified = {
|
|
237
|
+
topology: 'hierarchical',
|
|
238
|
+
maxAgents: 15,
|
|
239
|
+
strategy: 'adaptive',
|
|
240
|
+
enableConsensus: true
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
const v1Config = {
|
|
244
|
+
topology: unified.topology,
|
|
245
|
+
maxAgents: unified.maxAgents,
|
|
246
|
+
strategy: unified.strategy,
|
|
247
|
+
hierarchical: {
|
|
248
|
+
minWorkers: Math.min(8, unified.maxAgents),
|
|
249
|
+
maxWorkers: unified.maxAgents,
|
|
250
|
+
autoScale: true,
|
|
251
|
+
scalingThreshold: 0.8
|
|
252
|
+
},
|
|
253
|
+
consensus: unified.enableConsensus ? {
|
|
254
|
+
protocol: 'raft',
|
|
255
|
+
timeout: 5000
|
|
256
|
+
} : undefined
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
assert.strictEqual(v1Config.topology, 'hierarchical');
|
|
260
|
+
assert.strictEqual(v1Config.maxAgents, 15);
|
|
261
|
+
assert.strictEqual(v1Config.hierarchical.minWorkers, 8);
|
|
262
|
+
assert.strictEqual(v1Config.consensus.protocol, 'raft');
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
test('should translate unified config to V2 FactoryOptions', () => {
|
|
266
|
+
const unified = {
|
|
267
|
+
topology: 'mesh',
|
|
268
|
+
maxAgents: 5,
|
|
269
|
+
strategy: 'balanced',
|
|
270
|
+
tokenBudget: 50000,
|
|
271
|
+
apiKey: 'test-api-key'
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
const v2Config = {
|
|
275
|
+
mode: 'sdk',
|
|
276
|
+
maxConcurrentAgents: unified.maxAgents,
|
|
277
|
+
defaultTokenBudget: unified.tokenBudget,
|
|
278
|
+
apiKey: unified.apiKey,
|
|
279
|
+
enableDynamicAllocation: unified.strategy !== 'performance',
|
|
280
|
+
verbose: false
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
assert.strictEqual(v2Config.mode, 'sdk');
|
|
284
|
+
assert.strictEqual(v2Config.maxConcurrentAgents, 5);
|
|
285
|
+
assert.strictEqual(v2Config.defaultTokenBudget, 50000);
|
|
286
|
+
assert.strictEqual(v2Config.enableDynamicAllocation, true);
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
test('should disable dynamic allocation when strategy is "performance"', () => {
|
|
290
|
+
const unified = {
|
|
291
|
+
topology: 'mesh',
|
|
292
|
+
maxAgents: 5,
|
|
293
|
+
strategy: 'performance'
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
const v2Config = {
|
|
297
|
+
mode: 'sdk',
|
|
298
|
+
maxConcurrentAgents: unified.maxAgents,
|
|
299
|
+
enableDynamicAllocation: unified.strategy !== 'performance'
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
assert.strictEqual(v2Config.enableDynamicAllocation, false);
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
// ===========================
|
|
306
|
+
// 4. Feature Flags Rollout Logic
|
|
307
|
+
// ===========================
|
|
308
|
+
|
|
309
|
+
console.log('\nš Testing Feature Flags Rollout Logic...\n');
|
|
310
|
+
|
|
311
|
+
test('should return false for all users at 0% rollout', () => {
|
|
312
|
+
process.env.V2_ROLLOUT_PERCENT = '0';
|
|
313
|
+
|
|
314
|
+
const shouldUseV2 = () => {
|
|
315
|
+
const rollout = Math.max(0, Math.min(100, parseInt(process.env.V2_ROLLOUT_PERCENT || '100', 10)));
|
|
316
|
+
if (rollout === 0) return false;
|
|
317
|
+
if (rollout === 100) return true;
|
|
318
|
+
return Math.random() * 100 < rollout;
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
assert.strictEqual(shouldUseV2(), false);
|
|
322
|
+
delete process.env.V2_ROLLOUT_PERCENT;
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
test('should return true for all users at 100% rollout', () => {
|
|
326
|
+
process.env.V2_ROLLOUT_PERCENT = '100';
|
|
327
|
+
|
|
328
|
+
const shouldUseV2 = () => {
|
|
329
|
+
const rollout = Math.max(0, Math.min(100, parseInt(process.env.V2_ROLLOUT_PERCENT || '100', 10)));
|
|
330
|
+
if (rollout === 0) return false;
|
|
331
|
+
if (rollout === 100) return true;
|
|
332
|
+
return Math.random() * 100 < rollout;
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
assert.strictEqual(shouldUseV2(), true);
|
|
336
|
+
delete process.env.V2_ROLLOUT_PERCENT;
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
test('should produce consistent 40-60% split at 50% rollout (statistical)', () => {
|
|
340
|
+
process.env.V2_ROLLOUT_PERCENT = '50';
|
|
341
|
+
|
|
342
|
+
const hashUserId = (userId) => {
|
|
343
|
+
let hash = 0;
|
|
344
|
+
for (let i = 0; i < userId.length; i++) {
|
|
345
|
+
hash = ((hash << 5) - hash) + userId.charCodeAt(i);
|
|
346
|
+
hash |= 0;
|
|
347
|
+
}
|
|
348
|
+
return Math.abs(hash) % 100;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
const shouldUseV2 = (userId) => {
|
|
352
|
+
const rollout = 50;
|
|
353
|
+
const hash = hashUserId(userId);
|
|
354
|
+
return hash < rollout;
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
const users = Array.from({ length: 1000 }, (_, i) => `user-${i}`);
|
|
358
|
+
const v2Users = users.filter(userId => shouldUseV2(userId));
|
|
359
|
+
const v2Percentage = (v2Users.length / users.length) * 100;
|
|
360
|
+
|
|
361
|
+
assert.ok(v2Percentage >= 40 && v2Percentage <= 60, `V2 percentage ${v2Percentage} outside 40-60% range`);
|
|
362
|
+
|
|
363
|
+
delete process.env.V2_ROLLOUT_PERCENT;
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
test('should prioritize COORDINATION_VERSION env var over rollout percentage', () => {
|
|
367
|
+
process.env.V2_ROLLOUT_PERCENT = '0';
|
|
368
|
+
process.env.COORDINATION_VERSION = 'v2';
|
|
369
|
+
|
|
370
|
+
const getCoordinationVersion = () => {
|
|
371
|
+
if (process.env.COORDINATION_VERSION) {
|
|
372
|
+
const version = process.env.COORDINATION_VERSION.toLowerCase();
|
|
373
|
+
if (version !== 'v1' && version !== 'v2') {
|
|
374
|
+
throw new Error('Invalid COORDINATION_VERSION');
|
|
375
|
+
}
|
|
376
|
+
return version;
|
|
377
|
+
}
|
|
378
|
+
const rollout = parseInt(process.env.V2_ROLLOUT_PERCENT || '100', 10);
|
|
379
|
+
return rollout === 100 || rollout > 0 ? 'v2' : 'v1';
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
assert.strictEqual(getCoordinationVersion(), 'v2');
|
|
383
|
+
|
|
384
|
+
delete process.env.V2_ROLLOUT_PERCENT;
|
|
385
|
+
delete process.env.COORDINATION_VERSION;
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
// ===========================
|
|
389
|
+
// 5. CLI Version Flag Parsing
|
|
390
|
+
// ===========================
|
|
391
|
+
|
|
392
|
+
console.log('\nš Testing CLI Version Flag Parsing...\n');
|
|
393
|
+
|
|
394
|
+
test('should default to v2 when no flag or env var is provided', () => {
|
|
395
|
+
delete process.env.COORDINATION_VERSION;
|
|
396
|
+
const cliFlag = undefined;
|
|
397
|
+
|
|
398
|
+
const coordinationVersion = (
|
|
399
|
+
cliFlag ||
|
|
400
|
+
process.env.COORDINATION_VERSION ||
|
|
401
|
+
'v2'
|
|
402
|
+
).toLowerCase();
|
|
403
|
+
|
|
404
|
+
assert.strictEqual(coordinationVersion, 'v2');
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
test('should use CLI flag when provided', () => {
|
|
408
|
+
delete process.env.COORDINATION_VERSION;
|
|
409
|
+
const cliFlag = 'v1';
|
|
410
|
+
|
|
411
|
+
const coordinationVersion = (
|
|
412
|
+
cliFlag ||
|
|
413
|
+
process.env.COORDINATION_VERSION ||
|
|
414
|
+
'v2'
|
|
415
|
+
).toLowerCase();
|
|
416
|
+
|
|
417
|
+
assert.strictEqual(coordinationVersion, 'v1');
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
test('should use env var when CLI flag is not provided', () => {
|
|
421
|
+
process.env.COORDINATION_VERSION = 'v1';
|
|
422
|
+
const cliFlag = undefined;
|
|
423
|
+
|
|
424
|
+
const coordinationVersion = (
|
|
425
|
+
cliFlag ||
|
|
426
|
+
process.env.COORDINATION_VERSION ||
|
|
427
|
+
'v2'
|
|
428
|
+
).toLowerCase();
|
|
429
|
+
|
|
430
|
+
assert.strictEqual(coordinationVersion, 'v1');
|
|
431
|
+
|
|
432
|
+
delete process.env.COORDINATION_VERSION;
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
test('should prioritize CLI flag over env var', () => {
|
|
436
|
+
process.env.COORDINATION_VERSION = 'v1';
|
|
437
|
+
const cliFlag = 'v2';
|
|
438
|
+
|
|
439
|
+
const coordinationVersion = (
|
|
440
|
+
cliFlag ||
|
|
441
|
+
process.env.COORDINATION_VERSION ||
|
|
442
|
+
'v2'
|
|
443
|
+
).toLowerCase();
|
|
444
|
+
|
|
445
|
+
assert.strictEqual(coordinationVersion, 'v2');
|
|
446
|
+
|
|
447
|
+
delete process.env.COORDINATION_VERSION;
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
test('should validate CLI flag as v1 or v2', () => {
|
|
451
|
+
const validateVersion = (version) => {
|
|
452
|
+
return version === 'v1' || version === 'v2';
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
assert.strictEqual(validateVersion('v1'), true);
|
|
456
|
+
assert.strictEqual(validateVersion('v2'), true);
|
|
457
|
+
assert.strictEqual(validateVersion('v3'), false);
|
|
458
|
+
assert.strictEqual(validateVersion(''), false);
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
// ===========================
|
|
462
|
+
// Results Summary
|
|
463
|
+
// ===========================
|
|
464
|
+
|
|
465
|
+
console.log('\n' + '='.repeat(60));
|
|
466
|
+
console.log('š VALIDATION SUMMARY');
|
|
467
|
+
console.log('='.repeat(60));
|
|
468
|
+
|
|
469
|
+
const passRate = (results.passingTests / results.totalTests) * 100;
|
|
470
|
+
const consensusScore = passRate / 100;
|
|
471
|
+
|
|
472
|
+
console.log(`\nTotal Tests: ${results.totalTests}`);
|
|
473
|
+
console.log(`Passing Tests: ${results.passingTests}`);
|
|
474
|
+
console.log(`Failing Tests: ${results.failingTests}`);
|
|
475
|
+
console.log(`Pass Rate: ${passRate.toFixed(2)}%`);
|
|
476
|
+
console.log(`Consensus Score: ${consensusScore.toFixed(2)}`);
|
|
477
|
+
|
|
478
|
+
console.log('\n' + '='.repeat(60));
|
|
479
|
+
|
|
480
|
+
if (consensusScore >= 0.90) {
|
|
481
|
+
console.log('ā
CONSENSUS APPROVED (ā„0.90)');
|
|
482
|
+
console.log('Decision: APPROVE');
|
|
483
|
+
console.log('='.repeat(60));
|
|
484
|
+
console.log('\nā
Phase 11 Coordination Toggle Integration VALIDATED');
|
|
485
|
+
process.exit(0);
|
|
486
|
+
} else {
|
|
487
|
+
console.log('ā CONSENSUS FAILED (<0.90)');
|
|
488
|
+
console.log('Decision: REJECT');
|
|
489
|
+
console.log('='.repeat(60));
|
|
490
|
+
console.log('\nā Phase 11 Coordination Toggle Integration NEEDS FIXES');
|
|
491
|
+
|
|
492
|
+
console.log('\nFailed Tests:');
|
|
493
|
+
results.tests
|
|
494
|
+
.filter(t => t.status === 'FAIL')
|
|
495
|
+
.forEach(t => {
|
|
496
|
+
console.log(` - ${t.name}`);
|
|
497
|
+
console.log(` Error: ${t.error}`);
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
process.exit(1);
|
|
501
|
+
}
|
|
@@ -390,6 +390,35 @@ claude mcp add claude-flow-novice npx claude-flow-novice mcp start
|
|
|
390
390
|
}
|
|
391
391
|
```
|
|
392
392
|
|
|
393
|
+
**šØ MANDATORY: Post-Edit Hook Execution**
|
|
394
|
+
|
|
395
|
+
**CRITICAL**: Every primary swarm agent MUST run the post-edit-pipeline hook after EVERY file edit:
|
|
396
|
+
|
|
397
|
+
```bash
|
|
398
|
+
# REQUIRED after each file modification
|
|
399
|
+
node config/hooks/post-edit-pipeline.js "[FILE_PATH]" --memory-key "swarm/[agent]/[step]"
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
**Agent Instructions Template:**
|
|
403
|
+
```
|
|
404
|
+
Task("Agent Name", `
|
|
405
|
+
Your implementation task here...
|
|
406
|
+
|
|
407
|
+
MANDATORY: After EVERY file edit, run:
|
|
408
|
+
node config/hooks/post-edit-pipeline.js "[FILE_PATH]" --memory-key "swarm/[agent-name]/step-[N]"
|
|
409
|
+
|
|
410
|
+
Report confidence score when complete.
|
|
411
|
+
`, "agent-type")
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
**Post-Edit Hook Benefits:**
|
|
415
|
+
- Real-time validation (formatting, linting, type checking)
|
|
416
|
+
- Security scanning (hardcoded credentials, XSS, eval())
|
|
417
|
+
- Single-file testing (1-5s vs 10-60s full suite)
|
|
418
|
+
- TDD compliance detection (Red-Green-Refactor phases)
|
|
419
|
+
- Rust quality checks (unwrap/expect/panic with line numbers)
|
|
420
|
+
- Coverage tracking (Jest, pytest, cargo-tarpaulin)
|
|
421
|
+
|
|
393
422
|
**Confidence Score Interpretation:**
|
|
394
423
|
- **0.90-1.00**: Excellent - production ready
|
|
395
424
|
- **0.75-0.89**: Good - minor improvements possible
|