@daniellins/power-claude 0.16.3
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.
Potentially problematic release.
This version of @daniellins/power-claude might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/README.md +121 -0
- package/bin/cli.js +124 -0
- package/installer/__tests__/doctor-ready-oracles.test.cjs +140 -0
- package/installer/__tests__/merge-settings.test.cjs +330 -0
- package/installer/adopt.js +161 -0
- package/installer/copy.js +203 -0
- package/installer/doctor.js +266 -0
- package/installer/install.js +155 -0
- package/installer/manifest.js +102 -0
- package/installer/motor-scripts.js +50 -0
- package/installer/motor-scripts.json +39 -0
- package/installer/uninstall.js +99 -0
- package/installer/update.js +376 -0
- package/installer/util.js +113 -0
- package/installer/wizard.js +64 -0
- package/package.json +26 -0
- package/scripts/__fixtures__/anti-path-demo/agents/ap-writer.md +13 -0
- package/scripts/__fixtures__/anti-path-demo/templates/write-tmpl.md +7 -0
- package/scripts/__fixtures__/anti-path-demo/workflows/wf-ap.smoke.json +10 -0
- package/scripts/__fixtures__/anti-path-demo/workflows/wf-ap.yaml +25 -0
- package/scripts/__fixtures__/assess-tier/retrofit-leve/pod/agents/content-chief.md +1 -0
- package/scripts/__fixtures__/assess-tier/retrofit-leve/pod/workflows/wf-criacao-redteam.yaml +3 -0
- package/scripts/__fixtures__/assess-tier/retrofit-leve/pod-spec.json +13 -0
- package/scripts/__fixtures__/fidelity/fake-green-average-in-band.yaml +21 -0
- package/scripts/__fixtures__/fidelity/fake-green-average.yaml +18 -0
- package/scripts/__fixtures__/fidelity/fake-green-denominator.yaml +19 -0
- package/scripts/__fixtures__/fidelity/fake-green-missing-evidence.yaml +18 -0
- package/scripts/__fixtures__/fidelity/fake-green-threshold.yaml +18 -0
- package/scripts/__fixtures__/fidelity/fake-green-weight.yaml +18 -0
- package/scripts/__fixtures__/fidelity/golden.yaml +31 -0
- package/scripts/__fixtures__/fidelity/trindade-incoherent.yaml +15 -0
- package/scripts/__fixtures__/forge-canonical/pod-spec-example.json +37 -0
- package/scripts/__fixtures__/migrate-squad/authored/agents/offer-engineer.md +17 -0
- package/scripts/__fixtures__/migrate-squad/authored/knowledge/no-source.md +7 -0
- package/scripts/__fixtures__/migrate-squad/authored/knowledge/value-stack-method.md +8 -0
- package/scripts/__fixtures__/migrate-squad/authored/specs/wf-sample.smoke.json +24 -0
- package/scripts/__fixtures__/migrate-squad/authored/specs/wf-sample.spec.json +45 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/HEADLINE.md +3 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/README.md +4 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/agents/hormozi-offer.md +14 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/checklists/dead-redundant.md +4 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/checklists/method-guide.md +6 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/checklists/veto-screen.md +4 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/config/config.yaml +2 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/data/case-library.md +3 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/scripts/validate-mvn.py +16 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/sops/sop-sample.md +3 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/squad-io.yaml +14 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/tasks/gather-context.md +7 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/templates/output-tmpl.md +5 -0
- package/scripts/__fixtures__/migrate-squad/legacy-squad/workflows/wf-sample.yaml +24 -0
- package/scripts/__fixtures__/pipeline/pipelines/pipeline-checkpoint.yaml +21 -0
- package/scripts/__fixtures__/pipeline/pipelines/pipeline-demo.yaml +22 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-a/agents/maker.md +13 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-a/memory/learnings.consolidated.md +8 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-a/memory/learnings.jsonl +83 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-a/templates/make-tmpl.md +8 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-a/workflows/wf-a.yaml +16 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-b/agents/user.md +13 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-b/memory/learnings.consolidated.md +8 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-b/memory/learnings.jsonl +14 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-b/templates/use-tmpl.md +6 -0
- package/scripts/__fixtures__/pipeline/pods/pipe-b/workflows/wf-b.yaml +16 -0
- package/scripts/__fixtures__/pod-run/agents/forge-chief.md +13 -0
- package/scripts/__fixtures__/pod-run/agents/pod-critic.md +13 -0
- package/scripts/__fixtures__/pod-run/templates/build-tmpl.md +8 -0
- package/scripts/__fixtures__/pod-run/templates/gate-tmpl.md +6 -0
- package/scripts/__fixtures__/pod-run/workflows/wf-min.yaml +43 -0
- package/scripts/__fixtures__/pod-run/workflows/wf-skip-modes.yaml +50 -0
- package/scripts/__fixtures__/pod-workflow/invalid-checkpoint-all-skippable.yaml +30 -0
- package/scripts/__fixtures__/pod-workflow/invalid-checkpoint-criteria-escalar-de-bloco.yaml +40 -0
- package/scripts/__fixtures__/pod-workflow/invalid-checkpoint-skip-mode-desconhecido.yaml +30 -0
- package/scripts/__fixtures__/pod-workflow/invalid-checkpoint-unknown-key.yaml +29 -0
- package/scripts/__fixtures__/pod-workflow/invalid-cycle.yaml +26 -0
- package/scripts/__fixtures__/pod-workflow/invalid-fix-loop-backedge.yaml +29 -0
- package/scripts/__fixtures__/pod-workflow/invalid-fix-loop-forward.yaml +29 -0
- package/scripts/__fixtures__/pod-workflow/invalid-handoff-open.yaml +27 -0
- package/scripts/__fixtures__/pod-workflow/invalid-knowledge-shape.yaml +18 -0
- package/scripts/__fixtures__/pod-workflow/invalid-missing-agent.yaml +15 -0
- package/scripts/__fixtures__/pod-workflow/invalid-missing-outputs.yaml +15 -0
- package/scripts/__fixtures__/pod-workflow/invalid-missing-template.yaml +15 -0
- package/scripts/__fixtures__/pod-workflow/invalid-missing-veto.yaml +13 -0
- package/scripts/__fixtures__/pod-workflow/invalid-template-not-on-disk.yaml +16 -0
- package/scripts/__fixtures__/pod-workflow/invalid-veto-prose.yaml +17 -0
- package/scripts/__fixtures__/pod-workflow/knowledge/a.md +4 -0
- package/scripts/__fixtures__/pod-workflow/knowledge/b.md +4 -0
- package/scripts/__fixtures__/pod-workflow/knowledge/c.md +4 -0
- package/scripts/__fixtures__/pod-workflow/templates/step-tmpl.md +7 -0
- package/scripts/__fixtures__/pod-workflow/valid-checkpoint-skip-modes.yaml +29 -0
- package/scripts/__fixtures__/pod-workflow/valid-fix-loop.yaml +30 -0
- package/scripts/__fixtures__/pod-workflow/valid-knowledge.yaml +30 -0
- package/scripts/__fixtures__/pod-workflow/valid-veto-always-true.yaml +20 -0
- package/scripts/__fixtures__/pod-workflow/valid.yaml +27 -0
- package/scripts/__fixtures__/smoke-canary/agents/canary-reporter.md +13 -0
- package/scripts/__fixtures__/smoke-canary/agents/canary-researcher.md +13 -0
- package/scripts/__fixtures__/smoke-canary/agents/canary-synth.md +13 -0
- package/scripts/__fixtures__/smoke-canary/memory/learnings.consolidated.md +10 -0
- package/scripts/__fixtures__/smoke-canary/memory/learnings.jsonl +448 -0
- package/scripts/__fixtures__/smoke-canary/templates/report-tmpl.md +9 -0
- package/scripts/__fixtures__/smoke-canary/templates/research-tmpl.md +7 -0
- package/scripts/__fixtures__/smoke-canary/templates/synth-tmpl.md +9 -0
- package/scripts/__fixtures__/smoke-canary/workflows/wf-canary.smoke.json +11 -0
- package/scripts/__fixtures__/smoke-canary/workflows/wf-canary.yaml +53 -0
- package/scripts/__fixtures__/source-audit/fake-green-bronze-unsignaled.yaml +10 -0
- package/scripts/__fixtures__/source-audit/fake-green-counts.yaml +9 -0
- package/scripts/__fixtures__/source-audit/fake-green-missing-evidence.yaml +9 -0
- package/scripts/__fixtures__/source-audit/fake-green-unclassified.yaml +10 -0
- package/scripts/__fixtures__/source-audit/fake-green-verdict.yaml +10 -0
- package/scripts/__fixtures__/source-audit/golden-blocked.yaml +10 -0
- package/scripts/__fixtures__/source-audit/golden.yaml +11 -0
- package/scripts/__fixtures__/sweep-forms/agents/forms-count.md +13 -0
- package/scripts/__fixtures__/sweep-forms/agents/forms-field.md +13 -0
- package/scripts/__fixtures__/sweep-forms/agents/forms-fileref.md +13 -0
- package/scripts/__fixtures__/sweep-forms/agents/forms-json.md +13 -0
- package/scripts/__fixtures__/sweep-forms/agents/forms-section.md +13 -0
- package/scripts/__fixtures__/sweep-forms/specs/wf-forms.spec.json +5 -0
- package/scripts/__fixtures__/sweep-forms/templates/t_count.md +5 -0
- package/scripts/__fixtures__/sweep-forms/templates/t_field.md +3 -0
- package/scripts/__fixtures__/sweep-forms/templates/t_fileref.md +3 -0
- package/scripts/__fixtures__/sweep-forms/templates/t_json.md +0 -0
- package/scripts/__fixtures__/sweep-forms/templates/t_section.md +3 -0
- package/scripts/__fixtures__/sweep-forms/workflows/wf-forms.smoke.json +13 -0
- package/scripts/__fixtures__/sweep-forms/workflows/wf-forms.yaml +67 -0
- package/scripts/__fixtures__/validate-story-acs-corpus/corpus-1-noop-state-json.fixture.md +18 -0
- package/scripts/__fixtures__/validate-story-acs-corpus/corpus-2-crash-buildworkflowyaml.fixture.md +26 -0
- package/scripts/__fixtures__/validate-story-acs-corpus/corpus-3-nasce-verde-skip-modes.fixture.md +29 -0
- package/scripts/__fixtures__/validate-story-acs-corpus/corpus-4-guarda-sem-irmao.fixture.md +17 -0
- package/scripts/__fixtures__/validate-story-acs-corpus/corpus-5a-diff-stat-sem-guarda.fixture.md +17 -0
- package/scripts/__fixtures__/validate-story-acs-corpus/corpus-5b-test-f-sobre-diretorio.fixture.md +20 -0
- package/scripts/__fixtures__/veto-checks/copy-clean.md +4 -0
- package/scripts/__fixtures__/veto-checks/copy-dashes.md +4 -0
- package/scripts/__fixtures__/veto-checks/n8n-bad.md +18 -0
- package/scripts/__fixtures__/veto-checks/n8n-ok.md +22 -0
- package/scripts/__fixtures__/veto-checks/page-bad.html +7 -0
- package/scripts/__fixtures__/veto-checks/phash/copy.png +0 -0
- package/scripts/__fixtures__/veto-checks/phash/distinct.png +0 -0
- package/scripts/__fixtures__/veto-checks/phash/distinct2.png +0 -0
- package/scripts/__fixtures__/veto-checks/phash/make-fixtures.cjs +203 -0
- package/scripts/__fixtures__/veto-checks/phash/ref.png +0 -0
- package/scripts/__fixtures__/veto-checks/slide-ok.html +15 -0
- package/scripts/__fixtures__/veto-checks/slide-overflow.html +14 -0
- package/scripts/__fixtures__/veto-checks/sweep-pod/agents/vc-checker.md +13 -0
- package/scripts/__fixtures__/veto-checks/sweep-pod/templates/check-tmpl.md +6 -0
- package/scripts/__fixtures__/veto-checks/sweep-pod/workflows/wf-vc.smoke.json +10 -0
- package/scripts/__fixtures__/veto-checks/sweep-pod/workflows/wf-vc.yaml +19 -0
- package/scripts/__fixtures__/voz-do-dono/README.md +23 -0
- package/scripts/__fixtures__/voz-do-dono/dono-escalar.yaml +9 -0
- package/scripts/__fixtures__/voz-do-dono/dono-guia.yaml +10 -0
- package/scripts/__fixtures__/voz-do-dono/peca-3a-pessoa.md +6 -0
- package/scripts/__fixtures__/voz-do-dono/peca-com-lexico-proibido.md +6 -0
- package/scripts/__fixtures__/voz-do-dono/peca-limpa-1a-pessoa.md +6 -0
- package/scripts/__tests__/derive-ready-transitions.test.cjs +269 -0
- package/scripts/__tests__/enforce-cycle-authority.test.cjs +869 -0
- package/scripts/__tests__/enforce-git-push-authority.test.cjs +701 -0
- package/scripts/__tests__/enforce-ready-oracles.test.cjs +745 -0
- package/scripts/__tests__/motor-scripts.test.cjs +339 -0
- package/scripts/__tests__/pc-run-pod-counter.test.cjs +58 -0
- package/scripts/__tests__/pc-run-pod.test.cjs +578 -0
- package/scripts/__tests__/validate-pod-workflow.test.cjs +90 -0
- package/scripts/__tests__/validate-story-acs.test.cjs +607 -0
- package/scripts/anti-path.test.cjs +163 -0
- package/scripts/arena.cjs +514 -0
- package/scripts/arena.test.cjs +213 -0
- package/scripts/brief-leitura-obrigatoria.test.cjs +364 -0
- package/scripts/consolidate-knowledge-runner.test.cjs +249 -0
- package/scripts/default-funcional.test.cjs +153 -0
- package/scripts/derive-ready-transitions.cjs +325 -0
- package/scripts/forge-additive.test.cjs +158 -0
- package/scripts/forge-assess-tier.cjs +205 -0
- package/scripts/forge-assess-tier.test.cjs +114 -0
- package/scripts/forge-canonical.test.cjs +624 -0
- package/scripts/forge-generate.cjs +1303 -0
- package/scripts/forge-harden-learning.cjs +921 -0
- package/scripts/forge-harden-learning.test.cjs +242 -0
- package/scripts/forge-ingest-memory.cjs +136 -0
- package/scripts/forge-upgrade-pod.cjs +368 -0
- package/scripts/forge.test.cjs +609 -0
- package/scripts/harden-knowledge.test.cjs +612 -0
- package/scripts/harness-g5-lite.cjs +243 -0
- package/scripts/harness-g5-lite.test.cjs +134 -0
- package/scripts/hn-carousel-contrato-entrada.test.cjs +96 -0
- package/scripts/migrate-squad-orchestration.test.cjs +146 -0
- package/scripts/migration-manifest-sf3.2.test.cjs +382 -0
- package/scripts/migration-manifest-sf3.3.test.cjs +170 -0
- package/scripts/migration-manifest-sf5.5.test.cjs +189 -0
- package/scripts/migration-manifest.cjs +1146 -0
- package/scripts/migration-manifest.test.cjs +186 -0
- package/scripts/npm-scope-invocation.test.cjs +194 -0
- package/scripts/owner-layer.cjs +442 -0
- package/scripts/owner-layer.test.cjs +358 -0
- package/scripts/pc-run-pipeline.cjs +289 -0
- package/scripts/pc-run-pipeline.test.cjs +256 -0
- package/scripts/pc-run-pod-countgte.test.cjs +66 -0
- package/scripts/pc-run-pod.cjs +1355 -0
- package/scripts/phash-gate.test.cjs +433 -0
- package/scripts/pod-export-compile.cjs +487 -0
- package/scripts/pod-export-compile.test.cjs +312 -0
- package/scripts/pod-export-executor.cjs +678 -0
- package/scripts/pod-export-executor.test.cjs +1341 -0
- package/scripts/pod-export-hardening.test.cjs +531 -0
- package/scripts/pod-export-postprocess.cjs +427 -0
- package/scripts/pod-export-postprocess.test.cjs +558 -0
- package/scripts/pod-export-queue-race.test.cjs +865 -0
- package/scripts/pod-export-release.cjs +473 -0
- package/scripts/pod-export-release.test.cjs +267 -0
- package/scripts/pod-export-service.cjs +1297 -0
- package/scripts/pod-export-service.test.cjs +489 -0
- package/scripts/pod-export-tools.cjs +470 -0
- package/scripts/pod-export-ui.cjs +805 -0
- package/scripts/pod-export-ui.test.cjs +301 -0
- package/scripts/pod-memory-budget.test.cjs +309 -0
- package/scripts/pod-memory-note.cjs +357 -0
- package/scripts/pod-memory-note.test.cjs +452 -0
- package/scripts/pod-memory.cjs +1252 -0
- package/scripts/pod-memory.test.cjs +951 -0
- package/scripts/render-png.test.cjs +307 -0
- package/scripts/smoke-isolation.test.cjs +100 -0
- package/scripts/smoke-pod-workflow.cjs +755 -0
- package/scripts/smoke-sweep.test.cjs +170 -0
- package/scripts/validate-adopt.js +235 -0
- package/scripts/validate-branding.js +84 -0
- package/scripts/validate-budgets.js +140 -0
- package/scripts/validate-fidelity-output.cjs +267 -0
- package/scripts/validate-fidelity-output.test.cjs +101 -0
- package/scripts/validate-install.js +230 -0
- package/scripts/validate-no-clone.cjs +220 -0
- package/scripts/validate-no-clone.test.cjs +77 -0
- package/scripts/validate-pipeline.cjs +145 -0
- package/scripts/validate-pod-workflow.cjs +878 -0
- package/scripts/validate-source-audit.cjs +170 -0
- package/scripts/validate-source-audit.test.cjs +90 -0
- package/scripts/validate-story-acs.cjs +862 -0
- package/scripts/validate-update-scope-motor.js +421 -0
- package/scripts/veto-checks/html-valid.cjs +92 -0
- package/scripts/veto-checks/lexical-check.cjs +62 -0
- package/scripts/veto-checks/phash-gate.cjs +589 -0
- package/scripts/veto-checks/render-gate.cjs +165 -0
- package/scripts/veto-checks/render-png.cjs +358 -0
- package/scripts/veto-checks.test.cjs +219 -0
- package/scripts/watcher-audit.cjs +178 -0
- package/template/.claude/CLAUDE.md +103 -0
- package/template/.claude/agents/pc-analyst.md +100 -0
- package/template/.claude/agents/pc-architect.md +32 -0
- package/template/.claude/agents/pc-dev.md +27 -0
- package/template/.claude/agents/pc-devops.md +45 -0
- package/template/.claude/agents/pc-planner.md +32 -0
- package/template/.claude/agents/pc-po.md +25 -0
- package/template/.claude/agents/pc-qa.md +25 -0
- package/template/.claude/commands/power/academy.md +9 -0
- package/template/.claude/commands/power/automation.md +9 -0
- package/template/.claude/commands/power/content-carousel.md +267 -0
- package/template/.claude/commands/power/content.md +9 -0
- package/template/.claude/commands/power/dev.md +9 -0
- package/template/.claude/commands/power/forge.md +224 -0
- package/template/.claude/commands/power/hormozi.md +221 -0
- package/template/.claude/commands/power/modo.md +57 -0
- package/template/.claude/hooks/README.md +114 -0
- package/template/.claude/hooks/context-budget.cjs +64 -0
- package/template/.claude/hooks/enforce-cycle-authority.cjs +457 -0
- package/template/.claude/hooks/enforce-git-push-authority.cjs +925 -0
- package/template/.claude/hooks/enforce-ready-oracles.cjs +502 -0
- package/template/.claude/rules/authority.md +76 -0
- package/template/.claude/rules/curadoria-de-conhecimento.md +30 -0
- package/template/.claude/rules/model-matrix.md +34 -0
- package/template/.claude/rules/orchestration.md +133 -0
- package/template/.claude/settings.json +50 -0
- package/template/.claude/skills/pc-apply-qa-fixes/SKILL.md +108 -0
- package/template/.claude/skills/pc-apply-qa-fixes/references/fix-loop.md +40 -0
- package/template/.claude/skills/pc-apply-qa-fixes/references/fix-request-template.md +70 -0
- package/template/.claude/skills/pc-arena/SKILL.md +96 -0
- package/template/.claude/skills/pc-close-story/SKILL.md +105 -0
- package/template/.claude/skills/pc-commit/SKILL.md +108 -0
- package/template/.claude/skills/pc-develop-story/SKILL.md +116 -0
- package/template/.claude/skills/pc-full-cycle/SKILL.md +150 -0
- package/template/.claude/skills/pc-pipeline/SKILL.md +63 -0
- package/template/.claude/skills/pc-pipeline/references/gate-templates.md +46 -0
- package/template/.claude/skills/pc-review-story/SKILL.md +129 -0
- package/template/.claude/skills/pc-review-story/references/false-positive-detection.md +50 -0
- package/template/.claude/skills/pc-review-story/references/nfr-assess.md +47 -0
- package/template/.claude/skills/pc-review-story/references/risk-profile.md +75 -0
- package/template/.claude/skills/pc-review-story/references/security-checklist.md +69 -0
- package/template/.claude/skills/pc-review-story/references/test-design.md +37 -0
- package/template/.claude/skills/pc-review-story/references/trace-requirements.md +46 -0
- package/template/.claude/skills/pc-run-pod/SKILL.md +123 -0
- package/template/.claude/skills/pc-validate-story/SKILL.md +114 -0
- package/template/.claude/skills/pc-wave/SKILL.md +133 -0
- package/template/.env.example +10 -0
- package/template/knowledge/analyst/brainstorming.md +40 -0
- package/template/knowledge/analyst/brief-skeleton.md +32 -0
- package/template/knowledge/analyst/competitor-skeleton.md +39 -0
- package/template/knowledge/analyst/elicitation-menu.md +49 -0
- package/template/knowledge/analyst/market-research-skeleton.md +36 -0
- package/template/knowledge/analyst/research-prompt-structure.md +48 -0
- package/template/knowledge/analyst/roi-skeleton.md +51 -0
- package/template/knowledge/voice-dna/README.md +99 -0
- package/template/knowledge/voice-dna/voice-dna.example.yaml +157 -0
- package/template/pods/README.md +64 -0
- package/template/pods/academy/README.md +37 -0
- package/template/pods/academy/agents/academy-chief.md +27 -0
- package/template/pods/academy/examples/palestra.example.md +142 -0
- package/template/pods/academy/pod-spec.json +44 -0
- package/template/pods/academy/templates/materiais-tmpl.md +17 -0
- package/template/pods/academy/templates/revisao-didatica-tmpl.md +20 -0
- package/template/pods/academy/workflows/wf-materiais-revisao.yaml +30 -0
- package/template/pods/authority-content/README.md +43 -0
- package/template/pods/authority-content/agents/content-chief.md +28 -0
- package/template/pods/authority-content/pod-spec.json +45 -0
- package/template/pods/authority-content/templates/criacao-na-voz-tmpl.md +17 -0
- package/template/pods/authority-content/templates/red-team-factual-tmpl.md +23 -0
- package/template/pods/authority-content/workflows/wf-criacao-redteam.yaml +30 -0
- package/template/pods/automation/README.md +37 -0
- package/template/pods/automation/agents/langgraph-architect.md +30 -0
- package/template/pods/automation/agents/n8n-architect.md +30 -0
- package/template/pods/automation/examples/README.md +46 -0
- package/template/pods/automation/examples/n8n-content-radar.example.json +380 -0
- package/template/pods/automation/knowledge/langgraph-patterns.md +126 -0
- package/template/pods/automation/knowledge/n8n-patterns.md +131 -0
- package/template/pods/automation/memory/README.md +16 -0
- package/template/pods/automation/memory/learnings.consolidated.md +8 -0
- package/template/pods/automation/memory/learnings.jsonl +0 -0
- package/template/pods/automation/pod-spec.json +109 -0
- package/template/pods/automation/specs/wf-langgraph-build.spec.json +107 -0
- package/template/pods/automation/squad-io.yaml +28 -0
- package/template/pods/automation/templates/lg-build-tmpl.md +17 -0
- package/template/pods/automation/templates/lg-design-tmpl.md +23 -0
- package/template/pods/automation/templates/lg-discover-tmpl.md +20 -0
- package/template/pods/automation/templates/lg-handoff-tmpl.md +20 -0
- package/template/pods/automation/templates/lg-test-tmpl.md +20 -0
- package/template/pods/automation/templates/n8n-build-tmpl.md +14 -0
- package/template/pods/automation/templates/n8n-design-tmpl.md +23 -0
- package/template/pods/automation/templates/n8n-discover-tmpl.md +20 -0
- package/template/pods/automation/templates/n8n-handoff-tmpl.md +20 -0
- package/template/pods/automation/templates/n8n-test-tmpl.md +20 -0
- package/template/pods/automation/workflows/wf-langgraph-build.smoke.json +11 -0
- package/template/pods/automation/workflows/wf-langgraph-build.yaml +64 -0
- package/template/pods/automation/workflows/wf-n8n-build.smoke.json +11 -0
- package/template/pods/automation/workflows/wf-n8n-build.yaml +65 -0
- package/template/pods/content-carousel/README.md +91 -0
- package/template/pods/content-carousel/agents/carousel-builder.md +28 -0
- package/template/pods/content-carousel/agents/carousel-visual.md +24 -0
- package/template/pods/content-carousel/agents/hn-curator.md +74 -0
- package/template/pods/content-carousel/config/heuristic-watcher-rubric.yaml +59 -0
- package/template/pods/content-carousel/knowledge/aquisicao-ancora.md +443 -0
- package/template/pods/content-carousel/knowledge/cta-brief.md +25 -0
- package/template/pods/content-carousel/knowledge/dono.example.yaml +45 -0
- package/template/pods/content-carousel/knowledge/identidade-visual-mascote.md +62 -0
- package/template/pods/content-carousel/knowledge/image-generation.md +62 -0
- package/template/pods/content-carousel/knowledge/selecao-de-ancora.md +60 -0
- package/template/pods/content-carousel/knowledge/slides-html.md +56 -0
- package/template/pods/content-carousel/memory/README.md +18 -0
- package/template/pods/content-carousel/memory/learnings.consolidated.md +6 -0
- package/template/pods/content-carousel/memory/learnings.jsonl +0 -0
- package/template/pods/content-carousel/pod-spec.json +100 -0
- package/template/pods/content-carousel/squad-io.yaml +10 -0
- package/template/pods/content-carousel/templates/assembly-tmpl.md +23 -0
- package/template/pods/content-carousel/templates/digest-tmpl.md +29 -0
- package/template/pods/content-carousel/templates/visuals-tmpl.md +20 -0
- package/template/pods/content-carousel/workflows/wf-content-carousel.smoke.json +23 -0
- package/template/pods/content-carousel/workflows/wf-content-carousel.yaml +80 -0
- package/template/pods/dev-ia/README.md +45 -0
- package/template/pods/dev-ia/agents/db-architect.md +33 -0
- package/template/pods/dev-ia/agents/ux-architect.md +29 -0
- package/template/pods/dev-ia/knowledge/db/migration-protocol.md +95 -0
- package/template/pods/dev-ia/knowledge/db/rls-patterns.md +101 -0
- package/template/pods/dev-ia/knowledge/db/schema-review-checklist.md +76 -0
- package/template/pods/dev-ia/memory/README.md +16 -0
- package/template/pods/dev-ia/memory/learnings.consolidated.md +8 -0
- package/template/pods/dev-ia/memory/learnings.jsonl +0 -0
- package/template/pods/dev-ia/pod-spec.json +34 -0
- package/template/pods/dev-ia/templates/schema-review-tmpl.md +23 -0
- package/template/pods/dev-ia/templates/ux-flow-review-tmpl.md +23 -0
- package/template/pods/dev-ia/tools/db-ops/backup-manager.sh +321 -0
- package/template/pods/dev-ia/tools/db-ops/best-practices-auditor.sh +534 -0
- package/template/pods/dev-ia/tools/db-ops/bootstrap-runner.sh +255 -0
- package/template/pods/dev-ia/tools/db-ops/data-loader.sh +616 -0
- package/template/pods/dev-ia/tools/db-ops/detect-database.sh +113 -0
- package/template/pods/dev-ia/tools/db-ops/explain-analyzer.sh +285 -0
- package/template/pods/dev-ia/tools/db-ops/health-checker.sh +323 -0
- package/template/pods/dev-ia/tools/db-ops/migration-runner.sh +308 -0
- package/template/pods/dev-ia/tools/db-ops/postgresql-schema-loader.sh +334 -0
- package/template/pods/dev-ia/tools/db-ops/query-runner.sh +171 -0
- package/template/pods/dev-ia/tools/db-ops/rls-policy-installer.sh +480 -0
- package/template/pods/dev-ia/tools/db-ops/rls-test-suite.sh +172 -0
- package/template/pods/dev-ia/tools/db-ops/schema-context-loader.sh +176 -0
- package/template/pods/hormozi-method/README.md +52 -0
- package/template/pods/hormozi-method/agents/acquisition-strategist.md +33 -0
- package/template/pods/hormozi-method/agents/conversion-copywriter.md +34 -0
- package/template/pods/hormozi-method/agents/monetization-architect.md +35 -0
- package/template/pods/hormozi-method/agents/offer-engineer.md +37 -0
- package/template/pods/hormozi-method/knowledge/core-four-leads.md +51 -0
- package/template/pods/hormozi-method/knowledge/grand-slam-offer.md +66 -0
- package/template/pods/hormozi-method/knowledge/growth-decision.md +38 -0
- package/template/pods/hormozi-method/knowledge/hooks-and-ads.md +56 -0
- package/template/pods/hormozi-method/knowledge/launch-email.md +31 -0
- package/template/pods/hormozi-method/knowledge/money-model.md +46 -0
- package/template/pods/hormozi-method/knowledge/opportunity-screening.md +44 -0
- package/template/pods/hormozi-method/knowledge/pages.md +25 -0
- package/template/pods/hormozi-method/knowledge/pos-lancamento-leads.md +56 -0
- package/template/pods/hormozi-method/knowledge/pricing.md +36 -0
- package/template/pods/hormozi-method/knowledge/retention-ltv.md +37 -0
- package/template/pods/hormozi-method/knowledge/scale-roadmap.md +35 -0
- package/template/pods/hormozi-method/knowledge/swipefiles-curados.md +44 -0
- package/template/pods/hormozi-method/knowledge/value-equation-diagnostic.md +77 -0
- package/template/pods/hormozi-method/memory/README.md +16 -0
- package/template/pods/hormozi-method/memory/learnings.consolidated.md +6 -0
- package/template/pods/hormozi-method/memory/learnings.jsonl +0 -0
- package/template/pods/hormozi-method/pod-spec.json +50 -0
- package/template/pods/hormozi-method/specs/wf-full-launch-sequence.spec.json +149 -0
- package/template/pods/hormozi-method/specs/wf-lead-magnet-pipeline.spec.json +125 -0
- package/template/pods/hormozi-method/specs/wf-money-model-design.spec.json +117 -0
- package/template/pods/hormozi-method/specs/wf-paid-ads-campaign.spec.json +132 -0
- package/template/pods/hormozi-method/specs/wf-scaling-diagnostic.spec.json +121 -0
- package/template/pods/hormozi-method/squad-io.yaml +43 -0
- package/template/pods/hormozi-method/templates/conversion-copywriter-tmpl.md +20 -0
- package/template/pods/hormozi-method/templates/launch-execucao-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/launch-fechamento-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/launch-pos-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/launch-preparacao-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/lm-copy-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/lm-distribuicao-tmpl.md +18 -0
- package/template/pods/hormozi-method/templates/lm-estrategia-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/mm-arquitetura-tmpl.md +18 -0
- package/template/pods/hormozi-method/templates/mm-copy-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/mm-diagnostico-tmpl.md +14 -0
- package/template/pods/hormozi-method/templates/monetization-architect-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/offer-engineer-tmpl.md +20 -0
- package/template/pods/hormozi-method/templates/paid-criativos-tmpl.md +19 -0
- package/template/pods/hormozi-method/templates/paid-fundacao-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/paid-teste-escala-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/scaling-diagnostico-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/scaling-priorizacao-tmpl.md +17 -0
- package/template/pods/hormozi-method/templates/scaling-roadmap-tmpl.md +17 -0
- package/template/pods/hormozi-method/workflows/wf-full-launch-sequence.smoke.json +12 -0
- package/template/pods/hormozi-method/workflows/wf-full-launch-sequence.yaml +56 -0
- package/template/pods/hormozi-method/workflows/wf-grand-slam-offer.smoke.json +11 -0
- package/template/pods/hormozi-method/workflows/wf-grand-slam-offer.yaml +45 -0
- package/template/pods/hormozi-method/workflows/wf-lead-magnet-pipeline.smoke.json +9 -0
- package/template/pods/hormozi-method/workflows/wf-lead-magnet-pipeline.yaml +45 -0
- package/template/pods/hormozi-method/workflows/wf-money-model-design.smoke.json +11 -0
- package/template/pods/hormozi-method/workflows/wf-money-model-design.yaml +45 -0
- package/template/pods/hormozi-method/workflows/wf-paid-ads-campaign.smoke.json +9 -0
- package/template/pods/hormozi-method/workflows/wf-paid-ads-campaign.yaml +46 -0
- package/template/pods/hormozi-method/workflows/wf-scaling-diagnostic.smoke.json +11 -0
- package/template/pods/hormozi-method/workflows/wf-scaling-diagnostic.yaml +44 -0
- package/template/pods/squad-forge/README.md +53 -0
- package/template/pods/squad-forge/agents/forge-chief.md +31 -0
- package/template/pods/squad-forge/agents/mind-extractor.md +29 -0
- package/template/pods/squad-forge/agents/pod-critic.md +26 -0
- package/template/pods/squad-forge/config/heuristic-watcher-rubric.yaml +74 -0
- package/template/pods/squad-forge/knowledge/fidelity-rubric.yaml +176 -0
- package/template/pods/squad-forge/knowledge/g6-memory-check.md +17 -0
- package/template/pods/squad-forge/knowledge/memory-ingest.md +16 -0
- package/template/pods/squad-forge/knowledge/source-audit-rubric.yaml +60 -0
- package/template/pods/squad-forge/memory/README.md +16 -0
- package/template/pods/squad-forge/memory/learnings.consolidated.md +8 -0
- package/template/pods/squad-forge/memory/learnings.jsonl +0 -0
- package/template/pods/squad-forge/pod-spec.json +166 -0
- package/template/pods/squad-forge/squad-io.yaml +13 -0
- package/template/pods/squad-forge/tasks/pipeline.md +158 -0
- package/template/pods/squad-forge/templates/discovery-tmpl.md +40 -0
- package/template/pods/squad-forge/templates/generation-tmpl.md +18 -0
- package/template/pods/squad-forge/templates/red-team-tmpl.md +17 -0
- package/template/pods/squad-forge/templates/register-tmpl.md +17 -0
- package/template/pods/squad-forge/templates/workflow-tmpl.yaml +101 -0
- package/template/pods/squad-forge/workflows/wf-forge.smoke.json +12 -0
- package/template/pods/squad-forge/workflows/wf-forge.yaml +60 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/**
|
|
4
|
+
* forge-assess-tier.cjs — gate de proporcionalidade do forge (Story SF1.4).
|
|
5
|
+
*
|
|
6
|
+
* Reproduz o VEREDITO da régua `*assess` 5D do pc-architect por limiares
|
|
7
|
+
* ESTRUTURAIS determinísticos (ADR-004), sem invocar um subagente arquiteto a
|
|
8
|
+
* cada geração. Racional (Dev Notes SF1.4): o repo `power-claude` não embute o
|
|
9
|
+
* papel `pc-architect`; os limiares do ADR-004 são a lógica determinística e
|
|
10
|
+
* auditável que decide SIMPLE vs STANDARD/COMPLEX. NÃO redefine a régua 5D —
|
|
11
|
+
* consome os gatilhos estruturais dela.
|
|
12
|
+
*
|
|
13
|
+
* SIMPLE ⇔ ≤2 agentes E ≤1 workflow E ≤1 handoff cross-agente
|
|
14
|
+
* E sem DNA/persona externa E entregável não crítico de persistência.
|
|
15
|
+
* Qualquer gatilho oposto ⇒ STANDARD/COMPLEX.
|
|
16
|
+
*
|
|
17
|
+
* Uso:
|
|
18
|
+
* node scripts/forge-assess-tier.cjs <pod-spec.json>
|
|
19
|
+
* echo '{"agents":["a","b"],"workflows":1,"handoffs":0}' | node scripts/forge-assess-tier.cjs -
|
|
20
|
+
*
|
|
21
|
+
* Exit 0 sempre (é uma classificação, não um gate de falha); imprime o tier e os
|
|
22
|
+
* gatilhos que dispararam. `require()` expõe classifyTier + SCOPE_THRESHOLDS.
|
|
23
|
+
*
|
|
24
|
+
* Node >= 18, sem dependências externas.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
const fs = require('node:fs');
|
|
28
|
+
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// LIMIARES DO ADR-004 — constante nomeada, auditável, num único lugar.
|
|
31
|
+
// Risco 1 (SF1.4): a SF1.5 (hormozi, 4 agentes reais) pode recalibrar estes
|
|
32
|
+
// números; mantê-los aqui (não espalhados) permite ajuste sem reabrir arquitetura.
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
const SCOPE_THRESHOLDS = {
|
|
35
|
+
maxAgentsSimple: 2, // ≤2 agentes ainda pode ser SIMPLE
|
|
36
|
+
maxWorkflowsSimple: 1, // ≤1 workflow ainda pode ser SIMPLE
|
|
37
|
+
maxHandoffsSimple: 1, // ≤1 handoff cross-agente ainda pode ser SIMPLE
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const TIER_SIMPLE = 'SIMPLE';
|
|
41
|
+
const TIER_STANDARD = 'STANDARD/COMPLEX';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Conta IDENTIDADES físicas de agente numa lista de spec (Story SF8.1, AC1).
|
|
45
|
+
* O padrão real de pod-spec.json modela 1 agente físico como N objetos de etapa
|
|
46
|
+
* ({name, step, ...}) — `.length` contava ETAPAS, não agentes. Objetos com
|
|
47
|
+
* `.name` deduplicam por nome distinto; strings/números/objetos sem `.name`
|
|
48
|
+
* mantêm o comportamento anterior (1 por entrada, contagem por valor).
|
|
49
|
+
*/
|
|
50
|
+
function countAgentIdentities(list) {
|
|
51
|
+
const names = new Set();
|
|
52
|
+
let unnamed = 0;
|
|
53
|
+
for (const entry of list) {
|
|
54
|
+
if (entry && typeof entry === 'object' && typeof entry.name === 'string' && entry.name !== '') {
|
|
55
|
+
names.add(entry.name);
|
|
56
|
+
} else {
|
|
57
|
+
unnamed += 1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return names.size + unnamed;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Normaliza a spec do pod para contagens estruturais.
|
|
65
|
+
* agents: array de nomes/objetos-de-etapa OU número. workflows/handoffs: número.
|
|
66
|
+
* dna/critical: bool. Agentes contam por IDENTIDADE física (dedup por `.name`).
|
|
67
|
+
*/
|
|
68
|
+
function normalizeSpec(spec) {
|
|
69
|
+
const agents = Array.isArray(spec.agents)
|
|
70
|
+
? countAgentIdentities(spec.agents)
|
|
71
|
+
: Number(spec.agents || 0);
|
|
72
|
+
const workflows = Array.isArray(spec.workflows)
|
|
73
|
+
? spec.workflows.length
|
|
74
|
+
: Number(spec.workflows || 0);
|
|
75
|
+
const handoffs = Number(spec.handoffs || 0);
|
|
76
|
+
const dna = Boolean(spec.dna || spec.persona || spec.clone);
|
|
77
|
+
const critical = Boolean(spec.critical);
|
|
78
|
+
return { agents, workflows, handoffs, dna, critical };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Classifica o pedido em SIMPLE ou STANDARD/COMPLEX pelos limiares do ADR-004.
|
|
83
|
+
* Retorna { tier, triggers[] } — triggers lista cada gatilho que forçou o superior.
|
|
84
|
+
*/
|
|
85
|
+
function classifyTier(spec) {
|
|
86
|
+
const s = normalizeSpec(spec);
|
|
87
|
+
const triggers = [];
|
|
88
|
+
if (s.agents > SCOPE_THRESHOLDS.maxAgentsSimple) {
|
|
89
|
+
triggers.push(`${s.agents} agentes (> ${SCOPE_THRESHOLDS.maxAgentsSimple})`);
|
|
90
|
+
}
|
|
91
|
+
if (s.workflows > SCOPE_THRESHOLDS.maxWorkflowsSimple) {
|
|
92
|
+
triggers.push(`${s.workflows} workflows (> ${SCOPE_THRESHOLDS.maxWorkflowsSimple})`);
|
|
93
|
+
}
|
|
94
|
+
if (s.handoffs > SCOPE_THRESHOLDS.maxHandoffsSimple) {
|
|
95
|
+
triggers.push(`${s.handoffs} handoffs cross-agente (> ${SCOPE_THRESHOLDS.maxHandoffsSimple})`);
|
|
96
|
+
}
|
|
97
|
+
if (s.dna) triggers.push('DNA/persona externa (clone)');
|
|
98
|
+
if (s.critical) triggers.push('entregável crítico de persistência');
|
|
99
|
+
return {
|
|
100
|
+
tier: triggers.length === 0 ? TIER_SIMPLE : TIER_STANDARD,
|
|
101
|
+
triggers,
|
|
102
|
+
counts: s,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function readSpec(arg) {
|
|
107
|
+
const raw = arg === '-' ? fs.readFileSync(0, 'utf8') : fs.readFileSync(arg, 'utf8');
|
|
108
|
+
return JSON.parse(raw);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
// Tier AGREGADO do DISCO (Decisão C.1, SF3.1 — fecha G1; agregação corrigida
|
|
113
|
+
// na SF8.1). classifyTier(spec) conta só o que a spec declara; num pod
|
|
114
|
+
// pré-existente isso IGNORA os agentes/workflows/handoffs já em disco e
|
|
115
|
+
// re-classifica SIMPLE uma spec de 2 etapas sobre um pod COMPLEX.
|
|
116
|
+
// `podDiskCounts` lê o DISCO e combina com as contagens da spec por
|
|
117
|
+
// UNIÃO/MÁXIMO (via aggregateSpec) — a fonte da verdade do tier no modo
|
|
118
|
+
// aditivo e no upgrade-in-place. Máximo, não soma: um artefato que a spec
|
|
119
|
+
// declara E que já está materializado em disco é o MESMO artefato (o padrão
|
|
120
|
+
// "spec descreve o pod inteiro" do retrofit); no caso genuinamente
|
|
121
|
+
// incremental (spec declara trabalho novo, disco ainda menor) o valor da
|
|
122
|
+
// spec permanece como piso — nunca subconta o declarado.
|
|
123
|
+
// ---------------------------------------------------------------------------
|
|
124
|
+
const nodePath = require('node:path');
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Conta os artefatos JÁ EM DISCO de um pod existente:
|
|
128
|
+
* agents = todos os `agents/*.md` (exceto README.md)
|
|
129
|
+
* workflows = `workflows/wf-*.yaml|yml` (EXCLUINDO os `.smoke.json`/`.smoke.yaml`)
|
|
130
|
+
* handoffs = entradas `- from:`/`to:` declaradas em `squad-io.yaml`
|
|
131
|
+
* Pod inexistente/vazio → zeros. Determinístico, sem parse de YAML externo.
|
|
132
|
+
*/
|
|
133
|
+
function podDiskCounts(podDir) {
|
|
134
|
+
const counts = { agents: 0, workflows: 0, handoffs: 0 };
|
|
135
|
+
if (!podDir || !fs.existsSync(podDir)) return counts;
|
|
136
|
+
const agentsDir = nodePath.join(podDir, 'agents');
|
|
137
|
+
if (fs.existsSync(agentsDir)) {
|
|
138
|
+
counts.agents = fs.readdirSync(agentsDir)
|
|
139
|
+
.filter((f) => f.endsWith('.md') && f !== 'README.md').length;
|
|
140
|
+
}
|
|
141
|
+
const wfDir = nodePath.join(podDir, 'workflows');
|
|
142
|
+
if (fs.existsSync(wfDir)) {
|
|
143
|
+
counts.workflows = fs.readdirSync(wfDir)
|
|
144
|
+
.filter((f) => /^wf-.*\.ya?ml$/.test(f) && !/\.smoke\./.test(f)).length;
|
|
145
|
+
}
|
|
146
|
+
const io = nodePath.join(podDir, 'squad-io.yaml');
|
|
147
|
+
if (fs.existsSync(io)) {
|
|
148
|
+
const txt = fs.readFileSync(io, 'utf8');
|
|
149
|
+
// Cada handoff é um item de lista `- from:` no bloco `handoffs:`.
|
|
150
|
+
counts.handoffs = (txt.match(/^\s*-\s*from:/gim) || []).length;
|
|
151
|
+
}
|
|
152
|
+
return counts;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Retorna uma spec sintética cujas contagens combinam spec declarada e disco
|
|
157
|
+
* do pod por UNIÃO/MÁXIMO por dimensão (SF8.1, AC2) — nunca soma ingênua:
|
|
158
|
+
* artefato declarado na spec E materializado em disco é o MESMO artefato,
|
|
159
|
+
* contado uma vez. Usada por classifyTier para obter o tier AGREGADO.
|
|
160
|
+
* Preserva os flags qualitativos (dna/critical) da spec original.
|
|
161
|
+
*/
|
|
162
|
+
function aggregateSpec(spec, podDir) {
|
|
163
|
+
const s = normalizeSpec(spec);
|
|
164
|
+
const disk = podDiskCounts(podDir);
|
|
165
|
+
return {
|
|
166
|
+
agents: Math.max(s.agents, disk.agents),
|
|
167
|
+
workflows: Math.max(s.workflows, disk.workflows),
|
|
168
|
+
handoffs: Math.max(s.handoffs, disk.handoffs),
|
|
169
|
+
dna: s.dna,
|
|
170
|
+
critical: s.critical,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function main() {
|
|
175
|
+
const args = process.argv.slice(2);
|
|
176
|
+
let arg = null;
|
|
177
|
+
let podDir = null;
|
|
178
|
+
for (let i = 0; i < args.length; i++) {
|
|
179
|
+
if (args[i] === '--pod-dir') podDir = args[++i];
|
|
180
|
+
else arg = args[i];
|
|
181
|
+
}
|
|
182
|
+
if (!arg) {
|
|
183
|
+
console.error('Uso: node scripts/forge-assess-tier.cjs <pod-spec.json> | - [--pod-dir <dir>]');
|
|
184
|
+
process.exit(2);
|
|
185
|
+
}
|
|
186
|
+
const spec = readSpec(arg);
|
|
187
|
+
// Com --pod-dir, o tier é AGREGADO (spec declarada + disco do pod existente).
|
|
188
|
+
const result = classifyTier(podDir ? aggregateSpec(spec, nodePath.resolve(podDir)) : spec);
|
|
189
|
+
console.log(`tier: ${result.tier}`);
|
|
190
|
+
if (podDir) {
|
|
191
|
+
const disk = podDiskCounts(nodePath.resolve(podDir));
|
|
192
|
+
console.log(`disco (${podDir}): ${disk.agents} agentes, ${disk.workflows} workflows, ${disk.handoffs} handoffs (agregação por máximo com a spec)`);
|
|
193
|
+
}
|
|
194
|
+
if (result.triggers.length > 0) {
|
|
195
|
+
console.log('gatilhos que forçaram STANDARD/COMPLEX:');
|
|
196
|
+
for (const t of result.triggers) console.log(` - ${t}`);
|
|
197
|
+
} else {
|
|
198
|
+
console.log('nenhum gatilho oposto — caminho leve (SIMPLE).');
|
|
199
|
+
}
|
|
200
|
+
process.exit(0);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (require.main === module) main();
|
|
204
|
+
|
|
205
|
+
module.exports = { classifyTier, normalizeSpec, countAgentIdentities, podDiskCounts, aggregateSpec, SCOPE_THRESHOLDS, TIER_SIMPLE, TIER_STANDARD };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/**
|
|
4
|
+
* forge-assess-tier.test.cjs — Story SF8.1 (fix do caminho --pod-dir).
|
|
5
|
+
*
|
|
6
|
+
* Cobre:
|
|
7
|
+
* AC1 dedup de agentes por IDENTIDADE física (objetos com `.name` repetido
|
|
8
|
+
* contam 1 por nome; strings/números mantêm contagem por entrada).
|
|
9
|
+
* AC2 agregação spec+disco por UNIÃO/MÁXIMO por dimensão (agentes,
|
|
10
|
+
* workflows, handoffs) — nunca soma; caso incremental real preserva o
|
|
11
|
+
* valor da spec como piso (Risco 3).
|
|
12
|
+
* AC3 fixture reproduzindo o caso EXATO do gate SF6.4 (CONCERNS-1):
|
|
13
|
+
* agente físico único modelado como 2 etapas + disco com o .md físico e
|
|
14
|
+
* o wf já gerado → --pod-dir relata SIMPLE (bate com o standalone).
|
|
15
|
+
* AC4 regressão do standalone: specs SEM nome repetido → saída CLI
|
|
16
|
+
* byte-idêntica ao comportamento anterior; COM nome repetido → corrigida.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const fs = require('node:fs');
|
|
20
|
+
const os = require('node:os');
|
|
21
|
+
const path = require('node:path');
|
|
22
|
+
const { spawnSync } = require('node:child_process');
|
|
23
|
+
|
|
24
|
+
const at = require('./forge-assess-tier.cjs');
|
|
25
|
+
const SCRIPT = path.join(__dirname, 'forge-assess-tier.cjs');
|
|
26
|
+
|
|
27
|
+
let passed = 0;
|
|
28
|
+
const failures = [];
|
|
29
|
+
function ok(cond, label, extra) {
|
|
30
|
+
if (cond) { passed++; console.log(`[OK ] ${label}`); }
|
|
31
|
+
else { failures.push(label); console.log(`[FALHA] ${label}${extra ? ` — ${extra}` : ''}`); }
|
|
32
|
+
}
|
|
33
|
+
function tmp(name) { return fs.mkdtempSync(path.join(os.tmpdir(), `sf81-${name}-`)); }
|
|
34
|
+
function runCli(args) { return spawnSync(process.execPath, [SCRIPT, ...args], { encoding: 'utf8' }); }
|
|
35
|
+
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
// AC1 — dedup por identidade física.
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
ok(at.countAgentIdentities([{ name: 'chief', step: 'a' }, { name: 'chief', step: 'b' }]) === 1,
|
|
40
|
+
'AC1 2 etapas do MESMO agente físico contam 1 identidade');
|
|
41
|
+
ok(at.countAgentIdentities([{ name: 'chief', step: 'a' }, { name: 'chief', step: 'b' }, { name: 'critic', step: 'c' }]) === 2,
|
|
42
|
+
'AC1 3 etapas de 2 agentes físicos contam 2 identidades');
|
|
43
|
+
ok(at.countAgentIdentities(['x', 'y']) === 2, 'AC1 array de strings mantém contagem por entrada (comportamento anterior)');
|
|
44
|
+
ok(at.normalizeSpec({ agents: [{ name: 'chief', step: 'a' }, { name: 'chief', step: 'b' }] }).agents === 1,
|
|
45
|
+
'AC1 normalizeSpec aplica o dedup (vale para standalone E --pod-dir)');
|
|
46
|
+
ok(at.normalizeSpec({ agents: 3 }).agents === 3, 'AC1 agents numérico intacto');
|
|
47
|
+
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
// AC2 — união/máximo por dimensão, nunca soma.
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
const podMax = tmp('podmax');
|
|
52
|
+
fs.mkdirSync(path.join(podMax, 'agents'), { recursive: true });
|
|
53
|
+
fs.writeFileSync(path.join(podMax, 'agents', 'content-chief.md'), '# agente\n');
|
|
54
|
+
fs.mkdirSync(path.join(podMax, 'workflows'), { recursive: true });
|
|
55
|
+
fs.writeFileSync(path.join(podMax, 'workflows', 'wf-x.yaml'), 'steps:\n');
|
|
56
|
+
const specTwoSteps = { pod: 'p', agents: [{ name: 'content-chief', step: 'a' }, { name: 'content-chief', step: 'b' }], workflows: 1, handoffs: 0 };
|
|
57
|
+
const agg = at.aggregateSpec(specTwoSteps, podMax);
|
|
58
|
+
ok(agg.agents === 1, 'AC2 agentes: max(spec dedup 1, disco 1) = 1 — não 3 (soma antiga)', `agents=${agg.agents}`);
|
|
59
|
+
ok(agg.workflows === 1, 'AC2 workflows: max(1 declarado, 1 já gerado) = 1 — não 2', `workflows=${agg.workflows}`);
|
|
60
|
+
ok(agg.handoffs === 0, 'AC2 handoffs: max(0, 0) = 0');
|
|
61
|
+
// Caso incremental real (Risco 3): spec declara MAIS do que há em disco → spec é piso.
|
|
62
|
+
const aggInc = at.aggregateSpec({ pod: 'p', agents: 5, workflows: 3, handoffs: 2 }, podMax);
|
|
63
|
+
ok(aggInc.agents === 5 && aggInc.workflows === 3 && aggInc.handoffs === 2,
|
|
64
|
+
'AC2 incremental (disco < spec): valor da spec preservado como piso, nunca subconta');
|
|
65
|
+
// Disco maior que a spec continua dominando (semântica do forge-additive preservada).
|
|
66
|
+
const podBig = tmp('podbig');
|
|
67
|
+
fs.mkdirSync(path.join(podBig, 'agents'), { recursive: true });
|
|
68
|
+
for (const n of ['a', 'b', 'c', 'd']) fs.writeFileSync(path.join(podBig, 'agents', `${n}.md`), '# x\n');
|
|
69
|
+
ok(at.classifyTier(at.aggregateSpec({ pod: 'p', agents: ['x', 'y'] }, podBig)).tier === at.TIER_STANDARD,
|
|
70
|
+
'AC2 spec 2 + disco 4: max=4 > 2 → STANDARD/COMPLEX (caso do forge-additive preservado)');
|
|
71
|
+
|
|
72
|
+
// ---------------------------------------------------------------------------
|
|
73
|
+
// AC3 — fixture do caso exato do gate SF6.4 (authority-content/academy).
|
|
74
|
+
// Spec no formato real (1 agente físico como 2 etapas) + disco com o .md
|
|
75
|
+
// físico e o wf-*.yaml JÁ gerado a partir desta MESMA spec.
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
const FIXTURE = path.join(__dirname, '__fixtures__', 'assess-tier', 'retrofit-leve');
|
|
78
|
+
const fxSpec = path.join(FIXTURE, 'pod-spec.json');
|
|
79
|
+
const fxPod = path.join(FIXTURE, 'pod');
|
|
80
|
+
ok(fs.existsSync(fxSpec) && fs.existsSync(fxPod), 'AC3 fixture materializada em __fixtures__/assess-tier/retrofit-leve');
|
|
81
|
+
const cliFix = runCli([fxSpec, '--pod-dir', fxPod]);
|
|
82
|
+
ok(/^tier: SIMPLE/m.test(cliFix.stdout),
|
|
83
|
+
'AC3 caso SF6.4: --pod-dir agora relata SIMPLE (antes: 3 agentes/2 workflows → STANDARD falso)', cliFix.stdout);
|
|
84
|
+
ok(!/STANDARD/.test(cliFix.stdout), 'AC3 nenhum gatilho falso disparado na fixture');
|
|
85
|
+
const cliFixAlone = runCli([fxSpec]);
|
|
86
|
+
ok(/^tier: SIMPLE/m.test(cliFixAlone.stdout), 'AC3 --pod-dir bate com o caminho standalone (SIMPLE nos dois)');
|
|
87
|
+
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
// AC4 — regressão do standalone (byte-idêntico sem nome repetido).
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
const specPlain = tmp('plain');
|
|
92
|
+
const plainSimple = path.join(specPlain, 'simple.json');
|
|
93
|
+
fs.writeFileSync(plainSimple, JSON.stringify({ agents: ['a', 'b'], workflows: 1, handoffs: 0 }));
|
|
94
|
+
const outSimple = runCli([plainSimple]);
|
|
95
|
+
ok(outSimple.stdout === 'tier: SIMPLE\nnenhum gatilho oposto — caminho leve (SIMPLE).\n',
|
|
96
|
+
'AC4 standalone SIMPLE sem nome repetido: saída byte-idêntica', JSON.stringify(outSimple.stdout));
|
|
97
|
+
const plainStd = path.join(specPlain, 'std.json');
|
|
98
|
+
fs.writeFileSync(plainStd, JSON.stringify({ agents: ['a', 'b', 'c'], workflows: 2, handoffs: 0 }));
|
|
99
|
+
const outStd = runCli([plainStd]);
|
|
100
|
+
ok(outStd.stdout === 'tier: STANDARD/COMPLEX\ngatilhos que forçaram STANDARD/COMPLEX:\n - 3 agentes (> 2)\n - 2 workflows (> 1)\n',
|
|
101
|
+
'AC4 standalone STANDARD sem nome repetido: saída byte-idêntica', JSON.stringify(outStd.stdout));
|
|
102
|
+
// Com nome repetido: corrigida (dedup) — o gatilho de agentes deixa de disparar.
|
|
103
|
+
const plainDup = path.join(specPlain, 'dup.json');
|
|
104
|
+
fs.writeFileSync(plainDup, JSON.stringify({ agents: [{ name: 'c', step: 'a' }, { name: 'c', step: 'b' }, { name: 'c', step: 'c' }], workflows: 1, handoffs: 0 }));
|
|
105
|
+
const outDup = runCli([plainDup]);
|
|
106
|
+
ok(/^tier: SIMPLE/m.test(outDup.stdout),
|
|
107
|
+
'AC4 standalone COM nome repetido: corrigida (3 etapas de 1 agente físico → SIMPLE)', outDup.stdout);
|
|
108
|
+
|
|
109
|
+
// ---------------------------------------------------------------------------
|
|
110
|
+
console.log(`\n${passed} verificações OK, ${failures.length} falha(s).`);
|
|
111
|
+
if (failures.length > 0) {
|
|
112
|
+
for (const f of failures) console.log(` - ${f}`);
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|