@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,256 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/**
|
|
4
|
+
* pc-run-pipeline.test.cjs — suíte do maestro cross-pod (Story SF9.1, ADR-017).
|
|
5
|
+
* Prova, com pipeline sintético (pods-fixture 1-step, sem pods reais):
|
|
6
|
+
* (AC4) validate-pipeline: golden passa; cada malformação recusa fail-loud.
|
|
7
|
+
* (AC2/AC5) E2E golden: as 2 fases concluem; portão GO avança.
|
|
8
|
+
* (AC2) SUPERVISOR-NÃO-EXECUTOR: advance com run-filho não-done FALHA (o pipeline não
|
|
9
|
+
* executa a fase); e o motor não importa nada além de pc-run-pod (sem child_process/
|
|
10
|
+
* rede/LLM) — provado por inspeção da fonte.
|
|
11
|
+
* (AC11) portão binário: NO-GO trava e a fase seguinte NUNCA dispara; GO avança; checkpoint
|
|
12
|
+
* humano PARA (blocked) e só approve (GO)/reject (NO-GO) resolve.
|
|
13
|
+
* (AC3) referência-sem-cópia: o input da fase B é o PATH real do output da fase A (task-ref),
|
|
14
|
+
* verificado em disco; nenhuma cópia é criada no runDir da fase B.
|
|
15
|
+
* (AC2) baseline: run done mas output ausente em disco → fail-loud.
|
|
16
|
+
* retomada: recarga fresca do state → resume do ponto (fase A completed, B pending).
|
|
17
|
+
*
|
|
18
|
+
* Node >= 18. Exit 0/1.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const fs = require('node:fs');
|
|
22
|
+
const os = require('node:os');
|
|
23
|
+
const path = require('node:path');
|
|
24
|
+
|
|
25
|
+
const pp = require('./pc-run-pipeline.cjs');
|
|
26
|
+
const rpod = require('./pc-run-pod.cjs');
|
|
27
|
+
const vpipe = require('./validate-pipeline.cjs');
|
|
28
|
+
|
|
29
|
+
const REPO_ROOT = path.resolve(__dirname, '..');
|
|
30
|
+
const FIX = path.join(__dirname, '__fixtures__', 'pipeline');
|
|
31
|
+
const PODS = path.join(FIX, 'pods');
|
|
32
|
+
const CONTRACT = path.join(FIX, 'pipelines', 'pipeline-demo.yaml');
|
|
33
|
+
const CONTRACT_CP = path.join(FIX, 'pipelines', 'pipeline-checkpoint.yaml');
|
|
34
|
+
|
|
35
|
+
let passed = 0;
|
|
36
|
+
const failures = [];
|
|
37
|
+
function ok(cond, label) { if (cond) { passed++; console.log(`[OK ] ${label}`); } else { failures.push(label); console.error(`[FALHA] ${label}`); } }
|
|
38
|
+
function throwsFail(fn) { try { fn(); return false; } catch (e) { if (e instanceof vpipe.Fail || e instanceof pp.PipelineError) return true; throw e; } }
|
|
39
|
+
function freshSR() { return fs.mkdtempSync(path.join(os.tmpdir(), 'pipe-sr-')); }
|
|
40
|
+
function opts(sr) { return { podsRoot: PODS, stateRoot: sr }; }
|
|
41
|
+
|
|
42
|
+
/** Ator EXTERNO (operador): completa o run-filho da fase escrevendo o artefato e dirigindo pc-run-pod. */
|
|
43
|
+
function completeChild(sr, id, pid, artFile, body) {
|
|
44
|
+
const st = pp.loadPipelineState(sr, id).phases[pid];
|
|
45
|
+
fs.mkdirSync(path.join(st.run_dir, 'artifacts'), { recursive: true });
|
|
46
|
+
fs.writeFileSync(path.join(st.run_dir, 'artifacts', artFile), body);
|
|
47
|
+
const ctx = rpod.openRun({
|
|
48
|
+
statePath: path.join(st.run_dir, 'state.json'),
|
|
49
|
+
workflowPath: path.join(PODS, st.pod, 'workflows', `${st.workflow}.yaml`),
|
|
50
|
+
podRootOverride: path.join(PODS, st.pod),
|
|
51
|
+
});
|
|
52
|
+
rpod.advance(ctx);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ===========================================================================
|
|
56
|
+
// (AC4) validate-pipeline
|
|
57
|
+
// ===========================================================================
|
|
58
|
+
console.log('--- (AC4) validate-pipeline ---');
|
|
59
|
+
ok(!throwsFail(() => vpipe.validatePipeline(CONTRACT, PODS)), 'golden: contrato demo válido PASSA');
|
|
60
|
+
function badContract(mutate) {
|
|
61
|
+
const doc = fs.readFileSync(CONTRACT, 'utf8');
|
|
62
|
+
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'pipe-bad-'));
|
|
63
|
+
const p = path.join(d, 'pipeline-x.yaml');
|
|
64
|
+
fs.writeFileSync(p, mutate(doc));
|
|
65
|
+
return p;
|
|
66
|
+
}
|
|
67
|
+
ok(throwsFail(() => vpipe.validatePipeline(badContract((s) => s.replace('id: demo', 'deliverable_only: x')), PODS)), 'fail-loud: id ausente RECUSA');
|
|
68
|
+
ok(throwsFail(() => vpipe.validatePipeline(badContract((s) => s.replace('workflow: wf-b', 'workflow: wf-inexistente')), PODS)), 'fail-loud: pod/workflow inexistente em disco RECUSA');
|
|
69
|
+
ok(throwsFail(() => vpipe.validatePipeline(badContract((s) => s.replace('"<- phase-a.doc"', '"<- phase-z.doc"')), PODS)), 'fail-loud: input → fase não-declarada-antes RECUSA');
|
|
70
|
+
ok(throwsFail(() => vpipe.validatePipeline(badContract((s) => s.replace('"<- phase-a.doc"', '"<- phase-a.inexistente"')), PODS)), 'fail-loud: input → output inexistente da fase-fonte RECUSA');
|
|
71
|
+
ok(throwsFail(() => vpipe.validatePipeline(badContract((s) => s.replace('id: phase-b', 'id: phase-a')), PODS)), 'fail-loud: id de fase duplicado RECUSA');
|
|
72
|
+
// input referenciando fase FUTURA (self/adiante): trocar a referência de B para apontar a si mesma
|
|
73
|
+
ok(throwsFail(() => vpipe.validatePipeline(badContract((s) => s.replace('"<- phase-a.doc"', '"<- phase-b.final"')), PODS)), 'fail-loud: input → própria fase (ciclo) RECUSA');
|
|
74
|
+
// gate malformado (asserção sem forma válida)
|
|
75
|
+
ok(throwsFail(() => vpipe.validatePipeline(badContract((s) => s.replace('{ type: field_matches, field: quality, pattern: "^(alta|media|baixa)$" }', '{ type: inventado, field: x }')), PODS)), 'fail-loud: gate.veto com type inválido RECUSA');
|
|
76
|
+
|
|
77
|
+
// ===========================================================================
|
|
78
|
+
// (AC2) supervisor-não-executor — o motor não importa nada além de pc-run-pod
|
|
79
|
+
// ===========================================================================
|
|
80
|
+
console.log('--- (AC2) supervisor-não-executor (inspeção da fonte) ---');
|
|
81
|
+
const motorSrc = fs.readFileSync(path.join(__dirname, 'pc-run-pipeline.cjs'), 'utf8');
|
|
82
|
+
ok(!/require\(\s*['"]node:child_process['"]/.test(motorSrc) && !/require\(\s*['"](node:)?(http|https|net)['"]/.test(motorSrc),
|
|
83
|
+
'motor NÃO importa child_process/http/https/net — não pode spawnar nem chamar rede (não é executor)');
|
|
84
|
+
ok(!/execFileSync|execSync|\bspawn\b/.test(motorSrc), 'motor não usa execFileSync/spawn — só o módulo pc-run-pod (startRun) e leitura de state');
|
|
85
|
+
|
|
86
|
+
// ===========================================================================
|
|
87
|
+
// E2E golden + (AC3) referência-sem-cópia + (AC2) supervisor-não-executor comportamental
|
|
88
|
+
// ===========================================================================
|
|
89
|
+
console.log('--- E2E golden + referência-sem-cópia ---');
|
|
90
|
+
{
|
|
91
|
+
const sr = freshSR();
|
|
92
|
+
pp.init(CONTRACT, opts(sr));
|
|
93
|
+
let r = pp.advance('demo', opts(sr));
|
|
94
|
+
ok(r.status === 'started' && r.phase === 'phase-a', 'E2E: advance inicia a fase A (start do run-filho)');
|
|
95
|
+
ok(throwsFail(() => pp.advance('demo', opts(sr))), 'SUPERVISOR-NÃO-EXECUTOR: advance com run-filho A não-done FALHA (o pipeline não executa a fase)');
|
|
96
|
+
completeChild(sr, 'demo', 'phase-a', 'make.md', '## Body\nA\nstatus: ok\nquality: alta\n');
|
|
97
|
+
r = pp.advance('demo', opts(sr));
|
|
98
|
+
ok(r.status === 'phase-complete' && r.phase === 'phase-a', 'E2E: com filho A done + baseline + portão GO → fase A CONCLUÍDA');
|
|
99
|
+
r = pp.advance('demo', opts(sr));
|
|
100
|
+
ok(r.status === 'started' && r.phase === 'phase-b', 'E2E: advance inicia a fase B');
|
|
101
|
+
// referência-sem-cópia: o task-ref da fase B é o PATH real do output da fase A
|
|
102
|
+
const stA = pp.loadPipelineState(sr, 'demo').phases['phase-a'];
|
|
103
|
+
const outA = stA.outputs_resolved.doc;
|
|
104
|
+
const childB = rpod.readState(path.join(pp.loadPipelineState(sr, 'demo').phases['phase-b'].run_dir, 'state.json'));
|
|
105
|
+
ok(childB.task_ref && childB.task_ref.includes(outA), 'AC3: task-ref da fase B contém o PATH real do output da fase A (referência)');
|
|
106
|
+
const bRunDir = pp.loadPipelineState(sr, 'demo').phases['phase-b'].run_dir;
|
|
107
|
+
ok(!fs.existsSync(path.join(bRunDir, 'artifacts', 'make.md')), 'AC3: nenhuma CÓPIA do output de A foi criada no runDir de B (sem cópia)');
|
|
108
|
+
// o brief do 1º step de B (buildBrief) mostra "Tarefa:" com o path — canal task-ref
|
|
109
|
+
const bCtx = rpod.openRun({ statePath: path.join(bRunDir, 'state.json'), workflowPath: path.join(PODS, 'pipe-b', 'workflows', 'wf-b.yaml'), podRootOverride: path.join(PODS, 'pipe-b') });
|
|
110
|
+
ok(rpod.buildBrief(bCtx, 'use').includes(outA), 'AC3: o brief do 1º step de B injeta o path do output de A via "Tarefa:" (task-ref lido pelo pod)');
|
|
111
|
+
completeChild(sr, 'demo', 'phase-b', 'use.md', '## Body\nB\nstatus: ok\n');
|
|
112
|
+
r = pp.advance('demo', opts(sr));
|
|
113
|
+
ok(r.status === 'phase-complete' && r.phase === 'phase-b', 'E2E: fase B CONCLUÍDA');
|
|
114
|
+
r = pp.advance('demo', opts(sr));
|
|
115
|
+
ok(r.status === 'complete', 'E2E: pipeline COMPLETO após as 2 fases');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// ===========================================================================
|
|
119
|
+
// (AC11) portão binário: NO-GO trava; fase seguinte nunca dispara
|
|
120
|
+
// ===========================================================================
|
|
121
|
+
console.log('--- (AC11) portão NO-GO trava ---');
|
|
122
|
+
{
|
|
123
|
+
const sr = freshSR();
|
|
124
|
+
pp.init(CONTRACT, opts(sr));
|
|
125
|
+
pp.advance('demo', opts(sr)); // start A
|
|
126
|
+
// filho A done, MAS o portão de MÁQUINA (quality) NO-GO: quality inválida
|
|
127
|
+
completeChild(sr, 'demo', 'phase-a', 'make.md', '## Body\nA\nstatus: ok\nquality: pessima\n');
|
|
128
|
+
ok(throwsFail(() => pp.advance('demo', opts(sr))), 'portão NO-GO (quality inválida): advance FALHA fail-loud');
|
|
129
|
+
const s = pp.loadPipelineState(sr, 'demo');
|
|
130
|
+
ok(s.phases['phase-a'].status === 'failed' && s.phases['phase-b'].status === 'pending',
|
|
131
|
+
'portão NO-GO: fase A FALHOU e fase B NUNCA disparou (segue pending)');
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// ===========================================================================
|
|
135
|
+
// (AC11) checkpoint humano: PARA (blocked); approve=GO avança, reject=NO-GO trava
|
|
136
|
+
// ===========================================================================
|
|
137
|
+
console.log('--- (AC11) checkpoint humano (GO/NO-GO) ---');
|
|
138
|
+
{
|
|
139
|
+
const sr = freshSR();
|
|
140
|
+
pp.init(CONTRACT_CP, opts(sr));
|
|
141
|
+
pp.advance('cp-demo', opts(sr)); // start A
|
|
142
|
+
completeChild(sr, 'cp-demo', 'phase-a', 'make.md', '## Body\nA\nstatus: ok\nquality: alta\n');
|
|
143
|
+
const r = pp.advance('cp-demo', opts(sr));
|
|
144
|
+
ok(r.status === 'blocked', 'checkpoint humano: advance PARA em blocked (sem auto-avanço)');
|
|
145
|
+
ok(throwsFail(() => pp.advance('cp-demo', opts(sr))), 'checkpoint: advance enquanto blocked FALHA (exige decisão humana)');
|
|
146
|
+
const ap = pp.approve('cp-demo', { ...opts(sr), note: 'ok com ressalva menor' });
|
|
147
|
+
ok(ap.status === 'phase-complete', 'checkpoint: approve = GO conclui a fase (ressalva como texto livre num GO)');
|
|
148
|
+
ok(pp.loadPipelineState(sr, 'cp-demo').phases['phase-a'].note === 'ok com ressalva menor', 'checkpoint: ressalva registrada no state (não é 3º estado de fluxo)');
|
|
149
|
+
}
|
|
150
|
+
{
|
|
151
|
+
const sr = freshSR();
|
|
152
|
+
pp.init(CONTRACT_CP, opts(sr));
|
|
153
|
+
pp.advance('cp-demo', opts(sr));
|
|
154
|
+
completeChild(sr, 'cp-demo', 'phase-a', 'make.md', '## Body\nA\nstatus: ok\nquality: alta\n');
|
|
155
|
+
pp.advance('cp-demo', opts(sr)); // blocked
|
|
156
|
+
ok(throwsFail(() => pp.reject('cp-demo', opts(sr))), 'checkpoint: reject = NO-GO trava (fail-loud)');
|
|
157
|
+
ok(pp.loadPipelineState(sr, 'cp-demo').phases['phase-b'].status === 'pending', 'checkpoint NO-GO: fase B nunca disparou');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// ===========================================================================
|
|
161
|
+
// (AC2) baseline: run done mas output ausente em disco → fail-loud
|
|
162
|
+
// ===========================================================================
|
|
163
|
+
console.log('--- (AC2) baseline (artefato em disco) ---');
|
|
164
|
+
{
|
|
165
|
+
const sr = freshSR();
|
|
166
|
+
pp.init(CONTRACT, opts(sr));
|
|
167
|
+
pp.advance('demo', opts(sr));
|
|
168
|
+
completeChild(sr, 'demo', 'phase-a', 'make.md', '## Body\nA\nstatus: ok\nquality: alta\n');
|
|
169
|
+
// apaga o output DEPOIS do filho fechar done → baseline do pipeline deve pegar (não confia no state)
|
|
170
|
+
fs.rmSync(path.join(pp.loadPipelineState(sr, 'demo').phases['phase-a'].run_dir, 'artifacts', 'make.md'));
|
|
171
|
+
ok(throwsFail(() => pp.advance('demo', opts(sr))), 'baseline: run done mas output ausente em disco → advance FALHA (nunca por relato do state)');
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// ===========================================================================
|
|
175
|
+
// retomada: recarga fresca do state → resume do ponto
|
|
176
|
+
// ===========================================================================
|
|
177
|
+
console.log('--- retomada ---');
|
|
178
|
+
{
|
|
179
|
+
const sr = freshSR();
|
|
180
|
+
pp.init(CONTRACT, opts(sr));
|
|
181
|
+
pp.advance('demo', opts(sr));
|
|
182
|
+
completeChild(sr, 'demo', 'phase-a', 'make.md', '## Body\nA\nstatus: ok\nquality: alta\n');
|
|
183
|
+
pp.advance('demo', opts(sr)); // A completed
|
|
184
|
+
// "mata" o processo: uma leitura FRESCA do disco vê A completed, B pending
|
|
185
|
+
const fresh = pp.loadPipelineState(sr, 'demo');
|
|
186
|
+
ok(fresh.phases['phase-a'].status === 'completed' && fresh.phases['phase-b'].status === 'pending', 'retomada: state persistido em disco mostra A completed, B pending');
|
|
187
|
+
ok(pp.currentPhaseId(fresh) === 'phase-b', 'retomada: currentPhaseId resume em B (não repete A)');
|
|
188
|
+
const r = pp.advance('demo', opts(sr));
|
|
189
|
+
ok(r.status === 'started' && r.phase === 'phase-b', 'retomada: advance continua do ponto (inicia B), não recomeça A');
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// ===========================================================================
|
|
193
|
+
// (SF9.2 CONCERNS-1) roteamento de memória: start E next do operador isolam o run de
|
|
194
|
+
// pipeline — o memory REAL do pod fica byte-intocado. Retrocompat: standalone usa podRoot.
|
|
195
|
+
// ===========================================================================
|
|
196
|
+
console.log('--- (SF9.2 CONCERNS-1) roteamento de memória do run ---');
|
|
197
|
+
const crypto = require('node:crypto');
|
|
198
|
+
const sha = (p) => (fs.existsSync(p) ? crypto.createHash('sha256').update(fs.readFileSync(p)).digest('hex') : 'ABSENT');
|
|
199
|
+
|
|
200
|
+
/** Copia os pods-fixture para um pods-root próprio (para checar/semear a memória sem tocar o commit). */
|
|
201
|
+
function copyPods() {
|
|
202
|
+
const d = fs.mkdtempSync(path.join(os.tmpdir(), 'pipe-pods-'));
|
|
203
|
+
fs.cpSync(PODS, path.join(d, '.'), { recursive: true });
|
|
204
|
+
return d;
|
|
205
|
+
}
|
|
206
|
+
{
|
|
207
|
+
const podsRoot = copyPods();
|
|
208
|
+
const sr = freshSR();
|
|
209
|
+
const o = { podsRoot, stateRoot: sr };
|
|
210
|
+
// semeia a memória REAL do pod pipe-a com conteúdo conhecido
|
|
211
|
+
const memReal = path.join(podsRoot, 'pipe-a', 'memory');
|
|
212
|
+
fs.mkdirSync(memReal, { recursive: true });
|
|
213
|
+
const jsonl = path.join(memReal, 'learnings.jsonl');
|
|
214
|
+
const cons = path.join(memReal, 'learnings.consolidated.md');
|
|
215
|
+
fs.writeFileSync(jsonl, '{"seed":"baseline-sf9.2"}\n');
|
|
216
|
+
fs.writeFileSync(cons, '# consolidado semeado\n');
|
|
217
|
+
const before = { jsonl: sha(jsonl), cons: sha(cons) };
|
|
218
|
+
// contrato apontando para o pods-root copiado
|
|
219
|
+
const contract = path.join(fs.mkdtempSync(path.join(os.tmpdir(), 'pipe-c-')), 'pipeline-demo.yaml');
|
|
220
|
+
fs.writeFileSync(contract, fs.readFileSync(CONTRACT, 'utf8'));
|
|
221
|
+
pp.init(contract, o);
|
|
222
|
+
pp.advance('demo', o); // start fase A (persiste memory_pod_dir=tmp no state do filho)
|
|
223
|
+
// OPERADOR completa a fase via pc-run-pod SEM memoryPodDir (o fluxo CLI real que causava o bug):
|
|
224
|
+
const stA = pp.loadPipelineState(sr, 'demo').phases['phase-a'];
|
|
225
|
+
fs.mkdirSync(path.join(stA.run_dir, 'artifacts'), { recursive: true });
|
|
226
|
+
fs.writeFileSync(path.join(stA.run_dir, 'artifacts', 'make.md'), '## Body\nA\nstatus: ok\nquality: alta\n');
|
|
227
|
+
const ctxA = rpod.openRun({ statePath: path.join(stA.run_dir, 'state.json'), workflowPath: path.join(podsRoot, 'pipe-a', 'workflows', 'wf-a.yaml'), podRootOverride: path.join(podsRoot, 'pipe-a') });
|
|
228
|
+
rpod.advance(ctxA); // completa o run → recordLearning dispara; DEVE ir para o tmp, não para o memory real
|
|
229
|
+
const after = { jsonl: sha(jsonl), cons: sha(cons) };
|
|
230
|
+
ok(before.jsonl === after.jsonl && before.cons === after.cons,
|
|
231
|
+
'CONCERNS-1: após start + next do operador, o memory REAL do pod fica BYTE-INTOCADO (roteamento honrado pelo state)');
|
|
232
|
+
// e o learning FOI escrito — só que no dir isolado gravado no state do run
|
|
233
|
+
const routed = rpod.readState(path.join(stA.run_dir, 'state.json')).memory_pod_dir;
|
|
234
|
+
ok(routed && routed.startsWith(os.tmpdir()) && fs.existsSync(path.join(routed, 'memory', 'learnings.jsonl')),
|
|
235
|
+
'CONCERNS-1: o learning do run foi para o dir ISOLADO gravado no state (memory_pod_dir), não para o pod');
|
|
236
|
+
}
|
|
237
|
+
// retrocompat: run STANDALONE (sem memoryPodDir) escreve no podRoot — comportamento intacto
|
|
238
|
+
{
|
|
239
|
+
const podsRoot = copyPods();
|
|
240
|
+
const podA = path.join(podsRoot, 'pipe-a');
|
|
241
|
+
const runsRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'pipe-standalone-'));
|
|
242
|
+
const { ctx } = rpod.startRun({ workflowPath: path.join(podA, 'workflows', 'wf-a.yaml'), podRootOverride: podA, pod: 'pipe-a', workflow: 'wf-a', runsRoot, runId: 'r1' });
|
|
243
|
+
const st = rpod.readState(path.join(ctx.runDir, 'state.json'));
|
|
244
|
+
ok(!('memory_pod_dir' in st), 'retrocompat: run standalone (sem memoryPodDir) NÃO grava memory_pod_dir no state');
|
|
245
|
+
fs.mkdirSync(path.join(ctx.runDir, 'artifacts'), { recursive: true });
|
|
246
|
+
fs.writeFileSync(path.join(ctx.runDir, 'artifacts', 'make.md'), '## Body\nA\nstatus: ok\n');
|
|
247
|
+
const ctx2 = rpod.openRun({ statePath: path.join(ctx.runDir, 'state.json'), workflowPath: path.join(podA, 'workflows', 'wf-a.yaml'), podRootOverride: podA });
|
|
248
|
+
ok(ctx2.memoryPodDir === podA, 'retrocompat: openRun de run sem memory_pod_dir resolve memoryPodDir = podRoot (comportamento atual intacto)');
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (failures.length > 0) {
|
|
252
|
+
console.error(`\nSuíte pc-run-pipeline FALHOU: ${failures.length} de ${passed + failures.length}.`);
|
|
253
|
+
process.exit(1);
|
|
254
|
+
}
|
|
255
|
+
console.log(`\n${passed} asserções verdes. Maestro cross-pod pc-run-pipeline (SF9.1) provado.`);
|
|
256
|
+
process.exit(0);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/**
|
|
4
|
+
* pc-run-pod-countgte.test.cjs — suíte DEDICADA do FIX do bypass `count_gte`
|
|
5
|
+
* (Story SF3.1, M-r2-5 / DoD 4). Arquivo separado do counter/runner de propósito
|
|
6
|
+
* (isola o território SF3.1 sobre evalVeto, evita colisão de merge com a suíte SF2.3).
|
|
7
|
+
*
|
|
8
|
+
* O furo (verificado no código antes do fix): `evalVeto` tentava `extractField`
|
|
9
|
+
* PRIMEIRO — um artefato com a linha `Value Stack: 99` passava o veto SEM nenhum
|
|
10
|
+
* item de lista (número auto-declarado vencia a contagem real). Prova de bloqueio
|
|
11
|
+
* "integral" era formalmente falsa. Fix: campo auto-declarado NUNCA satisfaz
|
|
12
|
+
* count_gte; a contagem real de itens de lista é a ÚNICA fonte (heading presente OU
|
|
13
|
+
* ausente ⇒ contagem 0 ⇒ bloqueia).
|
|
14
|
+
*
|
|
15
|
+
* Node >= 18. Exit 0/1.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const path = require('node:path');
|
|
19
|
+
const { evalVeto } = require('./pc-run-pod.cjs');
|
|
20
|
+
|
|
21
|
+
let passed = 0;
|
|
22
|
+
const failures = [];
|
|
23
|
+
function ok(cond, label) {
|
|
24
|
+
if (cond) { passed++; console.log(`[OK ] ${label}`); }
|
|
25
|
+
else { failures.push(label); console.log(`[FALHA] ${label}`); }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const roots = { podRoot: __dirname, runDir: __dirname };
|
|
29
|
+
const A = (text) => evalVeto({ type: 'count_gte', field: 'Value Stack', n: 5 }, text, path.join(__dirname, 'a.md'), roots);
|
|
30
|
+
|
|
31
|
+
// --- FIXTURE LITERAL do design (linha 135/226): `Value Stack: 99` + ZERO itens → BLOQUEIA ---
|
|
32
|
+
ok(A('## Value Stack\nValue Stack: 99\n').ok === false,
|
|
33
|
+
'DoD4 `Value Stack: 99` declarado + ZERO itens de lista → veto BLOQUEIA (declaração não compra prova)');
|
|
34
|
+
|
|
35
|
+
// Campo declarado mesmo ACIMA do limite, sem itens → BLOQUEIA (não há bypass declarativo).
|
|
36
|
+
ok(A('## Value Stack\nValue Stack: 999\ntexto em prosa, nada de itens\n').ok === false,
|
|
37
|
+
'M-r2-5 `Value Stack: 999` sem itens de lista → BLOQUEIA (contagem real 0 vence o número declarado)');
|
|
38
|
+
|
|
39
|
+
// Heading AUSENTE ⇒ contagem 0 ⇒ BLOQUEIA.
|
|
40
|
+
ok(A('Nenhum heading aqui, só prosa.\n').ok === false,
|
|
41
|
+
'DoD4 heading ausente ⇒ contagem 0 ⇒ BLOQUEIA');
|
|
42
|
+
|
|
43
|
+
// Campo declarado presente MAS itens reais insuficientes (3 < 5) → BLOQUEIA (conta os reais).
|
|
44
|
+
ok(A('## Value Stack\nValue Stack: 99\n- a\n- b\n- c\n').ok === false,
|
|
45
|
+
'M-r2-5 `Value Stack: 99` + 3 itens reais (< 5) → BLOQUEIA (conta os 3 reais, ignora o 99)');
|
|
46
|
+
|
|
47
|
+
// 5 itens REAIS de lista → PASSA (a contagem real é a fonte legítima).
|
|
48
|
+
ok(A('## Value Stack\n- a\n- b\n- c\n- d\n- e\n').ok === true,
|
|
49
|
+
'contagem real de 5 itens de lista → PASSA (fonte legítima, não afrouxada)');
|
|
50
|
+
|
|
51
|
+
// 5 itens reais MESMO com um número declarado baixo → PASSA (a contagem real vence).
|
|
52
|
+
ok(A('## Value Stack\nValue Stack: 1\n- a\n- b\n- c\n- d\n- e\n').ok === true,
|
|
53
|
+
'contagem real de 5 vence o `Value Stack: 1` declarado → PASSA');
|
|
54
|
+
|
|
55
|
+
// Tabela conta como itens reais (semântica SF2.3 preservada) → 5 linhas de dados → PASSA.
|
|
56
|
+
ok(A('## Value Stack\n| Item | Preço |\n|---|---|\n| a | 1 |\n| b | 2 |\n| c | 3 |\n| d | 4 |\n').ok === true,
|
|
57
|
+
'itens reais em TABELA (cabeçalho + 4 dados = 5) → PASSA (semântica do contador intacta)');
|
|
58
|
+
|
|
59
|
+
console.log(`\n${passed}/${passed + failures.length} asserções do fix count_gte passaram.`);
|
|
60
|
+
if (failures.length) {
|
|
61
|
+
console.error('\nSUÍTE count_gte (SF3.1) FALHOU:');
|
|
62
|
+
for (const f of failures) console.error(` - ${f}`);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
console.log('Suíte count_gte verde (M-r2-5 fechado — bypass declarativo eliminado, contagem real é a única fonte).');
|
|
66
|
+
process.exit(0);
|