sinapse-ai 1.19.2 → 1.20.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/CLAUDE.md +2 -2
- package/.claude/hooks/enforce-delegation.cjs +32 -36
- package/.claude/rules/agent-handoff.md +10 -21
- package/.claude/rules/mandatory-delegation.md +1 -1
- package/.claude/rules/token-economy.md +12 -5
- package/.sinapse-ai/constitution.md +2 -0
- package/.sinapse-ai/core/atlas/flows-pt.js +6 -0
- package/.sinapse-ai/core/atlas/flows.js +7 -0
- package/.sinapse-ai/core/atlas/render-html.js +10 -8
- package/.sinapse-ai/core/atlas/render-markdown.js +8 -0
- package/.sinapse-ai/core/doctor/checks/constitution-consistency.js +7 -0
- package/.sinapse-ai/core/execution/autonomous-build-loop.js +10 -4
- package/.sinapse-ai/core/execution/build-orchestrator.js +73 -2
- package/.sinapse-ai/core/execution/rate-limit-manager.js +2 -0
- package/.sinapse-ai/core/execution/result-aggregator.js +2 -0
- package/.sinapse-ai/core/health-check/checks/project/constitution-consistency.js +12 -1
- package/.sinapse-ai/core/orchestration/cli-commands.js +121 -4
- package/.sinapse-ai/core/orchestration/executors/epic-4-executor.js +10 -2
- package/.sinapse-ai/core/orchestration/executors/epic-6-executor.js +53 -2
- package/.sinapse-ai/core/orchestration/index.js +3 -0
- package/.sinapse-ai/core/orchestration/master-orchestrator.js +116 -18
- package/.sinapse-ai/core/registry/service-registry.json +2 -32
- package/.sinapse-ai/core/synapse/context/context-tracker.js +118 -11
- package/.sinapse-ai/core/synapse/engine.js +18 -3
- package/.sinapse-ai/core/synapse/layers/l0-constitution.js +189 -8
- package/.sinapse-ai/core/synapse/output/formatter.js +65 -25
- package/.sinapse-ai/core-config.yaml +8 -1
- package/.sinapse-ai/data/entity-registry.yaml +492 -246
- package/.sinapse-ai/development/agents/analyst.md +18 -34
- package/.sinapse-ai/development/agents/architect.md +18 -34
- package/.sinapse-ai/development/agents/data-engineer.md +15 -28
- package/.sinapse-ai/development/agents/developer.md +18 -40
- package/.sinapse-ai/development/agents/devops.md +15 -28
- package/.sinapse-ai/development/agents/product-lead.md +18 -34
- package/.sinapse-ai/development/agents/project-lead.md +18 -34
- package/.sinapse-ai/development/agents/quality-gate.md +18 -34
- package/.sinapse-ai/development/agents/snps-orqx.md +5 -5
- package/.sinapse-ai/development/agents/sprint-lead.md +20 -36
- package/.sinapse-ai/development/agents/squad-creator.md +15 -27
- package/.sinapse-ai/development/agents/ux-design-expert.md +15 -27
- package/.sinapse-ai/development/scripts/agent-exit-hooks.js +13 -4
- package/.sinapse-ai/development/scripts/populate-entity-registry.js +3 -0
- package/.sinapse-ai/development/tasks/execute-epic-plan.md +0 -4
- package/.sinapse-ai/development/workflows/epic-orchestration.yaml +0 -1
- package/.sinapse-ai/git-hooks/lib/staged-secret-scan.js +3 -1
- package/.sinapse-ai/infrastructure/integrations/ai-providers/README.md +2 -2
- package/.sinapse-ai/install-manifest.yaml +94 -126
- package/.sinapse-ai/product/templates/activation-instructions-template.md +72 -185
- package/.sinapse-ai/product/templates/ide-rules/claude-rules.md +45 -274
- package/.sinapse-ai/product/templates/personalized-agent-template.md +3 -5
- package/.sinapse-ai/product/templates/statusline/agent-badges.json +2 -2
- package/.sinapse-ai/product/templates/statusline/statusline-script.js +5 -3
- package/.sinapse-ai/workflow-intelligence/index.js +3 -21
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +50 -2
- package/README.md +10 -0
- package/bin/cli.js +29 -0
- package/bin/commands/help.js +5 -0
- package/bin/commands/install.js +5 -4
- package/bin/commands/uninstall.js +5 -0
- package/bin/lib/command-generator.js +4 -4
- package/bin/lib/fs-utils.js +18 -0
- package/bin/lib/setup-statusline.js +3 -1
- package/bin/modules/chrome-brain-installer.js +5 -3
- package/bin/modules/mcp-installer.js +3 -6
- package/bin/postinstall.js +9 -1
- package/bin/sinapse-init.js +8 -9
- package/bin/sinapse.js +152 -2
- package/bin/utils/staged-secret-scan.js +3 -1
- package/docs/framework/atlas/OPERATING-ATLAS.md +3 -3
- package/docs/framework/atlas/atlas-data.json +27 -27
- package/docs/framework/atlas/atlas.html +12 -10
- package/docs/framework/source-tree.md +2 -3
- package/docs/framework/workflow-engine-status.md +70 -0
- package/docs/guides/ade-guide.md +4 -2
- package/docs/guides/api-reference.md +2 -0
- package/docs/guides/permission-modes.md +2 -0
- package/docs/guides/user-guide.md +21 -7
- package/docs/guides/workflows/AUTO-WORKTREE-WORKFLOW.md +2 -2
- package/docs/pt/architecture/ade-architecture.md +2 -0
- package/docs/pt/architecture/high-level-architecture.md +1 -1
- package/docs/pt/guides/ade-guide.md +4 -2
- package/docs/pt/guides/api-reference.md +2 -0
- package/docs/pt/guides/permission-modes.md +2 -0
- package/docs/pt/guides/user-guide.md +21 -7
- package/docs/pt/platforms/claude-code.md +2 -2
- package/docs/sinapse-workflows/auto-worktree-workflow.md +2 -2
- package/package.json +1 -1
- package/packages/installer/src/config/configure-environment.js +14 -6
- package/packages/installer/src/config/templates/core-config-template.js +43 -1
- package/packages/installer/src/installer/brownfield-upgrader.js +5 -3
- package/packages/installer/src/installer/file-hasher.js +29 -21
- package/packages/installer/src/installer/manifest-signature.js +61 -49
- package/packages/installer/src/installer/post-install-validator.js +24 -17
- package/packages/installer/src/installer/synapse-runtime-installer.js +148 -0
- package/packages/installer/src/merger/parsers/markdown-section-parser.js +3 -2
- package/packages/installer/src/updater/index.js +7 -1
- package/packages/installer/src/utils/atomic-write.js +35 -0
- package/packages/installer/src/wizard/i18n.js +294 -0
- package/packages/installer/src/wizard/index.js +31 -3
- package/packages/installer/src/wizard/validation/troubleshooting-system.js +60 -131
- package/packages/sinapse-install/src/capabilities/chrome-brain.js +5 -3
- package/packages/sinapse-install/src/installer.js +3 -1
- package/packages/sinapse-install/src/utils/atomic-write.js +67 -0
- package/scripts/apply-persona-disclaimer.js +2 -1
- package/scripts/bracket-report.js +103 -0
- package/scripts/sinapse-patch.js +2 -1
- package/scripts/sync-squad-yaml-components.js +2 -1
- package/scripts/validate-agent-codenames.js +168 -37
- package/scripts/validate-agents-md.js +2 -1
- package/scripts/validate-article-xi.js +10 -8
- package/scripts/validate-install-docs.js +23 -2
- package/scripts/validate-no-external-refs.js +14 -8
- package/sinapse/agents/sinapse-orqx.md +3 -3
- package/sinapse/agents/snps-orqx.md +3 -3
- package/sinapse/knowledge-base/routing-catalog.md +1 -1
- package/sinapse/tasks/diagnose-and-route.md +1 -1
- package/squads/claude-code-mastery/CHANGELOG.md +1 -1
- package/squads/claude-code-mastery/README.md +6 -6
- package/squads/claude-code-mastery/agents/claude-mastery-chief.md +10 -15
- package/squads/claude-code-mastery/agents/config-engineer.md +5 -12
- package/squads/claude-code-mastery/agents/hooks-architect.md +5 -11
- package/squads/claude-code-mastery/agents/mcp-integrator.md +5 -12
- package/squads/claude-code-mastery/agents/project-integrator.md +5 -12
- package/squads/claude-code-mastery/agents/roadmap-sentinel.md +14 -21
- package/squads/claude-code-mastery/agents/skill-craftsman.md +5 -11
- package/squads/claude-code-mastery/agents/swarm-orqx.md +20 -33
- package/squads/claude-code-mastery/data/claude-code-quick-ref.yaml +1 -1
- package/squads/claude-code-mastery/knowledge-base/claude-code-internals-deep.md +4 -4
- package/squads/claude-code-mastery/knowledge-base/claude-code-internals-reference.md +4 -4
- package/squads/claude-code-mastery/tasks/create-agent-definition.md +6 -6
- package/squads/claude-code-mastery/tasks/create-team-topology.md +3 -3
- package/squads/claude-code-mastery/tasks/diagnose.md +1 -1
- package/squads/claude-code-mastery/tasks/parallel-decomposition.md +1 -1
- package/squads/claude-code-mastery/tasks/worktree-strategy.md +1 -1
- package/squads/squad-animations/README.md +1 -1
- package/squads/squad-animations/agents/animation-interpreter.md +5 -5
- package/squads/squad-animations/agents/animations-orqx.md +6 -6
- package/squads/squad-animations/squad.yaml +1 -1
- package/squads/squad-animations/tasks/analyze-reference-animation.md +1 -1
- package/squads/squad-animations/tasks/build-animation-brief.md +1 -1
- package/squads/squad-animations/tasks/create-animation-storyboard.md +1 -1
- package/squads/squad-animations/tasks/cross-reference-brand-system.md +1 -1
- package/squads/squad-animations/tasks/extract-animation-intent.md +1 -1
- package/squads/squad-animations/tasks/generate-motion-vocabulary.md +1 -1
- package/squads/squad-animations/tasks/identify-website-animation.md +1 -1
- package/squads/squad-animations/tasks/interpret-animation-prompt.md +1 -1
- package/squads/squad-animations/tasks/refine-animation-specification.md +1 -1
- package/squads/squad-animations/tasks/translate-feeling-to-parameters.md +1 -1
- package/squads/squad-animations/tasks/validate-animation-feasibility.md +1 -1
- package/squads/squad-animations/workflows/prompt-to-animation-cycle.yaml +2 -2
- package/squads/squad-brand/agents/brand-auditor.md +1 -1
- package/squads/squad-brand/agents/brand-compiler.md +1 -1
- package/squads/squad-brand/agents/brand-motion-vfx.md +5 -5
- package/squads/squad-brand/agents/brand-orqx.md +2 -2
- package/squads/squad-brand/agents/brand-sonic-designer.md +1 -1
- package/squads/squad-brand/squad.yaml +1 -1
- package/squads/squad-brand/tasks/create-animation-library.md +1 -1
- package/squads/squad-brand/tasks/create-brand-characters.md +2 -2
- package/squads/squad-brand/tasks/create-event-branding.md +2 -2
- package/squads/squad-brand/tasks/create-micro-interactions.md +1 -1
- package/squads/squad-brand/tasks/create-page-transitions.md +1 -1
- package/squads/squad-brand/tasks/create-video-templates.md +1 -1
- package/squads/squad-brand/tasks/create-web-templates.md +1 -1
- package/squads/squad-brand/tasks/define-motion-language.md +1 -1
- package/squads/squad-brand/tasks/design-dynamic-identity-system.md +2 -2
- package/squads/squad-brand/tasks/design-illustration-system.md +1 -1
- package/squads/squad-commercial/README.md +3 -3
- package/squads/squad-commercial/agents/commercial-orqx.md +8 -8
- package/squads/squad-commercial/agents/cs-crm-specialist.md +3 -3
- package/squads/squad-commercial/agents/cs-revops-analyst.md +3 -3
- package/squads/squad-commercial/agents/cs-sales-closer.md +1 -1
- package/squads/squad-commercial/knowledge-base/commercial-analytics-reporting.md +7 -7
- package/squads/squad-commercial/knowledge-base/sales-revenue-master-reference.md +1 -1
- package/squads/squad-commercial/squad.yaml +3 -3
- package/squads/squad-commercial/tasks/analyze-revenue-leaks.md +2 -2
- package/squads/squad-commercial/tasks/audit-commercial-tech-stack.md +1 -1
- package/squads/squad-commercial/tasks/audit-crm-data.md +1 -1
- package/squads/squad-commercial/tasks/build-deal-scoring-model.md +1 -1
- package/squads/squad-commercial/tasks/build-forecasting-model.md +1 -1
- package/squads/squad-commercial/tasks/build-pipeline-dashboard.md +2 -2
- package/squads/squad-commercial/tasks/build-unit-economics-model.md +1 -1
- package/squads/squad-commercial/tasks/conduct-commercial-retrospective.md +2 -2
- package/squads/squad-commercial/tasks/conduct-deal-review.md +1 -1
- package/squads/squad-commercial/tasks/conduct-win-loss-analysis.md +1 -1
- package/squads/squad-commercial/tasks/configure-activity-tracking.md +1 -1
- package/squads/squad-commercial/tasks/configure-crm-integrations.md +1 -1
- package/squads/squad-commercial/tasks/configure-pipeline-stages.md +1 -1
- package/squads/squad-commercial/tasks/coordinate-revenue-cycle.md +1 -1
- package/squads/squad-commercial/tasks/create-commercial-brief.md +2 -2
- package/squads/squad-commercial/tasks/create-revenue-dashboard.md +1 -1
- package/squads/squad-commercial/tasks/design-lead-routing.md +1 -1
- package/squads/squad-commercial/tasks/design-quota-model.md +1 -1
- package/squads/squad-commercial/tasks/execute-save-play.md +1 -1
- package/squads/squad-commercial/tasks/manage-commercial-handoffs.md +1 -1
- package/squads/squad-commercial/tasks/manage-pipeline-forecast.md +3 -3
- package/squads/squad-commercial/tasks/monitor-pipeline-health.md +1 -1
- package/squads/squad-commercial/tasks/monitor-saas-metrics.md +1 -1
- package/squads/squad-commercial/tasks/plan-sales-capacity.md +1 -1
- package/squads/squad-commercial/tasks/plan-territory-mapping.md +1 -1
- package/squads/squad-commercial/tasks/review-revenue-architecture.md +2 -2
- package/squads/squad-commercial/tasks/run-quarterly-commercial-review.md +3 -3
- package/squads/squad-commercial/tasks/select-commercial-workflow.md +1 -1
- package/squads/squad-commercial/tasks/setup-outreach-sequences.md +1 -1
- package/squads/squad-commercial/templates/offer-brief-template.md +2 -2
- package/squads/squad-commercial/workflows/new-offer-launch.yaml +2 -2
- package/squads/squad-commercial/workflows/quarterly-commercial-review.yaml +1 -1
- package/squads/squad-commercial/workflows/revenue-forecasting-cycle.yaml +2 -2
- package/squads/squad-content/README.md +1 -1
- package/squads/squad-content/agents/content-analyst.md +4 -4
- package/squads/squad-content/agents/content-engineer.md +2 -2
- package/squads/squad-content/agents/content-governor.md +1 -1
- package/squads/squad-content/agents/content-orqx.md +6 -6
- package/squads/squad-content/agents/editorial-strategist.md +5 -5
- package/squads/squad-content/agents/platform-specialist.md +1 -1
- package/squads/squad-content/agents/signal-intelligence.md +4 -4
- package/squads/squad-content/checklists/editorial-planning-checklist.md +1 -1
- package/squads/squad-content/checklists/onboarding-setup-checklist.md +2 -2
- package/squads/squad-content/knowledge-base/ai-native-content-loop.md +2 -2
- package/squads/squad-content/knowledge-base/content-governance-principles.md +2 -2
- package/squads/squad-content/knowledge-base/cross-squad-integration-protocol.md +1 -1
- package/squads/squad-content/knowledge-base/signal-intelligence-v2.md +1 -1
- package/squads/squad-content/knowledge-base/task-ownership-map.md +5 -5
- package/squads/squad-content/squad.yaml +2 -2
- package/squads/squad-content/tasks/alert-opportunity-windows.md +6 -6
- package/squads/squad-content/tasks/analyze-content-performance.md +2 -2
- package/squads/squad-content/tasks/batch-content-production.md +1 -1
- package/squads/squad-content/tasks/benchmark-against-competitors.md +1 -1
- package/squads/squad-content/tasks/coordinate-cross-squad.md +1 -1
- package/squads/squad-content/tasks/create-content-governance.md +1 -1
- package/squads/squad-content/tasks/create-editorial-calendar.md +1 -1
- package/squads/squad-content/tasks/curate-ugc-signals.md +2 -2
- package/squads/squad-content/tasks/define-big-idea.md +1 -1
- package/squads/squad-content/tasks/define-content-kpis.md +1 -1
- package/squads/squad-content/tasks/flag-content-for-amplification.md +2 -2
- package/squads/squad-content/tasks/generate-content-report.md +3 -3
- package/squads/squad-content/tasks/manage-content-sprint.md +1 -1
- package/squads/squad-content/tasks/measure-content-roi.md +3 -3
- package/squads/squad-content/tasks/orchestrate-content-pipeline.md +2 -2
- package/squads/squad-content/tasks/plan-content-sprint.md +3 -3
- package/squads/squad-content/tasks/predict-content-performance.md +2 -2
- package/squads/squad-content/tasks/scan-daily-signals.md +2 -2
- package/squads/squad-content/tasks/triage-content-requests.md +1 -1
- package/squads/squad-content/tasks/triage-urgent-signal.md +1 -1
- package/squads/squad-content/templates/signal-alert-template.md +2 -2
- package/squads/squad-content/templates/weekly-briefing-template.md +1 -1
- package/squads/squad-content/workflows/content-audit-cycle.yaml +1 -1
- package/squads/squad-content/workflows/content-creation-cycle.yaml +3 -3
- package/squads/squad-content/workflows/editorial-planning-cycle.yaml +3 -3
- package/squads/squad-content/workflows/onboarding-content-cycle.yaml +3 -3
- package/squads/squad-content/workflows/performance-feedback-loop.yaml +3 -3
- package/squads/squad-content/workflows/signal-to-content-cycle.yaml +5 -5
- package/squads/squad-copy/README.md +4 -4
- package/squads/squad-copy/agents/ad-copywriter.md +4 -4
- package/squads/squad-copy/agents/copy-orqx.md +3 -3
- package/squads/squad-copy/agents/copy-strategist.md +5 -5
- package/squads/squad-copy/agents/direct-response-writer.md +3 -3
- package/squads/squad-copy/agents/email-sequence-strategist.md +1 -1
- package/squads/squad-copy/agents/funnel-copywriter.md +3 -3
- package/squads/squad-copy/agents/headline-specialist.md +1 -1
- package/squads/squad-copy/agents/proof-architect.md +3 -3
- package/squads/squad-copy/squad.yaml +3 -3
- package/squads/squad-copy/tasks/build-proof-stack.md +3 -3
- package/squads/squad-copy/tasks/craft-cta-variations.md +2 -2
- package/squads/squad-copy/tasks/craft-email-nurture-sequence.md +2 -2
- package/squads/squad-copy/tasks/craft-objection-handlers.md +1 -1
- package/squads/squad-copy/tasks/craft-social-media-hooks.md +1 -1
- package/squads/squad-copy/tasks/create-cart-abandonment-sequence.md +2 -2
- package/squads/squad-copy/tasks/create-customer-story.md +2 -2
- package/squads/squad-copy/tasks/create-email-campaign.md +2 -2
- package/squads/squad-copy/tasks/create-mechanism-copy.md +4 -4
- package/squads/squad-copy/tasks/create-opening-hooks.md +1 -1
- package/squads/squad-copy/tasks/create-ugc-script.md +2 -2
- package/squads/squad-copy/tasks/create-urgency-scarcity-framework.md +1 -1
- package/squads/squad-copy/tasks/create-welcome-sequence.md +2 -2
- package/squads/squad-copy/tasks/design-headline-ab-tests.md +1 -1
- package/squads/squad-copy/tasks/design-trigger-sequence.md +1 -1
- package/squads/squad-copy/tasks/design-welcome-series.md +2 -2
- package/squads/squad-copy/tasks/optimize-existing-copy.md +2 -2
- package/squads/squad-copy/tasks/optimize-funnel-conversion-copy.md +2 -2
- package/squads/squad-copy/tasks/optimize-pricing-framing.md +2 -2
- package/squads/squad-copy/tasks/write-ad-copy-google.md +2 -2
- package/squads/squad-copy/tasks/write-ad-copy-social.md +2 -2
- package/squads/squad-copy/tasks/write-ad-copy-variations.md +4 -4
- package/squads/squad-copy/tasks/write-case-study.md +2 -2
- package/squads/squad-copy/tasks/write-comparison-piece.md +2 -2
- package/squads/squad-copy/tasks/write-email-sequence.md +1 -1
- package/squads/squad-copy/tasks/write-email-subject-lines.md +1 -1
- package/squads/squad-copy/tasks/write-funnel-copy-sequence.md +4 -4
- package/squads/squad-copy/tasks/write-landing-page-copy.md +2 -2
- package/squads/squad-copy/tasks/write-launch-sequence.md +2 -2
- package/squads/squad-copy/tasks/write-opt-in-page.md +2 -2
- package/squads/squad-copy/tasks/write-product-narrative.md +2 -2
- package/squads/squad-copy/tasks/write-retargeting-copy.md +2 -2
- package/squads/squad-copy/tasks/write-sales-letter.md +1 -1
- package/squads/squad-copy/tasks/write-social-proof-section.md +1 -1
- package/squads/squad-copy/tasks/write-subheadlines-and-deck-copy.md +1 -1
- package/squads/squad-copy/tasks/write-upsell-copy.md +2 -2
- package/squads/squad-copy/tasks/write-vsl-script.md +3 -3
- package/squads/squad-copy/tasks/write-whitepaper-persuasive.md +2 -2
- package/squads/squad-copy/workflows/campaign-copy-cycle.yaml +4 -4
- package/squads/squad-copy/workflows/conversion-copy-sprint.yaml +6 -6
- package/squads/squad-copy/workflows/sales-copy-pipeline.yaml +4 -4
- package/squads/squad-design/README.md +6 -6
- package/squads/squad-design/agents/cro-persuasion.md +3 -3
- package/squads/squad-design/agents/design-orqx.md +17 -17
- package/squads/squad-design/agents/dx-accessibility-specialist.md +5 -5
- package/squads/squad-design/agents/dx-design-system-architect.md +8 -8
- package/squads/squad-design/agents/dx-frontend-engineer.md +7 -7
- package/squads/squad-design/agents/dx-interaction-designer.md +6 -6
- package/squads/squad-design/agents/dx-performance-engineer.md +3 -3
- package/squads/squad-design/agents/dx-ui-designer.md +7 -7
- package/squads/squad-design/agents/dx-ux-strategist.md +7 -7
- package/squads/squad-design/agents/platform-aesthetic-director.md +11 -11
- package/squads/squad-design/agents/premium-packaging-strategist.md +2 -2
- package/squads/squad-design/agents/product-surface-director.md +1 -1
- package/squads/squad-design/squad.yaml +6 -6
- package/squads/squad-design/tasks/analyze-javascript-bundles.md +1 -1
- package/squads/squad-design/tasks/audit-core-web-vitals.md +1 -1
- package/squads/squad-design/tasks/audit-design-system-health.md +1 -1
- package/squads/squad-design/tasks/audit-motion-performance.md +1 -1
- package/squads/squad-design/tasks/certify-accessibility-compliance.md +2 -2
- package/squads/squad-design/tasks/compose-screen-layouts.md +3 -3
- package/squads/squad-design/tasks/conduct-competitive-ux-analysis.md +1 -1
- package/squads/squad-design/tasks/conduct-dx-quality-gate.md +3 -3
- package/squads/squad-design/tasks/conduct-usability-heuristic-review.md +1 -1
- package/squads/squad-design/tasks/conduct-visual-qa.md +1 -1
- package/squads/squad-design/tasks/conduct-wcag-audit.md +1 -1
- package/squads/squad-design/tasks/configure-cdn-strategy.md +1 -1
- package/squads/squad-design/tasks/configure-token-export-pipeline.md +1 -1
- package/squads/squad-design/tasks/create-a11y-remediation-plan.md +4 -4
- package/squads/squad-design/tasks/create-color-system.md +2 -2
- package/squads/squad-design/tasks/create-component-governance.md +1 -1
- package/squads/squad-design/tasks/create-component-tokens.md +2 -2
- package/squads/squad-design/tasks/create-dark-light-themes.md +3 -3
- package/squads/squad-design/tasks/create-easing-curve-library.md +1 -1
- package/squads/squad-design/tasks/create-empty-error-states.md +1 -1
- package/squads/squad-design/tasks/create-error-boundary-patterns.md +1 -1
- package/squads/squad-design/tasks/create-illustration-style.md +1 -1
- package/squads/squad-design/tasks/create-mobile-first-designs.md +2 -2
- package/squads/squad-design/tasks/create-motion-documentation.md +1 -1
- package/squads/squad-design/tasks/create-motion-tokens.md +2 -2
- package/squads/squad-design/tasks/create-primitive-tokens.md +1 -1
- package/squads/squad-design/tasks/create-responsive-grid-system.md +1 -1
- package/squads/squad-design/tasks/create-screen-reader-specs.md +1 -1
- package/squads/squad-design/tasks/create-scroll-animation-patterns.md +1 -1
- package/squads/squad-design/tasks/create-semantic-tokens.md +1 -1
- package/squads/squad-design/tasks/create-storybook-documentation-standards.md +1 -1
- package/squads/squad-design/tasks/create-user-personas.md +1 -1
- package/squads/squad-design/tasks/create-ux-principles.md +1 -1
- package/squads/squad-design/tasks/create-wireframe-brief.md +2 -2
- package/squads/squad-design/tasks/define-atomic-hierarchy.md +2 -2
- package/squads/squad-design/tasks/define-content-hierarchy.md +2 -2
- package/squads/squad-design/tasks/define-motion-principles.md +4 -4
- package/squads/squad-design/tasks/define-performance-budgets.md +1 -1
- package/squads/squad-design/tasks/define-token-taxonomy.md +2 -2
- package/squads/squad-design/tasks/design-accessible-form-patterns.md +2 -2
- package/squads/squad-design/tasks/design-component-api-contracts.md +3 -3
- package/squads/squad-design/tasks/design-component-visual-states.md +4 -4
- package/squads/squad-design/tasks/design-dashboard-layouts.md +1 -1
- package/squads/squad-design/tasks/design-duration-scale.md +1 -1
- package/squads/squad-design/tasks/design-feedback-animations.md +2 -2
- package/squads/squad-design/tasks/design-focus-management.md +1 -1
- package/squads/squad-design/tasks/design-form-patterns.md +2 -2
- package/squads/squad-design/tasks/design-icon-system.md +1 -1
- package/squads/squad-design/tasks/design-information-architecture.md +2 -2
- package/squads/squad-design/tasks/design-landing-page-ui.md +3 -3
- package/squads/squad-design/tasks/design-loading-choreography.md +1 -1
- package/squads/squad-design/tasks/design-multi-brand-theming.md +1 -1
- package/squads/squad-design/tasks/design-page-transitions.md +1 -1
- package/squads/squad-design/tasks/design-spacing-scale.md +3 -3
- package/squads/squad-design/tasks/design-typography-scale.md +3 -3
- package/squads/squad-design/tasks/design-user-flows.md +2 -2
- package/squads/squad-design/tasks/design-visual-hierarchy.md +2 -2
- package/squads/squad-design/tasks/eliminate-render-blocking.md +1 -1
- package/squads/squad-design/tasks/extract-critical-css.md +1 -1
- package/squads/squad-design/tasks/govern-third-party-scripts.md +1 -1
- package/squads/squad-design/tasks/implement-authentication-ui.md +1 -1
- package/squads/squad-design/tasks/implement-component-library.md +4 -4
- package/squads/squad-design/tasks/implement-form-system.md +2 -2
- package/squads/squad-design/tasks/implement-reduced-motion.md +3 -3
- package/squads/squad-design/tasks/implement-responsive-layouts.md +1 -1
- package/squads/squad-design/tasks/implement-routing-strategy.md +1 -1
- package/squads/squad-design/tasks/map-dark-mode-tokens.md +3 -3
- package/squads/squad-design/tasks/map-user-journeys.md +2 -2
- package/squads/squad-design/tasks/migrate-legacy-design-system.md +1 -1
- package/squads/squad-design/tasks/monitor-performance-regression.md +1 -1
- package/squads/squad-design/tasks/optimize-font-loading.md +1 -1
- package/squads/squad-design/tasks/optimize-image-pipeline.md +1 -1
- package/squads/squad-design/tasks/orchestrate-dx-pipeline.md +2 -2
- package/squads/squad-design/tasks/plan-ux-research-sprint.md +1 -1
- package/squads/squad-design/tasks/produce-design-handoff-specs.md +4 -4
- package/squads/squad-design/tasks/review-aria-patterns.md +1 -1
- package/squads/squad-design/tasks/setup-performance-ci-gates.md +1 -1
- package/squads/squad-design/tasks/setup-storybook-integration.md +1 -1
- package/squads/squad-design/tasks/spec-gesture-interactions.md +1 -1
- package/squads/squad-design/tasks/spec-micro-interactions.md +2 -2
- package/squads/squad-design/tasks/synthesize-user-research.md +2 -2
- package/squads/squad-design/tasks/test-keyboard-navigation.md +1 -1
- package/squads/squad-design/tasks/validate-ux-with-testing.md +1 -1
- package/squads/squad-design/tasks/verify-color-contrast.md +2 -2
- package/squads/squad-design/templates/a11y-audit-report-template.md +1 -1
- package/squads/squad-design/templates/design-handoff-template.md +1 -1
- package/squads/squad-design/templates/performance-budget-template.md +1 -1
- package/squads/squad-design/templates/ux-research-plan-template.md +1 -1
- package/squads/squad-design/workflows/a11y-compliance-cycle.yaml +8 -8
- package/squads/squad-design/workflows/design-system-build-cycle.yaml +12 -12
- package/squads/squad-design/workflows/landing-page-sprint.yaml +10 -10
- package/squads/squad-design/workflows/performance-remediation-cycle.yaml +6 -6
- package/squads/squad-design/workflows/ux-research-sprint.yaml +8 -8
- package/squads/squad-design/workflows/zero-to-digital-product-cycle.yaml +16 -16
- package/squads/squad-finance/README.md +1 -1
- package/squads/squad-finance/agents/budget-controller.md +1 -1
- package/squads/squad-finance/agents/cost-optimizer.md +2 -2
- package/squads/squad-finance/agents/finance-orqx.md +4 -4
- package/squads/squad-finance/agents/fiscal-compliance-br.md +4 -4
- package/squads/squad-finance/agents/forecast-strategist.md +6 -6
- package/squads/squad-finance/agents/pricing-strategist.md +3 -3
- package/squads/squad-finance/agents/profitability-analyst.md +1 -1
- package/squads/squad-finance/agents/revenue-analyst.md +1 -1
- package/squads/squad-finance/checklists/monthly-close-checklist.md +1 -1
- package/squads/squad-finance/checklists/quarterly-review-checklist.md +1 -1
- package/squads/squad-finance/squad.yaml +2 -2
- package/squads/squad-finance/tasks/analyze-price-sensitivity.md +1 -1
- package/squads/squad-finance/tasks/benchmark-competitor-pricing.md +1 -1
- package/squads/squad-finance/tasks/calculate-rate-card.md +1 -1
- package/squads/squad-finance/tasks/coordinate-quarterly-review.md +2 -2
- package/squads/squad-finance/tasks/create-proposal-pricing.md +1 -1
- package/squads/squad-finance/tasks/design-service-tiers.md +1 -1
- package/squads/squad-finance/tasks/design-value-based-pricing.md +1 -1
- package/squads/squad-finance/tasks/manage-financial-calendar.md +1 -1
- package/squads/squad-finance/tasks/model-pricing-scenario.md +1 -1
- package/squads/squad-finance/tasks/optimize-rate-realization.md +1 -1
- package/squads/squad-finance/tasks/simulate-pricing-impact.md +1 -1
- package/squads/squad-finance/tasks/track-pricing-performance.md +1 -1
- package/squads/squad-paidmedia/README.md +4 -4
- package/squads/squad-paidmedia/agents/campaign-analyst.md +6 -6
- package/squads/squad-paidmedia/agents/creative-strategist.md +2 -2
- package/squads/squad-paidmedia/agents/cro-specialist.md +5 -5
- package/squads/squad-paidmedia/agents/google-ads-specialist.md +2 -2
- package/squads/squad-paidmedia/agents/meta-ads-specialist.md +6 -6
- package/squads/squad-paidmedia/agents/paidmedia-orqx.md +6 -6
- package/squads/squad-paidmedia/agents/performance-engineer.md +2 -2
- package/squads/squad-paidmedia/agents/pm-creative-performance-analyst.md +2 -2
- package/squads/squad-paidmedia/knowledge-base/routing-catalog.md +21 -21
- package/squads/squad-paidmedia/squad.yaml +4 -4
- package/squads/squad-paidmedia/tasks/allocate-cross-channel-budget.md +1 -1
- package/squads/squad-paidmedia/tasks/allocate-meta-budget.md +2 -2
- package/squads/squad-paidmedia/tasks/analyze-audience-performance.md +1 -1
- package/squads/squad-paidmedia/tasks/analyze-content-performance.md +1 -1
- package/squads/squad-paidmedia/tasks/analyze-conversion-funnel.md +2 -2
- package/squads/squad-paidmedia/tasks/analyze-creative-effectiveness.md +1 -1
- package/squads/squad-paidmedia/tasks/analyze-keyword-rankings.md +1 -1
- package/squads/squad-paidmedia/tasks/analyze-landing-page.md +1 -1
- package/squads/squad-paidmedia/tasks/analyze-local-keywords.md +1 -1
- package/squads/squad-paidmedia/tasks/analyze-local-market.md +1 -1
- package/squads/squad-paidmedia/tasks/analyze-reviews-strategy.md +1 -1
- package/squads/squad-paidmedia/tasks/analyze-top-pages.md +1 -1
- package/squads/squad-paidmedia/tasks/analyze-traffic-sources.md +1 -1
- package/squads/squad-paidmedia/tasks/analyze-user-behavior.md +1 -1
- package/squads/squad-paidmedia/tasks/audit-conversion-tracking.md +1 -1
- package/squads/squad-paidmedia/tasks/audit-gmb-location.md +1 -1
- package/squads/squad-paidmedia/tasks/audit-meta-ads-account.md +1 -1
- package/squads/squad-paidmedia/tasks/audit-sitemap-health.md +1 -1
- package/squads/squad-paidmedia/tasks/build-audience-architecture.md +2 -2
- package/squads/squad-paidmedia/tasks/build-creative-scorecard.md +1 -1
- package/squads/squad-paidmedia/tasks/calculate-sample-size.md +1 -1
- package/squads/squad-paidmedia/tasks/check-indexing-status.md +1 -1
- package/squads/squad-paidmedia/tasks/create-scaling-roadmap.md +1 -1
- package/squads/squad-paidmedia/tasks/design-campaign-structure.md +2 -2
- package/squads/squad-paidmedia/tasks/design-progressive-profiling.md +1 -1
- package/squads/squad-paidmedia/tasks/detect-creative-fatigue.md +1 -1
- package/squads/squad-paidmedia/tasks/execute-launch-checklist.md +1 -1
- package/squads/squad-paidmedia/tasks/generate-monthly-report.md +1 -1
- package/squads/squad-paidmedia/tasks/generate-search-performance-overview.md +1 -1
- package/squads/squad-paidmedia/tasks/generate-weekly-summary.md +1 -1
- package/squads/squad-paidmedia/tasks/manage-pixel-capi-health.md +1 -1
- package/squads/squad-paidmedia/tasks/manage-scaling-roadmap.md +1 -1
- package/squads/squad-paidmedia/tasks/measure-activation-rate.md +1 -1
- package/squads/squad-paidmedia/tasks/optimize-ad-set-targeting.md +2 -2
- package/squads/squad-paidmedia/tasks/optimize-form-conversion.md +1 -1
- package/squads/squad-paidmedia/tasks/optimize-onboarding-activation.md +1 -1
- package/squads/squad-paidmedia/tasks/optimize-page-conversion.md +1 -1
- package/squads/squad-paidmedia/tasks/optimize-signup-flow.md +1 -1
- package/squads/squad-paidmedia/tasks/plan-customer-engagement.md +1 -1
- package/squads/squad-paidmedia/tasks/run-ab-test.md +1 -1
- package/squads/squad-paidmedia/tasks/run-creative-test.md +1 -1
- package/squads/squad-paidmedia/tasks/track-gmb-performance-trends.md +1 -1
- package/squads/squad-paidmedia/tasks/triage-campaign-issues.md +1 -1
- package/squads/squad-product/README.md +2 -2
- package/squads/squad-product/agents/product-orqx.md +4 -4
- package/squads/squad-product/agents/ps-delivery-manager.md +2 -2
- package/squads/squad-product/agents/ps-product-ops-specialist.md +2 -2
- package/squads/squad-product/squad.yaml +2 -2
- package/squads/squad-product/tasks/audit-product-tool-stack.md +1 -1
- package/squads/squad-product/tasks/build-product-knowledge-base.md +1 -1
- package/squads/squad-product/tasks/calculate-sprint-velocity.md +1 -1
- package/squads/squad-product/tasks/configure-feature-flag-rollout.md +1 -1
- package/squads/squad-product/tasks/create-product-artifact-template.md +1 -1
- package/squads/squad-product/tasks/create-product-onboarding-runbook.md +3 -3
- package/squads/squad-product/tasks/create-product-playbook.md +2 -2
- package/squads/squad-product/tasks/document-product-process.md +1 -1
- package/squads/squad-product/tasks/execute-feature-launch-checklist.md +1 -1
- package/squads/squad-product/tasks/facilitate-sprint-retrospective.md +1 -1
- package/squads/squad-product/tasks/generate-product-health-report.md +2 -2
- package/squads/squad-product/tasks/maintain-decision-log-system.md +1 -1
- package/squads/squad-product/tasks/manage-sprint-capacity-planning.md +1 -1
- package/squads/squad-product/tasks/map-cross-functional-dependencies.md +1 -1
- package/squads/squad-product/tasks/prepare-product-handoff-package.md +4 -4
- package/squads/squad-product/tasks/run-product-operations-audit.md +1 -1
- package/squads/squad-product/tasks/run-shape-up-betting-table.md +1 -1
- package/squads/squad-product/tasks/run-sprint-planning-session.md +1 -1
- package/squads/squad-product/tasks/scope-agency-mvp.md +1 -1
- package/squads/squad-product/tasks/setup-new-client-product-operations.md +1 -1
- package/squads/squad-product/tasks/standardize-cross-client-metrics.md +1 -1
- package/squads/squad-product/tasks/triage-technical-debt-backlog.md +1 -1
- package/squads/squad-product/tasks/write-release-notes.md +1 -1
- package/squads/squad-research/README.md +3 -3
- package/squads/squad-research/agents/audience-intelligence.md +9 -9
- package/squads/squad-research/agents/competitive-intelligence.md +1 -1
- package/squads/squad-research/agents/data-synthesizer.md +11 -11
- package/squads/squad-research/agents/deep-researcher.md +2 -2
- package/squads/squad-research/agents/market-analyst.md +9 -9
- package/squads/squad-research/agents/research-orqx.md +4 -4
- package/squads/squad-research/agents/trend-forecaster.md +2 -2
- package/squads/squad-research/knowledge-base/agentic-second-brain-reference.md +1 -1
- package/squads/squad-research/knowledge-base/community-platforms-reference.md +1 -1
- package/squads/squad-research/knowledge-base/cross-squad-integration-protocol.md +1 -1
- package/squads/squad-research/knowledge-base/multi-agent-research-methodology.md +3 -3
- package/squads/squad-research/squad.yaml +3 -3
- package/squads/squad-research/tasks/analyze-audience-behavior.md +2 -2
- package/squads/squad-research/tasks/analyze-audience-psychographics.md +2 -2
- package/squads/squad-research/tasks/analyze-competitor-pricing.md +1 -1
- package/squads/squad-research/tasks/analyze-industry-trends.md +2 -2
- package/squads/squad-research/tasks/analyze-macro-forces.md +1 -1
- package/squads/squad-research/tasks/analyze-pricing-landscape.md +2 -2
- package/squads/squad-research/tasks/analyze-social-listening.md +2 -2
- package/squads/squad-research/tasks/analyze-value-chain.md +2 -2
- package/squads/squad-research/tasks/answer-strategic-question.md +1 -1
- package/squads/squad-research/tasks/assess-market-maturity.md +2 -2
- package/squads/squad-research/tasks/build-audience-persona.md +2 -2
- package/squads/squad-research/tasks/build-data-narrative.md +2 -2
- package/squads/squad-research/tasks/compile-competitive-dossier.md +2 -2
- package/squads/squad-research/tasks/conduct-deep-research.md +1 -1
- package/squads/squad-research/tasks/conduct-jobs-to-be-done.md +2 -2
- package/squads/squad-research/tasks/create-empathy-map.md +2 -2
- package/squads/squad-research/tasks/create-executive-briefing.md +2 -2
- package/squads/squad-research/tasks/create-insight-deck.md +2 -2
- package/squads/squad-research/tasks/create-research-dossier.md +1 -1
- package/squads/squad-research/tasks/create-research-repository.md +2 -2
- package/squads/squad-research/tasks/create-swot-analysis.md +4 -4
- package/squads/squad-research/tasks/design-survey.md +2 -2
- package/squads/squad-research/tasks/evaluate-market-entry.md +2 -2
- package/squads/squad-research/tasks/evaluate-regulatory-landscape.md +2 -2
- package/squads/squad-research/tasks/forecast-industry-trends.md +2 -2
- package/squads/squad-research/tasks/forecast-market-growth.md +2 -2
- package/squads/squad-research/tasks/generate-actionable-recommendations.md +2 -2
- package/squads/squad-research/tasks/identify-market-segments.md +3 -3
- package/squads/squad-research/tasks/map-audience-ecosystem.md +2 -2
- package/squads/squad-research/tasks/map-audience-journey.md +2 -2
- package/squads/squad-research/tasks/map-industry-ecosystem.md +2 -2
- package/squads/squad-research/tasks/map-market-opportunity.md +2 -2
- package/squads/squad-research/tasks/map-pain-gain-matrix.md +2 -2
- package/squads/squad-research/tasks/map-strategic-implications.md +2 -2
- package/squads/squad-research/tasks/orchestrate-research-pipeline.md +4 -4
- package/squads/squad-research/tasks/predict-market-shifts.md +1 -1
- package/squads/squad-research/tasks/profile-ideal-customer.md +2 -2
- package/squads/squad-research/tasks/run-porter-five-forces.md +1 -1
- package/squads/squad-research/tasks/run-scenario-planning.md +1 -1
- package/squads/squad-research/tasks/segment-audience.md +2 -2
- package/squads/squad-research/tasks/size-market-tam-sam-som.md +2 -2
- package/squads/squad-research/tasks/synthesize-multi-source.md +1 -1
- package/squads/squad-research/tasks/synthesize-research-report.md +2 -2
- package/squads/squad-research/tasks/validate-persona-with-data.md +2 -2
- package/squads/squad-research/tasks/visualize-research-data.md +2 -2
- package/squads/squad-research/templates/audience-persona-template.md +1 -1
- package/squads/squad-research/templates/competitive-dossier-template.md +1 -1
- package/squads/squad-research/templates/market-analysis-template.md +1 -1
- package/squads/squad-research/workflows/audience-intelligence-cycle.yaml +12 -12
- package/squads/squad-research/workflows/competitive-intelligence-cycle.yaml +2 -2
- package/squads/squad-research/workflows/deep-research-cycle.yaml +2 -2
- package/squads/squad-research/workflows/full-research-sprint.yaml +8 -8
- package/squads/squad-research/workflows/market-analysis-cycle.yaml +12 -12
- package/squads/squad-research/workflows/trend-forecasting-cycle.yaml +2 -2
- package/.sinapse-ai/core/execution/context-injector.js +0 -537
- package/.sinapse-ai/core/execution/parallel-executor.js +0 -299
- package/.sinapse-ai/core/execution/parallel-monitor.js +0 -430
- package/.sinapse-ai/core/execution/semantic-merge-engine.js +0 -1748
- package/.sinapse-ai/core/execution/wave-executor.js +0 -401
- package/.sinapse-ai/development/tasks/waves.md +0 -205
- package/.sinapse-ai/lib/build.json +0 -1
- package/.sinapse-ai/workflow-intelligence/engine/wave-analyzer.js +0 -684
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wave Executor
|
|
3
|
-
* Story 10.1 - Parallel Agent Execution
|
|
4
|
-
*
|
|
5
|
-
* Executes task waves in parallel, leveraging the WaveAnalyzer
|
|
6
|
-
* for dependency-aware scheduling.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const EventEmitter = require('events');
|
|
10
|
-
const _path = require('path');
|
|
11
|
-
|
|
12
|
-
// Import dependencies with fallbacks
|
|
13
|
-
let WaveAnalyzer;
|
|
14
|
-
try {
|
|
15
|
-
// Named export — the module exports { WaveAnalyzer, ... }. Requiring the
|
|
16
|
-
// whole object and calling `new WaveAnalyzer()` (line ~37) would throw
|
|
17
|
-
// "not a constructor". Destructure the class.
|
|
18
|
-
({ WaveAnalyzer } = require('../../workflow-intelligence/engine/wave-analyzer'));
|
|
19
|
-
} catch {
|
|
20
|
-
WaveAnalyzer = null;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
let RateLimitManager;
|
|
24
|
-
try {
|
|
25
|
-
RateLimitManager = require('./rate-limit-manager');
|
|
26
|
-
} catch {
|
|
27
|
-
RateLimitManager = null;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
class WaveExecutor extends EventEmitter {
|
|
31
|
-
constructor(config = {}) {
|
|
32
|
-
super();
|
|
33
|
-
|
|
34
|
-
// Configuration
|
|
35
|
-
this.maxParallel = config.maxParallel || 4;
|
|
36
|
-
this.taskTimeout = config.taskTimeout || 10 * 60 * 1000; // 10 minutes
|
|
37
|
-
this.continueOnNonCriticalFailure = config.continueOnNonCriticalFailure !== false;
|
|
38
|
-
|
|
39
|
-
// Dependencies
|
|
40
|
-
this.waveAnalyzer = config.waveAnalyzer || (WaveAnalyzer ? new WaveAnalyzer() : null);
|
|
41
|
-
this.taskExecutor = config.taskExecutor || null;
|
|
42
|
-
this.rateLimitManager =
|
|
43
|
-
config.rateLimitManager || (RateLimitManager ? new RateLimitManager() : null);
|
|
44
|
-
|
|
45
|
-
// State
|
|
46
|
-
this.activeExecutions = new Map();
|
|
47
|
-
this.completedWaves = [];
|
|
48
|
-
this.currentWaveIndex = 0;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Execute all waves for a workflow
|
|
53
|
-
* @param {string} workflowId - Workflow identifier
|
|
54
|
-
* @param {Object} context - Execution context
|
|
55
|
-
* @returns {Promise<Object>} - Execution results
|
|
56
|
-
*/
|
|
57
|
-
async executeWaves(workflowId, context = {}) {
|
|
58
|
-
const startTime = Date.now();
|
|
59
|
-
|
|
60
|
-
// Get wave analysis
|
|
61
|
-
let analysis;
|
|
62
|
-
if (this.waveAnalyzer) {
|
|
63
|
-
analysis = this.waveAnalyzer.analyze(workflowId);
|
|
64
|
-
} else {
|
|
65
|
-
// Fallback: single wave with all tasks
|
|
66
|
-
analysis = {
|
|
67
|
-
waves: [
|
|
68
|
-
{
|
|
69
|
-
index: 1,
|
|
70
|
-
tasks: context.tasks || [],
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (!analysis.waves || analysis.waves.length === 0) {
|
|
77
|
-
return {
|
|
78
|
-
workflowId,
|
|
79
|
-
success: true,
|
|
80
|
-
waves: [],
|
|
81
|
-
totalDuration: 0,
|
|
82
|
-
message: 'No waves to execute',
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
this.emit('execution_started', { workflowId, totalWaves: analysis.waves.length });
|
|
87
|
-
|
|
88
|
-
const results = [];
|
|
89
|
-
let aborted = false;
|
|
90
|
-
|
|
91
|
-
for (const wave of analysis.waves) {
|
|
92
|
-
if (aborted) break;
|
|
93
|
-
|
|
94
|
-
this.currentWaveIndex = wave.index;
|
|
95
|
-
this.emit('wave_started', {
|
|
96
|
-
waveIndex: wave.index,
|
|
97
|
-
tasks: wave.tasks.map((t) => ({ id: t.id, description: t.description })),
|
|
98
|
-
totalTasks: wave.tasks.length,
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
const waveResult = await this.executeWave(wave, context);
|
|
102
|
-
|
|
103
|
-
results.push({
|
|
104
|
-
wave: wave.index,
|
|
105
|
-
results: waveResult,
|
|
106
|
-
allSucceeded: waveResult.every((r) => r.success),
|
|
107
|
-
duration: waveResult.reduce((sum, r) => sum + (r.duration || 0), 0),
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
this.emit('wave_completed', {
|
|
111
|
-
waveIndex: wave.index,
|
|
112
|
-
results: waveResult,
|
|
113
|
-
success: waveResult.every((r) => r.success),
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
// Check if we should continue
|
|
117
|
-
const criticalFailed = waveResult.some((r) => !r.success && r.critical);
|
|
118
|
-
if (criticalFailed) {
|
|
119
|
-
this.emit('wave_failed', {
|
|
120
|
-
waveIndex: wave.index,
|
|
121
|
-
reason: 'critical_task_failed',
|
|
122
|
-
failedTasks: waveResult.filter((r) => !r.success && r.critical),
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
if (!this.continueOnNonCriticalFailure) {
|
|
126
|
-
aborted = true;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const totalDuration = Date.now() - startTime;
|
|
132
|
-
|
|
133
|
-
const executionResult = {
|
|
134
|
-
workflowId,
|
|
135
|
-
waves: results,
|
|
136
|
-
success: !aborted && results.every((w) => w.allSucceeded),
|
|
137
|
-
aborted,
|
|
138
|
-
totalDuration,
|
|
139
|
-
metrics: this.calculateMetrics(results),
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
this.emit('execution_completed', executionResult);
|
|
143
|
-
|
|
144
|
-
return executionResult;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Execute a single wave with parallel task execution
|
|
149
|
-
* @param {Object} wave - Wave definition
|
|
150
|
-
* @param {Object} context - Execution context
|
|
151
|
-
* @returns {Promise<Array>} - Task results
|
|
152
|
-
*/
|
|
153
|
-
async executeWave(wave, context) {
|
|
154
|
-
const tasks = wave.tasks || [];
|
|
155
|
-
|
|
156
|
-
if (tasks.length === 0) {
|
|
157
|
-
return [];
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Split tasks into chunks based on maxParallel
|
|
161
|
-
const chunks = this.chunkArray(tasks, this.maxParallel);
|
|
162
|
-
const allResults = [];
|
|
163
|
-
|
|
164
|
-
for (const chunk of chunks) {
|
|
165
|
-
// Execute chunk in parallel
|
|
166
|
-
const promises = chunk.map((task) => this.executeTaskWithTimeout(task, context));
|
|
167
|
-
|
|
168
|
-
const chunkResults = await Promise.allSettled(promises);
|
|
169
|
-
|
|
170
|
-
// Process results
|
|
171
|
-
for (let i = 0; i < chunkResults.length; i++) {
|
|
172
|
-
const result = chunkResults[i];
|
|
173
|
-
const task = chunk[i];
|
|
174
|
-
|
|
175
|
-
if (result.status === 'fulfilled') {
|
|
176
|
-
allResults.push({
|
|
177
|
-
taskId: task.id,
|
|
178
|
-
success: result.value.success,
|
|
179
|
-
result: result.value,
|
|
180
|
-
critical: task.critical || false,
|
|
181
|
-
duration: result.value.duration || 0,
|
|
182
|
-
});
|
|
183
|
-
} else {
|
|
184
|
-
allResults.push({
|
|
185
|
-
taskId: task.id,
|
|
186
|
-
success: false,
|
|
187
|
-
error: result.reason?.message || 'Unknown error',
|
|
188
|
-
critical: task.critical || false,
|
|
189
|
-
duration: 0,
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
this.emit('task_completed', {
|
|
194
|
-
taskId: task.id,
|
|
195
|
-
success: result.status === 'fulfilled' && result.value?.success,
|
|
196
|
-
waveIndex: wave.index,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return allResults;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Execute a task with timeout
|
|
206
|
-
* @param {Object} task - Task to execute
|
|
207
|
-
* @param {Object} context - Execution context
|
|
208
|
-
* @returns {Promise<Object>} - Task result
|
|
209
|
-
*/
|
|
210
|
-
async executeTaskWithTimeout(task, context) {
|
|
211
|
-
const startTime = Date.now();
|
|
212
|
-
|
|
213
|
-
// Track active execution
|
|
214
|
-
this.activeExecutions.set(task.id, {
|
|
215
|
-
task,
|
|
216
|
-
startTime,
|
|
217
|
-
status: 'running',
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
this.emit('task_started', { taskId: task.id, description: task.description });
|
|
221
|
-
|
|
222
|
-
try {
|
|
223
|
-
// Create timeout promise
|
|
224
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
225
|
-
setTimeout(() => {
|
|
226
|
-
reject(new Error(`Task ${task.id} timed out after ${this.taskTimeout}ms`));
|
|
227
|
-
}, this.taskTimeout);
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
// Execute task with rate limiting if available
|
|
231
|
-
let executionPromise;
|
|
232
|
-
if (this.taskExecutor) {
|
|
233
|
-
if (this.rateLimitManager) {
|
|
234
|
-
executionPromise = this.rateLimitManager.executeWithRetry(
|
|
235
|
-
() => this.taskExecutor(task, context),
|
|
236
|
-
{ taskId: task.id },
|
|
237
|
-
);
|
|
238
|
-
} else {
|
|
239
|
-
executionPromise = this.taskExecutor(task, context);
|
|
240
|
-
}
|
|
241
|
-
} else {
|
|
242
|
-
// Default executor (no-op)
|
|
243
|
-
executionPromise = this.defaultExecutor(task, context);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
// Race between execution and timeout
|
|
247
|
-
const result = await Promise.race([executionPromise, timeoutPromise]);
|
|
248
|
-
|
|
249
|
-
// Update active execution
|
|
250
|
-
this.activeExecutions.set(task.id, {
|
|
251
|
-
task,
|
|
252
|
-
startTime,
|
|
253
|
-
endTime: Date.now(),
|
|
254
|
-
status: 'completed',
|
|
255
|
-
success: result.success,
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
return {
|
|
259
|
-
...result,
|
|
260
|
-
duration: Date.now() - startTime,
|
|
261
|
-
};
|
|
262
|
-
} catch (error) {
|
|
263
|
-
// Update active execution
|
|
264
|
-
this.activeExecutions.set(task.id, {
|
|
265
|
-
task,
|
|
266
|
-
startTime,
|
|
267
|
-
endTime: Date.now(),
|
|
268
|
-
status: 'failed',
|
|
269
|
-
error: error.message,
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
return {
|
|
273
|
-
success: false,
|
|
274
|
-
error: error.message,
|
|
275
|
-
duration: Date.now() - startTime,
|
|
276
|
-
};
|
|
277
|
-
} finally {
|
|
278
|
-
// Remove from active after a delay (for monitoring)
|
|
279
|
-
setTimeout(() => {
|
|
280
|
-
this.activeExecutions.delete(task.id);
|
|
281
|
-
}, 5000);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Default task executor (placeholder)
|
|
287
|
-
* @param {Object} task - Task to execute
|
|
288
|
-
* @param {Object} context - Execution context
|
|
289
|
-
* @returns {Promise<Object>} - Execution result
|
|
290
|
-
*/
|
|
291
|
-
async defaultExecutor(task, _context) {
|
|
292
|
-
// This should be overridden or configured
|
|
293
|
-
console.log(`[WaveExecutor] Executing task: ${task.id}`);
|
|
294
|
-
return { success: true, output: 'Default executor - no action taken' };
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Split array into chunks
|
|
299
|
-
* @param {Array} array - Array to split
|
|
300
|
-
* @param {number} size - Chunk size
|
|
301
|
-
* @returns {Array<Array>} - Chunked arrays
|
|
302
|
-
*/
|
|
303
|
-
chunkArray(array, size) {
|
|
304
|
-
const chunks = [];
|
|
305
|
-
for (let i = 0; i < array.length; i += size) {
|
|
306
|
-
chunks.push(array.slice(i, i + size));
|
|
307
|
-
}
|
|
308
|
-
return chunks;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* Calculate execution metrics
|
|
313
|
-
* @param {Array} waveResults - Results from all waves
|
|
314
|
-
* @returns {Object} - Metrics
|
|
315
|
-
*/
|
|
316
|
-
calculateMetrics(waveResults) {
|
|
317
|
-
const allTasks = waveResults.flatMap((w) => w.results);
|
|
318
|
-
const successful = allTasks.filter((t) => t.success).length;
|
|
319
|
-
const failed = allTasks.filter((t) => !t.success).length;
|
|
320
|
-
const totalDuration = allTasks.reduce((sum, t) => sum + (t.duration || 0), 0);
|
|
321
|
-
|
|
322
|
-
// Calculate wall time (actual elapsed time)
|
|
323
|
-
const wallTime = waveResults.reduce((sum, w) => {
|
|
324
|
-
const maxDuration = Math.max(...w.results.map((r) => r.duration || 0));
|
|
325
|
-
return sum + maxDuration;
|
|
326
|
-
}, 0);
|
|
327
|
-
|
|
328
|
-
return {
|
|
329
|
-
totalTasks: allTasks.length,
|
|
330
|
-
successful,
|
|
331
|
-
failed,
|
|
332
|
-
successRate: allTasks.length > 0 ? (successful / allTasks.length) * 100 : 100,
|
|
333
|
-
totalDuration,
|
|
334
|
-
wallTime,
|
|
335
|
-
parallelEfficiency: wallTime > 0 ? totalDuration / wallTime : 1,
|
|
336
|
-
totalWaves: waveResults.length,
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Get current execution status
|
|
342
|
-
* @returns {Object} - Current status
|
|
343
|
-
*/
|
|
344
|
-
getStatus() {
|
|
345
|
-
const active = [];
|
|
346
|
-
for (const [taskId, execution] of this.activeExecutions) {
|
|
347
|
-
active.push({
|
|
348
|
-
taskId,
|
|
349
|
-
status: execution.status,
|
|
350
|
-
elapsed: Date.now() - execution.startTime,
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
return {
|
|
355
|
-
currentWave: this.currentWaveIndex,
|
|
356
|
-
activeExecutions: active,
|
|
357
|
-
completedWaves: this.completedWaves.length,
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Format status for CLI output
|
|
363
|
-
* @returns {string} - Formatted status
|
|
364
|
-
*/
|
|
365
|
-
formatStatus() {
|
|
366
|
-
const status = this.getStatus();
|
|
367
|
-
|
|
368
|
-
let output = '🌊 Wave Executor Status\n';
|
|
369
|
-
output += '━'.repeat(40) + '\n\n';
|
|
370
|
-
|
|
371
|
-
output += `Current Wave: ${status.currentWave}\n`;
|
|
372
|
-
output += `Completed Waves: ${status.completedWaves}\n`;
|
|
373
|
-
output += `Active Executions: ${status.activeExecutions.length}\n\n`;
|
|
374
|
-
|
|
375
|
-
if (status.activeExecutions.length > 0) {
|
|
376
|
-
output += '**Active Tasks:**\n';
|
|
377
|
-
for (const exec of status.activeExecutions) {
|
|
378
|
-
const elapsed = Math.round(exec.elapsed / 1000);
|
|
379
|
-
const icon = exec.status === 'running' ? '🔄' : exec.status === 'completed' ? '✅' : '❌';
|
|
380
|
-
output += ` ${icon} ${exec.taskId} - ${elapsed}s\n`;
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
return output;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* Cancel all active executions
|
|
389
|
-
*/
|
|
390
|
-
cancelAll() {
|
|
391
|
-
for (const [taskId, execution] of this.activeExecutions) {
|
|
392
|
-
execution.status = 'cancelled';
|
|
393
|
-
this.emit('task_cancelled', { taskId });
|
|
394
|
-
}
|
|
395
|
-
this.emit('execution_cancelled', { reason: 'user_requested' });
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
module.exports = WaveExecutor;
|
|
400
|
-
module.exports.WaveExecutor = WaveExecutor;
|
|
401
|
-
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
# Task: `*waves` - Wave Analysis
|
|
2
|
-
|
|
3
|
-
<!-- Story: WIS-4 - Wave Analysis Engine -->
|
|
4
|
-
<!-- Version: 1.0.0 -->
|
|
5
|
-
<!-- Created: 2025-12-25 -->
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
Analyzes workflow task dependencies to identify waves of tasks that can execute in parallel. Shows optimization opportunities and critical path.
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
*waves [workflow-name] [options]
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Arguments
|
|
18
|
-
|
|
19
|
-
| Argument | Type | Required | Description |
|
|
20
|
-
|----------|------|----------|-------------|
|
|
21
|
-
| `workflow` | string | No | Workflow name to analyze (default: auto-detect from context) |
|
|
22
|
-
|
|
23
|
-
## Options
|
|
24
|
-
|
|
25
|
-
| Option | Type | Description |
|
|
26
|
-
|--------|------|-------------|
|
|
27
|
-
| `--visual` | flag | Show ASCII visualization of wave structure |
|
|
28
|
-
| `--json` | flag | Output as JSON format |
|
|
29
|
-
| `--help` | flag | Show this help message |
|
|
30
|
-
|
|
31
|
-
## Examples
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
# Analyze current workflow (auto-detected)
|
|
35
|
-
*waves
|
|
36
|
-
|
|
37
|
-
# Analyze specific workflow
|
|
38
|
-
*waves story_development
|
|
39
|
-
|
|
40
|
-
# Visual ASCII representation
|
|
41
|
-
*waves story_development --visual
|
|
42
|
-
|
|
43
|
-
# JSON output for programmatic use
|
|
44
|
-
*waves story_development --json
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Output
|
|
48
|
-
|
|
49
|
-
### Standard Output
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
Wave Analysis: story_development
|
|
53
|
-
════════════════════════════════════════
|
|
54
|
-
|
|
55
|
-
Wave 1 (parallel):
|
|
56
|
-
└─ read-story
|
|
57
|
-
└─ setup-branch
|
|
58
|
-
|
|
59
|
-
Wave 2:
|
|
60
|
-
└─ implement
|
|
61
|
-
|
|
62
|
-
Wave 3 (parallel):
|
|
63
|
-
└─ write-tests
|
|
64
|
-
└─ update-docs
|
|
65
|
-
|
|
66
|
-
Wave 4:
|
|
67
|
-
└─ run-tests
|
|
68
|
-
|
|
69
|
-
Total Sequential: 57min
|
|
70
|
-
Total Parallel: 42min
|
|
71
|
-
Optimization: 26% faster
|
|
72
|
-
|
|
73
|
-
Critical Path: read-story → implement → write-tests → run-tests
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Visual Output (--visual)
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
Wave Analysis: story_development
|
|
80
|
-
════════════════════════════════════════
|
|
81
|
-
|
|
82
|
-
Wave 1 ──┬── read-story (5min)
|
|
83
|
-
└── setup-branch (2min)
|
|
84
|
-
│
|
|
85
|
-
Wave 2 ──────── implement (30min)
|
|
86
|
-
│
|
|
87
|
-
Wave 3 ──┬── write-tests (10min)
|
|
88
|
-
└── update-docs (5min)
|
|
89
|
-
│
|
|
90
|
-
Wave 4 ──────── run-tests (5min)
|
|
91
|
-
|
|
92
|
-
Total Sequential: 57min
|
|
93
|
-
Total Parallel: 42min
|
|
94
|
-
Optimization: 26% faster
|
|
95
|
-
|
|
96
|
-
Critical Path: read-story → implement → write-tests → run-tests
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### JSON Output (--json)
|
|
100
|
-
|
|
101
|
-
```json
|
|
102
|
-
{
|
|
103
|
-
"workflowId": "story_development",
|
|
104
|
-
"totalTasks": 6,
|
|
105
|
-
"waves": [
|
|
106
|
-
{
|
|
107
|
-
"waveNumber": 1,
|
|
108
|
-
"tasks": ["read-story", "setup-branch"],
|
|
109
|
-
"parallel": true,
|
|
110
|
-
"dependsOn": [],
|
|
111
|
-
"estimatedDuration": "5min"
|
|
112
|
-
}
|
|
113
|
-
],
|
|
114
|
-
"optimizationGain": "26%",
|
|
115
|
-
"criticalPath": ["read-story", "implement", "write-tests", "run-tests"]
|
|
116
|
-
}
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## Circular Dependency Handling
|
|
120
|
-
|
|
121
|
-
If circular dependencies are detected, the command will show an error:
|
|
122
|
-
|
|
123
|
-
```
|
|
124
|
-
❌ Circular Dependency Detected!
|
|
125
|
-
|
|
126
|
-
Cycle: task-a → task-b → task-c → task-a
|
|
127
|
-
|
|
128
|
-
Suggestion: Remove dependency from task-c to task-a
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
## Integration
|
|
132
|
-
|
|
133
|
-
### With `*next` Command
|
|
134
|
-
|
|
135
|
-
The `*waves` analysis integrates with the `*next` command to show wave context:
|
|
136
|
-
|
|
137
|
-
```
|
|
138
|
-
🧭 Workflow: story_development
|
|
139
|
-
📍 State: in_development (Wave 2 of 4)
|
|
140
|
-
|
|
141
|
-
Current Wave (parallel):
|
|
142
|
-
├─ `*write-tests` - Write unit tests ⏳
|
|
143
|
-
└─ `*update-docs` - Update documentation ⏳
|
|
144
|
-
|
|
145
|
-
Next Wave (after current completes):
|
|
146
|
-
└─ `*run-tests` - Execute test suite
|
|
147
|
-
|
|
148
|
-
💡 Tip: Run both current wave tasks in parallel to save ~15min
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Implementation
|
|
152
|
-
|
|
153
|
-
```javascript
|
|
154
|
-
// Task implementation
|
|
155
|
-
const { analyzeWaves, createWaveAnalyzer } = require('.sinapse-ai/workflow-intelligence');
|
|
156
|
-
|
|
157
|
-
async function executeWaves(args, options) {
|
|
158
|
-
const workflowId = args[0] || await detectCurrentWorkflow();
|
|
159
|
-
const analyzer = createWaveAnalyzer();
|
|
160
|
-
|
|
161
|
-
try {
|
|
162
|
-
const result = analyzer.analyzeWaves(workflowId);
|
|
163
|
-
const output = analyzer.formatOutput(result, {
|
|
164
|
-
visual: options.visual,
|
|
165
|
-
json: options.json
|
|
166
|
-
});
|
|
167
|
-
console.log(output);
|
|
168
|
-
} catch (error) {
|
|
169
|
-
if (error.name === 'CircularDependencyError') {
|
|
170
|
-
console.error('❌ Circular Dependency Detected!\n');
|
|
171
|
-
console.error(`Cycle: ${error.cycle.join(' → ')}`);
|
|
172
|
-
console.error(`\nSuggestion: ${error.getSuggestion()}`);
|
|
173
|
-
process.exit(1);
|
|
174
|
-
}
|
|
175
|
-
throw error;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
## Performance
|
|
181
|
-
|
|
182
|
-
| Workflow Size | Analysis Time |
|
|
183
|
-
|--------------|---------------|
|
|
184
|
-
| Small (5 tasks) | <10ms |
|
|
185
|
-
| Medium (20 tasks) | <30ms |
|
|
186
|
-
| Large (50 tasks) | <50ms |
|
|
187
|
-
|
|
188
|
-
## Related Commands
|
|
189
|
-
|
|
190
|
-
- `*next` - Get next command suggestions (integrates wave context)
|
|
191
|
-
- `*workflow` - Show workflow status
|
|
192
|
-
- `*help` - Show all available commands
|
|
193
|
-
|
|
194
|
-
## Agent Integration
|
|
195
|
-
|
|
196
|
-
This task is available for:
|
|
197
|
-
- `@developer` - Developer Agent
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
## Change Log
|
|
202
|
-
|
|
203
|
-
| Version | Date | Changes |
|
|
204
|
-
|---------|------|---------|
|
|
205
|
-
| 1.0.0 | 2025-12-25 | Initial implementation (WIS-4) |
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"built": true}
|