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
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
* Troubleshooting System
|
|
3
3
|
* Task 1.8.6: Provides actionable troubleshooting for errors
|
|
4
4
|
*
|
|
5
|
+
* Story onda2-p6 (AF-20260702 item 2.9) — migrated to i18n (PT+EN), following
|
|
6
|
+
* the pattern established in the sibling module report-generator.js (100% i18n).
|
|
7
|
+
*
|
|
5
8
|
* @module wizard/validation/troubleshooting-system
|
|
6
9
|
*/
|
|
7
10
|
|
|
8
11
|
const chalk = require('chalk');
|
|
9
12
|
const inquirer = require('inquirer');
|
|
13
|
+
const { t, tf, tList } = require('../i18n');
|
|
10
14
|
|
|
11
15
|
// Canonical repo + docs locations. The legacy `docs.SinapseAI.com` domain never
|
|
12
16
|
// existed; every help link points at real, shipped docs in the GitHub repo
|
|
@@ -16,157 +20,81 @@ const DOCS_BASE = `${REPO_URL}/blob/main/docs`;
|
|
|
16
20
|
|
|
17
21
|
/**
|
|
18
22
|
* Troubleshooting database
|
|
19
|
-
* Maps error codes to detailed troubleshooting information
|
|
23
|
+
* Maps error codes to detailed troubleshooting information.
|
|
24
|
+
*
|
|
25
|
+
* `problemKey`/`causesKey`/`solutionsKey` point at i18n.js entries (resolved
|
|
26
|
+
* at display time via t()/tList(), so the active language always wins).
|
|
27
|
+
* `docs` and `priority` are not natural-language content — left as-is.
|
|
20
28
|
*/
|
|
21
29
|
const TROUBLESHOOTING_DATABASE = {
|
|
22
30
|
ENV_FILE_MISSING: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'File creation permissions issue',
|
|
27
|
-
'.env accidentally deleted',
|
|
28
|
-
],
|
|
29
|
-
solutions: [
|
|
30
|
-
'Re-run wizard: npx sinapse-ai@latest install',
|
|
31
|
-
'Manually create .env from template: cp .env.example .env',
|
|
32
|
-
'Check file permissions in project directory',
|
|
33
|
-
],
|
|
31
|
+
problemKey: 'troubleshootEnvFileMissingProblem',
|
|
32
|
+
causesKey: 'troubleshootEnvFileMissingCauses',
|
|
33
|
+
solutionsKey: 'troubleshootEnvFileMissingSolutions',
|
|
34
34
|
docs: `${DOCS_BASE}/installation/troubleshooting.md`,
|
|
35
35
|
priority: 'critical',
|
|
36
36
|
},
|
|
37
37
|
|
|
38
38
|
CORE_CONFIG_MISSING: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
'.sinapse-ai directory missing',
|
|
43
|
-
'File creation failed',
|
|
44
|
-
],
|
|
45
|
-
solutions: [
|
|
46
|
-
'Re-run wizard: npx sinapse-ai@latest install',
|
|
47
|
-
'Check .sinapse-ai directory exists',
|
|
48
|
-
'Manually create from template',
|
|
49
|
-
],
|
|
39
|
+
problemKey: 'troubleshootCoreConfigMissingProblem',
|
|
40
|
+
causesKey: 'troubleshootCoreConfigMissingCauses',
|
|
41
|
+
solutionsKey: 'troubleshootCoreConfigMissingSolutions',
|
|
50
42
|
docs: `${DOCS_BASE}/troubleshooting.md`,
|
|
51
43
|
priority: 'high',
|
|
52
44
|
},
|
|
53
45
|
|
|
54
46
|
MCP_HEALTH_CHECK_FAILED: {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
'Network connectivity issues',
|
|
59
|
-
'MCP service temporarily unavailable',
|
|
60
|
-
'Package not installed correctly',
|
|
61
|
-
],
|
|
62
|
-
solutions: [
|
|
63
|
-
'Verify API key in .env file',
|
|
64
|
-
'Test network: curl https://api.service.com/health',
|
|
65
|
-
'Retry MCP installation: npm run install:mcps',
|
|
66
|
-
'Check MCP service status',
|
|
67
|
-
'Verify npx can access package: npx -y [package-name] --version',
|
|
68
|
-
],
|
|
47
|
+
problemKey: 'troubleshootMcpHealthCheckFailedProblem',
|
|
48
|
+
causesKey: 'troubleshootMcpHealthCheckFailedCauses',
|
|
49
|
+
solutionsKey: 'troubleshootMcpHealthCheckFailedSolutions',
|
|
69
50
|
docs: `${DOCS_BASE}/troubleshooting.md`,
|
|
70
51
|
priority: 'medium',
|
|
71
52
|
},
|
|
72
53
|
|
|
73
54
|
ALL_MCP_HEALTH_CHECKS_FAILED: {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
'MCPs not installed correctly',
|
|
78
|
-
'Configuration file corrupted',
|
|
79
|
-
'API keys not configured',
|
|
80
|
-
],
|
|
81
|
-
solutions: [
|
|
82
|
-
'Check internet connection',
|
|
83
|
-
'Re-run MCP installation',
|
|
84
|
-
'Verify .mcp.json syntax',
|
|
85
|
-
'Configure API keys in .env',
|
|
86
|
-
'Delete .mcp.json and reinstall',
|
|
87
|
-
],
|
|
55
|
+
problemKey: 'troubleshootAllMcpHealthChecksFailedProblem',
|
|
56
|
+
causesKey: 'troubleshootAllMcpHealthChecksFailedCauses',
|
|
57
|
+
solutionsKey: 'troubleshootAllMcpHealthChecksFailedSolutions',
|
|
88
58
|
docs: `${DOCS_BASE}/troubleshooting.md`,
|
|
89
59
|
priority: 'high',
|
|
90
60
|
},
|
|
91
61
|
|
|
92
62
|
GITIGNORE_CRITICAL_MISSING: {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
'.gitignore manually edited incorrectly',
|
|
97
|
-
'Git not initialized',
|
|
98
|
-
],
|
|
99
|
-
solutions: [
|
|
100
|
-
'Add missing entries to .gitignore',
|
|
101
|
-
'Copy from template: .env, node_modules, *.key, *.pem',
|
|
102
|
-
'Initialize git if needed: git init',
|
|
103
|
-
],
|
|
63
|
+
problemKey: 'troubleshootGitignoreCriticalMissingProblem',
|
|
64
|
+
causesKey: 'troubleshootGitignoreCriticalMissingCauses',
|
|
65
|
+
solutionsKey: 'troubleshootGitignoreCriticalMissingSolutions',
|
|
104
66
|
docs: `${DOCS_BASE}/security/security-best-practices.md`,
|
|
105
67
|
priority: 'high',
|
|
106
68
|
},
|
|
107
69
|
|
|
108
70
|
DEPS_INSTALL_FAILED: {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
'Package manager not installed',
|
|
113
|
-
'npm/yarn registry unavailable',
|
|
114
|
-
'Disk space insufficient',
|
|
115
|
-
],
|
|
116
|
-
solutions: [
|
|
117
|
-
'Check internet connection',
|
|
118
|
-
'Verify package manager installed: npm --version',
|
|
119
|
-
'Clear cache: npm cache clean --force',
|
|
120
|
-
'Try different package manager: yarn or pnpm',
|
|
121
|
-
'Check disk space: df -h (Unix) or dir (Windows)',
|
|
122
|
-
],
|
|
71
|
+
problemKey: 'troubleshootDepsInstallFailedProblem',
|
|
72
|
+
causesKey: 'troubleshootDepsInstallFailedCauses',
|
|
73
|
+
solutionsKey: 'troubleshootDepsInstallFailedSolutions',
|
|
123
74
|
docs: `${DOCS_BASE}/installation/troubleshooting.md`,
|
|
124
75
|
priority: 'critical',
|
|
125
76
|
},
|
|
126
77
|
|
|
127
78
|
CRITICAL_DEPS_MISSING: {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
'node_modules corrupted',
|
|
132
|
-
'Package installation failed silently',
|
|
133
|
-
],
|
|
134
|
-
solutions: [
|
|
135
|
-
'Delete node_modules: rm -rf node_modules',
|
|
136
|
-
'Delete lock file: rm package-lock.json',
|
|
137
|
-
'Reinstall: npm install',
|
|
138
|
-
'Try clean install: npm ci',
|
|
139
|
-
],
|
|
79
|
+
problemKey: 'troubleshootCriticalDepsMissingProblem',
|
|
80
|
+
causesKey: 'troubleshootCriticalDepsMissingCauses',
|
|
81
|
+
solutionsKey: 'troubleshootCriticalDepsMissingSolutions',
|
|
140
82
|
docs: `${DOCS_BASE}/installation/troubleshooting.md`,
|
|
141
83
|
priority: 'high',
|
|
142
84
|
},
|
|
143
85
|
|
|
144
86
|
VULNERABILITIES_FOUND: {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
'Transitive dependencies with security issues',
|
|
149
|
-
],
|
|
150
|
-
solutions: [
|
|
151
|
-
'Run: npm audit fix',
|
|
152
|
-
'Run: npm audit fix --force (if needed)',
|
|
153
|
-
'Update packages: npm update',
|
|
154
|
-
'Review: npm audit for details',
|
|
155
|
-
],
|
|
87
|
+
problemKey: 'troubleshootVulnerabilitiesFoundProblem',
|
|
88
|
+
causesKey: 'troubleshootVulnerabilitiesFoundCauses',
|
|
89
|
+
solutionsKey: 'troubleshootVulnerabilitiesFoundSolutions',
|
|
156
90
|
docs: 'https://docs.npmjs.com/cli/v8/commands/npm-audit',
|
|
157
91
|
priority: 'medium',
|
|
158
92
|
},
|
|
159
93
|
|
|
160
94
|
ENV_PERMISSIONS_INSECURE: {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
'Permissions not set during installation',
|
|
165
|
-
],
|
|
166
|
-
solutions: [
|
|
167
|
-
'Run: chmod 600 .env',
|
|
168
|
-
'Verify: ls -la .env',
|
|
169
|
-
],
|
|
95
|
+
problemKey: 'troubleshootEnvPermissionsInsecureProblem',
|
|
96
|
+
causesKey: 'troubleshootEnvPermissionsInsecureCauses',
|
|
97
|
+
solutionsKey: 'troubleshootEnvPermissionsInsecureSolutions',
|
|
170
98
|
docs: `${DOCS_BASE}/security/security-best-practices.md`,
|
|
171
99
|
priority: 'medium',
|
|
172
100
|
},
|
|
@@ -184,7 +112,7 @@ async function offerTroubleshooting(errors) {
|
|
|
184
112
|
|
|
185
113
|
console.log('');
|
|
186
114
|
console.log(chalk.bold.cyan('═══════════════════════════════════════════════'));
|
|
187
|
-
console.log(chalk.bold.cyan('🔧
|
|
115
|
+
console.log(chalk.bold.cyan('🔧 ' + t('troubleshootGuideTitle')));
|
|
188
116
|
console.log(chalk.bold.cyan('═══════════════════════════════════════════════'));
|
|
189
117
|
console.log('');
|
|
190
118
|
|
|
@@ -223,18 +151,18 @@ async function offerTroubleshooting(errors) {
|
|
|
223
151
|
{
|
|
224
152
|
type: 'confirm',
|
|
225
153
|
name: 'viewLogs',
|
|
226
|
-
message: '
|
|
154
|
+
message: t('troubleshootViewLogsPrompt'),
|
|
227
155
|
default: false,
|
|
228
156
|
},
|
|
229
157
|
]);
|
|
230
158
|
|
|
231
159
|
if (viewLogs) {
|
|
232
160
|
console.log('');
|
|
233
|
-
console.log(chalk.bold('📄
|
|
161
|
+
console.log(chalk.bold('📄 ' + t('troubleshootInstallationLogsTitle')));
|
|
234
162
|
console.log(chalk.dim(' - .sinapse/install-log.txt'));
|
|
235
163
|
console.log(chalk.dim(' - .sinapse/install-errors.log'));
|
|
236
164
|
console.log('');
|
|
237
|
-
console.log(chalk.dim('
|
|
165
|
+
console.log(chalk.dim(t('troubleshootViewWithCat')));
|
|
238
166
|
}
|
|
239
167
|
|
|
240
168
|
// Offer to open documentation
|
|
@@ -242,23 +170,23 @@ async function offerTroubleshooting(errors) {
|
|
|
242
170
|
{
|
|
243
171
|
type: 'confirm',
|
|
244
172
|
name: 'openDocs',
|
|
245
|
-
message: '
|
|
173
|
+
message: t('troubleshootOpenDocsPrompt'),
|
|
246
174
|
default: false,
|
|
247
175
|
},
|
|
248
176
|
]);
|
|
249
177
|
|
|
250
178
|
if (openDocs) {
|
|
251
179
|
console.log('');
|
|
252
|
-
console.log(chalk.green('📚
|
|
180
|
+
console.log(chalk.green('📚 ' + t('troubleshootDocumentationTitle')));
|
|
253
181
|
console.log(chalk.green(` ${DOCS_BASE}/troubleshooting.md`));
|
|
254
182
|
console.log('');
|
|
255
183
|
}
|
|
256
184
|
|
|
257
185
|
// Offer support contact
|
|
258
186
|
console.log('');
|
|
259
|
-
console.log(chalk.bold('💬
|
|
260
|
-
console.log(chalk.dim(` -
|
|
261
|
-
console.log(chalk.dim(` -
|
|
187
|
+
console.log(chalk.bold('💬 ' + t('troubleshootNeedHelpTitle')));
|
|
188
|
+
console.log(chalk.dim(` - ${tf('troubleshootGithubIssuesLine', { url: `${REPO_URL}/issues` })}`));
|
|
189
|
+
console.log(chalk.dim(` - ${tf('troubleshootDocumentationLine', { url: `${DOCS_BASE}/troubleshooting.md` })}`));
|
|
262
190
|
console.log('');
|
|
263
191
|
}
|
|
264
192
|
|
|
@@ -274,12 +202,12 @@ function displayTroubleshooting(code, troubleshooting, errorInstances) {
|
|
|
274
202
|
low: chalk.gray('⚪'),
|
|
275
203
|
}[troubleshooting.priority] || '⚪';
|
|
276
204
|
|
|
277
|
-
console.log(chalk.bold(`${priorityIcon} ${troubleshooting.
|
|
205
|
+
console.log(chalk.bold(`${priorityIcon} ${t(troubleshooting.problemKey)}`));
|
|
278
206
|
console.log('');
|
|
279
207
|
|
|
280
208
|
// Show affected items
|
|
281
209
|
if (errorInstances.length > 1) {
|
|
282
|
-
console.log(chalk.dim(
|
|
210
|
+
console.log(chalk.dim(tf('troubleshootAffectedItems', { count: errorInstances.length })));
|
|
283
211
|
errorInstances.slice(0, 3).forEach(err => {
|
|
284
212
|
if (err.file) {
|
|
285
213
|
console.log(chalk.dim(` - ${err.file}`));
|
|
@@ -288,30 +216,31 @@ function displayTroubleshooting(code, troubleshooting, errorInstances) {
|
|
|
288
216
|
}
|
|
289
217
|
});
|
|
290
218
|
if (errorInstances.length > 3) {
|
|
291
|
-
console.log(chalk.dim(
|
|
219
|
+
console.log(chalk.dim(tf('troubleshootAndMore', { count: errorInstances.length - 3 })));
|
|
292
220
|
}
|
|
293
221
|
console.log('');
|
|
294
222
|
}
|
|
295
223
|
|
|
296
224
|
// Show causes
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
225
|
+
const causes = tList(troubleshooting.causesKey);
|
|
226
|
+
if (causes.length > 0) {
|
|
227
|
+
console.log(chalk.bold(t('troubleshootPossibleCauses')));
|
|
228
|
+
causes.forEach((cause, i) => {
|
|
300
229
|
console.log(` ${i + 1}. ${cause}`);
|
|
301
230
|
});
|
|
302
231
|
console.log('');
|
|
303
232
|
}
|
|
304
233
|
|
|
305
234
|
// Show solutions
|
|
306
|
-
console.log(chalk.bold.green('
|
|
307
|
-
troubleshooting.
|
|
235
|
+
console.log(chalk.bold.green(t('troubleshootSolutionsHeading')));
|
|
236
|
+
tList(troubleshooting.solutionsKey).forEach((solution, i) => {
|
|
308
237
|
console.log(chalk.green(` ${i + 1}. ${solution}`));
|
|
309
238
|
});
|
|
310
239
|
console.log('');
|
|
311
240
|
|
|
312
241
|
// Show documentation link
|
|
313
242
|
if (troubleshooting.docs) {
|
|
314
|
-
console.log(chalk.dim(
|
|
243
|
+
console.log(chalk.dim('📖 ' + tf('troubleshootDocsLine', { url: troubleshooting.docs })));
|
|
315
244
|
console.log('');
|
|
316
245
|
}
|
|
317
246
|
|
|
@@ -335,11 +264,11 @@ function displayGenericTroubleshooting(code, errorInstances) {
|
|
|
335
264
|
});
|
|
336
265
|
|
|
337
266
|
console.log('');
|
|
338
|
-
console.log(chalk.bold.green('
|
|
339
|
-
console.log(chalk.green('
|
|
340
|
-
console.log(chalk.green('
|
|
341
|
-
console.log(chalk.green('
|
|
342
|
-
console.log(chalk.green('
|
|
267
|
+
console.log(chalk.bold.green(t('troubleshootGeneralSolutions')));
|
|
268
|
+
console.log(chalk.green(' ' + t('troubleshootGeneralSolution1')));
|
|
269
|
+
console.log(chalk.green(' ' + t('troubleshootGeneralSolution2')));
|
|
270
|
+
console.log(chalk.green(' ' + t('troubleshootGeneralSolution3')));
|
|
271
|
+
console.log(chalk.green(' ' + t('troubleshootGeneralSolution4')));
|
|
343
272
|
console.log('');
|
|
344
273
|
|
|
345
274
|
console.log(chalk.dim('─────────────────────────────────────────────────'));
|
|
@@ -19,6 +19,7 @@ const path = require('path');
|
|
|
19
19
|
const os = require('os');
|
|
20
20
|
const { execSync } = require('child_process');
|
|
21
21
|
const { detectOS, OS_TYPE } = require('../os-detector');
|
|
22
|
+
const { atomicWriteFileSync } = require('../utils/atomic-write');
|
|
22
23
|
|
|
23
24
|
// ---------------------------------------------------------------------------
|
|
24
25
|
// Constants
|
|
@@ -339,7 +340,8 @@ function readJsonSafe(filePath) {
|
|
|
339
340
|
function writeJson(filePath, data) {
|
|
340
341
|
const dir = path.dirname(filePath);
|
|
341
342
|
fs.mkdirSync(dir, { recursive: true });
|
|
342
|
-
|
|
343
|
+
// Atomic (tmp+rename): these are user config files (settings.json, .mcp.json)
|
|
344
|
+
atomicWriteFileSync(filePath, JSON.stringify(data, null, 2) + '\n', 'utf8');
|
|
343
345
|
}
|
|
344
346
|
|
|
345
347
|
/**
|
|
@@ -755,7 +757,7 @@ function installChromeBrain(options = {}) {
|
|
|
755
757
|
if (dryRun) {
|
|
756
758
|
LOG.info(`[DRY-RUN] Would create ${filePath}`);
|
|
757
759
|
} else {
|
|
758
|
-
|
|
760
|
+
atomicWriteFileSync(filePath, content, 'utf8');
|
|
759
761
|
// Make executable on Unix
|
|
760
762
|
if (osInfo.type !== OS_TYPE.WINDOWS) {
|
|
761
763
|
fs.chmodSync(filePath, 0o755);
|
|
@@ -848,7 +850,7 @@ function installChromeBrain(options = {}) {
|
|
|
848
850
|
LOG.info(`[DRY-RUN] Would create ${file.label}`);
|
|
849
851
|
} else {
|
|
850
852
|
fs.mkdirSync(path.dirname(file.path), { recursive: true });
|
|
851
|
-
|
|
853
|
+
atomicWriteFileSync(file.path, file.content, 'utf8');
|
|
852
854
|
LOG.ok(file.label);
|
|
853
855
|
}
|
|
854
856
|
} catch (err) {
|
|
@@ -23,6 +23,7 @@ const { intro, outro, select, confirm, note, isCancel, cancel } = require('@clac
|
|
|
23
23
|
const { execa } = require('execa');
|
|
24
24
|
|
|
25
25
|
const { detectOS, getOSDisplayName } = require('./os-detector');
|
|
26
|
+
const { atomicWriteFileSync } = require('./utils/atomic-write');
|
|
26
27
|
const { checkAllDependencies, displayResults } = require('./dep-checker');
|
|
27
28
|
|
|
28
29
|
/**
|
|
@@ -148,7 +149,8 @@ async function createUserConfigDirect(profile, logger, dryRun) {
|
|
|
148
149
|
|
|
149
150
|
const yaml = require('js-yaml');
|
|
150
151
|
const yamlContent = yaml.dump(config, { lineWidth: -1 });
|
|
151
|
-
|
|
152
|
+
// Atomic (tmp+rename): user config must never be torn
|
|
153
|
+
atomicWriteFileSync(userConfigPath, yamlContent, 'utf8');
|
|
152
154
|
|
|
153
155
|
logger.success(`User config created at ${userConfigPath}`);
|
|
154
156
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atomic write (tmp + rename) — self-contained copy for @sinapse/sinapse-install.
|
|
3
|
+
*
|
|
4
|
+
* This package publishes on its own, so it cannot require the canonical util
|
|
5
|
+
* in `.sinapse-ai/core/synapse/utils/atomic-write.js` (main sinapse-ai
|
|
6
|
+
* package). Keep the two in sync if the pattern evolves.
|
|
7
|
+
*
|
|
8
|
+
* Onda B2 (AF-20260703): a crash or concurrent reader must never see a torn
|
|
9
|
+
* config file.
|
|
10
|
+
*
|
|
11
|
+
* @module src/utils/atomic-write
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
'use strict';
|
|
15
|
+
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
|
|
19
|
+
const IS_WINDOWS = process.platform === 'win32';
|
|
20
|
+
const TRANSIENT_LOCK_CODES = new Set(['EPERM', 'EBUSY', 'EACCES', 'ENOTEMPTY']);
|
|
21
|
+
|
|
22
|
+
function sleepSync(ms) {
|
|
23
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function retrySync(fn, retries = 3, delayMs = 120) {
|
|
27
|
+
for (let attempt = 0; ; attempt++) {
|
|
28
|
+
try {
|
|
29
|
+
return fn();
|
|
30
|
+
} catch (err) {
|
|
31
|
+
if (!TRANSIENT_LOCK_CODES.has(err.code) || attempt >= retries) {
|
|
32
|
+
throw err;
|
|
33
|
+
}
|
|
34
|
+
sleepSync(delayMs * (attempt + 1));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function atomicWriteFileSync(filePath, data, encoding = 'utf8') {
|
|
40
|
+
const tmpPath = `${filePath}.tmp.${process.pid}`;
|
|
41
|
+
try {
|
|
42
|
+
const dir = path.dirname(filePath);
|
|
43
|
+
if (!fs.existsSync(dir)) {
|
|
44
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
45
|
+
}
|
|
46
|
+
fs.writeFileSync(tmpPath, data, encoding);
|
|
47
|
+
if (IS_WINDOWS) {
|
|
48
|
+
retrySync(() => {
|
|
49
|
+
try {
|
|
50
|
+
fs.unlinkSync(filePath);
|
|
51
|
+
} catch (err) {
|
|
52
|
+
if (err.code !== 'ENOENT') {
|
|
53
|
+
throw err;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
retrySync(() => fs.renameSync(tmpPath, filePath));
|
|
59
|
+
} catch (error) {
|
|
60
|
+
try {
|
|
61
|
+
fs.unlinkSync(tmpPath);
|
|
62
|
+
} catch { /* ignore cleanup errors */ }
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
module.exports = { atomicWriteFileSync };
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
const fs = require('fs');
|
|
18
18
|
const path = require('path');
|
|
19
|
+
const { atomicWriteSync } = require('../.sinapse-ai/core/synapse/utils/atomic-write');
|
|
19
20
|
|
|
20
21
|
const ROOT = path.resolve(__dirname, '..');
|
|
21
22
|
|
|
@@ -85,7 +86,7 @@ function ensureNotice(filePath, realName) {
|
|
|
85
86
|
next = notice + '\n\n' + content;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
|
-
|
|
89
|
+
atomicWriteSync(filePath, next);
|
|
89
90
|
return { status: 'inserted', filePath };
|
|
90
91
|
}
|
|
91
92
|
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Bracket Report — leitor de medição da DEC-04 (read-only).
|
|
6
|
+
*
|
|
7
|
+
* Sumariza os brackets das sessões reais em .synapse/sessions/ para a apuração
|
|
8
|
+
* pré-registrada em docs/epics/epic-ultra-optimization/decisions/DEC-04-brackets-medicao.md
|
|
9
|
+
* (critério: >=95% das sessões reais em FRESH até 2026-07-30 → aposentar
|
|
10
|
+
* DEPLETED/CRITICAL + SYNAPSE_LEGACY_MODE, cada corte com story própria).
|
|
11
|
+
*
|
|
12
|
+
* Duas fontes por sessão, ambas persistidas:
|
|
13
|
+
* - observed = context.last_bracket (gravado pelo hook a cada prompt — QW-1,
|
|
14
|
+
* .claude/hooks/synapse-engine.cjs:72-84)
|
|
15
|
+
* - derived = calculateBracket(estimateContextPercent(prompt_count)) usando o
|
|
16
|
+
* MESMO código de produção (context-tracker.js) e o registry de
|
|
17
|
+
* modelos ativo em core-config.yaml — zero lógica duplicada.
|
|
18
|
+
*
|
|
19
|
+
* hook-metrics.json NÃO serve de série histórica (é snapshot do último prompt);
|
|
20
|
+
* por isso a apuração lê as sessions. Fixtures sintéticas são excluídas.
|
|
21
|
+
*
|
|
22
|
+
* Uso: node scripts/bracket-report.js [--json]
|
|
23
|
+
* Read-only: não escreve nada, exit 0 sempre (ferramenta de apuração, não gate).
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
const fs = require('fs');
|
|
27
|
+
const path = require('path');
|
|
28
|
+
|
|
29
|
+
const ROOT = path.resolve(__dirname, '..');
|
|
30
|
+
const SESSIONS_DIR = path.join(ROOT, '.synapse', 'sessions');
|
|
31
|
+
|
|
32
|
+
// Fixtures/artefatos que não são sessões reais de uso (excluídos do critério).
|
|
33
|
+
const EXCLUDE = new Set(['_active-agent.json', 'e2e-test-session.json']);
|
|
34
|
+
|
|
35
|
+
function main() {
|
|
36
|
+
const asJson = process.argv.includes('--json');
|
|
37
|
+
|
|
38
|
+
if (!fs.existsSync(SESSIONS_DIR)) {
|
|
39
|
+
console.log('Sem .synapse/sessions/ — nada a apurar (motor inativo nesta máquina).');
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const {
|
|
44
|
+
calculateBracket,
|
|
45
|
+
estimateContextPercent,
|
|
46
|
+
getModelConfig,
|
|
47
|
+
} = require(path.join(ROOT, '.sinapse-ai', 'core', 'synapse', 'context', 'context-tracker.js'));
|
|
48
|
+
|
|
49
|
+
const model = getModelConfig(ROOT);
|
|
50
|
+
const rows = [];
|
|
51
|
+
|
|
52
|
+
for (const file of fs.readdirSync(SESSIONS_DIR).sort()) {
|
|
53
|
+
if (!file.endsWith('.json') || EXCLUDE.has(file)) continue;
|
|
54
|
+
let session;
|
|
55
|
+
try {
|
|
56
|
+
session = JSON.parse(fs.readFileSync(path.join(SESSIONS_DIR, file), 'utf8'));
|
|
57
|
+
} catch {
|
|
58
|
+
continue; // arquivo corrompido não entra na amostra
|
|
59
|
+
}
|
|
60
|
+
const prompts = session.prompt_count || 0;
|
|
61
|
+
const percent = estimateContextPercent(prompts, ROOT);
|
|
62
|
+
rows.push({
|
|
63
|
+
session: file.replace('.json', '').slice(0, 8),
|
|
64
|
+
prompts,
|
|
65
|
+
contextPercent: Math.round(percent * 10) / 10,
|
|
66
|
+
derived: calculateBracket(percent),
|
|
67
|
+
observed: (session.context && session.context.last_bracket) || null,
|
|
68
|
+
lastActivity: (session.last_activity || '').slice(0, 10),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const total = rows.length;
|
|
73
|
+
const fresh = rows.filter((r) => r.derived === 'FRESH').length;
|
|
74
|
+
const freshPct = total ? Math.round((fresh / total) * 1000) / 10 : 0;
|
|
75
|
+
const summary = {
|
|
76
|
+
apuracao: new Date().toISOString().slice(0, 10),
|
|
77
|
+
modelConfig: { maxContext: model.maxContext, avgTokensPerPrompt: model.avgTokensPerPrompt },
|
|
78
|
+
sessoesReais: total,
|
|
79
|
+
emFresh: fresh,
|
|
80
|
+
pctFresh: freshPct,
|
|
81
|
+
criterio: 'DEC-04: >=95% em FRESH ate 2026-07-30 -> aposentar DEPLETED/CRITICAL + SYNAPSE_LEGACY_MODE',
|
|
82
|
+
criterioAtendido: freshPct >= 95,
|
|
83
|
+
sessions: rows,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
if (asJson) {
|
|
87
|
+
console.log(JSON.stringify(summary, null, 2));
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
console.log(`Bracket Report — ${summary.apuracao} (modelo ativo: janela ${model.maxContext}, avg ${model.avgTokensPerPrompt} tok/prompt)`);
|
|
92
|
+
console.log(`Sessões reais: ${total} | FRESH: ${fresh} (${freshPct}%) | critério >=95%: ${summary.criterioAtendido ? 'ATENDIDO' : 'não atendido'}`);
|
|
93
|
+
console.log('');
|
|
94
|
+
console.log('session | prompts | ctx% | derived | observed | last_activity');
|
|
95
|
+
for (const r of rows) {
|
|
96
|
+
console.log(
|
|
97
|
+
`${r.session} | ${String(r.prompts).padStart(7)} | ${String(r.contextPercent).padStart(5)} | ${String(r.derived).padEnd(8)} | ${String(r.observed || '-').padEnd(8)} | ${r.lastActivity}`,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
main();
|
|
103
|
+
process.exitCode = 0; // apuração nunca falha o build
|
package/scripts/sinapse-patch.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
const fs = require('fs');
|
|
14
14
|
const path = require('path');
|
|
15
|
+
const { atomicWriteSync } = require('../.sinapse-ai/core/synapse/utils/atomic-write');
|
|
15
16
|
const os = require('os');
|
|
16
17
|
|
|
17
18
|
// ─────────────────────────────────────────────
|
|
@@ -228,7 +229,7 @@ if (dkyStart !== -1) {
|
|
|
228
229
|
// ═══════════════════════════════════════════════════
|
|
229
230
|
// SALVAR
|
|
230
231
|
// ═══════════════════════════════════════════════════
|
|
231
|
-
|
|
232
|
+
atomicWriteSync(CLI_PATH, content, 'utf8');
|
|
232
233
|
|
|
233
234
|
console.log(`\n=== Patch aplicado com sucesso: ${changes} alteracoes ===`);
|
|
234
235
|
console.log('');
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
const fs = require('fs');
|
|
35
35
|
const path = require('path');
|
|
36
|
+
const { atomicWriteSync } = require('../.sinapse-ai/core/synapse/utils/atomic-write');
|
|
36
37
|
|
|
37
38
|
const ROOT = path.resolve(__dirname, '..');
|
|
38
39
|
const SQUADS_DIR = path.join(ROOT, 'squads');
|
|
@@ -168,7 +169,7 @@ function processSquad(squadName) {
|
|
|
168
169
|
}
|
|
169
170
|
const block = buildComponentsBlock(agents);
|
|
170
171
|
const newContent = content.trimEnd() + '\n' + block;
|
|
171
|
-
|
|
172
|
+
atomicWriteSync(yamlPath, newContent, 'utf8');
|
|
172
173
|
return { squadName, status: 'updated', changes: agents.length };
|
|
173
174
|
}
|
|
174
175
|
|