sinapse-ai 1.17.0 → 1.19.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/.claude/rules/documentation-first.md +6 -0
- package/.sinapse-ai/constitution.md +2 -2
- package/.sinapse-ai/core/code-intel/registry-syncer.js +5 -3
- package/.sinapse-ai/core/doctor/checks/agent-memory.js +7 -5
- package/.sinapse-ai/core/doctor/checks/claude-md.js +13 -0
- package/.sinapse-ai/core/doctor/checks/constitution-consistency.js +1 -0
- package/.sinapse-ai/core/doctor/checks/hooks-claude-count.js +11 -0
- package/.sinapse-ai/core/doctor/checks/settings-json.js +16 -2
- package/.sinapse-ai/core/doctor/index.js +27 -0
- package/.sinapse-ai/core/execution/build-orchestrator.js +192 -8
- package/.sinapse-ai/core/external-executors/delegate-cli.js +6 -2
- package/.sinapse-ai/core/health-check/checks/project/constitution-consistency.js +2 -1
- package/.sinapse-ai/core/ideation/ideation-engine.js +10 -8
- package/.sinapse-ai/core/mcp/config-migrator.js +8 -5
- package/.sinapse-ai/core/mcp/global-config-manager.js +4 -1
- package/.sinapse-ai/core/mcp/symlink-manager.js +6 -3
- package/.sinapse-ai/core/orchestration/bob-orchestrator.js +2 -4
- package/.sinapse-ai/core/orchestration/brownfield-handler.js +5 -4
- package/.sinapse-ai/core/orchestration/executors/epic-4-executor.js +45 -38
- package/.sinapse-ai/core/orchestration/gate-evaluator.js +104 -9
- package/.sinapse-ai/core/orchestration/greenfield-handler.js +14 -46
- package/.sinapse-ai/core/orchestration/index.js +0 -12
- package/.sinapse-ai/core/orchestration/master-orchestrator.js +60 -4
- package/.sinapse-ai/core/orchestration/session-state.js +19 -2
- package/.sinapse-ai/core/orchestration/workflow-executor.js +84 -127
- package/.sinapse-ai/core/quality-gates/focus-area-recommender.js +15 -11
- package/.sinapse-ai/core/registry/build-registry.js +3 -2
- package/.sinapse-ai/core/synapse/scripts/generate-constitution.js +1 -0
- package/.sinapse-ai/core/synapse/utils/atomic-write.js +34 -9
- package/.sinapse-ai/core-config.yaml +5 -1
- package/.sinapse-ai/data/capability-detection.js +3 -3
- package/.sinapse-ai/data/entity-registry.yaml +542 -601
- package/.sinapse-ai/data/mcp-discipline.js +1 -1
- package/.sinapse-ai/data/mcp-tool-examples.yaml +8 -8
- package/.sinapse-ai/data/tok2-validation.js +1 -1
- package/.sinapse-ai/data/tool-registry.yaml +4 -3
- package/.sinapse-ai/development/agents/project-lead/MEMORY.md +1 -1
- package/.sinapse-ai/development/agents/project-lead.md +9 -13
- package/.sinapse-ai/development/agents/snps-orqx.md +5 -5
- package/.sinapse-ai/development/scripts/migrate-task-to-v2.js +1 -1
- package/.sinapse-ai/development/scripts/validate-task-v2.js +67 -4
- package/.sinapse-ai/development/tasks/advanced-elicitation.md +3 -3
- package/.sinapse-ai/development/tasks/analyst-facilitate-brainstorming.md +3 -3
- package/.sinapse-ai/development/tasks/analyze-framework.md +1 -8
- package/.sinapse-ai/development/tasks/analyze-performance.md +1 -8
- package/.sinapse-ai/development/tasks/apply-qa-fixes.md +3 -3
- package/.sinapse-ai/development/tasks/architect-analyze-impact.md +3 -3
- package/.sinapse-ai/development/tasks/audit-codebase.md +1 -8
- package/.sinapse-ai/development/tasks/audit-tailwind-config.md +1 -4
- package/.sinapse-ai/development/tasks/audit-utilities.md +1 -8
- package/.sinapse-ai/development/tasks/bootstrap-shadcn-library.md +3 -3
- package/.sinapse-ai/development/tasks/brownfield-create-epic.md +3 -3
- package/.sinapse-ai/development/tasks/brownfield-create-story.md +3 -3
- package/.sinapse-ai/development/tasks/build-component.md +2 -5
- package/.sinapse-ai/development/tasks/calculate-roi.md +3 -3
- package/.sinapse-ai/development/tasks/ci-cd-configuration.md +1 -1
- package/.sinapse-ai/development/tasks/cleanup-utilities.md +3 -3
- package/.sinapse-ai/development/tasks/collaborative-edit.md +3 -3
- package/.sinapse-ai/development/tasks/compose-molecule.md +2 -5
- package/.sinapse-ai/development/tasks/consolidate-patterns.md +3 -3
- package/.sinapse-ai/development/tasks/correct-course.md +3 -3
- package/.sinapse-ai/development/tasks/create-brownfield-story.md +2 -5
- package/.sinapse-ai/development/tasks/create-deep-research-prompt.md +2 -5
- package/.sinapse-ai/development/tasks/create-doc.md +2 -5
- package/.sinapse-ai/development/tasks/create-next-story.md +2 -5
- package/.sinapse-ai/development/tasks/create-suite.md +2 -5
- package/.sinapse-ai/development/tasks/create-task.md +2 -5
- package/.sinapse-ai/development/tasks/create-workflow.md +2 -5
- package/.sinapse-ai/development/tasks/db-analyze-hotpaths.md +1 -8
- package/.sinapse-ai/development/tasks/db-apply-migration.md +1 -8
- package/.sinapse-ai/development/tasks/db-bootstrap.md +1 -8
- package/.sinapse-ai/development/tasks/db-domain-modeling.md +1 -8
- package/.sinapse-ai/development/tasks/db-dry-run.md +1 -8
- package/.sinapse-ai/development/tasks/db-env-check.md +1 -8
- package/.sinapse-ai/development/tasks/db-explain.md +1 -8
- package/.sinapse-ai/development/tasks/db-impersonate.md +1 -8
- package/.sinapse-ai/development/tasks/db-load-csv.md +1 -8
- package/.sinapse-ai/development/tasks/db-policy-apply.md +1 -8
- package/.sinapse-ai/development/tasks/db-rls-audit.md +1 -8
- package/.sinapse-ai/development/tasks/db-rollback.md +1 -8
- package/.sinapse-ai/development/tasks/db-run-sql.md +1 -8
- package/.sinapse-ai/development/tasks/db-schema-audit.md +1 -8
- package/.sinapse-ai/development/tasks/db-seed.md +1 -8
- package/.sinapse-ai/development/tasks/db-smoke-test.md +1 -8
- package/.sinapse-ai/development/tasks/db-snapshot.md +1 -8
- package/.sinapse-ai/development/tasks/db-squad-integration.md +1 -8
- package/.sinapse-ai/development/tasks/db-supabase-setup.md +1 -8
- package/.sinapse-ai/development/tasks/db-verify-order.md +1 -8
- package/.sinapse-ai/development/tasks/deprecate-component.md +3 -3
- package/.sinapse-ai/development/tasks/dev-apply-qa-fixes.md +3 -3
- package/.sinapse-ai/development/tasks/dev-backlog-debt.md +3 -3
- package/.sinapse-ai/development/tasks/dev-develop-story.md +1 -1
- package/.sinapse-ai/development/tasks/dev-improve-code-quality.md +3 -3
- package/.sinapse-ai/development/tasks/dev-optimize-performance.md +3 -3
- package/.sinapse-ai/development/tasks/dev-suggest-refactoring.md +3 -3
- package/.sinapse-ai/development/tasks/dev-validate-next-story.md +3 -3
- package/.sinapse-ai/development/tasks/document-project.md +3 -3
- package/.sinapse-ai/development/tasks/environment-bootstrap.md +0 -4
- package/.sinapse-ai/development/tasks/execute-checklist.md +3 -3
- package/.sinapse-ai/development/tasks/export-design-tokens-dtcg.md +3 -3
- package/.sinapse-ai/development/tasks/extend-pattern.md +1 -8
- package/.sinapse-ai/development/tasks/extract-tokens.md +3 -3
- package/.sinapse-ai/development/tasks/facilitate-brainstorming-session.md +1 -1
- package/.sinapse-ai/development/tasks/generate-ai-frontend-prompt.md +2 -5
- package/.sinapse-ai/development/tasks/generate-documentation.md +2 -5
- package/.sinapse-ai/development/tasks/generate-migration-strategy.md +2 -5
- package/.sinapse-ai/development/tasks/generate-shock-report.md +2 -5
- package/.sinapse-ai/development/tasks/github-devops-github-pr-automation.md +3 -3
- package/.sinapse-ai/development/tasks/github-devops-repository-cleanup.md +3 -3
- package/.sinapse-ai/development/tasks/github-devops-version-management.md +3 -3
- package/.sinapse-ai/development/tasks/improve-self.md +1 -16
- package/.sinapse-ai/development/tasks/index-docs.md +1 -4
- package/.sinapse-ai/development/tasks/init-project-status.md +1 -7
- package/.sinapse-ai/development/tasks/integrate-squad.md +3 -3
- package/.sinapse-ai/development/tasks/kb-mode-interaction.md +3 -3
- package/.sinapse-ai/development/tasks/learn-patterns.md +3 -3
- package/.sinapse-ai/development/tasks/modify-agent.md +1 -8
- package/.sinapse-ai/development/tasks/modify-task.md +1 -8
- package/.sinapse-ai/development/tasks/modify-workflow.md +1 -8
- package/.sinapse-ai/development/tasks/po-backlog-add.md +3 -3
- package/.sinapse-ai/development/tasks/po-manage-story-backlog.md +3 -3
- package/.sinapse-ai/development/tasks/po-pull-story-from-clickup.md +3 -3
- package/.sinapse-ai/development/tasks/po-pull-story.md +3 -3
- package/.sinapse-ai/development/tasks/po-stories-index.md +3 -3
- package/.sinapse-ai/development/tasks/po-sync-story-to-clickup.md +3 -3
- package/.sinapse-ai/development/tasks/po-sync-story.md +3 -3
- package/.sinapse-ai/development/tasks/pr-automation.md +1 -1
- package/.sinapse-ai/development/tasks/propose-modification.md +3 -3
- package/.sinapse-ai/development/tasks/push-and-pr.md +1 -1
- package/.sinapse-ai/development/tasks/qa-backlog-add-followup.md +1 -8
- package/.sinapse-ai/development/tasks/qa-create-fix-request.md +1 -4
- package/.sinapse-ai/development/tasks/qa-gate.md +1 -8
- package/.sinapse-ai/development/tasks/qa-generate-tests.md +1 -8
- package/.sinapse-ai/development/tasks/qa-nfr-assess.md +1 -8
- package/.sinapse-ai/development/tasks/qa-review-proposal.md +1 -8
- package/.sinapse-ai/development/tasks/qa-review-story.md +1 -8
- package/.sinapse-ai/development/tasks/qa-risk-profile.md +1 -8
- package/.sinapse-ai/development/tasks/qa-run-tests.md +1 -8
- package/.sinapse-ai/development/tasks/qa-test-design.md +1 -8
- package/.sinapse-ai/development/tasks/qa-trace-requirements.md +1 -8
- package/.sinapse-ai/development/tasks/release-management.md +1 -1
- package/.sinapse-ai/development/tasks/security-audit.md +1 -4
- package/.sinapse-ai/development/tasks/security-scan.md +1 -4
- package/.sinapse-ai/development/tasks/setup-database.md +2 -11
- package/.sinapse-ai/development/tasks/setup-design-system.md +2 -11
- package/.sinapse-ai/development/tasks/shard-doc.md +3 -3
- package/.sinapse-ai/development/tasks/sm-create-next-story.md +3 -3
- package/.sinapse-ai/development/tasks/sync-documentation.md +1 -6
- package/.sinapse-ai/development/tasks/tailwind-upgrade.md +3 -3
- package/.sinapse-ai/development/tasks/test-as-user.md +3 -3
- package/.sinapse-ai/development/tasks/undo-last.md +2 -5
- package/.sinapse-ai/development/tasks/update-manifest.md +1 -8
- package/.sinapse-ai/development/tasks/ux-create-wireframe.md +1 -1
- package/.sinapse-ai/development/tasks/ux-ds-scan-artifact.md +3 -3
- package/.sinapse-ai/development/tasks/ux-user-research.md +3 -3
- package/.sinapse-ai/development/tasks/validate-next-story.md +1 -8
- package/.sinapse-ai/development/templates/chrome-brain/scripts/chrome-ensure.cjs +1 -1
- package/.sinapse-ai/development/workflows/development-cycle.yaml +1 -12
- package/.sinapse-ai/git-hooks/post-commit +0 -0
- package/.sinapse-ai/git-hooks/pre-commit +0 -0
- package/.sinapse-ai/git-hooks/pre-push +0 -0
- package/.sinapse-ai/infrastructure/scripts/changelog-generator.js +5 -1
- package/.sinapse-ai/infrastructure/scripts/pattern-extractor.js +11 -2
- package/.sinapse-ai/infrastructure/scripts/test-utilities.js +34 -13
- package/.sinapse-ai/infrastructure/scripts/usage-analytics.js +9 -5
- package/.sinapse-ai/infrastructure/scripts/validate-claude-integration.js +10 -2
- package/.sinapse-ai/install-manifest.yaml +326 -334
- package/.sinapse-ai/lib/build.json +1 -0
- package/.sinapse-ai/product/templates/personalized-task-template-v2.md +4 -2
- package/.sinapse-ai/product/templates/statusline/statusline-script.js +7 -3
- package/CHANGELOG.md +108 -43
- package/README.en.md +5 -5
- package/README.md +5 -5
- package/bin/cli.js +1 -1
- package/bin/commands/install.js +288 -114
- package/bin/commands/local.js +11 -0
- package/bin/lib/command-generator.js +31 -2
- package/docs/README.md +1 -1
- package/docs/agent-reference-guide.md +1 -1
- package/docs/community/README-community-snippet-core.md +1 -1
- package/docs/community/README-community-snippet-mcp.md +1 -1
- package/docs/community/README-community-snippet-squads.md +1 -1
- package/docs/examples/quickstart-recording.md +1 -1
- package/docs/framework/README.md +1 -1
- package/docs/framework/architecture-overview.md +1 -0
- package/docs/framework/coding-standards.md +1 -1
- package/docs/framework/core-architecture.md +1 -1
- package/docs/framework/guiding-principles.md +1 -1
- package/docs/framework/source-tree.md +1 -1
- package/docs/framework/tech-stack.md +1 -1
- package/docs/framework/versioning-and-releases.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/guides/agent-reference.md +1 -1
- package/docs/guides/agent-selection-guide.md +1 -1
- package/docs/guides/api-reference.md +1 -1
- package/docs/guides/contextual-greeting-system-guide.md +1 -1
- package/docs/guides/contributing-squads.md +1 -1
- package/docs/guides/development-setup.md +1 -1
- package/docs/guides/git-workflow-guide.md +1 -1
- package/docs/guides/installation-troubleshooting.md +1 -1
- package/docs/guides/llm-routing.md +1 -1
- package/docs/guides/mcp-global-setup.md +1 -1
- package/docs/guides/meta-agent-commands.md +1 -1
- package/docs/guides/project-status-feature.md +1 -1
- package/docs/guides/quality-dashboard.md +1 -1
- package/docs/guides/quality-gates.md +1 -1
- package/docs/guides/security-hardening.md +1 -1
- package/docs/guides/service-discovery.md +19 -22
- package/docs/guides/squad-examples/README.md +1 -1
- package/docs/guides/squad-migration.md +1 -1
- package/docs/guides/squads-guide.md +1 -1
- package/docs/guides/squads-overview.md +10 -13
- package/docs/guides/template-engine-v2.md +1 -1
- package/docs/guides/testing-guide.md +1 -1
- package/docs/guides/user-guide.md +30 -26
- package/docs/installation/README.md +3 -3
- package/docs/installation/faq.md +1 -1
- package/docs/installation/linux.md +2 -2
- package/docs/installation/macos.md +1 -1
- package/docs/installation/npx-install.md +1 -1
- package/docs/installation/troubleshooting.md +1 -1
- package/docs/installation/uninstallation.md +1 -1
- package/docs/installation/v4-quick-start.md +1 -1
- package/docs/installation/windows.md +2 -2
- package/docs/pt/CHANGELOG.md +1 -1
- package/docs/pt/DOCUMENTATION-ROADMAP.md +1 -1
- package/docs/pt/ENVIRONMENT.md +1 -1
- package/docs/pt/FEATURE_PROCESS.md +2 -2
- package/docs/pt/GUIDING-PRINCIPLES.md +2 -2
- package/docs/pt/agent-reference-guide.md +3 -3
- package/docs/pt/architecture/ARCHITECTURE-INDEX.md +2 -2
- package/docs/pt/architecture/ade-architecture.md +1 -1
- package/docs/pt/architecture/agent-config-audit.md +1 -1
- package/docs/pt/architecture/agent-responsibility-matrix.md +1 -1
- package/docs/pt/architecture/agent-tool-integration-guide.md +1 -1
- package/docs/pt/architecture/ci-cd.md +1 -1
- package/docs/pt/architecture/coding-standards.md +1 -1
- package/docs/pt/architecture/contribution-workflow-research.md +1 -1
- package/docs/pt/architecture/dashboard-architecture.md +1 -1
- package/docs/pt/architecture/dashboard-realtime.md +1 -1
- package/docs/pt/architecture/hcs-check-specifications.md +1 -1
- package/docs/pt/architecture/hcs-execution-modes.md +1 -1
- package/docs/pt/architecture/hcs-self-healing-spec.md +1 -1
- package/docs/pt/architecture/high-level-architecture.md +1 -1
- package/docs/pt/architecture/introduction.md +1 -1
- package/docs/pt/architecture/mcp-api-keys-management.md +3 -3
- package/docs/pt/architecture/mcp-system-diagrams.md +1 -1
- package/docs/pt/architecture/module-system.md +4 -4
- package/docs/pt/architecture/multi-repo-strategy.md +2 -2
- package/docs/pt/architecture/source-tree.md +1 -1
- package/docs/pt/architecture/squad-improvement-analysis.md +1 -1
- package/docs/pt/architecture/squad-improvement-recommended-approach.md +1 -1
- package/docs/pt/architecture/tech-stack.md +1 -1
- package/docs/pt/architecture/utility-integration-guide.md +1 -1
- package/docs/pt/code-of-conduct.md +1 -1
- package/docs/pt/community/README-community-snippet-core.md +1 -1
- package/docs/pt/community/README-community-snippet-mcp.md +2 -2
- package/docs/pt/contributing.md +7 -7
- package/docs/pt/core-architecture.md +1 -1
- package/docs/pt/docker-mcp-setup.md +1 -1
- package/docs/pt/framework/README.md +1 -1
- package/docs/pt/framework/coding-standards.md +1 -1
- package/docs/pt/framework/source-tree.md +1 -1
- package/docs/pt/framework/tech-stack.md +1 -1
- package/docs/pt/getting-started.md +1 -1
- package/docs/pt/git-workflow-guide.md +1 -1
- package/docs/pt/guides/README.md +3 -3
- package/docs/pt/guides/agent-selection-guide.md +2 -2
- package/docs/pt/guides/api-reference.md +1 -1
- package/docs/pt/guides/contextual-greeting-system-guide.md +1 -1
- package/docs/pt/guides/contributing-squads.md +1 -1
- package/docs/pt/guides/development-setup.md +1 -1
- package/docs/pt/guides/installation-troubleshooting.md +1 -1
- package/docs/pt/guides/llm-routing.md +1 -1
- package/docs/pt/guides/mcp/desktop-commander.md +1 -1
- package/docs/pt/guides/mcp/docker-gateway-tutorial.md +1 -1
- package/docs/pt/guides/mcp-global-setup.md +1 -1
- package/docs/pt/guides/project-status-feature.md +1 -1
- package/docs/pt/guides/quality-dashboard.md +1 -1
- package/docs/pt/guides/quality-gates.md +1 -1
- package/docs/pt/guides/security-hardening.md +2 -2
- package/docs/pt/guides/service-discovery.md +19 -22
- package/docs/pt/guides/squad-examples/README.md +1 -1
- package/docs/pt/guides/squad-migration.md +1 -1
- package/docs/pt/guides/squads-guide.md +1 -1
- package/docs/pt/guides/squads-overview.md +11 -13
- package/docs/pt/guides/template-engine-v2.md +1 -1
- package/docs/pt/guides/testing-guide.md +3 -3
- package/docs/pt/guides/user-guide.md +30 -26
- package/docs/pt/guides/workflows-guide.md +1 -1
- package/docs/pt/how-to-contribute-with-pull-requests.md +1 -1
- package/docs/pt/ide-integration.md +2 -2
- package/docs/pt/installation/README.md +1 -1
- package/docs/pt/installation/faq.md +1 -1
- package/docs/pt/installation/linux.md +1 -1
- package/docs/pt/installation/macos.md +1 -1
- package/docs/pt/installation/troubleshooting.md +1 -1
- package/docs/pt/installation/v4-quick-start.md +1 -1
- package/docs/pt/installation/windows.md +1 -1
- package/docs/pt/meta-agent-commands.md +1 -1
- package/docs/pt/migration-guide.md +1 -1
- package/docs/pt/npx-install.md +1 -1
- package/docs/pt/performance-tuning-guide.md +1 -1
- package/docs/pt/platforms/claude-code.md +2 -2
- package/docs/pt/roadmap.md +2 -2
- package/docs/pt/security-best-practices.md +2 -2
- package/docs/pt/security.md +1 -1
- package/docs/pt/sinapse-nomenclature-specification.md +1 -1
- package/docs/pt/troubleshooting.md +1 -1
- package/docs/pt/uninstallation.md +1 -1
- package/docs/pt/versioning-and-releases.md +1 -1
- package/docs/security/overview.md +1 -1
- package/docs/security/security-best-practices.md +2 -2
- package/docs/sinapse-workflows/README.md +1 -1
- package/package.json +2 -1
- package/packages/installer/package.json +1 -0
- package/packages/installer/src/wizard/feedback.js +18 -2
- package/packages/installer/src/wizard/i18n.js +78 -0
- package/packages/installer/src/wizard/ide-config-generator.js +8 -9
- package/packages/installer/src/wizard/index.js +16 -16
- package/packages/installer/src/wizard/validation/report-generator.js +22 -21
- package/packages/installer/src/wizard/validation/troubleshooting-system.js +19 -13
- package/scripts/gen-agent-badges.js +1 -1
- package/scripts/package-synapse.js +14 -5
- package/scripts/prepare-hooks.js +19 -0
- package/scripts/validate-agent-codenames.js +174 -0
- package/scripts/validate-all.js +1 -0
- package/sinapse/agents/sinapse-orqx.md +5 -5
- package/sinapse/agents/snps-orqx.md +5 -5
- package/squads/squad-brand/agents/brand-creative-engineer.md +5 -5
- package/squads/squad-brand/squad.yaml +6 -6
- package/squads/squad-content/agents/content-engineer.md +7 -7
- package/squads/squad-content/squad.yaml +5 -5
- package/squads/squad-courses/agents/production-director.md +5 -5
- package/squads/squad-courses/squad.yaml +1 -1
- package/.sinapse-ai/core/orchestration/terminal-spawner.js +0 -1044
- package/.sinapse-ai/scripts/pm.sh +0 -466
|
@@ -23,9 +23,8 @@ const fsSync = require('fs');
|
|
|
23
23
|
const path = require('path');
|
|
24
24
|
const yaml = require('js-yaml');
|
|
25
25
|
|
|
26
|
-
// Import dependencies from Story 11.1
|
|
26
|
+
// Import dependencies from Story 11.1 and 11.5
|
|
27
27
|
const ExecutorAssignment = require('./executor-assignment');
|
|
28
|
-
const TerminalSpawner = require('./terminal-spawner');
|
|
29
28
|
const { SessionState, ActionType } = require('./session-state');
|
|
30
29
|
|
|
31
30
|
// IDS Gate Wiring: GateEvaluator wires the IDS verification gates into the
|
|
@@ -190,25 +189,6 @@ class WorkflowExecutor {
|
|
|
190
189
|
}
|
|
191
190
|
}
|
|
192
191
|
|
|
193
|
-
/**
|
|
194
|
-
* Emits terminal spawn to all registered callbacks (Story 12.6)
|
|
195
|
-
* @param {string} agent - Agent ID
|
|
196
|
-
* @param {number} pid - Process ID
|
|
197
|
-
* @param {string} task - Task being executed
|
|
198
|
-
* @private
|
|
199
|
-
*/
|
|
200
|
-
_emitTerminalSpawn(agent, pid, task) {
|
|
201
|
-
for (const callback of this._terminalSpawnCallbacks) {
|
|
202
|
-
try {
|
|
203
|
-
callback(agent, pid, task);
|
|
204
|
-
} catch (error) {
|
|
205
|
-
if (this.options.debug) {
|
|
206
|
-
console.log(`[WorkflowExecutor] Terminal spawn callback error: ${error.message}`);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
192
|
/**
|
|
213
193
|
* Loads the workflow definition
|
|
214
194
|
* @returns {Promise<Object>} Workflow definition
|
|
@@ -450,6 +430,82 @@ class WorkflowExecutor {
|
|
|
450
430
|
};
|
|
451
431
|
}
|
|
452
432
|
|
|
433
|
+
/**
|
|
434
|
+
* Loads and validates an arbitrary workflow definition by path and returns it
|
|
435
|
+
* as a structured handoff for the agent-driven steps it describes.
|
|
436
|
+
*
|
|
437
|
+
* This is the GENERIC counterpart to {@link WorkflowExecutor#execute}, which is
|
|
438
|
+
* specialized for the development-cycle (it reads story metadata and runs the
|
|
439
|
+
* six hardcoded dev-cycle phases in-process). Handlers that drive multi-agent
|
|
440
|
+
* workflows — e.g. the brownfield/greenfield handlers running
|
|
441
|
+
* brownfield-discovery.yaml — use this entry point; the per-step work is then
|
|
442
|
+
* carried out by the spawned agents the workflow assigns (orchestrate-then-handoff).
|
|
443
|
+
*
|
|
444
|
+
* Validation is REAL: a missing path, a missing file, malformed YAML, or an
|
|
445
|
+
* empty definition each surface as an honest `{ success: false, error }`. The
|
|
446
|
+
* method never fabricates step output.
|
|
447
|
+
*
|
|
448
|
+
* @param {string} workflowPath - Absolute path to the workflow YAML
|
|
449
|
+
* @param {Object} [options] - Execution context
|
|
450
|
+
* @param {string} [options.projectRoot] - Project root (defaults to this.projectRoot)
|
|
451
|
+
* @param {Object} [options.techStack] - Detected tech stack threaded into the returned context
|
|
452
|
+
* @returns {Promise<Object>} `{ success, workflowPath, workflow, steps, context }`
|
|
453
|
+
* on success, or `{ success: false, error }` on a validation failure.
|
|
454
|
+
*/
|
|
455
|
+
async executeWorkflow(workflowPath, options = {}) {
|
|
456
|
+
if (!workflowPath || typeof workflowPath !== 'string') {
|
|
457
|
+
return { success: false, error: 'workflowPath is required and must be a string' };
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
if (!fsSync.existsSync(workflowPath)) {
|
|
461
|
+
return { success: false, error: `Workflow file not found: ${workflowPath}` };
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
let definition;
|
|
465
|
+
try {
|
|
466
|
+
const content = await fs.readFile(workflowPath, 'utf8');
|
|
467
|
+
definition = yaml.load(content);
|
|
468
|
+
} catch (error) {
|
|
469
|
+
return { success: false, error: `Failed to parse workflow ${workflowPath}: ${error.message}` };
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
const workflow = definition && definition.workflow ? definition.workflow : definition;
|
|
473
|
+
if (!workflow || typeof workflow !== 'object') {
|
|
474
|
+
return { success: false, error: `Workflow definition is empty: ${workflowPath}` };
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
return {
|
|
478
|
+
success: true,
|
|
479
|
+
workflowPath,
|
|
480
|
+
workflow,
|
|
481
|
+
steps: WorkflowExecutor._extractStepIds(workflow),
|
|
482
|
+
context: {
|
|
483
|
+
projectRoot: options.projectRoot || this.projectRoot,
|
|
484
|
+
techStack: options.techStack || {},
|
|
485
|
+
},
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Extracts ordered step identifiers from a workflow definition that may model
|
|
491
|
+
* its steps as a `sequence` list (brownfield/greenfield workflows) or a
|
|
492
|
+
* `phases` object map (development-cycle).
|
|
493
|
+
* @param {Object} workflow - The `workflow` node of a parsed definition
|
|
494
|
+
* @returns {string[]} Ordered step identifiers (empty array when none declared)
|
|
495
|
+
* @private
|
|
496
|
+
*/
|
|
497
|
+
static _extractStepIds(workflow) {
|
|
498
|
+
if (workflow && Array.isArray(workflow.sequence)) {
|
|
499
|
+
return workflow.sequence.map(
|
|
500
|
+
(step, index) => (step && (step.step || step.id || step.name)) || `step_${index + 1}`,
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
if (workflow && workflow.phases && typeof workflow.phases === 'object') {
|
|
504
|
+
return Object.keys(workflow.phases);
|
|
505
|
+
}
|
|
506
|
+
return [];
|
|
507
|
+
}
|
|
508
|
+
|
|
453
509
|
/**
|
|
454
510
|
* Executes a single workflow phase
|
|
455
511
|
* @param {string} phaseId - Phase identifier
|
|
@@ -640,39 +696,8 @@ class WorkflowExecutor {
|
|
|
640
696
|
}
|
|
641
697
|
}
|
|
642
698
|
|
|
643
|
-
//
|
|
644
|
-
|
|
645
|
-
const context = {
|
|
646
|
-
story: storyPath,
|
|
647
|
-
files: [],
|
|
648
|
-
instructions: `Execute *develop for story: ${storyPath}`,
|
|
649
|
-
metadata: this.state.accumulatedContext,
|
|
650
|
-
};
|
|
651
|
-
|
|
652
|
-
const result = await TerminalSpawner.spawnAgent(agent.replace('@', ''), 'develop', {
|
|
653
|
-
context,
|
|
654
|
-
timeout: DEFAULT_TIMEOUT_MS,
|
|
655
|
-
debug: this.options.debug,
|
|
656
|
-
});
|
|
657
|
-
|
|
658
|
-
// Story 12.6: Emit terminal spawn for observability (AC1)
|
|
659
|
-
if (result.pid) {
|
|
660
|
-
this._emitTerminalSpawn(agent, result.pid, 'development');
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
return {
|
|
664
|
-
status: result.success ? PhaseStatus.COMPLETED : PhaseStatus.FAILED,
|
|
665
|
-
implementation: {
|
|
666
|
-
files_created: [],
|
|
667
|
-
files_modified: [],
|
|
668
|
-
tests_added: [],
|
|
669
|
-
},
|
|
670
|
-
output: result.output,
|
|
671
|
-
outputFile: result.outputFile,
|
|
672
|
-
};
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
// Fallback: Return pending for manual execution
|
|
699
|
+
// Honest fallback: the dev cycle does not invoke the agent in-process here;
|
|
700
|
+
// execution is handed off (manual) rather than fabricated by a stub.
|
|
676
701
|
return {
|
|
677
702
|
status: PhaseStatus.COMPLETED,
|
|
678
703
|
implementation: {
|
|
@@ -680,7 +705,7 @@ class WorkflowExecutor {
|
|
|
680
705
|
files_modified: [],
|
|
681
706
|
tests_added: [],
|
|
682
707
|
},
|
|
683
|
-
note: '
|
|
708
|
+
note: 'Manual execution required',
|
|
684
709
|
};
|
|
685
710
|
} catch (error) {
|
|
686
711
|
return {
|
|
@@ -957,42 +982,7 @@ class WorkflowExecutor {
|
|
|
957
982
|
// Story 12.6: Emit agent spawn for observability (AC1)
|
|
958
983
|
this._emitAgentSpawn(agent, 'quality_gate');
|
|
959
984
|
|
|
960
|
-
//
|
|
961
|
-
if (phase.spawn_in_terminal && TerminalSpawner.isSpawnerAvailable()) {
|
|
962
|
-
const context = {
|
|
963
|
-
story: storyPath,
|
|
964
|
-
files: [],
|
|
965
|
-
instructions: `Execute quality review for story: ${storyPath}`,
|
|
966
|
-
metadata: {
|
|
967
|
-
executor: this.state.executor,
|
|
968
|
-
implementation: this.state.phaseResults['2_development']?.implementation,
|
|
969
|
-
},
|
|
970
|
-
};
|
|
971
|
-
|
|
972
|
-
const result = await TerminalSpawner.spawnAgent(agent.replace('@', ''), 'quality-review', {
|
|
973
|
-
context,
|
|
974
|
-
timeout: DEFAULT_TIMEOUT_MS / 4, // 30 minutes
|
|
975
|
-
debug: this.options.debug,
|
|
976
|
-
});
|
|
977
|
-
|
|
978
|
-
// Story 12.6: Emit terminal spawn for observability (AC1)
|
|
979
|
-
if (result.pid) {
|
|
980
|
-
this._emitTerminalSpawn(agent, result.pid, 'quality_gate');
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
return {
|
|
984
|
-
status: result.success ? PhaseStatus.COMPLETED : PhaseStatus.FAILED,
|
|
985
|
-
review_result: {
|
|
986
|
-
verdict: result.success ? 'APPROVED' : 'NEEDS_WORK',
|
|
987
|
-
score: result.success ? 90 : 60,
|
|
988
|
-
findings: [],
|
|
989
|
-
recommendations: [],
|
|
990
|
-
},
|
|
991
|
-
output: result.output,
|
|
992
|
-
};
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
// Fallback
|
|
985
|
+
// Honest fallback: the review is handed off (manual) rather than fabricated by a stub.
|
|
996
986
|
return {
|
|
997
987
|
status: PhaseStatus.COMPLETED,
|
|
998
988
|
review_result: {
|
|
@@ -1001,7 +991,7 @@ class WorkflowExecutor {
|
|
|
1001
991
|
findings: [],
|
|
1002
992
|
recommendations: [],
|
|
1003
993
|
},
|
|
1004
|
-
note: '
|
|
994
|
+
note: 'Manual review required',
|
|
1005
995
|
};
|
|
1006
996
|
} catch (error) {
|
|
1007
997
|
return {
|
|
@@ -1027,40 +1017,7 @@ class WorkflowExecutor {
|
|
|
1027
1017
|
// Story 12.6: Emit agent spawn for observability (AC1)
|
|
1028
1018
|
this._emitAgentSpawn(agent, 'push');
|
|
1029
1019
|
|
|
1030
|
-
//
|
|
1031
|
-
if (phase.spawn_in_terminal && TerminalSpawner.isSpawnerAvailable()) {
|
|
1032
|
-
const context = {
|
|
1033
|
-
story: storyPath,
|
|
1034
|
-
files: [],
|
|
1035
|
-
instructions: `Execute *pre-push and *push for story: ${storyPath}`,
|
|
1036
|
-
metadata: {
|
|
1037
|
-
review_result: this.state.phaseResults['4_quality_gate']?.review_result,
|
|
1038
|
-
},
|
|
1039
|
-
};
|
|
1040
|
-
|
|
1041
|
-
const result = await TerminalSpawner.spawnAgent(agent.replace('@', ''), 'push-and-pr', {
|
|
1042
|
-
context,
|
|
1043
|
-
timeout: DEFAULT_TIMEOUT_MS / 12, // 10 minutes
|
|
1044
|
-
debug: this.options.debug,
|
|
1045
|
-
});
|
|
1046
|
-
|
|
1047
|
-
// Story 12.6: Emit terminal spawn for observability (AC1)
|
|
1048
|
-
if (result.pid) {
|
|
1049
|
-
this._emitTerminalSpawn(agent, result.pid, 'push');
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
return {
|
|
1053
|
-
status: result.success ? PhaseStatus.COMPLETED : PhaseStatus.FAILED,
|
|
1054
|
-
push_result: {
|
|
1055
|
-
commit_hash: '',
|
|
1056
|
-
branch: 'main',
|
|
1057
|
-
},
|
|
1058
|
-
pr_url: '',
|
|
1059
|
-
output: result.output,
|
|
1060
|
-
};
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
// Fallback
|
|
1020
|
+
// Honest fallback: the push is handed off (manual) rather than fabricated by a stub.
|
|
1064
1021
|
return {
|
|
1065
1022
|
status: PhaseStatus.COMPLETED,
|
|
1066
1023
|
push_result: {
|
|
@@ -1068,7 +1025,7 @@ class WorkflowExecutor {
|
|
|
1068
1025
|
branch: 'main',
|
|
1069
1026
|
},
|
|
1070
1027
|
pr_url: '',
|
|
1071
|
-
note: '
|
|
1028
|
+
note: 'Manual push required',
|
|
1072
1029
|
};
|
|
1073
1030
|
} catch (error) {
|
|
1074
1031
|
return {
|
|
@@ -124,13 +124,15 @@ class FocusAreaRecommender {
|
|
|
124
124
|
|
|
125
125
|
for (const file of changedFiles.slice(0, 20)) {
|
|
126
126
|
try {
|
|
127
|
-
// Count commits touching this file in last 30 days
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
// Count commits touching this file in last 30 days. No shell pipe
|
|
128
|
+
// (wc -l / 2>/dev/null) — those fail on Windows cmd; count lines in JS
|
|
129
|
+
// and suppress stderr via stdio so it stays cross-platform.
|
|
130
|
+
const commitOut = execSync(
|
|
131
|
+
`git log --oneline --since="30 days ago" -- "${file}"`,
|
|
132
|
+
{ encoding: 'utf8', timeout: 5000, stdio: ['ignore', 'pipe', 'ignore'] },
|
|
133
|
+
);
|
|
132
134
|
|
|
133
|
-
const count =
|
|
135
|
+
const count = commitOut.split('\n').filter(Boolean).length;
|
|
134
136
|
|
|
135
137
|
if (count >= 5) {
|
|
136
138
|
insights.hotspots.push({
|
|
@@ -140,11 +142,13 @@ class FocusAreaRecommender {
|
|
|
140
142
|
});
|
|
141
143
|
}
|
|
142
144
|
|
|
143
|
-
// Get unique contributors for this file
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
// Get unique contributors for this file. Dedup in JS via Set instead of
|
|
146
|
+
// a `| sort -u` shell pipe (unavailable on Windows cmd).
|
|
147
|
+
const authorsOut = execSync(
|
|
148
|
+
`git log --format="%aN" --since="30 days ago" -- "${file}"`,
|
|
149
|
+
{ encoding: 'utf8', timeout: 5000, stdio: ['ignore', 'pipe', 'ignore'] },
|
|
150
|
+
);
|
|
151
|
+
const authors = [...new Set(authorsOut.split('\n').map((s) => s.trim()).filter(Boolean))];
|
|
148
152
|
|
|
149
153
|
for (const author of authors) {
|
|
150
154
|
insights.contributors.set(author, (insights.contributors.get(author) || 0) + 1);
|
|
@@ -23,8 +23,9 @@ const SCAN_SOURCES = [
|
|
|
23
23
|
category: 'task',
|
|
24
24
|
taskFormat: 'TASK-FORMAT-V1',
|
|
25
25
|
subcategoryExtractor: (filePath) => {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
// path.basename is OS-agnostic; a raw glob result on Windows uses '\\',
|
|
27
|
+
// so split('/') would return the whole path and corrupt the subcategory.
|
|
28
|
+
const filename = path.basename(filePath);
|
|
28
29
|
// Extract agent prefix (e.g., dev-, qa-, po-)
|
|
29
30
|
const prefixMatch = filename.match(/^([a-z]+)-/);
|
|
30
31
|
if (prefixMatch) {
|
|
@@ -22,6 +22,28 @@ const path = require('path');
|
|
|
22
22
|
|
|
23
23
|
const IS_WINDOWS = process.platform === 'win32';
|
|
24
24
|
|
|
25
|
+
// On Windows the AV scanner, Windows Search indexer, or a concurrent reader can
|
|
26
|
+
// hold a transient lock on the target, making unlink/rename throw EPERM/EBUSY
|
|
27
|
+
// where POSIX would succeed. A short bounded retry clears virtually all of these.
|
|
28
|
+
const TRANSIENT_LOCK_CODES = new Set(['EPERM', 'EBUSY', 'EACCES', 'ENOTEMPTY']);
|
|
29
|
+
|
|
30
|
+
function sleepSync(ms) {
|
|
31
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function retrySync(fn, retries = 3, delayMs = 120) {
|
|
35
|
+
for (let attempt = 0; ; attempt++) {
|
|
36
|
+
try {
|
|
37
|
+
return fn();
|
|
38
|
+
} catch (err) {
|
|
39
|
+
if (!TRANSIENT_LOCK_CODES.has(err.code) || attempt >= retries) {
|
|
40
|
+
throw err;
|
|
41
|
+
}
|
|
42
|
+
sleepSync(delayMs * (attempt + 1));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
25
47
|
/**
|
|
26
48
|
* Write data to a file atomically.
|
|
27
49
|
*
|
|
@@ -49,18 +71,20 @@ function atomicWriteSync(filePath, data, encoding = 'utf8') {
|
|
|
49
71
|
|
|
50
72
|
// Step 2: On Windows, unlink target first (rename won't overwrite)
|
|
51
73
|
if (IS_WINDOWS) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
74
|
+
retrySync(() => {
|
|
75
|
+
try {
|
|
76
|
+
fs.unlinkSync(filePath);
|
|
77
|
+
} catch (err) {
|
|
78
|
+
if (err.code !== 'ENOENT') {
|
|
79
|
+
throw err;
|
|
80
|
+
}
|
|
81
|
+
// ENOENT = target doesn't exist yet, that's fine
|
|
57
82
|
}
|
|
58
|
-
|
|
59
|
-
}
|
|
83
|
+
});
|
|
60
84
|
}
|
|
61
85
|
|
|
62
|
-
// Step 3: Atomic rename
|
|
63
|
-
fs.renameSync(tmpPath, filePath);
|
|
86
|
+
// Step 3: Atomic rename (retried for transient Windows locks)
|
|
87
|
+
retrySync(() => fs.renameSync(tmpPath, filePath));
|
|
64
88
|
} catch (error) {
|
|
65
89
|
// Clean up tmp file on failure
|
|
66
90
|
try {
|
|
@@ -76,5 +100,6 @@ function atomicWriteSync(filePath, data, encoding = 'utf8') {
|
|
|
76
100
|
|
|
77
101
|
module.exports = {
|
|
78
102
|
atomicWriteSync,
|
|
103
|
+
retrySync,
|
|
79
104
|
};
|
|
80
105
|
|
|
@@ -310,7 +310,11 @@ ideSync:
|
|
|
310
310
|
enabled: false
|
|
311
311
|
path: .codex/agents
|
|
312
312
|
format: full-markdown-yaml
|
|
313
|
-
redirects:
|
|
313
|
+
redirects:
|
|
314
|
+
# Master alias: o id-fonte canônico é snps-orqx; sinapse-orqx aponta para ele
|
|
315
|
+
# no espelho de dogfood (.claude/). No install o command-generator gera ambos
|
|
316
|
+
# como entry points full do Imperator — isto cobre só a paridade do repo.
|
|
317
|
+
sinapse-orqx: snps-orqx
|
|
314
318
|
validation:
|
|
315
319
|
strictMode: true
|
|
316
320
|
failOnDrift: true
|
|
@@ -26,7 +26,7 @@ function detectToolSearch() {
|
|
|
26
26
|
// Check Claude Code cached features for tool search availability
|
|
27
27
|
const claudeJsonPath = path.join(os.homedir(), '.claude.json');
|
|
28
28
|
try {
|
|
29
|
-
const config = JSON.parse(fs.readFileSync(claudeJsonPath, 'utf8'));
|
|
29
|
+
const config = JSON.parse(fs.readFileSync(claudeJsonPath, 'utf8').replace(/^\uFEFF/, ''));
|
|
30
30
|
const features = config.cachedGrowthBookFeatures || {};
|
|
31
31
|
return {
|
|
32
32
|
available: features.tengu_mcp_tool_search === true,
|
|
@@ -54,7 +54,7 @@ function detectDeferLoading() {
|
|
|
54
54
|
function detectProjectMcps() {
|
|
55
55
|
const mcpJsonPath = path.join(PROJECT_ROOT, '.mcp.json');
|
|
56
56
|
try {
|
|
57
|
-
const config = JSON.parse(fs.readFileSync(mcpJsonPath, 'utf8'));
|
|
57
|
+
const config = JSON.parse(fs.readFileSync(mcpJsonPath, 'utf8').replace(/^\uFEFF/, ''));
|
|
58
58
|
const servers = config.mcpServers || {};
|
|
59
59
|
return Object.entries(servers).map(([name, cfg]) => ({
|
|
60
60
|
name,
|
|
@@ -96,7 +96,7 @@ function detectGlobalMcps() {
|
|
|
96
96
|
// Detection: check ~/.claude/settings.json or known conventions
|
|
97
97
|
const settingsPath = path.join(os.homedir(), '.claude', 'settings.json');
|
|
98
98
|
try {
|
|
99
|
-
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
|
99
|
+
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8').replace(/^\uFEFF/, ''));
|
|
100
100
|
if (settings.mcpServers) {
|
|
101
101
|
for (const [name, cfg] of Object.entries(settings.mcpServers)) {
|
|
102
102
|
servers.push({
|