opencode-swarm 7.0.0-beta.1 → 7.0.1
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/LICENSE +21 -0
- package/README.md +1265 -40
- package/dist/__tests__/acknowledge-spec-drift.test.d.ts +1 -0
- package/dist/__tests__/cli-version.adversarial.test.d.ts +1 -0
- package/dist/__tests__/cli-version.test.d.ts +1 -0
- package/dist/__tests__/conflict-resolution.test.d.ts +1 -0
- package/dist/__tests__/convene-general-council.test.d.ts +10 -0
- package/dist/__tests__/critic_drift_verifier-whitelist.test.d.ts +1 -0
- package/dist/__tests__/critic_hallucination_verifier-whitelist.test.d.ts +1 -0
- package/dist/__tests__/disagreement-detector.test.d.ts +7 -0
- package/dist/__tests__/evidence-lock.adversarial.test.d.ts +8 -0
- package/dist/__tests__/evidence-lock.test.d.ts +6 -0
- package/dist/__tests__/gate-evidence.adversarial.test.d.ts +7 -0
- package/dist/__tests__/general-council-service.test.d.ts +7 -0
- package/dist/__tests__/lint-spec.test.d.ts +1 -0
- package/dist/__tests__/preflight-phase.test.d.ts +1 -0
- package/dist/__tests__/qa-gate-hardening.test.d.ts +12 -0
- package/dist/__tests__/req-coverage.test.d.ts +1 -0
- package/dist/__tests__/security-adversarial.test.d.ts +1 -0
- package/dist/__tests__/sounding-board-parser.test.d.ts +1 -0
- package/dist/__tests__/spec-hash.test.d.ts +1 -0
- package/dist/__tests__/spec-schema.test.d.ts +1 -0
- package/dist/__tests__/web-search-provider.test.d.ts +6 -0
- package/dist/__tests__/write-drift-evidence-requirement-coverage.test.d.ts +4 -0
- package/dist/adversarial-tests.test.d.ts +1 -0
- package/dist/agents/architect-permission.adversarial.test.d.ts +5 -0
- package/dist/agents/architect.commands-list.adversarial.test.d.ts +1 -0
- package/dist/agents/architect.commands-list.test.d.ts +1 -0
- package/dist/agents/architect.d.ts +57 -0
- package/dist/agents/architect.dark-matter.test.d.ts +1 -0
- package/dist/agents/architect.designer-gate.test.d.ts +1 -0
- package/dist/agents/coder.d.ts +2 -0
- package/dist/agents/council-member.d.ts +30 -0
- package/dist/agents/council-member.test.d.ts +8 -0
- package/dist/agents/council-moderator.d.ts +20 -0
- package/dist/agents/critic.d.ts +34 -0
- package/dist/agents/curator-agent.d.ts +14 -0
- package/dist/agents/designer.d.ts +2 -0
- package/dist/agents/docs.d.ts +2 -0
- package/dist/agents/explorer-consumer-contract.test.d.ts +1 -0
- package/dist/agents/explorer-role-boundary.test.d.ts +1 -0
- package/dist/agents/explorer.d.ts +5 -0
- package/dist/agents/index.d.ts +52 -0
- package/dist/agents/reviewer.d.ts +5 -0
- package/dist/agents/sme.d.ts +2 -0
- package/dist/agents/test-engineer.adversarial.test.d.ts +5 -0
- package/dist/agents/test-engineer.d.ts +2 -0
- package/dist/agents/test-engineer.security.test.d.ts +1 -0
- package/dist/background/circuit-breaker.d.ts +149 -0
- package/dist/background/event-bus.d.ts +60 -0
- package/dist/background/evidence-summary-integration.d.ts +73 -0
- package/dist/background/index.d.ts +22 -0
- package/dist/background/manager.d.ts +122 -0
- package/dist/background/plan-sync-worker.d.ts +122 -0
- package/dist/background/queue.d.ts +117 -0
- package/dist/background/status-artifact.d.ts +115 -0
- package/dist/background/trigger.d.ts +179 -0
- package/dist/background/trigger.vulnerability.test.d.ts +1 -0
- package/dist/background/worker.d.ts +92 -0
- package/dist/cli/index.d.ts +37 -0
- package/dist/cli/index.js +31346 -11426
- package/dist/commands/acknowledge-spec-drift.d.ts +5 -0
- package/dist/commands/brainstorm.d.ts +13 -0
- package/dist/commands/brainstorm.test.d.ts +1 -0
- package/dist/commands/checkpoint.d.ts +5 -0
- package/dist/commands/close.d.ts +11 -0
- package/dist/commands/command-adapters.security.test.d.ts +14 -0
- package/dist/commands/commands.test.d.ts +1 -0
- package/dist/commands/config.d.ts +5 -0
- package/dist/commands/council.d.ts +17 -0
- package/dist/commands/council.test.d.ts +4 -0
- package/dist/commands/curate.test.d.ts +1 -0
- package/dist/commands/doctor.d.ts +17 -0
- package/dist/commands/full-auto-config-guard.test.d.ts +7 -0
- package/dist/commands/full-auto-discoverability.test.d.ts +8 -0
- package/dist/commands/full-auto-registration.test.d.ts +5 -0
- package/dist/commands/full-auto-sessionid.test.d.ts +5 -0
- package/dist/commands/full-auto.d.ts +10 -0
- package/dist/commands/full-auto.regression.test.d.ts +10 -0
- package/dist/commands/full-auto.test.d.ts +6 -0
- package/dist/commands/index.d.ts +50 -0
- package/dist/commands/index.help-text.test.d.ts +1 -0
- package/dist/commands/issue.d.ts +13 -0
- package/dist/{knowledge.d.ts → commands/knowledge.d.ts} +2 -0
- package/dist/commands/pr-review.d.ts +11 -0
- package/dist/commands/qa-gates.d.ts +15 -0
- package/dist/commands/qa-gates.test.d.ts +1 -0
- package/dist/commands/registry-documentation.test.d.ts +1 -0
- package/dist/commands/registry-type.test.d.ts +1 -0
- package/dist/commands/registry.d.ts +282 -0
- package/dist/commands/reset-session.d.ts +7 -0
- package/dist/{reset.d.ts → commands/reset.d.ts} +1 -1
- package/dist/commands/shortcut-routing.test.d.ts +11 -0
- package/dist/{sync-plan.d.ts → commands/sync-plan.d.ts} +3 -1
- package/dist/commands/turbo-registration.test.d.ts +5 -0
- package/dist/commands/turbo-sessionid.test.d.ts +5 -0
- package/dist/commands/turbo.regression.test.d.ts +11 -0
- package/dist/commands/turbo.test.d.ts +5 -0
- package/dist/config/agent-categories.d.ts +12 -0
- package/dist/config/cache-paths.d.ts +17 -0
- package/dist/config/constants.architect-whitelist.test.d.ts +1 -0
- package/dist/config/constants.d.ts +72 -0
- package/dist/config/evidence-schema.d.ts +1352 -0
- package/dist/config/index.d.ts +11 -0
- package/dist/{config.d.ts → config/loader.d.ts} +11 -6
- package/dist/config/plan-schema.d.ts +191 -0
- package/dist/config/schema.d.ts +1078 -0
- package/dist/config/spec-schema.d.ts +113 -0
- package/dist/context/role-filter.d.ts +27 -0
- package/dist/context/zone-classifier.d.ts +17 -0
- package/dist/council/__tests__/council-evidence-writer.adversarial.test.d.ts +6 -0
- package/dist/council/council-advisory.d.ts +46 -0
- package/dist/council/council-evidence-writer.d.ts +18 -0
- package/dist/council/council-service.d.ts +21 -0
- package/dist/council/criteria-store.d.ts +9 -0
- package/dist/council/disagreement-detector.d.ts +24 -0
- package/dist/council/general-council-advisory.d.ts +29 -0
- package/dist/council/general-council-service.d.ts +22 -0
- package/dist/council/general-council-types.d.ts +98 -0
- package/dist/council/types.d.ts +126 -0
- package/dist/council/web-search-provider.d.ts +35 -0
- package/dist/db/global-db.d.ts +22 -0
- package/dist/db/global-db.test.d.ts +7 -0
- package/dist/db/index.d.ts +13 -0
- package/dist/db/project-db.d.ts +40 -0
- package/dist/db/project-db.test.d.ts +4 -0
- package/dist/db/qa-gate-profile.d.ts +107 -0
- package/dist/db/qa-gate-profile.test.d.ts +4 -0
- package/dist/diff/__tests__/semantic-classifier.test.d.ts +1 -0
- package/dist/diff/__tests__/summary-generator.test.d.ts +1 -0
- package/dist/diff/ast-diff.d.ts +21 -0
- package/dist/diff/semantic-classifier.d.ts +59 -0
- package/dist/diff/summary-generator.d.ts +33 -0
- package/dist/environment/index.d.ts +3 -0
- package/dist/environment/profile.d.ts +50 -0
- package/dist/environment/prompt-renderer.d.ts +6 -0
- package/dist/evidence/index.d.ts +2 -0
- package/dist/evidence/lock.d.ts +36 -0
- package/dist/evidence/manager.d.ts +78 -0
- package/dist/gate-evidence.d.ts +69 -0
- package/dist/gate-evidence.test.d.ts +1 -0
- package/dist/git/branch.d.ts +70 -0
- package/dist/git/index.d.ts +22 -0
- package/dist/git/pr.d.ts +28 -0
- package/dist/graph/graph-builder.d.ts +39 -0
- package/dist/graph/graph-query.d.ts +42 -0
- package/dist/graph/graph-store.d.ts +27 -0
- package/dist/graph/import-extractor.d.ts +44 -0
- package/dist/graph/index.d.ts +16 -0
- package/dist/graph/symbol-extractor.d.ts +17 -0
- package/dist/graph/types.d.ts +84 -0
- package/dist/hooks/__tests__/semantic-diff-injection.test.d.ts +1 -0
- package/dist/hooks/adversarial-detector.d.ts +50 -0
- package/dist/hooks/agent-activity.d.ts +38 -0
- package/dist/hooks/co-change-suggester.d.ts +51 -0
- package/dist/hooks/compaction-customizer.d.ts +11 -0
- package/dist/hooks/conflict-resolution.d.ts +12 -0
- package/dist/hooks/context-budget.d.ts +34 -0
- package/dist/hooks/context-scoring.d.ts +70 -0
- package/dist/hooks/curator-drift-advisory.test.d.ts +1 -0
- package/dist/hooks/curator-drift.d.ts +30 -0
- package/dist/hooks/curator-llm-factory.d.ts +20 -0
- package/dist/hooks/curator-types.d.ts +103 -0
- package/dist/hooks/curator.d.ts +108 -0
- package/dist/hooks/dark-matter-detector.d.ts +38 -0
- package/dist/hooks/delegation-gate.d.ts +78 -0
- package/dist/hooks/delegation-gate.evidence.test.d.ts +4 -0
- package/dist/hooks/delegation-gate.getEvidenceTaskId.test.d.ts +20 -0
- package/dist/hooks/delegation-gate.plan-fallback-security.test.d.ts +13 -0
- package/dist/hooks/delegation-gate.plan-fallback.test.d.ts +5 -0
- package/dist/hooks/delegation-gate.seed-state.test.d.ts +1 -0
- package/dist/hooks/delegation-gate.turbo-evidence.test.d.ts +8 -0
- package/dist/hooks/delegation-gate.verify.test.d.ts +11 -0
- package/dist/hooks/delegation-ledger.d.ts +37 -0
- package/dist/hooks/delegation-ledger.test.d.ts +11 -0
- package/dist/hooks/delegation-sanitizer.d.ts +24 -0
- package/dist/hooks/delegation-tracker.d.ts +15 -0
- package/dist/hooks/diff-scope.d.ts +12 -0
- package/dist/hooks/diff-scope.test.d.ts +1 -0
- package/dist/hooks/extractors.d.ts +53 -0
- package/dist/hooks/full-auto-intercept.d.ts +77 -0
- package/dist/hooks/guardrails.d.ts +174 -0
- package/dist/hooks/hive-promoter.d.ts +40 -0
- package/dist/hooks/incremental-verify.d.ts +34 -0
- package/dist/hooks/incremental-verify.test.d.ts +1 -0
- package/dist/hooks/index.d.ts +20 -0
- package/dist/hooks/knowledge-curator.d.ts +27 -0
- package/dist/hooks/knowledge-injector.d.ts +20 -0
- package/dist/hooks/knowledge-migrator.d.ts +11 -0
- package/dist/hooks/knowledge-reader.d.ts +22 -0
- package/dist/hooks/knowledge-store.d.ts +30 -0
- package/dist/hooks/knowledge-types.d.ts +131 -0
- package/dist/hooks/knowledge-validator.d.ts +29 -0
- package/dist/hooks/loop-detector.d.ts +17 -0
- package/dist/hooks/loop-detector.test.d.ts +1 -0
- package/dist/hooks/message-priority.d.ts +105 -0
- package/dist/hooks/messages-transform.d.ts +13 -0
- package/dist/hooks/model-limits.d.ts +96 -0
- package/dist/hooks/normalize-tool-name.d.ts +25 -0
- package/dist/hooks/phase-monitor.d.ts +29 -0
- package/dist/hooks/pipeline-tracker.d.ts +41 -0
- package/dist/hooks/repo-graph-builder.d.ts +32 -0
- package/dist/hooks/repo-graph-injection.d.ts +45 -0
- package/dist/hooks/review-receipt.d.ts +189 -0
- package/dist/hooks/scope-guard-throw-behavior.test.d.ts +15 -0
- package/dist/hooks/scope-guard.adversarial.test.d.ts +1 -0
- package/dist/hooks/scope-guard.d.ts +43 -0
- package/dist/hooks/scope-guard.test.d.ts +14 -0
- package/dist/hooks/self-review.d.ts +14 -0
- package/dist/hooks/self-review.test.d.ts +14 -0
- package/dist/hooks/semantic-diff-injection.d.ts +24 -0
- package/dist/hooks/slop-detector.adversarial.test.d.ts +1 -0
- package/dist/hooks/slop-detector.d.ts +17 -0
- package/dist/hooks/slop-detector.test.d.ts +1 -0
- package/dist/hooks/spawn-helper.d.ts +5 -0
- package/dist/hooks/spawn-helper.test.d.ts +1 -0
- package/dist/hooks/steering-consumed.d.ts +30 -0
- package/dist/hooks/system-enhancer.d.ts +30 -0
- package/dist/hooks/tool-summarizer.d.ts +28 -0
- package/dist/hooks/trajectory-logger.d.ts +69 -0
- package/dist/hooks/utils.d.ts +20 -0
- package/dist/hooks/watchdog.integration.test.d.ts +9 -0
- package/dist/index.adversarial-bootstrap.test.d.ts +1 -0
- package/dist/index.bootstrap-adversarial.test.d.ts +1 -0
- package/dist/index.bootstrap-directory.test.d.ts +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +74690 -47646
- package/dist/knowledge/identity.d.ts +25 -0
- package/dist/knowledge/index.d.ts +2 -0
- package/dist/lang/detector.d.ts +20 -0
- package/dist/lang/framework-detector.d.ts +98 -0
- package/dist/lang/grammars/tree-sitter-dart.wasm +0 -0
- package/dist/lang/grammars/tree-sitter-kotlin.wasm +0 -0
- package/dist/lang/grammars/tree-sitter-swift.wasm +0 -0
- package/dist/lang/grammars/tree-sitter.wasm +0 -0
- package/dist/lang/index.d.ts +4 -0
- package/dist/lang/profiles.d.ts +72 -0
- package/dist/lang/registry.d.ts +24 -0
- package/dist/lang/runtime.d.ts +35 -0
- package/dist/model-fallback.adversarial.test.d.ts +22 -0
- package/dist/model-fallback.test.d.ts +12 -0
- package/dist/mutation/__tests__/engine.adversarial.test.d.ts +1 -0
- package/dist/mutation/__tests__/engine.test.d.ts +1 -0
- package/dist/mutation/__tests__/equivalence.adversarial.test.d.ts +1 -0
- package/dist/mutation/__tests__/equivalence.test.d.ts +1 -0
- package/dist/mutation/__tests__/gate.adversarial.test.d.ts +1 -0
- package/dist/mutation/__tests__/gate.test.d.ts +1 -0
- package/dist/mutation/__tests__/generator.test.d.ts +1 -0
- package/dist/mutation/engine.d.ts +47 -0
- package/dist/mutation/equivalence.d.ts +35 -0
- package/dist/mutation/gate.d.ts +28 -0
- package/dist/mutation/generator.d.ts +16 -0
- package/dist/output/agent-writer.d.ts +27 -0
- package/dist/output/index.d.ts +1 -0
- package/dist/parallel/dependency-graph.d.ts +34 -0
- package/dist/parallel/dispatcher/index.d.ts +12 -0
- package/dist/parallel/dispatcher/noop-dispatcher.d.ts +18 -0
- package/dist/parallel/dispatcher/noop-dispatcher.test.d.ts +10 -0
- package/dist/parallel/dispatcher/parallel-dispatcher.d.ts +18 -0
- package/dist/parallel/dispatcher/types.d.ts +33 -0
- package/dist/parallel/file-locks.d.ts +40 -0
- package/dist/parallel/index.d.ts +5 -0
- package/dist/parallel/meta-indexer.d.ts +32 -0
- package/dist/parallel/review-router.d.ts +29 -0
- package/dist/plan/checkpoint.d.ts +25 -0
- package/dist/plan/checkpoint.test.d.ts +1 -0
- package/dist/plan/index.d.ts +1 -0
- package/dist/plan/ledger-integrity.test.d.ts +5 -0
- package/dist/plan/ledger-snapshot-adversarial.test.d.ts +1 -0
- package/dist/plan/ledger.d.ts +286 -0
- package/dist/plan/ledger.test.d.ts +1 -0
- package/dist/plan/manager.cas-backoff.test.d.ts +10 -0
- package/dist/plan/manager.d.ts +90 -0
- package/dist/plan/manager.ledger-aware.test.d.ts +1 -0
- package/dist/plan/manager.loadplan-validation-guard.test.d.ts +13 -0
- package/dist/plan/manager.update-task-status.test.d.ts +1 -0
- package/dist/plan/migration-revert.regression.test.d.ts +8 -0
- package/dist/prm/__tests__/course-correction.test.d.ts +1 -0
- package/dist/prm/__tests__/escalation-queue-drain.test.d.ts +1 -0
- package/dist/prm/__tests__/escalation.test.d.ts +1 -0
- package/dist/prm/__tests__/index.test.d.ts +1 -0
- package/dist/prm/__tests__/integration.test.d.ts +1 -0
- package/dist/prm/__tests__/pattern-detector.test.d.ts +5 -0
- package/dist/prm/__tests__/replay.test.d.ts +1 -0
- package/dist/prm/__tests__/trajectory-store.test.d.ts +7 -0
- package/dist/prm/course-correction.d.ts +20 -0
- package/dist/prm/escalation.d.ts +73 -0
- package/dist/prm/index.d.ts +58 -0
- package/dist/prm/pattern-detector.d.ts +71 -0
- package/dist/prm/replay.d.ts +44 -0
- package/dist/prm/trajectory-store.d.ts +66 -0
- package/dist/prm/types.d.ts +120 -0
- package/dist/quality/index.d.ts +1 -0
- package/dist/quality/metrics.d.ts +25 -0
- package/dist/sast/rules/c.d.ts +9 -0
- package/dist/sast/rules/csharp.d.ts +9 -0
- package/dist/sast/rules/go.d.ts +9 -0
- package/dist/sast/rules/index.d.ts +72 -0
- package/dist/sast/rules/java.d.ts +9 -0
- package/dist/sast/rules/javascript.d.ts +9 -0
- package/dist/sast/rules/php.d.ts +9 -0
- package/dist/sast/rules/python.d.ts +9 -0
- package/dist/sast/semgrep.d.ts +68 -0
- package/dist/sast/semgrep.test.d.ts +1 -0
- package/dist/sbom/cyclonedx.d.ts +101 -0
- package/dist/sbom/detectors/dart.d.ts +7 -0
- package/dist/sbom/detectors/dotnet.d.ts +7 -0
- package/dist/sbom/detectors/go.d.ts +7 -0
- package/dist/sbom/detectors/index.d.ts +53 -0
- package/dist/sbom/detectors/java.d.ts +7 -0
- package/dist/sbom/detectors/nodejs.d.ts +7 -0
- package/dist/sbom/detectors/python.d.ts +7 -0
- package/dist/sbom/detectors/rust.d.ts +7 -0
- package/dist/sbom/detectors/swift.d.ts +7 -0
- package/dist/scope/scope-persistence.d.ts +109 -0
- package/dist/scope/scope-persistence.test.d.ts +13 -0
- package/dist/services/compaction-service.d.ts +28 -0
- package/dist/services/compaction-service.test.d.ts +1 -0
- package/dist/services/config-doctor.d.ts +125 -0
- package/dist/services/config-doctor.security.test.d.ts +1 -0
- package/dist/services/config-doctor.test.d.ts +1 -0
- package/dist/services/context-budget-service.d.ts +101 -0
- package/dist/services/decision-drift-analyzer.d.ts +96 -0
- package/dist/services/diagnose-service.d.ts +41 -0
- package/dist/services/evidence-service.d.ts +65 -0
- package/dist/services/evidence-summary-service.d.ts +75 -0
- package/dist/services/export-service.d.ts +30 -0
- package/dist/services/handoff-service.d.ts +74 -0
- package/dist/services/history-service.d.ts +35 -0
- package/dist/services/index.d.ts +13 -0
- package/dist/services/plan-service.d.ts +25 -0
- package/dist/services/preflight-integration.d.ts +38 -0
- package/dist/services/preflight-service.d.ts +62 -0
- package/dist/services/run-memory.d.ts +66 -0
- package/dist/services/status-service.d.ts +35 -0
- package/dist/services/status-service.turbo-indicator.test.d.ts +5 -0
- package/dist/services/tool-doctor.d.ts +26 -0
- package/dist/services/tool-doctor.test.d.ts +1 -0
- package/dist/services/version-check.d.ts +28 -0
- package/dist/services/warning-buffer.d.ts +9 -0
- package/dist/session/snapshot-reader.d.ts +37 -0
- package/dist/session/snapshot-writer.d.ts +115 -0
- package/dist/skills/index.d.ts +30 -0
- package/dist/state/agent-run-context.d.ts +24 -0
- package/dist/state.agent-run-context.test.d.ts +10 -0
- package/dist/state.d.ts +501 -1
- package/dist/state.rehydrate.test.d.ts +1 -0
- package/dist/state.rehydration-adversarial.test.d.ts +1 -0
- package/dist/state.rehydration-integration.test.d.ts +1 -0
- package/dist/state.session-restart.test.d.ts +7 -0
- package/dist/summaries/index.d.ts +2 -0
- package/dist/summaries/manager.d.ts +29 -0
- package/dist/summaries/summarizer.d.ts +38 -0
- package/dist/telemetry.d.ts +59 -0
- package/dist/telemetry.test.d.ts +1 -0
- package/dist/test-impact/__tests__/analyzer-import-fix.adversarial.test.d.ts +1 -0
- package/dist/test-impact/__tests__/analyzer-import-fix.test.d.ts +1 -0
- package/dist/test-impact/__tests__/analyzer.adversarial.test.d.ts +1 -0
- package/dist/test-impact/__tests__/analyzer.test.d.ts +1 -0
- package/dist/test-impact/__tests__/council-fixes.test.d.ts +1 -0
- package/dist/test-impact/__tests__/failure-classifier.adversarial.test.d.ts +1 -0
- package/dist/test-impact/__tests__/failure-classifier.test.d.ts +1 -0
- package/dist/test-impact/__tests__/flaky-detector.adversarial.test.d.ts +1 -0
- package/dist/test-impact/__tests__/flaky-detector.test.d.ts +1 -0
- package/dist/test-impact/__tests__/history-store.adversarial.test.d.ts +1 -0
- package/dist/test-impact/__tests__/history-store.test.d.ts +1 -0
- package/dist/test-impact/__tests__/test-impact.adversarial.test.d.ts +1 -0
- package/dist/test-impact/__tests__/test-impact.test.d.ts +1 -0
- package/dist/test-impact/analyzer.d.ts +9 -0
- package/dist/test-impact/failure-classifier.d.ts +26 -0
- package/dist/test-impact/flaky-detector.d.ts +14 -0
- package/dist/test-impact/history-store.d.ts +15 -0
- package/dist/tools/__tests__/barrel-exports.test.d.ts +1 -0
- package/dist/tools/__tests__/diff-ast-fallback.test.d.ts +1 -0
- package/dist/tools/__tests__/diff-markdown-summary.test.d.ts +1 -0
- package/dist/tools/__tests__/diff-semantic.test.d.ts +1 -0
- package/dist/tools/__tests__/diff-summary.adversarial.test.d.ts +1 -0
- package/dist/tools/__tests__/diff-summary.test.d.ts +1 -0
- package/dist/tools/__tests__/mutation-test.adversarial.test.d.ts +1 -0
- package/dist/tools/__tests__/mutation-test.sourcefiles.test.d.ts +1 -0
- package/dist/tools/__tests__/mutation-test.test.d.ts +1 -0
- package/dist/tools/__tests__/test-runner-history.test.d.ts +1 -0
- package/dist/tools/__tests__/test-runner-impact.adversarial.test.d.ts +1 -0
- package/dist/tools/__tests__/test-runner-impact.test.d.ts +1 -0
- package/dist/tools/__tests__/test-runner-source-files.test.d.ts +1 -0
- package/dist/tools/barrel-export-check-gate-status.test.d.ts +6 -0
- package/dist/tools/batch-symbols.d.ts +24 -0
- package/dist/tools/batch-symbols.test.d.ts +1 -0
- package/dist/tools/build-check.d.ts +50 -0
- package/dist/tools/check-gate-status.adversarial.test.d.ts +1 -0
- package/dist/tools/check-gate-status.d.ts +7 -0
- package/dist/tools/check-gate-status.gates.test.d.ts +1 -0
- package/dist/tools/check-gate-status.plugin-registration.test.d.ts +1 -0
- package/dist/tools/checkpoint.d.ts +12 -0
- package/dist/tools/co-change-analyzer.d.ts +45 -0
- package/dist/tools/completion-verify.d.ts +25 -0
- package/dist/tools/complexity-hotspots.d.ts +2 -0
- package/dist/tools/convene-council.d.ts +53 -0
- package/dist/tools/convene-general-council.d.ts +25 -0
- package/dist/{create-tool.d.ts → tools/create-tool.d.ts} +13 -1
- package/dist/tools/curator-analyze.d.ts +7 -0
- package/dist/tools/curator-analyze.test.d.ts +1 -0
- package/dist/tools/declare-council-criteria.d.ts +14 -0
- package/dist/tools/declare-scope.d.ts +50 -0
- package/dist/tools/diff-summary.d.ts +12 -0
- package/dist/tools/diff.d.ts +24 -0
- package/dist/tools/doc-scan.d.ts +38 -0
- package/dist/tools/domain-detector.d.ts +6 -0
- package/dist/tools/evidence-check.d.ts +8 -0
- package/dist/tools/file-extractor.d.ts +9 -0
- package/dist/tools/generate-mutants.d.ts +15 -0
- package/dist/tools/get-approved-plan.d.ts +55 -0
- package/dist/tools/get-qa-gate-profile.d.ts +27 -0
- package/dist/tools/gitingest.d.ts +18 -0
- package/dist/tools/imports.d.ts +5 -0
- package/dist/tools/index.d.ts +66 -0
- package/dist/tools/knowledge-add.d.ts +2 -0
- package/dist/tools/knowledge-query.d.ts +5 -0
- package/dist/tools/knowledge-recall.d.ts +2 -0
- package/dist/tools/knowledge-remove.d.ts +2 -0
- package/dist/tools/knowledge-tools.integration.test.d.ts +1 -0
- package/dist/tools/lint-spec.d.ts +2 -0
- package/dist/tools/lint.d.ts +63 -0
- package/dist/tools/mutation-test.d.ts +2 -0
- package/dist/tools/mutation-test.security.test.d.ts +1 -0
- package/dist/tools/phase-complete.d.ts +25 -0
- package/dist/tools/pkg-audit.d.ts +2 -0
- package/dist/tools/placeholder-scan.d.ts +28 -0
- package/dist/tools/plugin-registration-adversarial.test.d.ts +1 -0
- package/dist/tools/pre-check-batch.d.ts +89 -0
- package/dist/tools/quality-budget.d.ts +26 -0
- package/dist/tools/repo-graph.d.ts +226 -0
- package/dist/tools/repo-map.d.ts +2 -0
- package/dist/tools/req-coverage.d.ts +47 -0
- package/dist/tools/resolve-working-directory.d.ts +35 -0
- package/dist/tools/resolve-working-directory.test.d.ts +1 -0
- package/dist/tools/retrieve-summary.d.ts +2 -0
- package/dist/tools/sast-baseline.d.ts +126 -0
- package/dist/tools/sast-scan.d.ts +87 -0
- package/dist/tools/save-plan.d.ts +95 -0
- package/dist/tools/save-plan.subdirectory-rejection.test.d.ts +1 -0
- package/dist/tools/sbom-generate.d.ts +26 -0
- package/dist/tools/schema-drift.d.ts +2 -0
- package/dist/tools/search.adversarial.test.d.ts +1 -0
- package/dist/tools/search.d.ts +29 -0
- package/dist/tools/search.test.d.ts +1 -0
- package/dist/tools/secretscan.d.ts +35 -0
- package/dist/tools/set-qa-gates.d.ts +40 -0
- package/dist/tools/suggest-patch.adversarial.test.d.ts +1 -0
- package/dist/tools/suggest-patch.d.ts +37 -0
- package/dist/tools/suggest-patch.test.d.ts +1 -0
- package/dist/tools/symbols.d.ts +21 -0
- package/dist/tools/syntax-check.d.ts +37 -0
- package/dist/tools/test-impact.d.ts +2 -0
- package/dist/tools/test-runner.d.ts +86 -0
- package/dist/tools/test-runner.security-adversarial.test.d.ts +5 -0
- package/dist/tools/todo-extract.d.ts +2 -0
- package/dist/tools/tool-names.d.ts +10 -0
- package/dist/tools/update-task-status.adversarial.test.d.ts +13 -0
- package/dist/tools/update-task-status.d.ts +114 -0
- package/dist/tools/update-task-status.gates.test.d.ts +1 -0
- package/dist/tools/update-task-status.test.d.ts +1 -0
- package/dist/tools/update-task-status.turbo-bypass.test.d.ts +1 -0
- package/dist/tools/verify-six-tools-registration.test.d.ts +9 -0
- package/dist/tools/web-search.d.ts +13 -0
- package/dist/tools/write-drift-evidence.d.ts +31 -0
- package/dist/tools/write-hallucination-evidence.d.ts +30 -0
- package/dist/tools/write-mutation-evidence.d.ts +34 -0
- package/dist/tools/write-mutation-evidence.test.d.ts +1 -0
- package/dist/tools/write-retro.d.ts +55 -0
- package/dist/transient-retry.test.d.ts +10 -0
- package/dist/types/delegation.d.ts +24 -0
- package/dist/types/events.d.ts +125 -0
- package/dist/utils/errors.d.ts +33 -0
- package/dist/utils/gitignore-warning.d.ts +17 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/logger.d.ts +3 -0
- package/dist/utils/merge.d.ts +5 -0
- package/dist/utils/path-security.d.ts +36 -0
- package/dist/utils/regex.d.ts +30 -0
- package/dist/utils/spec-hash.d.ts +15 -0
- package/dist/utils/tool-output.d.ts +12 -0
- package/dist/validation/task-id.d.ts +43 -0
- package/package.json +21 -14
- package/dist/architect.d.ts +0 -7
- package/dist/checkpoint.d.ts +0 -7
- package/dist/co-change-analyzer.d.ts +0 -1
- package/dist/compat.d.ts +0 -12
- package/dist/config-doctor.d.ts +0 -1
- package/dist/detector.d.ts +0 -7
- package/dist/diagnose-service.d.ts +0 -1
- package/dist/doctor.d.ts +0 -5
- package/dist/evidence-schema.d.ts +0 -2
- package/dist/evidence-service.d.ts +0 -1
- package/dist/export-service.d.ts +0 -1
- package/dist/handoff-service.d.ts +0 -1
- package/dist/history-service.d.ts +0 -1
- package/dist/hive-promoter.d.ts +0 -2
- package/dist/knowledge-migrator.d.ts +0 -2
- package/dist/knowledge-store.d.ts +0 -1
- package/dist/knowledge-types.d.ts +0 -1
- package/dist/knowledge-validator.d.ts +0 -2
- package/dist/loader.d.ts +0 -1
- package/dist/manager.d.ts +0 -1
- package/dist/models.d.ts +0 -1
- package/dist/plan-service.d.ts +0 -1
- package/dist/preflight-service.d.ts +0 -1
- package/dist/profiles.d.ts +0 -7
- package/dist/register.d.ts +0 -36
- package/dist/schema.d.ts +0 -2
- package/dist/snapshot-writer.d.ts +0 -1
- package/dist/status-service.d.ts +0 -15
- package/dist/telemetry/src/events.d.ts +0 -308
- package/dist/telemetry/src/guards.d.ts +0 -14
- package/dist/telemetry/src/index.d.ts +0 -4
- package/dist/telemetry/src/version.d.ts +0 -1
- package/dist/utils.d.ts +0 -1
- package/dist/write-retro.d.ts +0 -1
- /package/dist/{discovery.d.ts → build/discovery.d.ts} +0 -0
- /package/dist/{agents.d.ts → commands/agents.d.ts} +0 -0
- /package/dist/{analyze.d.ts → commands/analyze.d.ts} +0 -0
- /package/dist/{archive.d.ts → commands/archive.d.ts} +0 -0
- /package/dist/{benchmark.d.ts → commands/benchmark.d.ts} +0 -0
- /package/dist/{clarify.d.ts → commands/clarify.d.ts} +0 -0
- /package/dist/{curate.d.ts → commands/curate.d.ts} +0 -0
- /package/dist/{dark-matter.d.ts → commands/dark-matter.d.ts} +0 -0
- /package/dist/{diagnose.d.ts → commands/diagnose.d.ts} +0 -0
- /package/dist/{evidence.d.ts → commands/evidence.d.ts} +0 -0
- /package/dist/{export.d.ts → commands/export.d.ts} +0 -0
- /package/dist/{handoff.d.ts → commands/handoff.d.ts} +0 -0
- /package/dist/{history.d.ts → commands/history.d.ts} +0 -0
- /package/dist/{plan.d.ts → commands/plan.d.ts} +0 -0
- /package/dist/{preflight.d.ts → commands/preflight.d.ts} +0 -0
- /package/dist/{promote.d.ts → commands/promote.d.ts} +0 -0
- /package/dist/{retrieve.d.ts → commands/retrieve.d.ts} +0 -0
- /package/dist/{rollback.d.ts → commands/rollback.d.ts} +0 -0
- /package/dist/{simulate.d.ts → commands/simulate.d.ts} +0 -0
- /package/dist/{specify.d.ts → commands/specify.d.ts} +0 -0
- /package/dist/{status.d.ts → commands/status.d.ts} +0 -0
- /package/dist/{turbo.d.ts → commands/turbo.d.ts} +0 -0
- /package/dist/{write_retro.d.ts → commands/write-retro.d.ts} +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decision Drift Analyzer Service
|
|
3
|
+
*
|
|
4
|
+
* Analyzes decisions from context.md and current plan state to detect:
|
|
5
|
+
* 1. Stale decisions (age/phase mismatch or no recent confirmation)
|
|
6
|
+
* 2. Contradictions (new decisions conflicting with existing ones)
|
|
7
|
+
*
|
|
8
|
+
* Results are integrated into architect context injection.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Drift signal severity levels
|
|
12
|
+
*/
|
|
13
|
+
export type DriftSeverity = 'warning' | 'error';
|
|
14
|
+
/**
|
|
15
|
+
* A single decision extracted from context.md
|
|
16
|
+
*/
|
|
17
|
+
export interface Decision {
|
|
18
|
+
/** Raw decision text */
|
|
19
|
+
text: string;
|
|
20
|
+
/** Phase when decision was made (extracted or inferred) */
|
|
21
|
+
phase: number | null;
|
|
22
|
+
/** Whether decision has a confirmation marker */
|
|
23
|
+
confirmed: boolean;
|
|
24
|
+
/** Timestamp if available */
|
|
25
|
+
timestamp: string | null;
|
|
26
|
+
/** Line number in source file */
|
|
27
|
+
line: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A detected drift signal
|
|
31
|
+
*/
|
|
32
|
+
export interface DriftSignal {
|
|
33
|
+
/** Unique identifier for this drift */
|
|
34
|
+
id: string;
|
|
35
|
+
/** Severity level */
|
|
36
|
+
severity: DriftSeverity;
|
|
37
|
+
/** Type of drift */
|
|
38
|
+
type: 'stale' | 'contradiction';
|
|
39
|
+
/** Human-readable description */
|
|
40
|
+
message: string;
|
|
41
|
+
/** Source reference (file and line) */
|
|
42
|
+
source: {
|
|
43
|
+
file: string;
|
|
44
|
+
line: number;
|
|
45
|
+
};
|
|
46
|
+
/** Related decisions if applicable */
|
|
47
|
+
relatedDecisions?: string[];
|
|
48
|
+
/** Suggested resolution hint */
|
|
49
|
+
hint?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Result of drift analysis
|
|
53
|
+
*/
|
|
54
|
+
export interface DriftAnalysisResult {
|
|
55
|
+
/** Whether drift was detected */
|
|
56
|
+
hasDrift: boolean;
|
|
57
|
+
/** List of drift signals */
|
|
58
|
+
signals: DriftSignal[];
|
|
59
|
+
/** Summary text for context injection */
|
|
60
|
+
summary: string;
|
|
61
|
+
/** Timestamp of analysis */
|
|
62
|
+
analyzedAt: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Configuration for drift analyzer
|
|
66
|
+
*/
|
|
67
|
+
export interface DriftAnalyzerConfig {
|
|
68
|
+
/** Maximum age in phases before a decision is considered stale */
|
|
69
|
+
staleThresholdPhases: number;
|
|
70
|
+
/** Whether to detect contradictions */
|
|
71
|
+
detectContradictions: boolean;
|
|
72
|
+
/** Maximum signals to return */
|
|
73
|
+
maxSignals: number;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Default configuration
|
|
77
|
+
*/
|
|
78
|
+
export declare const DEFAULT_DRIFT_CONFIG: DriftAnalyzerConfig;
|
|
79
|
+
/**
|
|
80
|
+
* Extract decisions from context.md content
|
|
81
|
+
*/
|
|
82
|
+
export declare function extractDecisionsFromContext(contextContent: string): Decision[];
|
|
83
|
+
/**
|
|
84
|
+
* Simple keyword-based contradiction detection
|
|
85
|
+
* Looks for decisions that express opposite intentions
|
|
86
|
+
*/
|
|
87
|
+
export declare function findContradictions(decisions: Decision[]): DriftSignal[];
|
|
88
|
+
/**
|
|
89
|
+
* Analyze decision drift
|
|
90
|
+
*/
|
|
91
|
+
export declare function analyzeDecisionDrift(directory: string, config?: Partial<DriftAnalyzerConfig>): Promise<DriftAnalysisResult>;
|
|
92
|
+
/**
|
|
93
|
+
* Format drift signals as a structured section for context injection
|
|
94
|
+
* Returns bounded output suitable for LLM context
|
|
95
|
+
*/
|
|
96
|
+
export declare function formatDriftForContext(result: DriftAnalysisResult): string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single health check result.
|
|
3
|
+
*/
|
|
4
|
+
export interface HealthCheck {
|
|
5
|
+
name: string;
|
|
6
|
+
status: '✅' | '❌' | '⚠️' | '⬜';
|
|
7
|
+
detail: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Structured diagnose data returned by the diagnose service.
|
|
11
|
+
*/
|
|
12
|
+
export interface DiagnoseData {
|
|
13
|
+
checks: HealthCheck[];
|
|
14
|
+
passCount: number;
|
|
15
|
+
totalCount: number;
|
|
16
|
+
allPassed: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolve the grammar WASM directory from an arbitrary module directory.
|
|
20
|
+
* Exported for unit testing — callers should not pass import.meta.url directly.
|
|
21
|
+
*
|
|
22
|
+
* Rules:
|
|
23
|
+
* - Dev source (ends with /src/services): go up one level → src/lang/grammars
|
|
24
|
+
* - CLI bundle (ends with /cli): go up one level → dist/lang/grammars
|
|
25
|
+
* - Main bundle (everything else): stay put → dist/lang/grammars
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveGrammarDir(thisDir: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get diagnose data from the swarm directory.
|
|
30
|
+
* Returns structured health checks for GUI, background flows, or commands.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getDiagnoseData(directory: string): Promise<DiagnoseData>;
|
|
33
|
+
/**
|
|
34
|
+
* Format diagnose data as markdown for command output.
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatDiagnoseMarkdown(diagnose: DiagnoseData): string;
|
|
37
|
+
/**
|
|
38
|
+
* Handle diagnose command - delegates to service and formats output.
|
|
39
|
+
* Kept for backward compatibility - thin adapter.
|
|
40
|
+
*/
|
|
41
|
+
export declare function handleDiagnoseCommand(directory: string, _args: string[]): Promise<string>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Evidence } from '../config/evidence-schema';
|
|
2
|
+
/**
|
|
3
|
+
* Structured evidence entry for a task.
|
|
4
|
+
*/
|
|
5
|
+
export interface EvidenceEntryData {
|
|
6
|
+
index: number;
|
|
7
|
+
entry: Evidence;
|
|
8
|
+
type: string;
|
|
9
|
+
verdict: string;
|
|
10
|
+
verdictIcon: string;
|
|
11
|
+
agent: string;
|
|
12
|
+
summary: string;
|
|
13
|
+
timestamp: string;
|
|
14
|
+
details: Record<string, string | number | undefined>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Structured evidence data for a single task.
|
|
18
|
+
*/
|
|
19
|
+
export interface TaskEvidenceData {
|
|
20
|
+
hasEvidence: boolean;
|
|
21
|
+
taskId: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
entries: EvidenceEntryData[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Structured evidence list data for all tasks.
|
|
28
|
+
*/
|
|
29
|
+
export interface EvidenceListData {
|
|
30
|
+
hasEvidence: boolean;
|
|
31
|
+
tasks: Array<{
|
|
32
|
+
taskId: string;
|
|
33
|
+
entryCount: number;
|
|
34
|
+
lastUpdated: string;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get emoji for verdict type (exported for use in entry formatting).
|
|
39
|
+
*/
|
|
40
|
+
export declare function getVerdictEmoji(verdict: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Get evidence data for a specific task.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getTaskEvidenceData(directory: string, taskId: string): Promise<TaskEvidenceData>;
|
|
45
|
+
/**
|
|
46
|
+
* Get list of all evidence bundles.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getEvidenceListData(directory: string): Promise<EvidenceListData>;
|
|
49
|
+
/**
|
|
50
|
+
* Format evidence list as markdown for command output.
|
|
51
|
+
*/
|
|
52
|
+
export declare function formatEvidenceListMarkdown(list: EvidenceListData): string;
|
|
53
|
+
/**
|
|
54
|
+
* Format task evidence as markdown for command output.
|
|
55
|
+
*/
|
|
56
|
+
export declare function formatTaskEvidenceMarkdown(evidence: TaskEvidenceData): string;
|
|
57
|
+
/**
|
|
58
|
+
* Handle evidence command - delegates to service and formats output.
|
|
59
|
+
* Kept for backward compatibility - thin adapter.
|
|
60
|
+
*/
|
|
61
|
+
export declare function handleEvidenceCommand(directory: string, args: string[]): Promise<string>;
|
|
62
|
+
/**
|
|
63
|
+
* Handle evidence summary command - generates completion ratio and blockers report.
|
|
64
|
+
*/
|
|
65
|
+
export declare function handleEvidenceSummaryCommand(directory: string): Promise<string>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evidence Summary Service
|
|
3
|
+
*
|
|
4
|
+
* Provides deterministic evidence aggregation per task and phase.
|
|
5
|
+
* Produces machine-readable and human-readable summary artifacts.
|
|
6
|
+
*/
|
|
7
|
+
import type { PhaseStatus, TaskStatus } from '../config/plan-schema';
|
|
8
|
+
/** Evidence types required for task completion */
|
|
9
|
+
export declare const REQUIRED_EVIDENCE_TYPES: readonly ["review", "test"];
|
|
10
|
+
export type RequiredEvidenceType = (typeof REQUIRED_EVIDENCE_TYPES)[number];
|
|
11
|
+
/** Summary artifact schema version */
|
|
12
|
+
export declare const EVIDENCE_SUMMARY_VERSION = "1.0.0";
|
|
13
|
+
/** Evidence summary for a single task */
|
|
14
|
+
export interface TaskEvidenceSummary {
|
|
15
|
+
taskId: string;
|
|
16
|
+
phase: number;
|
|
17
|
+
taskStatus: TaskStatus;
|
|
18
|
+
evidenceCount: number;
|
|
19
|
+
hasReview: boolean;
|
|
20
|
+
hasTest: boolean;
|
|
21
|
+
hasApproval: boolean;
|
|
22
|
+
missingEvidence: string[];
|
|
23
|
+
isComplete: boolean;
|
|
24
|
+
blockers: string[];
|
|
25
|
+
lastEvidenceTimestamp: string | null;
|
|
26
|
+
}
|
|
27
|
+
/** Phase evidence summary */
|
|
28
|
+
export interface PhaseEvidenceSummary {
|
|
29
|
+
phaseId: number;
|
|
30
|
+
phaseName: string;
|
|
31
|
+
phaseStatus: PhaseStatus;
|
|
32
|
+
totalTasks: number;
|
|
33
|
+
completedTasks: number;
|
|
34
|
+
tasksWithEvidence: number;
|
|
35
|
+
tasksWithCompleteEvidence: number;
|
|
36
|
+
completionRatio: number;
|
|
37
|
+
missingEvidenceByType: Record<string, string[]>;
|
|
38
|
+
blockers: PhaseBlocker[];
|
|
39
|
+
tasks: TaskEvidenceSummary[];
|
|
40
|
+
}
|
|
41
|
+
/** Blockers preventing phase closure */
|
|
42
|
+
export interface PhaseBlocker {
|
|
43
|
+
type: 'missing_evidence' | 'incomplete_task' | 'blocked_task';
|
|
44
|
+
taskId: string;
|
|
45
|
+
reason: string;
|
|
46
|
+
severity: 'high' | 'medium' | 'low';
|
|
47
|
+
}
|
|
48
|
+
/** Full evidence summary artifact */
|
|
49
|
+
export interface EvidenceSummaryArtifact {
|
|
50
|
+
schema_version: typeof EVIDENCE_SUMMARY_VERSION;
|
|
51
|
+
generated_at: string;
|
|
52
|
+
planTitle: string;
|
|
53
|
+
currentPhase: number;
|
|
54
|
+
phaseSummaries: PhaseEvidenceSummary[];
|
|
55
|
+
overallCompletionRatio: number;
|
|
56
|
+
overallBlockers: PhaseBlocker[];
|
|
57
|
+
summaryText: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Build complete evidence summary artifact
|
|
61
|
+
*
|
|
62
|
+
* Aggregates evidence per task and phase, producing deterministic
|
|
63
|
+
* summary artifacts including completion ratio, missing evidence,
|
|
64
|
+
* blockers, and per-task status.
|
|
65
|
+
*/
|
|
66
|
+
export declare function buildEvidenceSummary(directory: string, currentPhase?: number): Promise<EvidenceSummaryArtifact | null>;
|
|
67
|
+
/**
|
|
68
|
+
* Check if auto-summaries are enabled via feature flags
|
|
69
|
+
*/
|
|
70
|
+
export declare function isAutoSummaryEnabled(automationConfig?: {
|
|
71
|
+
capabilities?: {
|
|
72
|
+
evidence_auto_summaries?: boolean;
|
|
73
|
+
};
|
|
74
|
+
mode?: string;
|
|
75
|
+
}): boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured export data.
|
|
3
|
+
*/
|
|
4
|
+
export interface ExportData {
|
|
5
|
+
version: string;
|
|
6
|
+
exported: string;
|
|
7
|
+
plan: unknown;
|
|
8
|
+
context: string | null;
|
|
9
|
+
/** The plan's execution_profile, if set. Consumers must honour locked profiles. */
|
|
10
|
+
execution_profile?: {
|
|
11
|
+
parallelization_enabled: boolean;
|
|
12
|
+
max_concurrent_tasks: number;
|
|
13
|
+
council_parallel: boolean;
|
|
14
|
+
locked: boolean;
|
|
15
|
+
} | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get export data from the swarm directory.
|
|
19
|
+
* Returns structured data for GUI, background flows, or commands.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getExportData(directory: string): Promise<ExportData>;
|
|
22
|
+
/**
|
|
23
|
+
* Format export data as markdown with JSON code block for command output.
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatExportMarkdown(exportData: ExportData): string;
|
|
26
|
+
/**
|
|
27
|
+
* Handle export command - delegates to service and formats output.
|
|
28
|
+
* Kept for backward compatibility - thin adapter.
|
|
29
|
+
*/
|
|
30
|
+
export declare function handleExportCommand(directory: string, _args: string[]): Promise<string>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handoff Service
|
|
3
|
+
*
|
|
4
|
+
* Provides structured handoff data for agent transitions between swarm sessions.
|
|
5
|
+
* Reads from .swarm files to gather current state for context-efficient handoffs.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Pending QA state from agent sessions
|
|
9
|
+
*/
|
|
10
|
+
export interface PendingQA {
|
|
11
|
+
taskId: string;
|
|
12
|
+
lastFailure: string | null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Delegation chain entry
|
|
16
|
+
*/
|
|
17
|
+
export interface DelegationEntry {
|
|
18
|
+
from: string;
|
|
19
|
+
to: string;
|
|
20
|
+
taskId: string;
|
|
21
|
+
timestamp: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Delegation state from session snapshot
|
|
25
|
+
*/
|
|
26
|
+
export interface DelegationState {
|
|
27
|
+
activeChains: string[];
|
|
28
|
+
delegationDepth: number;
|
|
29
|
+
pendingHandoffs: string[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Structured handoff data for agent transitions
|
|
33
|
+
*/
|
|
34
|
+
export interface HandoffData {
|
|
35
|
+
/** ISO timestamp when data was generated */
|
|
36
|
+
generated: string;
|
|
37
|
+
/** Current phase number or name */
|
|
38
|
+
currentPhase: string | null;
|
|
39
|
+
/** Current task ID being worked on */
|
|
40
|
+
currentTask: string | null;
|
|
41
|
+
/** List of incomplete task IDs */
|
|
42
|
+
incompleteTasks: string[];
|
|
43
|
+
/** Pending QA state */
|
|
44
|
+
pendingQA: PendingQA | null;
|
|
45
|
+
/** Active agent name */
|
|
46
|
+
activeAgent: string | null;
|
|
47
|
+
/** Recent decisions from context.md */
|
|
48
|
+
recentDecisions: string[];
|
|
49
|
+
/** Delegation state */
|
|
50
|
+
delegationState: DelegationState | null;
|
|
51
|
+
/** Locked execution_profile for this plan, if set. Resuming sessions must honour it. */
|
|
52
|
+
execution_profile?: {
|
|
53
|
+
parallelization_enabled: boolean;
|
|
54
|
+
max_concurrent_tasks: number;
|
|
55
|
+
council_parallel: boolean;
|
|
56
|
+
locked: boolean;
|
|
57
|
+
} | null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get handoff data from the swarm directory.
|
|
61
|
+
* Reads session state, plan, and context to build comprehensive handoff info.
|
|
62
|
+
*/
|
|
63
|
+
export declare function getHandoffData(directory: string): Promise<HandoffData>;
|
|
64
|
+
/**
|
|
65
|
+
* Format handoff data as terse markdown for LLM consumption.
|
|
66
|
+
* Targets under 2K tokens for efficient context injection.
|
|
67
|
+
*/
|
|
68
|
+
export declare function formatHandoffMarkdown(data: HandoffData): string;
|
|
69
|
+
/**
|
|
70
|
+
* Format handoff data as a continuation prompt for new agent sessions.
|
|
71
|
+
* Returns a terse markdown code block with essential context and explicit
|
|
72
|
+
* resumption instructions. Designed to be copy-pasted into a new session.
|
|
73
|
+
*/
|
|
74
|
+
export declare function formatContinuationPrompt(data: HandoffData): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured history data for a single phase.
|
|
3
|
+
*/
|
|
4
|
+
export interface PhaseHistoryData {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
status: 'complete' | 'in_progress' | 'pending' | 'blocked' | 'closed';
|
|
8
|
+
statusText: string;
|
|
9
|
+
statusIcon: string;
|
|
10
|
+
completedTasks: number;
|
|
11
|
+
totalTasks: number;
|
|
12
|
+
tasksDisplay: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Structured history data returned by the history service.
|
|
16
|
+
*/
|
|
17
|
+
export interface HistoryData {
|
|
18
|
+
hasPlan: boolean;
|
|
19
|
+
phases: PhaseHistoryData[];
|
|
20
|
+
isLegacy: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get history data from the swarm directory.
|
|
24
|
+
* Returns structured data for GUI, background flows, or commands.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getHistoryData(directory: string): Promise<HistoryData>;
|
|
27
|
+
/**
|
|
28
|
+
* Format history data as markdown for command output.
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatHistoryMarkdown(history: HistoryData): string;
|
|
31
|
+
/**
|
|
32
|
+
* Handle history command - delegates to service and formats output.
|
|
33
|
+
* Kept for backward compatibility - thin adapter.
|
|
34
|
+
*/
|
|
35
|
+
export declare function handleHistoryCommand(directory: string, _args: string[]): Promise<string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { analyzeDecisionDrift, DEFAULT_DRIFT_CONFIG, type Decision, type DriftAnalysisResult, type DriftAnalyzerConfig, type DriftSeverity, type DriftSignal, extractDecisionsFromContext, findContradictions, formatDriftForContext, } from './decision-drift-analyzer';
|
|
2
|
+
export { applySafeAutoFixes, type ConfigBackup, type ConfigDoctorResult, type ConfigFinding, type ConfigFix, createConfigBackup, type FindingSeverity, getConfigPaths, runConfigDoctor, runConfigDoctorWithFixes, shouldRunOnStartup, writeBackupArtifact, writeDoctorArtifact, } from './config-doctor';
|
|
3
|
+
export { type BudgetState, type ContextBudgetConfig, type ContextBudgetReport, DEFAULT_CONTEXT_BUDGET_CONFIG, estimateTokens, formatBudgetWarning, getContextBudgetReport, getDefaultConfig, } from './context-budget-service';
|
|
4
|
+
export { type DiagnoseData, formatDiagnoseMarkdown, getDiagnoseData, type HealthCheck, handleDiagnoseCommand, } from './diagnose-service';
|
|
5
|
+
export { type EvidenceEntryData, type EvidenceListData, formatEvidenceListMarkdown, formatTaskEvidenceMarkdown, getEvidenceListData, getTaskEvidenceData, getVerdictEmoji, handleEvidenceCommand, type TaskEvidenceData, } from './evidence-service';
|
|
6
|
+
export { buildEvidenceSummary, EVIDENCE_SUMMARY_VERSION, type EvidenceSummaryArtifact, isAutoSummaryEnabled, type PhaseBlocker, type PhaseEvidenceSummary, REQUIRED_EVIDENCE_TYPES, type TaskEvidenceSummary, } from './evidence-summary-service';
|
|
7
|
+
export { type ExportData, formatExportMarkdown, getExportData, handleExportCommand, } from './export-service';
|
|
8
|
+
export { type DelegationState, formatHandoffMarkdown, getHandoffData, type HandoffData, type PendingQA, } from './handoff-service';
|
|
9
|
+
export { formatHistoryMarkdown, getHistoryData, type HistoryData, handleHistoryCommand, type PhaseHistoryData, } from './history-service';
|
|
10
|
+
export { formatPlanMarkdown, getPlanData, handlePlanCommand, type PlanData, } from './plan-service';
|
|
11
|
+
export { createPreflightIntegration, type PreflightIntegrationConfig, runManualPreflight, } from './preflight-integration';
|
|
12
|
+
export { formatPreflightMarkdown, handlePreflightCommand, type PreflightCheckResult, type PreflightCheckType, type PreflightConfig, type PreflightReport, runPreflight, } from './preflight-service';
|
|
13
|
+
export { formatStatusMarkdown, getStatusData, handleStatusCommand, type StatusData, } from './status-service';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured plan data for a specific phase or full plan.
|
|
3
|
+
*/
|
|
4
|
+
export interface PlanData {
|
|
5
|
+
hasPlan: boolean;
|
|
6
|
+
fullMarkdown: string;
|
|
7
|
+
requestedPhase: number | null;
|
|
8
|
+
phaseMarkdown: string | null;
|
|
9
|
+
errorMessage: string | null;
|
|
10
|
+
isLegacy: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get plan data from the swarm directory.
|
|
14
|
+
* Returns structured data for GUI, background flows, or commands.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getPlanData(directory: string, phaseArg?: string | number): Promise<PlanData>;
|
|
17
|
+
/**
|
|
18
|
+
* Format plan data as markdown for command output.
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatPlanMarkdown(planData: PlanData): string;
|
|
21
|
+
/**
|
|
22
|
+
* Handle plan command - delegates to service and formats output.
|
|
23
|
+
* Kept for backward compatibility - thin adapter.
|
|
24
|
+
*/
|
|
25
|
+
export declare function handlePlanCommand(directory: string, args: string[]): Promise<string>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preflight Background Integration
|
|
3
|
+
*
|
|
4
|
+
* Wires the preflight service to background automation:
|
|
5
|
+
* - Subscribes to preflight.requested events
|
|
6
|
+
* - Runs preflight checks
|
|
7
|
+
* - Updates status artifact with results
|
|
8
|
+
*/
|
|
9
|
+
import { PreflightTriggerManager } from '../background/trigger';
|
|
10
|
+
import type { AutomationConfig } from '../config/schema';
|
|
11
|
+
import { type PreflightConfig, type PreflightReport } from '../services/preflight-service';
|
|
12
|
+
/** Integration configuration */
|
|
13
|
+
export interface PreflightIntegrationConfig {
|
|
14
|
+
/** Automation configuration (required for capability gating) */
|
|
15
|
+
automationConfig: AutomationConfig;
|
|
16
|
+
/** Directory to run preflight in */
|
|
17
|
+
directory: string;
|
|
18
|
+
/** Swarm directory for status artifact */
|
|
19
|
+
swarmDir: string;
|
|
20
|
+
/** Preflight check configuration */
|
|
21
|
+
preflightConfig?: PreflightConfig;
|
|
22
|
+
/** Whether to update status artifact (default true) */
|
|
23
|
+
updateStatusArtifact?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create preflight integration
|
|
27
|
+
*
|
|
28
|
+
* Sets up the handler that will be called when preflight is requested.
|
|
29
|
+
* Returns the trigger manager and cleanup function.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createPreflightIntegration(config: PreflightIntegrationConfig): {
|
|
32
|
+
manager: PreflightTriggerManager;
|
|
33
|
+
cleanup: () => void;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Run preflight manually (for testing or CLI)
|
|
37
|
+
*/
|
|
38
|
+
export declare function runManualPreflight(directory: string, phase: number, config?: PreflightConfig): Promise<PreflightReport>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preflight Automation Service
|
|
3
|
+
*
|
|
4
|
+
* Runs automated preflight checks for release readiness:
|
|
5
|
+
* - lint check
|
|
6
|
+
* - tests check (sane verification scope)
|
|
7
|
+
* - secrets check
|
|
8
|
+
* - evidence completeness check
|
|
9
|
+
* - version consistency check
|
|
10
|
+
*
|
|
11
|
+
* Returns deterministic structured result with per-check status + overall verdict.
|
|
12
|
+
* Callable by background flow (from preflight.requested events).
|
|
13
|
+
*/
|
|
14
|
+
/** Preflight check types */
|
|
15
|
+
export type PreflightCheckType = 'lint' | 'tests' | 'secrets' | 'evidence' | 'version' | 'req_coverage';
|
|
16
|
+
/** Individual check status */
|
|
17
|
+
export interface PreflightCheckResult {
|
|
18
|
+
type: PreflightCheckType;
|
|
19
|
+
status: 'pass' | 'fail' | 'skip' | 'error';
|
|
20
|
+
message: string;
|
|
21
|
+
details?: Record<string, unknown>;
|
|
22
|
+
durationMs?: number;
|
|
23
|
+
}
|
|
24
|
+
/** Preflight report structure */
|
|
25
|
+
export interface PreflightReport {
|
|
26
|
+
id: string;
|
|
27
|
+
timestamp: number;
|
|
28
|
+
phase: number;
|
|
29
|
+
overall: 'pass' | 'fail' | 'skipped';
|
|
30
|
+
checks: PreflightCheckResult[];
|
|
31
|
+
totalDurationMs: number;
|
|
32
|
+
message: string;
|
|
33
|
+
}
|
|
34
|
+
/** Preflight configuration */
|
|
35
|
+
export interface PreflightConfig {
|
|
36
|
+
/** Timeout per check in ms (default 60s, min 5s, max 300s) */
|
|
37
|
+
checkTimeoutMs?: number;
|
|
38
|
+
/** Skip tests check (default false) */
|
|
39
|
+
skipTests?: boolean;
|
|
40
|
+
/** Skip secrets check (default false) */
|
|
41
|
+
skipSecrets?: boolean;
|
|
42
|
+
/** Skip evidence check (default false) */
|
|
43
|
+
skipEvidence?: boolean;
|
|
44
|
+
/** Skip version check (default false) */
|
|
45
|
+
skipVersion?: boolean;
|
|
46
|
+
/** Test scope (default 'convention' for faster preflight) */
|
|
47
|
+
testScope?: 'all' | 'convention' | 'graph';
|
|
48
|
+
/** Linter to use (default 'biome') */
|
|
49
|
+
linter?: 'biome' | 'eslint';
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Run all preflight checks
|
|
53
|
+
*/
|
|
54
|
+
export declare function runPreflight(dir: string, phase: number, config?: PreflightConfig): Promise<PreflightReport>;
|
|
55
|
+
/**
|
|
56
|
+
* Format preflight report as markdown
|
|
57
|
+
*/
|
|
58
|
+
export declare function formatPreflightMarkdown(report: PreflightReport): string;
|
|
59
|
+
/**
|
|
60
|
+
* Handle preflight command - thin adapter for CLI
|
|
61
|
+
*/
|
|
62
|
+
export declare function handlePreflightCommand(directory: string, _args: string[]): Promise<string>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run Memory Service
|
|
3
|
+
*
|
|
4
|
+
* Provides append-only per-task outcome logging for tracking task execution
|
|
5
|
+
* results across swarm sessions. Used to avoid repeating known failure patterns.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Represents a single task execution outcome entry
|
|
9
|
+
*/
|
|
10
|
+
export interface RunMemoryEntry {
|
|
11
|
+
/** ISO timestamp when the entry was recorded */
|
|
12
|
+
timestamp: string;
|
|
13
|
+
/** Plan.json task ID (e.g. "3.2") */
|
|
14
|
+
taskId: string;
|
|
15
|
+
/** SHA256 hash of taskId + sorted file targets, first 8 chars */
|
|
16
|
+
taskFingerprint: string;
|
|
17
|
+
/** Which agent executed the task (e.g. "coder") */
|
|
18
|
+
agent: string;
|
|
19
|
+
/** Outcome of the task execution */
|
|
20
|
+
outcome: 'pass' | 'fail' | 'retry' | 'skip';
|
|
21
|
+
/** 1-indexed attempt number */
|
|
22
|
+
attemptNumber: number;
|
|
23
|
+
/** One-line failure reason (only for fail/retry outcomes) */
|
|
24
|
+
failureReason?: string;
|
|
25
|
+
/** Files that were modified during this attempt */
|
|
26
|
+
filesModified?: string[];
|
|
27
|
+
/** Wall-clock time in milliseconds */
|
|
28
|
+
durationMs?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Generate a task fingerprint from taskId and file targets
|
|
32
|
+
*
|
|
33
|
+
* @param taskId - The task identifier
|
|
34
|
+
* @param fileTargets - Array of file paths that were targeted
|
|
35
|
+
* @returns First 8 characters of SHA256 hash
|
|
36
|
+
*/
|
|
37
|
+
export declare function generateTaskFingerprint(taskId: string, fileTargets: string[]): string;
|
|
38
|
+
/**
|
|
39
|
+
* Append a task outcome entry to the run memory log
|
|
40
|
+
*
|
|
41
|
+
* @param directory - The swarm workspace directory
|
|
42
|
+
* @param entry - The outcome entry to record
|
|
43
|
+
*/
|
|
44
|
+
export declare function recordOutcome(directory: string, entry: RunMemoryEntry): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Get all entries for a specific task ID
|
|
47
|
+
*
|
|
48
|
+
* @param directory - The swarm workspace directory
|
|
49
|
+
* @param taskId - The task identifier to filter by
|
|
50
|
+
* @returns Array of matching entries
|
|
51
|
+
*/
|
|
52
|
+
export declare function getTaskHistory(directory: string, taskId: string): Promise<RunMemoryEntry[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Get all failure and retry entries
|
|
55
|
+
*
|
|
56
|
+
* @param directory - The swarm workspace directory
|
|
57
|
+
* @returns Array of fail/retry entries
|
|
58
|
+
*/
|
|
59
|
+
export declare function getFailures(directory: string): Promise<RunMemoryEntry[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Generate a compact summary of task failures for context injection
|
|
62
|
+
*
|
|
63
|
+
* @param directory - The swarm workspace directory
|
|
64
|
+
* @returns Formatted summary string (≤500 tokens) or null if no failures
|
|
65
|
+
*/
|
|
66
|
+
export declare function getRunMemorySummary(directory: string): Promise<string | null>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AgentDefinition } from '../agents';
|
|
2
|
+
/**
|
|
3
|
+
* Structured status data returned by the status service.
|
|
4
|
+
* This can be used by GUI, background flows, or command adapters.
|
|
5
|
+
*/
|
|
6
|
+
export interface StatusData {
|
|
7
|
+
hasPlan: boolean;
|
|
8
|
+
currentPhase: string;
|
|
9
|
+
completedTasks: number;
|
|
10
|
+
totalTasks: number;
|
|
11
|
+
agentCount: number;
|
|
12
|
+
isLegacy: boolean;
|
|
13
|
+
turboMode: boolean;
|
|
14
|
+
/** Last known context budget percentage (0-100), or null if not yet measured */
|
|
15
|
+
contextBudgetPct: number | null;
|
|
16
|
+
/** Number of context compaction events triggered this session */
|
|
17
|
+
compactionCount: number;
|
|
18
|
+
/** ISO timestamp of last compaction snapshot, or null if none */
|
|
19
|
+
lastSnapshotAt: string | null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get status data from the swarm directory.
|
|
23
|
+
* Returns structured data that can be used by GUI, background flows, or commands.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getStatusData(directory: string, agents: Record<string, AgentDefinition>): Promise<StatusData>;
|
|
26
|
+
/**
|
|
27
|
+
* Format status data as markdown for command output.
|
|
28
|
+
* This is the thin adapter that delegates to the service.
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatStatusMarkdown(status: StatusData): string;
|
|
31
|
+
/**
|
|
32
|
+
* Handle status command - delegates to service and formats output.
|
|
33
|
+
* Kept for backward compatibility - thin adapter.
|
|
34
|
+
*/
|
|
35
|
+
export declare function handleStatusCommand(directory: string, agents: Record<string, AgentDefinition>): Promise<string>;
|