@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,339 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/**
|
|
4
|
+
* motor-scripts.test.cjs — teste-guarda fail-loud do manifest de distribuição
|
|
5
|
+
* dos scripts do motor (ADR-007, Decisão 1).
|
|
6
|
+
*
|
|
7
|
+
* Converte "esquecer de decidir se um script novo é motor" em falha de CI:
|
|
8
|
+
* qualquer violação dos 4 invariantes = exit 1 com mensagem que diz o que
|
|
9
|
+
* decidir. Os invariantes são funções PURAS (recebem listas/conteúdo) testadas
|
|
10
|
+
* contra fixtures E executadas contra o disco real.
|
|
11
|
+
*
|
|
12
|
+
* 1. Completude — todo script `.cjs`/`.js` em scripts/ que não casa `exclude`
|
|
13
|
+
* está no manifest. Script novo fora dos dois → FAIL.
|
|
14
|
+
* 2. Existência — todo `path` do manifest existe no disco (sem entrada morta).
|
|
15
|
+
* 3. Fechamento — para cada script do manifest, todo `require('./X')` resolve
|
|
16
|
+
* de require a um `scripts/X` também no manifest.
|
|
17
|
+
* 4. Referência — sem entrada fantasma: cada entrada é justificada por
|
|
18
|
+
* citação em template/ (por basename/stem) OU por ser
|
|
19
|
+
* required-by outra entrada do manifest (fecho de require /
|
|
20
|
+
* campo `requiredBy`). E todo `scripts/<nome>` citado COM
|
|
21
|
+
* prefixo `scripts/` em template/ está no manifest ∪ exclude.
|
|
22
|
+
*
|
|
23
|
+
* NOTA sobre o invariante 4 (fiel ao ADR-007): a leitura estrita "todo
|
|
24
|
+
* `reason: referenced` aparece por basename-com-extensão em template/" torna o
|
|
25
|
+
* próprio manifest do ADR reprovado no próprio teste — `smoke-pod-workflow.cjs`
|
|
26
|
+
* só é citado como `smoke` em prosa (pipeline.md), nunca pelo nome completo. O
|
|
27
|
+
* ADR-007 antecipa isso ("Residual não coberto": citação por nome-cru fica fora
|
|
28
|
+
* do invariante 4 template→manifest, coberta pelo invariante 1) e usa o campo
|
|
29
|
+
* `requiredBy` para justificar entradas de fecho. Logo o invariante 4 aqui é um
|
|
30
|
+
* check ANTI-FANTASMA com escape por fecho de require: `smoke-pod-workflow.cjs`
|
|
31
|
+
* é legítimo por ser `require`-ado por `migration-manifest.cjs`/`harness-g5-lite.cjs`.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
const fs = require('node:fs');
|
|
35
|
+
const path = require('node:path');
|
|
36
|
+
|
|
37
|
+
const REPO_ROOT = path.resolve(__dirname, '..', '..');
|
|
38
|
+
const SCRIPTS_DIR = path.join(REPO_ROOT, 'scripts');
|
|
39
|
+
const TEMPLATE_DIR = path.join(REPO_ROOT, 'template');
|
|
40
|
+
|
|
41
|
+
const { loadManifest } = require('../../installer/motor-scripts');
|
|
42
|
+
|
|
43
|
+
let failures = 0;
|
|
44
|
+
function assert(ok, msg) {
|
|
45
|
+
if (ok) {
|
|
46
|
+
console.log(`[OK ] ${msg}`);
|
|
47
|
+
} else {
|
|
48
|
+
console.error(`[FALHA] ${msg}`);
|
|
49
|
+
failures++;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ---------------------------------------------------------------------------
|
|
54
|
+
// Helpers puros
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
|
|
57
|
+
/** True se `repoRelPath` (ex.: "scripts/foo.test.cjs") casa algum padrão exclude. */
|
|
58
|
+
function isExcluded(repoRelPath, patterns) {
|
|
59
|
+
const base = repoRelPath.split('/').pop();
|
|
60
|
+
const segs = repoRelPath.split('/');
|
|
61
|
+
return patterns.some((pat) => {
|
|
62
|
+
if (pat.endsWith('/')) return segs.includes(pat.slice(0, -1)); // dir: __tests__/
|
|
63
|
+
if (pat.startsWith('*.')) return base.endsWith(pat.slice(1)); // glob: *.test.cjs
|
|
64
|
+
return base === pat || repoRelPath === pat; // exato
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Stem = basename sem a última extensão (foo.cjs → foo; validate-branding.js → validate-branding). */
|
|
69
|
+
function stemOf(p) {
|
|
70
|
+
const base = p.split('/').pop();
|
|
71
|
+
return base.replace(/\.[^.]+$/, '');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Extrai `require('./X')` de um conteúdo e resolve RELATIVO AO DIRETÓRIO DO PRÓPRIO SCRIPT.
|
|
76
|
+
*
|
|
77
|
+
* SF11.11: antes, o alvo era montado como `scripts/X` fixo, o que só está certo para scripts na
|
|
78
|
+
* RAIZ de `scripts/`. Para um script em subdiretório (`scripts/veto-checks/render-png.cjs`
|
|
79
|
+
* requerendo `./render-gate.cjs`) o alvo real é `scripts/veto-checks/render-gate.cjs`, e a régua
|
|
80
|
+
* antiga errava nas DUAS direções: acusava fechamento quebrado num require legítimo (o alvo
|
|
81
|
+
* `scripts/render-gate.cjs` não existe) e, simetricamente, deixaria passar um require de fato
|
|
82
|
+
* pendente dentro do subdiretório se por acaso houvesse homônimo na raiz. `fromPath` é opcional
|
|
83
|
+
* para preservar o contrato das fixtures que passam scripts de raiz.
|
|
84
|
+
*/
|
|
85
|
+
function requiredSiblings(content, fromPath = 'scripts/x.cjs') {
|
|
86
|
+
const dir = fromPath.split('/').slice(0, -1).join('/');
|
|
87
|
+
const out = [];
|
|
88
|
+
const re = /require\(\s*['"]\.\/([^'"]+)['"]\s*\)/g;
|
|
89
|
+
let m;
|
|
90
|
+
while ((m = re.exec(content)) !== null) out.push(`${dir}/${m[1]}`);
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// --- Invariante 1: completude ---
|
|
95
|
+
// diskScripts: repo-rel paths de todos os .cjs/.js em scripts/ (recursivo).
|
|
96
|
+
// Retorna paths que NÃO estão no manifest E não casam exclude.
|
|
97
|
+
function invariantCompleteness(diskScripts, manifestPaths, excludes) {
|
|
98
|
+
const inManifest = new Set(manifestPaths);
|
|
99
|
+
return diskScripts.filter((p) => !inManifest.has(p) && !isExcluded(p, excludes));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// --- Invariante 2: existência ---
|
|
103
|
+
// Retorna paths do manifest ausentes em diskFilesSet.
|
|
104
|
+
function invariantExistence(manifestPaths, diskFilesSet) {
|
|
105
|
+
return manifestPaths.filter((p) => !diskFilesSet.has(p));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// --- Invariante 3: fechamento de require ---
|
|
109
|
+
// contents: Map<repoRelPath, string>. Retorna violações {from, missing}.
|
|
110
|
+
function invariantRequireClosure(manifestPaths, contents) {
|
|
111
|
+
const inManifest = new Set(manifestPaths);
|
|
112
|
+
const violations = [];
|
|
113
|
+
for (const p of manifestPaths) {
|
|
114
|
+
const content = contents.get(p);
|
|
115
|
+
if (content === undefined) continue; // existência cobre o ausente
|
|
116
|
+
for (const sib of requiredSiblings(content, p)) {
|
|
117
|
+
if (!inManifest.has(sib)) violations.push({ from: p, missing: sib });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return violations;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// --- Invariante 4: referência real / anti-fantasma ---
|
|
124
|
+
// entries: [{path, owner, reason, requiredBy?}]; templateText: concat de template/;
|
|
125
|
+
// prefixedCitations: Set de 'scripts/<nome>' citados COM prefixo em template/.
|
|
126
|
+
// Retorna { phantom: string[], danglingCitations: string[] }.
|
|
127
|
+
function invariantRealReference(entries, templateText, prefixedCitations, contents) {
|
|
128
|
+
const inManifest = new Set(entries.map((e) => e.path));
|
|
129
|
+
const excludes = loadManifest().exclude;
|
|
130
|
+
|
|
131
|
+
// Fecho de require: quem é required-by outra entrada (justifica entrada de fecho).
|
|
132
|
+
const requiredByClosure = new Set();
|
|
133
|
+
for (const e of entries) {
|
|
134
|
+
const content = contents.get(e.path);
|
|
135
|
+
if (content) for (const sib of requiredSiblings(content, e.path)) requiredByClosure.add(sib);
|
|
136
|
+
if (e.requiredBy) requiredByClosure.add(e.path); // declarado explicitamente
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const phantom = [];
|
|
140
|
+
for (const e of entries) {
|
|
141
|
+
const stem = stemOf(e.path);
|
|
142
|
+
const base = e.path.split('/').pop();
|
|
143
|
+
const citedByName = templateText.includes(base) || templateText.includes(stem);
|
|
144
|
+
const citedByPrefix = prefixedCitations.has(e.path);
|
|
145
|
+
const justifiedByClosure = requiredByClosure.has(e.path) || Boolean(e.requiredBy);
|
|
146
|
+
if (!citedByName && !citedByPrefix && !justifiedByClosure) phantom.push(e.path);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Toda citação COM prefixo scripts/ em template/ tem que estar em manifest ∪ exclude.
|
|
150
|
+
const dangling = [];
|
|
151
|
+
for (const cited of prefixedCitations) {
|
|
152
|
+
if (!inManifest.has(cited) && !isExcluded(cited, excludes)) dangling.push(cited);
|
|
153
|
+
}
|
|
154
|
+
return { phantom, danglingCitations: dangling };
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// ---------------------------------------------------------------------------
|
|
158
|
+
// Coleta do disco real
|
|
159
|
+
// ---------------------------------------------------------------------------
|
|
160
|
+
|
|
161
|
+
function listScriptFiles(dir) {
|
|
162
|
+
// Todos os .cjs/.js sob scripts/ (recursivo), como repo-rel paths.
|
|
163
|
+
const out = [];
|
|
164
|
+
const stack = [dir];
|
|
165
|
+
while (stack.length > 0) {
|
|
166
|
+
const d = stack.pop();
|
|
167
|
+
for (const entry of fs.readdirSync(d, { withFileTypes: true })) {
|
|
168
|
+
const p = path.join(d, entry.name);
|
|
169
|
+
if (entry.isDirectory()) stack.push(p);
|
|
170
|
+
else if (entry.isFile() && /\.(cjs|js)$/.test(entry.name)) {
|
|
171
|
+
out.push(path.relative(REPO_ROOT, p).split(path.sep).join('/'));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return out;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function readTemplateText(dir) {
|
|
179
|
+
let text = '';
|
|
180
|
+
const stack = [dir];
|
|
181
|
+
while (stack.length > 0) {
|
|
182
|
+
const d = stack.pop();
|
|
183
|
+
for (const entry of fs.readdirSync(d, { withFileTypes: true })) {
|
|
184
|
+
const p = path.join(d, entry.name);
|
|
185
|
+
if (entry.isDirectory()) stack.push(p);
|
|
186
|
+
else if (entry.isFile()) {
|
|
187
|
+
try { text += fs.readFileSync(p, 'utf8') + '\n'; } catch { /* binário */ }
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return text;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function prefixedCitationsOf(templateText) {
|
|
195
|
+
const set = new Set();
|
|
196
|
+
const re = /scripts\/[a-zA-Z0-9_.-]+\.(?:cjs|js)/g;
|
|
197
|
+
let m;
|
|
198
|
+
while ((m = re.exec(templateText)) !== null) set.add(m[0]);
|
|
199
|
+
return set;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// ---------------------------------------------------------------------------
|
|
203
|
+
// FIXTURES NEGATIVAS (não basta passar contra o disco de hoje)
|
|
204
|
+
// ---------------------------------------------------------------------------
|
|
205
|
+
|
|
206
|
+
function runNegativeFixtures() {
|
|
207
|
+
console.log('\n--- Fixtures negativas (cada uma DEVE detectar a violação) ---');
|
|
208
|
+
const manifestPaths = ['scripts/a.cjs', 'scripts/b.cjs'];
|
|
209
|
+
const excludes = ['*.test.cjs', '__tests__/', '__fixtures__/'];
|
|
210
|
+
|
|
211
|
+
// (a) .cjs novo fora do manifest/exclude → FAIL
|
|
212
|
+
const disk = ['scripts/a.cjs', 'scripts/b.cjs', 'scripts/novo-motor.cjs', 'scripts/x.test.cjs'];
|
|
213
|
+
const missing = invariantCompleteness(disk, manifestPaths, excludes);
|
|
214
|
+
assert(
|
|
215
|
+
missing.length === 1 && missing[0] === 'scripts/novo-motor.cjs',
|
|
216
|
+
`fixture (a): script novo fora do manifest/exclude é detectado (detectados: ${missing.join(', ') || 'nenhum'})`
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
// (b) require de módulo fora do manifest → FAIL
|
|
220
|
+
const contents = new Map([
|
|
221
|
+
['scripts/a.cjs', "const b = require('./b.cjs'); const z = require('./nao-listado.cjs');"],
|
|
222
|
+
['scripts/b.cjs', '// sem requires'],
|
|
223
|
+
]);
|
|
224
|
+
const closureViol = invariantRequireClosure(manifestPaths, contents);
|
|
225
|
+
assert(
|
|
226
|
+
closureViol.length === 1 && closureViol[0].missing === 'scripts/nao-listado.cjs',
|
|
227
|
+
`fixture (b): require de módulo fora do manifest é detectado (violações: ${closureViol.map((v) => v.missing).join(', ') || 'nenhuma'})`
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
// (b2) SF11.11 — require dentro de SUBDIRETÓRIO resolve pelo dir do próprio script:
|
|
231
|
+
// o legítimo (irmão no mesmo subdir, presente no manifest) NÃO acusa, e o pendente do
|
|
232
|
+
// mesmo subdir acusa com o path COMPLETO (não com o homônimo de raiz). Sem esta régua,
|
|
233
|
+
// `scripts/veto-checks/render-png.cjs` requerendo `./render-gate.cjs` seria falso-positivo.
|
|
234
|
+
const subPaths = ['scripts/sub/a.cjs', 'scripts/sub/b.cjs', 'scripts/b.cjs'];
|
|
235
|
+
const subContents = new Map([
|
|
236
|
+
['scripts/sub/a.cjs', "const b = require('./b.cjs'); const z = require('./so-na-raiz.cjs');"],
|
|
237
|
+
['scripts/sub/b.cjs', '// sem requires'],
|
|
238
|
+
['scripts/b.cjs', '// homônimo de raiz, irrelevante para o require do subdir'],
|
|
239
|
+
]);
|
|
240
|
+
const subViol = invariantRequireClosure(subPaths, subContents);
|
|
241
|
+
assert(
|
|
242
|
+
subViol.length === 1 && subViol[0].missing === 'scripts/sub/so-na-raiz.cjs',
|
|
243
|
+
`fixture (b2): require em subdiretório resolve pelo dir do script (violações: ${subViol.map((v) => v.missing).join(', ') || 'nenhuma'})`
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
// (c) entrada do manifest sem arquivo no disco → FAIL
|
|
247
|
+
const diskSet = new Set(['scripts/a.cjs']); // falta scripts/b.cjs
|
|
248
|
+
const dead = invariantExistence(manifestPaths, diskSet);
|
|
249
|
+
assert(
|
|
250
|
+
dead.length === 1 && dead[0] === 'scripts/b.cjs',
|
|
251
|
+
`fixture (c): entrada do manifest sem arquivo é detectada (mortas: ${dead.join(', ') || 'nenhuma'})`
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
// Sanidade: fixture "limpa" NÃO acusa nada.
|
|
255
|
+
const cleanDisk = ['scripts/a.cjs', 'scripts/b.cjs', 'scripts/z.test.cjs'];
|
|
256
|
+
assert(invariantCompleteness(cleanDisk, manifestPaths, excludes).length === 0, 'sanidade: disco consistente não acusa completude');
|
|
257
|
+
assert(invariantRequireClosure(manifestPaths, new Map([['scripts/a.cjs', "require('./b.cjs')"]])).length === 0, 'sanidade: fecho consistente não acusa');
|
|
258
|
+
assert(invariantExistence(manifestPaths, new Set(manifestPaths)).length === 0, 'sanidade: existência consistente não acusa');
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// ---------------------------------------------------------------------------
|
|
262
|
+
// EXECUÇÃO CONTRA O DISCO REAL
|
|
263
|
+
// ---------------------------------------------------------------------------
|
|
264
|
+
|
|
265
|
+
function runAgainstDisk() {
|
|
266
|
+
console.log('\n--- Invariantes contra o disco real ---');
|
|
267
|
+
const manifest = loadManifest();
|
|
268
|
+
const manifestPaths = manifest.scripts.map((e) => e.path);
|
|
269
|
+
const excludes = manifest.exclude;
|
|
270
|
+
|
|
271
|
+
const diskScripts = listScriptFiles(SCRIPTS_DIR);
|
|
272
|
+
const diskFilesSet = new Set(diskScripts);
|
|
273
|
+
const contents = new Map();
|
|
274
|
+
for (const rel of manifestPaths) {
|
|
275
|
+
const abs = path.join(REPO_ROOT, ...rel.split('/'));
|
|
276
|
+
if (fs.existsSync(abs)) contents.set(rel, fs.readFileSync(abs, 'utf8'));
|
|
277
|
+
}
|
|
278
|
+
const templateText = readTemplateText(TEMPLATE_DIR);
|
|
279
|
+
const prefixed = prefixedCitationsOf(templateText);
|
|
280
|
+
|
|
281
|
+
// 1. Completude
|
|
282
|
+
const incomplete = invariantCompleteness(diskScripts, manifestPaths, excludes);
|
|
283
|
+
assert(
|
|
284
|
+
incomplete.length === 0,
|
|
285
|
+
incomplete.length === 0
|
|
286
|
+
? 'invariante 1 (completude): todo script do disco está no manifest ou no exclude'
|
|
287
|
+
: `invariante 1 (completude) VIOLADO — decida: motor → manifest; não-motor → exclude: ${incomplete.join(', ')}`
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
// 2. Existência
|
|
291
|
+
const dead = invariantExistence(manifestPaths, diskFilesSet);
|
|
292
|
+
assert(
|
|
293
|
+
dead.length === 0,
|
|
294
|
+
dead.length === 0
|
|
295
|
+
? `invariante 2 (existência): todas as ${manifestPaths.length} entradas existem no disco`
|
|
296
|
+
: `invariante 2 (existência) VIOLADO — entradas sem arquivo: ${dead.join(', ')}`
|
|
297
|
+
);
|
|
298
|
+
|
|
299
|
+
// 3. Fechamento de require
|
|
300
|
+
const closure = invariantRequireClosure(manifestPaths, contents);
|
|
301
|
+
assert(
|
|
302
|
+
closure.length === 0,
|
|
303
|
+
closure.length === 0
|
|
304
|
+
? 'invariante 3 (fechamento de require): todo require(./irmão) resolve dentro do manifest'
|
|
305
|
+
: `invariante 3 (fechamento) VIOLADO — ${closure.map((v) => `${v.from} → ${v.missing}`).join('; ')}`
|
|
306
|
+
);
|
|
307
|
+
|
|
308
|
+
// 4. Referência real / anti-fantasma
|
|
309
|
+
const { phantom, danglingCitations } = invariantRealReference(manifest.scripts, templateText, prefixed, contents);
|
|
310
|
+
assert(
|
|
311
|
+
phantom.length === 0,
|
|
312
|
+
phantom.length === 0
|
|
313
|
+
? 'invariante 4a (anti-fantasma): toda entrada é citada em template/ ou justificada por fecho de require'
|
|
314
|
+
: `invariante 4a (anti-fantasma) VIOLADO — entradas sem justificativa: ${phantom.join(', ')}`
|
|
315
|
+
);
|
|
316
|
+
assert(
|
|
317
|
+
danglingCitations.length === 0,
|
|
318
|
+
danglingCitations.length === 0
|
|
319
|
+
? 'invariante 4b: toda citação com prefixo scripts/ em template/ está no manifest ∪ exclude'
|
|
320
|
+
: `invariante 4b VIOLADO — citações com prefixo fora do manifest/exclude: ${danglingCitations.join(', ')}`
|
|
321
|
+
);
|
|
322
|
+
|
|
323
|
+
// Sanidade extra: 21 entradas (ADR-007=14; +1 fidelity SF7.1; +1 arena SF7.4; +3 veto-checks SF7.2/ADR-011; +1 harden-learning SF7.6/ADR-012; +1 source-audit SF7.10/ADR-014); +2 SF9.1 pipeline; +1 SF10.1 pod-export-compile; +2 SF10.2 pod-export-executor+tools; +1 SF10.11 pod-export-postprocess (fixer in-process, require-dependency do executor — NÃO blessed: a raiz blessed é só `scripts/veto-checks/`, ver `blessedVetoRels` em pc-run-pod.cjs).
|
|
324
|
+
assert(manifest.scripts.length === 34, `manifest tem 34 entradas (ADR-007 + SF7.x + SF9.1 pipeline + SF10.1 export + SF10.2 executor/tools + SF10.3 service + SF10.5 ui + SF10.6 release + SF10.8 veto phash-gate + SF10.11 postprocess + SF11.5 pod-memory-note + SF11.11 veto render-png + SF13.1 validate-story-acs) — tem ${manifest.scripts.length}`);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function main() {
|
|
328
|
+
console.log('POWER CLAUDE — teste-guarda do manifest de scripts do motor (ADR-007)\n');
|
|
329
|
+
runNegativeFixtures();
|
|
330
|
+
runAgainstDisk();
|
|
331
|
+
if (failures > 0) {
|
|
332
|
+
console.error(`\nTeste-guarda FALHOU: ${failures} violação(ões).`);
|
|
333
|
+
process.exit(1);
|
|
334
|
+
}
|
|
335
|
+
console.log('\nTeste-guarda verde.');
|
|
336
|
+
process.exit(0);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
main();
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/**
|
|
4
|
+
* pc-run-pod-counter.test.cjs — suíte DEDICADA do contador de itens (Story SF2.3,
|
|
5
|
+
* débito #2 do gate sf1.5-piloto-hormozi-g5.yaml).
|
|
6
|
+
*
|
|
7
|
+
* Arquivo SEPARADO de pc-run-pod.test.cjs de propósito: a Story SF2.2 roda em
|
|
8
|
+
* paralelo tocando advance()/buildBrief() na MESMA suíte — este arquivo isola os
|
|
9
|
+
* fixtures/asserções do contador (território SF2.3) e evita colisão de merge.
|
|
10
|
+
*
|
|
11
|
+
* Prova AC7 (as 3 formas contam) e AC8 (sem afrouxamento — bullets contam como
|
|
12
|
+
* antes; numeradas/tabela só SOMAM; separador de tabela NÃO conta).
|
|
13
|
+
*
|
|
14
|
+
* Node >= 18. Exit 0/1.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const { countListItemsInSection } = require('../pc-run-pod.cjs');
|
|
18
|
+
|
|
19
|
+
let passed = 0;
|
|
20
|
+
const failures = [];
|
|
21
|
+
function eq(actual, expected, label) {
|
|
22
|
+
if (actual === expected) { passed++; console.log(`[OK ] ${label} (=${actual})`); }
|
|
23
|
+
else { failures.push(`${label} — esperado ${expected}, obtido ${actual}`); console.log(`[FALHA] ${label} — esperado ${expected}, obtido ${actual}`); }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// --- AC8: bullets contam EXATAMENTE como na SF1.1 (comportamento inalterado) ---
|
|
27
|
+
eq(countListItemsInSection('## Value Stack\n- a\n- b\n* c\n', 'Value Stack'), 3, 'AC8 bullets `-`/`*` contam como antes');
|
|
28
|
+
eq(countListItemsInSection('## Value Stack\ntexto em prosa sem itens\n', 'Value Stack'), 0, 'AC8 prosa corrida NÃO conta');
|
|
29
|
+
eq(countListItemsInSection('## Outra\n- a\n- b\n## Value Stack\n- x\n', 'Value Stack'), 1, 'AC8 só conta sob a seção-alvo (escopo por heading)');
|
|
30
|
+
|
|
31
|
+
// --- AC7 (b): lista numerada conta ---
|
|
32
|
+
eq(countListItemsInSection('## Value Stack\n1. um\n2. dois\n3. três\n', 'Value Stack'), 3, 'AC7 lista numerada `1.`/`2.` conta');
|
|
33
|
+
eq(countListItemsInSection('## Value Stack\n1. um\ntexto\n2. dois\n', 'Value Stack'), 2, 'AC7 numerada conta só as linhas de item (prosa no meio ignorada)');
|
|
34
|
+
|
|
35
|
+
// --- AC7 (c): linhas de tabela contam, separador NÃO (Risco 3) ---
|
|
36
|
+
const tabela = '## Value Stack\n| Item | Valor |\n|------|-------|\n| Coaching | $1000 |\n| Plano | $500 |\n';
|
|
37
|
+
eq(countListItemsInSection(tabela, 'Value Stack'), 3, 'AC7 linhas de tabela contam (cabeçalho + 2 dados = 3), separador EXCLUÍDO');
|
|
38
|
+
eq(countListItemsInSection('## Value Stack\n| a | b |\n| :--- | ---: |\n| c | d |\n', 'Value Stack'), 2, 'Risco3 separador `|:---|---:|` alinhado NÃO conta');
|
|
39
|
+
eq(countListItemsInSection('## Value Stack\n|---|---|\n', 'Value Stack'), 0, 'Risco3 tabela só com separador → 0 itens');
|
|
40
|
+
|
|
41
|
+
// --- AC7 misto: as 3 formas somam sob o mesmo heading ---
|
|
42
|
+
const misto = '## Value Stack\n- bullet\n1. numerado\n| tab | row |\n|-----|-----|\n| dado | dado |\n';
|
|
43
|
+
eq(countListItemsInSection(misto, 'Value Stack'), 4, 'AC7 formas mistas somam (1 bullet + 1 numerada + 2 tabela s/ separador)');
|
|
44
|
+
|
|
45
|
+
// --- AC8: numeradas/tabela só SOMAM — nunca reduzem um count de bullets ---
|
|
46
|
+
const antes = countListItemsInSection('## VS\n- a\n- b\n- c\n- d\n- e\n', 'VS');
|
|
47
|
+
const depois = countListItemsInSection('## VS\n- a\n- b\n- c\n- d\n- e\n1. extra\n', 'VS');
|
|
48
|
+
eq(antes, 5, 'AC8 baseline de 5 bullets preservado');
|
|
49
|
+
eq(depois, 6, 'AC8 adicionar numerada só INCREMENTA (5→6), nunca reduz');
|
|
50
|
+
|
|
51
|
+
console.log(`\n${passed}/${passed + failures.length} asserções do contador passaram.`);
|
|
52
|
+
if (failures.length > 0) {
|
|
53
|
+
console.error('\nSUÍTE contador FALHOU:');
|
|
54
|
+
for (const f of failures) console.error(` - ${f}`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
console.log('Suíte contador verde (débito #2 fechado — 3 formas, sem afrouxar bullets).');
|
|
58
|
+
process.exit(0);
|