wtf-p 0.8.4 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -27
- package/bin/commands/install-logic.js +5 -5
- package/bin/install.js +11 -11
- package/bin/lib/adapter-compiler.js +275 -225
- package/bin/lib/manifest.js +21 -21
- package/bin/lib/native-registration.js +25 -10
- package/bin/lib/{clio-registration.js → pancode-registration.js} +62 -63
- package/bin/lib/utils.js +3 -3
- package/bin/uninstall.js +8 -8
- package/package.json +5 -4
- package/{vendors/clio-extension → pancode/extension}/.wtfp-generated.json +15 -11
- package/{vendors/clio-extension → pancode/extension}/compatibility/action-availability.json +14 -14
- package/{vendors/clio-extension/clio-coder-extension.yaml → pancode/extension/pancode-extension.yaml} +6 -5
- package/{vendors/clio-extension → pancode/extension}/runtime/claim-coverage.cjs +1 -1
- package/{vendors/clio-extension → pancode/extension}/runtime/desk-trust.cjs +1 -1
- package/{vendors/clio-extension → pancode/extension}/runtime/extension.test.ts +184 -97
- package/{vendors/clio-extension → pancode/extension}/runtime/extension.ts +169 -83
- package/pancode/extension/runtime/help.json +82 -0
- package/{vendors/clio-extension → pancode/extension}/runtime/write-guard.json +1 -1
- package/{vendors → pancode}/plugin/.wtfp-generated.json +114 -114
- package/{vendors → pancode}/plugin/compatibility/action-availability.json +16 -16
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-argument-verifier.md +7 -3
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-citation-expert.md +6 -2
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-citation-formatter.md +6 -2
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-coherence-checker.md +7 -3
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-outliner.md +6 -2
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-plan-checker.md +7 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-prose-polisher.md +6 -2
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-research-synthesizer.md +6 -2
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-section-planner.md +6 -2
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-section-reviewer.md +7 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-section-writer.md +7 -3
- package/{vendors/claude/ai.iowarp.clio/fleets → pancode/plugin/dev.pancode/playbooks}/wtfp-draft-review.md +1 -1
- package/{vendors/claude/ai.iowarp.clio/fleets → pancode/plugin/dev.pancode/playbooks}/wtfp-plan-section.md +2 -0
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/add-todo.md +1 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/advance.md +8 -8
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/analyze-bib.md +5 -5
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/audit-milestone.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/check-refs.md +5 -5
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/check-todos.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/checkpoint.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/contribute.md +4 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/create-outline.md +6 -6
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/create-poster.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/create-slides.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/discuss-section.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/execute-outline.md +6 -6
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/export-latex.md +3 -3
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/help.md +7 -7
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/insert-section.md +4 -4
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/list-assumptions.md +1 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/map-project.md +1 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/new-paper.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/pause-writing.md +2 -2
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/plan-milestone-gaps.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/plan-revision.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/plan-section.md +6 -6
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/polish-prose.md +5 -5
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/progress.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/quick.md +5 -5
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/remove-section.md +4 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/report-bug.md +4 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/request-feature.md +4 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/research-gap.md +6 -6
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/resume-writing.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/review-section.md +6 -6
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/settings.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/submit-milestone.md +3 -3
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/update.md +4 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/verify-work.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/write-section.md +6 -6
- package/{vendors → pancode}/plugin/plugin.json +56 -56
- package/{vendors → pancode}/plugin/repository/CONTRIBUTING.md +5 -2
- package/{vendors → pancode}/plugin/skills/wtfp-plan-section/references/actions.md +2 -2
- package/{vendors → pancode}/plugin/workflows/create-outline.md +1 -1
- package/{vendors → pancode}/plugin/workflows/insert-section.md +1 -1
- package/{vendors → pancode}/plugin/workflows/pause-writing.md +1 -1
- package/protocol/workflows/create-outline.md +1 -1
- package/protocol/workflows/insert-section.md +1 -1
- package/protocol/workflows/pause-writing.md +1 -1
- package/vendors/antigravity/.wtfp-generated.json +9 -9
- package/vendors/antigravity/plugin.json +2 -2
- package/vendors/antigravity/repository/CONTRIBUTING.md +5 -2
- package/vendors/antigravity/skills/wtfp-create-outline/SKILL.md +1 -1
- package/vendors/antigravity/skills/wtfp-insert-section/SKILL.md +1 -1
- package/vendors/antigravity/skills/wtfp-pause-writing/SKILL.md +1 -1
- package/vendors/antigravity/workflows/create-outline.md +1 -1
- package/vendors/antigravity/workflows/insert-section.md +1 -1
- package/vendors/antigravity/workflows/pause-writing.md +1 -1
- package/vendors/claude/.claude-plugin/marketplace.json +2 -2
- package/vendors/claude/.claude-plugin/plugin.json +1 -1
- package/vendors/claude/.wtfp-generated.json +188 -188
- package/vendors/claude/commands/create-outline.md +1 -1
- package/vendors/claude/commands/insert-section.md +1 -1
- package/vendors/claude/commands/pause-writing.md +1 -1
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-argument-verifier.md +7 -3
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-citation-expert.md +6 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/agents/wtfp-citation-formatter.md +6 -2
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-coherence-checker.md +7 -3
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-outliner.md +6 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/agents/wtfp-plan-checker.md +7 -3
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/agents/wtfp-prose-polisher.md +6 -2
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-research-synthesizer.md +6 -2
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-section-planner.md +6 -2
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-section-reviewer.md +7 -3
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/agents/wtfp-section-writer.md +7 -3
- package/vendors/{plugin/ai.iowarp.clio/playbooks → claude/dev.pancode/fleets}/wtfp-draft-review.md +1 -1
- package/vendors/{plugin/ai.iowarp.clio/playbooks → claude/dev.pancode/fleets}/wtfp-plan-section.md +2 -0
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/advance.md +4 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/analyze-bib.md +4 -4
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/audit-milestone.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/check-refs.md +4 -4
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/check-todos.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/checkpoint.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/contribute.md +4 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/create-outline.md +5 -5
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/create-poster.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/create-slides.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/discuss-section.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/execute-outline.md +5 -5
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/export-latex.md +2 -2
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/prompts/wtfp/help.md +7 -7
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/insert-section.md +3 -3
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/new-paper.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/pause-writing.md +1 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/plan-milestone-gaps.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/plan-revision.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/plan-section.md +5 -5
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/polish-prose.md +4 -4
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/progress.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/quick.md +4 -4
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/prompts/wtfp/remove-section.md +4 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/report-bug.md +4 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/request-feature.md +4 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/research-gap.md +5 -5
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/resume-writing.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/review-section.md +5 -5
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/settings.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/submit-milestone.md +2 -2
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/prompts/wtfp/update.md +4 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/verify-work.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/write-section.md +5 -5
- package/vendors/claude/plugin.json +56 -56
- package/vendors/claude/repository/CONTRIBUTING.md +5 -2
- package/vendors/claude/workflows/create-outline.md +1 -1
- package/vendors/claude/workflows/insert-section.md +1 -1
- package/vendors/claude/workflows/pause-writing.md +1 -1
- package/vendors/codex/plugins/wtfp/.codex-plugin/plugin.json +1 -1
- package/vendors/codex/plugins/wtfp/.wtfp-generated.json +7 -7
- package/vendors/codex/plugins/wtfp/plugin.json +1 -1
- package/vendors/codex/plugins/wtfp/repository/CONTRIBUTING.md +5 -2
- package/vendors/codex/plugins/wtfp/workflows/create-outline.md +1 -1
- package/vendors/codex/plugins/wtfp/workflows/insert-section.md +1 -1
- package/vendors/codex/plugins/wtfp/workflows/pause-writing.md +1 -1
- package/vendors/copilot/.wtfp-generated.json +6 -6
- package/vendors/copilot/marketplace.json +2 -2
- package/vendors/copilot/plugins/wtfp/.claude-plugin/plugin.json +1 -1
- package/vendors/copilot/plugins/wtfp/.wtfp-generated.json +9 -9
- package/vendors/copilot/plugins/wtfp/commands/wtfp-create-outline.md +1 -1
- package/vendors/copilot/plugins/wtfp/commands/wtfp-insert-section.md +1 -1
- package/vendors/copilot/plugins/wtfp/commands/wtfp-pause-writing.md +1 -1
- package/vendors/copilot/plugins/wtfp/repository/CONTRIBUTING.md +5 -2
- package/vendors/copilot/plugins/wtfp/workflows/create-outline.md +1 -1
- package/vendors/copilot/plugins/wtfp/workflows/insert-section.md +1 -1
- package/vendors/copilot/plugins/wtfp/workflows/pause-writing.md +1 -1
- package/vendors/copilot/project/.github/prompts/wtfp-pause-writing.prompt.md +1 -1
- package/vendors/copilot/project/.github/wtfp/workflows/create-outline.md +1 -1
- package/vendors/copilot/project/.github/wtfp/workflows/insert-section.md +1 -1
- package/vendors/copilot/project/.github/wtfp/workflows/pause-writing.md +1 -1
- package/vendors/gemini/.wtfp-generated.json +9 -9
- package/vendors/gemini/commands/wtfp/create-outline.toml +1 -1
- package/vendors/gemini/commands/wtfp/insert-section.toml +1 -1
- package/vendors/gemini/commands/wtfp/pause-writing.toml +1 -1
- package/vendors/gemini/gemini-extension.json +1 -1
- package/vendors/gemini/repository/CONTRIBUTING.md +5 -2
- package/vendors/gemini/workflows/create-outline.md +1 -1
- package/vendors/gemini/workflows/insert-section.md +1 -1
- package/vendors/gemini/workflows/pause-writing.md +1 -1
- package/vendors/opencode/.wtfp-generated.json +8 -8
- package/vendors/opencode/commands/wtfp/create-outline.md +1 -1
- package/vendors/opencode/commands/wtfp/insert-section.md +1 -1
- package/vendors/opencode/commands/wtfp/pause-writing.md +1 -1
- package/vendors/opencode/repository/CONTRIBUTING.md +5 -2
- package/vendors/opencode/workflows/create-outline.md +1 -1
- package/vendors/opencode/workflows/insert-section.md +1 -1
- package/vendors/opencode/workflows/pause-writing.md +1 -1
- /package/{vendors/clio-extension → pancode/extension}/actions/add-todo.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/advance.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/analyze-bib.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/audit-milestone.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/check-refs.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/check-todos.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/checkpoint.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/contribute.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/create-outline.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/create-poster.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/create-slides.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/discuss-section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/execute-outline.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/export-latex.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/help.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/insert-section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/list-assumptions.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/map-project.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/new-paper.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/pause-writing.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/plan-milestone-gaps.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/plan-revision.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/plan-section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/polish-prose.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/progress.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/quick.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/remove-section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/report-bug.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/request-feature.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/research-gap.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/resume-writing.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/review-section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/settings.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/submit-milestone.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/update.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/verify-work.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/write-section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/checkpoint.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/common.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/config.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/decisions.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/evidence.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/interaction.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/manifest.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/outline.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/section.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/source.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/state.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/validation.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/checkpoint.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/config.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/decisions.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/evidence.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/interaction.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/manifest.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/outline.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/source.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/state.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/validation.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/runtime/json-schema.cjs +0 -0
- /package/{vendors/clio-extension → pancode/extension}/runtime/package.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/skins/wtfp.json +0 -0
- /package/{vendors → pancode}/plugin/actions/add-todo.json +0 -0
- /package/{vendors → pancode}/plugin/actions/advance.json +0 -0
- /package/{vendors → pancode}/plugin/actions/analyze-bib.json +0 -0
- /package/{vendors → pancode}/plugin/actions/audit-milestone.json +0 -0
- /package/{vendors → pancode}/plugin/actions/check-refs.json +0 -0
- /package/{vendors → pancode}/plugin/actions/check-todos.json +0 -0
- /package/{vendors → pancode}/plugin/actions/checkpoint.json +0 -0
- /package/{vendors → pancode}/plugin/actions/contribute.json +0 -0
- /package/{vendors → pancode}/plugin/actions/create-outline.json +0 -0
- /package/{vendors → pancode}/plugin/actions/create-poster.json +0 -0
- /package/{vendors → pancode}/plugin/actions/create-slides.json +0 -0
- /package/{vendors → pancode}/plugin/actions/discuss-section.json +0 -0
- /package/{vendors → pancode}/plugin/actions/execute-outline.json +0 -0
- /package/{vendors → pancode}/plugin/actions/export-latex.json +0 -0
- /package/{vendors → pancode}/plugin/actions/help.json +0 -0
- /package/{vendors → pancode}/plugin/actions/insert-section.json +0 -0
- /package/{vendors → pancode}/plugin/actions/list-assumptions.json +0 -0
- /package/{vendors → pancode}/plugin/actions/map-project.json +0 -0
- /package/{vendors → pancode}/plugin/actions/new-paper.json +0 -0
- /package/{vendors → pancode}/plugin/actions/pause-writing.json +0 -0
- /package/{vendors → pancode}/plugin/actions/plan-milestone-gaps.json +0 -0
- /package/{vendors → pancode}/plugin/actions/plan-revision.json +0 -0
- /package/{vendors → pancode}/plugin/actions/plan-section.json +0 -0
- /package/{vendors → pancode}/plugin/actions/polish-prose.json +0 -0
- /package/{vendors → pancode}/plugin/actions/progress.json +0 -0
- /package/{vendors → pancode}/plugin/actions/quick.json +0 -0
- /package/{vendors → pancode}/plugin/actions/remove-section.json +0 -0
- /package/{vendors → pancode}/plugin/actions/report-bug.json +0 -0
- /package/{vendors → pancode}/plugin/actions/request-feature.json +0 -0
- /package/{vendors → pancode}/plugin/actions/research-gap.json +0 -0
- /package/{vendors → pancode}/plugin/actions/resume-writing.json +0 -0
- /package/{vendors → pancode}/plugin/actions/review-section.json +0 -0
- /package/{vendors → pancode}/plugin/actions/settings.json +0 -0
- /package/{vendors → pancode}/plugin/actions/submit-milestone.json +0 -0
- /package/{vendors → pancode}/plugin/actions/update.json +0 -0
- /package/{vendors → pancode}/plugin/actions/verify-work.json +0 -0
- /package/{vendors → pancode}/plugin/actions/write-section.json +0 -0
- /package/{vendors → pancode}/plugin/aliases.lock.json +0 -0
- /package/{vendors → pancode}/plugin/catalog.json +0 -0
- /package/{vendors → pancode}/plugin/effects.json +0 -0
- /package/{vendors → pancode}/plugin/project/README.md +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/checkpoint.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/common.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/config.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/decisions.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/evidence.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/interaction.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/manifest.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/outline.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/section.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/source.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/state.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/validation.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/checkpoint.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/config.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/decisions.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/evidence.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/interaction.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/manifest.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/outline.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/section.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/source.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/state.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/validation.json +0 -0
- /package/{vendors → pancode}/plugin/roles/argument-verifier.md +0 -0
- /package/{vendors → pancode}/plugin/roles/citation-expert.md +0 -0
- /package/{vendors → pancode}/plugin/roles/citation-formatter.md +0 -0
- /package/{vendors → pancode}/plugin/roles/coherence-checker.md +0 -0
- /package/{vendors → pancode}/plugin/roles/outliner.md +0 -0
- /package/{vendors → pancode}/plugin/roles/plan-checker.md +0 -0
- /package/{vendors → pancode}/plugin/roles/prose-polisher.md +0 -0
- /package/{vendors → pancode}/plugin/roles/research-synthesizer.md +0 -0
- /package/{vendors → pancode}/plugin/roles/section-planner.md +0 -0
- /package/{vendors → pancode}/plugin/roles/section-reviewer.md +0 -0
- /package/{vendors → pancode}/plugin/roles/section-writer.md +0 -0
- /package/{vendors → pancode}/plugin/schemas/action.schema.json +0 -0
- /package/{vendors → pancode}/plugin/schemas/aliases.schema.json +0 -0
- /package/{vendors → pancode}/plugin/schemas/catalog.schema.json +0 -0
- /package/{vendors → pancode}/plugin/schemas/effects.schema.json +0 -0
- /package/{vendors → pancode}/plugin/schemas/role-result.schema.json +0 -0
- /package/{vendors → pancode}/plugin/schemas/tools.schema.json +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-deliver-research/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-deliver-research/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-deliver-research/references/actions.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-manage-project/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-manage-project/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-manage-project/references/actions.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-plan-section/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-plan-section/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-research-literature/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-research-literature/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-research-literature/references/actions.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-review-manuscript/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-review-manuscript/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-review-manuscript/references/actions.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-start-project/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-start-project/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-start-project/references/actions.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-write-section/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-write-section/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-write-section/references/actions.md +0 -0
- /package/{vendors → pancode}/plugin/templates/README.md +0 -0
- /package/{vendors → pancode}/plugin/templates/grant-proposal-outline.md +0 -0
- /package/{vendors → pancode}/plugin/templates/paper-outline.md +0 -0
- /package/{vendors → pancode}/plugin/templates/poster.md +0 -0
- /package/{vendors → pancode}/plugin/templates/slides.md +0 -0
- /package/{vendors → pancode}/plugin/tools/README.md +0 -0
- /package/{vendors → pancode}/plugin/tools/bibliography/analyze-impact.js +0 -0
- /package/{vendors → pancode}/plugin/tools/bibliography/format.js +0 -0
- /package/{vendors → pancode}/plugin/tools/bibliography/index.js +0 -0
- /package/{vendors → pancode}/plugin/tools/citation/fetch.js +0 -0
- /package/{vendors → pancode}/plugin/tools/citation/rank.js +0 -0
- /package/{vendors → pancode}/plugin/tools/citation/scholar-lookup.js +0 -0
- /package/{vendors → pancode}/plugin/tools/citation/semantic-scholar.js +0 -0
- /package/{vendors → pancode}/plugin/tools/package.json +0 -0
- /package/{vendors → pancode}/plugin/tools/support/cite-nexus-client.js +0 -0
- /package/{vendors → pancode}/plugin/tools/wtfp-tool.js +0 -0
- /package/{vendors → pancode}/plugin/tools.json +0 -0
- /package/{vendors → pancode}/plugin/workflows/add-todo.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/advance.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/analyze-bib.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/audit-milestone.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/check-refs.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/check-todos.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/checkpoint.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/contribute.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/create-poster.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/create-slides.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/discuss-section.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/execute-outline.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/export-latex.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/help.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/list-assumptions.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/map-project.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/new-paper.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/plan-milestone-gaps.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/plan-revision.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/plan-section.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/polish-prose.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/progress.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/quick.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/remove-section.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/report-bug.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/request-feature.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/research-gap.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/resume-writing.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/review-section.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/settings.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/submit-milestone.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/update.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/verify-work.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/write-section.md +0 -0
- /package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/add-todo.md +0 -0
- /package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/list-assumptions.md +0 -0
- /package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/map-project.md +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
// Generated by WTF-P adapter compiler v5 from
|
|
1
|
+
// Generated by WTF-P adapter compiler v5 from hosts/pancode/runtime/extension.test.ts; do not edit.
|
|
2
2
|
/**
|
|
3
|
-
* Package tests for the WTF-P desk, run by `
|
|
4
|
-
*
|
|
5
|
-
* task-owned TMPDIR and drives the desk the way
|
|
3
|
+
* Package tests for the WTF-P desk, run by `pancode extensions test
|
|
4
|
+
* pancode/extension`. Each case builds a small valid project in a
|
|
5
|
+
* task-owned TMPDIR and drives the desk the way PanCode does: tool calls,
|
|
6
6
|
* interviews, hooks and observations. The kit serves no plugin unless a case
|
|
7
7
|
* passes one. Answers here are simulated interview events, not a human's:
|
|
8
8
|
* they test the desk's bookkeeping, never an author's judgment.
|
|
@@ -15,7 +15,7 @@ import os, { homedir } from "node:os";
|
|
|
15
15
|
import path from "node:path";
|
|
16
16
|
import { test } from "node:test";
|
|
17
17
|
import { fileURLToPath } from "node:url";
|
|
18
|
-
import { createExtensionTestHost } from "
|
|
18
|
+
import { createExtensionTestHost } from "pancode/sdk/testing";
|
|
19
19
|
|
|
20
20
|
const ROOT = fileURLToPath(new URL("../", import.meta.url));
|
|
21
21
|
const PROJECT = "desk-test";
|
|
@@ -201,7 +201,7 @@ const SERVED = { id: "wtfp", prompts: ["wtfp:check-todos", "wtfp:plan-section",
|
|
|
201
201
|
|
|
202
202
|
async function withDesk(run: (host: Host, workspace: string) => Promise<void>, plugin: typeof SERVED | null = null): Promise<void> {
|
|
203
203
|
const workspace = project();
|
|
204
|
-
const host =
|
|
204
|
+
const host = withPanCodeFacts(await createExtensionTestHost(ROOT, { workspace, plugin }), workspace);
|
|
205
205
|
try {
|
|
206
206
|
await run(host, workspace);
|
|
207
207
|
} finally {
|
|
@@ -233,12 +233,12 @@ const rewriteOf = (result: { effects?: Array<{ kind: string }> }): Json | null =
|
|
|
233
233
|
(result.effects?.find((effect) => effect.kind === "rewrite_tool_input") as { args?: Json } | undefined)?.args ?? null;
|
|
234
234
|
|
|
235
235
|
// --- the host's facts ------------------------------------------------------------
|
|
236
|
-
//
|
|
236
|
+
// PanCode sends a before_tool hook where a path-taking tool lands and, for
|
|
237
237
|
// dispatch, the plan admission parsed, and judges a rewritten call again. The
|
|
238
|
-
// desk judges only those, so the test host models them as
|
|
238
|
+
// desk judges only those, so the test host models them as PanCode resolves them,
|
|
239
239
|
// with the test process's own access.
|
|
240
240
|
|
|
241
|
-
/** The WTF-P recipes
|
|
241
|
+
/** The WTF-P recipes PanCode runs read-only: the reviewers, whose recipes are PanCode's read-only class. */
|
|
242
242
|
const READ_ONLY_RECIPES = new Set(["wtfp-argument-verifier", "wtfp-coherence-checker", "wtfp-plan-checker", "wtfp-section-reviewer"]);
|
|
243
243
|
|
|
244
244
|
/** A path with its existing part resolved through links; the rest is kept as named. */
|
|
@@ -253,13 +253,13 @@ function physical(file: string): string {
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
/**
|
|
256
|
-
* Where a write through `joined` lands, as
|
|
256
|
+
* Where a write through `joined` lands, as PanCode's canonicalizeRawPath walks it
|
|
257
257
|
* (src/core/path-canonical.ts): a link at any component, dangling or not, is
|
|
258
258
|
* read and the walk goes on from its target, a `..` after a link steps up from
|
|
259
259
|
* the link's target, and a missing component ends the walk. Null for a loop,
|
|
260
260
|
* more than 40 links, or a component that cannot be inspected.
|
|
261
261
|
*/
|
|
262
|
-
function
|
|
262
|
+
function pancodeWalk(joined: string): string | null {
|
|
263
263
|
const { root } = path.parse(joined);
|
|
264
264
|
const parts = joined.slice(root.length).split(path.sep).filter((part) => part !== "" && part !== ".");
|
|
265
265
|
const up = parts.indexOf("..");
|
|
@@ -312,15 +312,15 @@ function clioWalk(joined: string): string | null {
|
|
|
312
312
|
return current;
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
-
/** Where
|
|
316
|
-
function
|
|
315
|
+
/** Where PanCode lands a tool's path: `@` dropped, Unicode spaces plain, `~` expanded, then PanCode's physical walk from the workspace it runs in. */
|
|
316
|
+
function pancodeTarget(raw: string, workspace: string): Json {
|
|
317
317
|
let spelled = (raw.startsWith("@") ? raw.slice(1) : raw).replace(/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/gu, " ");
|
|
318
318
|
if (spelled === "~") spelled = homedir();
|
|
319
319
|
else if (spelled.startsWith("~/")) spelled = homedir() + spelled.slice(1);
|
|
320
320
|
const real = realpathSync(workspace);
|
|
321
|
-
//
|
|
321
|
+
// PanCode runs in the workspace, so its own /proc/self/cwd is the workspace.
|
|
322
322
|
if (spelled === "/proc/self/cwd" || spelled.startsWith("/proc/self/cwd/")) spelled = real + spelled.slice("/proc/self/cwd".length);
|
|
323
|
-
const landed =
|
|
323
|
+
const landed = pancodeWalk(path.isAbsolute(spelled) ? spelled : `${real}${path.sep}${spelled}`);
|
|
324
324
|
const at = landed ?? (path.isAbsolute(spelled) ? spelled : `${real}${path.sep}${spelled}`);
|
|
325
325
|
const relative = path.relative(real, at);
|
|
326
326
|
const inside = landed !== null && relative !== ".." && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative);
|
|
@@ -328,19 +328,19 @@ function clioTarget(raw: string, workspace: string): Json {
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
/**
|
|
331
|
-
* A dispatch call as
|
|
331
|
+
* A dispatch call as PanCode's admission hands it to hooks (src/tools/dispatch-arguments.ts
|
|
332
332
|
* prepareDispatchArguments, src/tools/dispatch-admission.ts): `tasks` an array, a
|
|
333
|
-
* lone `task` moved into it, and either
|
|
334
|
-
* reason preparation failed.
|
|
333
|
+
* lone `task` moved into it, and either PanCode's private resolved plan or the
|
|
334
|
+
* reason preparation failed. PanCode refuses a `./` root and parallel writers
|
|
335
335
|
* without roots before any hook; these tests send no other failing shape.
|
|
336
336
|
*/
|
|
337
|
-
function
|
|
337
|
+
function pancodePrepare(args: Json): Json {
|
|
338
338
|
const next: Json = { ...args };
|
|
339
339
|
if (typeof next.tasks === "string" && /^\s*[[{]/u.test(next.tasks)) {
|
|
340
340
|
try {
|
|
341
341
|
next.tasks = JSON.parse(next.tasks) as unknown;
|
|
342
342
|
} catch {
|
|
343
|
-
//
|
|
343
|
+
// PanCode leaves the string and reports the shape itself.
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
if (next.tasks !== undefined && !Array.isArray(next.tasks)) next.tasks = [next.tasks];
|
|
@@ -358,7 +358,7 @@ function clioPrepare(args: Json): Json {
|
|
|
358
358
|
: writers.length > 1 && declared.some((roots, index) => !READ_ONLY_RECIPES.has(agentOf(items[index] as Json, args)) && roots.filter((root) => !/^\.\/?$/u.test(root.trim())).length === 0)
|
|
359
359
|
? "parallel writers need disjoint intent.write_roots"
|
|
360
360
|
: null;
|
|
361
|
-
return failure === null ? { ...next,
|
|
361
|
+
return failure === null ? { ...next, __pancode_resolved_dispatch_plan: { resolvedBy: "pancode" } } : { ...next, __pancode_dispatch_plan_preparation_error: failure };
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
function agentOf(item: Json, args: Json): string {
|
|
@@ -366,8 +366,8 @@ function agentOf(item: Json, args: Json): string {
|
|
|
366
366
|
return named.trim() || "coder";
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
/** The plan
|
|
370
|
-
function
|
|
369
|
+
/** The plan PanCode's admission reports for prepared arguments: write roots trimmed, without `.`, deduplicated and sorted, with their physical boundaries. */
|
|
370
|
+
function pancodePlan(prepared: Json, workspace: string): Json {
|
|
371
371
|
const real = realpathSync(workspace);
|
|
372
372
|
if (prepared.list === true) return { kind: "list" };
|
|
373
373
|
if (prepared.apply_winner !== undefined) return { kind: "apply-winner", branch: String((prepared.apply_winner as Json).branch ?? ""), cwd: real };
|
|
@@ -380,7 +380,7 @@ function clioPlan(prepared: Json, workspace: string): Json {
|
|
|
380
380
|
const spelledCwd = typeof item.cwd === "string" ? item.cwd : typeof prepared.cwd === "string" ? prepared.cwd : ".";
|
|
381
381
|
const cwd = physical(path.resolve(real, spelledCwd.trim() || "."));
|
|
382
382
|
const agent = agentOf(item, prepared);
|
|
383
|
-
//
|
|
383
|
+
// PanCode runs a read-only recipe's worker read-only, with no write roots (src/tools/dispatch.ts writerLanding).
|
|
384
384
|
const readOnly = READ_ONLY_RECIPES.has(agent);
|
|
385
385
|
const roots = readOnly ? [] : [...new Set((((item.intent as Json | undefined)?.write_roots ?? shared ?? []) as string[]).map((root) => root.trim()).filter((root) => !/^\.\/?$/u.test(root)))].sort();
|
|
386
386
|
return { role: "task", agent, cwd, writeRoots: roots, writeBoundaries: roots.map((root) => physical(path.resolve(cwd, root))), worktree: item.worktree === true, readOnly };
|
|
@@ -388,30 +388,30 @@ function clioPlan(prepared: Json, workspace: string): Json {
|
|
|
388
388
|
};
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
-
/** A before_tool event as
|
|
391
|
+
/** A before_tool event as PanCode sends it, unless the test sent its own facts. */
|
|
392
392
|
function withFacts(event: Json, workspace: string): Json {
|
|
393
|
-
//
|
|
393
|
+
// PanCode sends the same landing at after_tool as at before_tool.
|
|
394
394
|
if ((event.point !== "before_tool" && event.point !== "after_tool") || "target" in event || "dispatch" in event) return event;
|
|
395
395
|
const args = (event.args ?? {}) as Json;
|
|
396
396
|
if (event.tool === "dispatch") {
|
|
397
|
-
const prepared =
|
|
398
|
-
return typeof prepared.
|
|
397
|
+
const prepared = pancodePrepare(args);
|
|
398
|
+
return typeof prepared.__pancode_dispatch_plan_preparation_error === "string" ? { ...event, args: prepared } : { ...event, args: prepared, dispatch: pancodePlan(prepared, workspace) };
|
|
399
399
|
}
|
|
400
400
|
const raw = args.path ?? args.file_path ?? args.filePath;
|
|
401
401
|
if (["write", "edit", "artifact"].includes(event.tool as string) && typeof raw === "string" && raw.trim().length > 0)
|
|
402
|
-
return { ...event, target:
|
|
402
|
+
return { ...event, target: pancodeTarget(event.tool === "artifact" ? raw.trim() : raw, workspace) };
|
|
403
403
|
return event;
|
|
404
404
|
}
|
|
405
405
|
|
|
406
406
|
/**
|
|
407
|
-
* The test host as
|
|
408
|
-
*
|
|
407
|
+
* The test host as PanCode runs the desk: each before_tool event carries
|
|
408
|
+
* PanCode's facts; a dispatch PanCode could not prepare is refused by PanCode with its
|
|
409
409
|
* own reason when no hook refused it first; and a call the desk rewrites is
|
|
410
410
|
* admitted afresh, so a plan-scale one, which needs the operator's approval,
|
|
411
411
|
* is refused, and any other is judged again with the plan of what it starts.
|
|
412
|
-
* An event marked `bare` reaches the desk as
|
|
412
|
+
* An event marked `bare` reaches the desk as a host that sends no facts sends it.
|
|
413
413
|
*/
|
|
414
|
-
function
|
|
414
|
+
function withPanCodeFacts(host: Host, workspace: string): Host {
|
|
415
415
|
const hook = host.hook.bind(host);
|
|
416
416
|
const refuse = (reason: string) => ({ effects: [{ kind: "block_tool", reason }] });
|
|
417
417
|
const judged = async (event: Json, options?: Json) => {
|
|
@@ -422,8 +422,8 @@ function withClioFacts(host: Host, workspace: string): Host {
|
|
|
422
422
|
const sent = withFacts(event, workspace);
|
|
423
423
|
const first = await hook(sent as never, options as never);
|
|
424
424
|
if (event.point !== "before_tool" || event.tool !== "dispatch" || "dispatch" in event) return first;
|
|
425
|
-
const failure = (sent.args as Json).
|
|
426
|
-
if (typeof failure === "string") return blocked(first) === null ? refuse(`
|
|
425
|
+
const failure = (sent.args as Json).__pancode_dispatch_plan_preparation_error;
|
|
426
|
+
if (typeof failure === "string") return blocked(first) === null ? refuse(`PanCode: ${failure}`) : first;
|
|
427
427
|
const rewritten = rewriteOf(first);
|
|
428
428
|
if (rewritten === null || blocked(first) !== null) return first;
|
|
429
429
|
if ((((sent.dispatch as Json).tasks as unknown[]) ?? []).length > 1) return refuse("extension wtfp rewrote dispatch input into a call that would need operator approval");
|
|
@@ -468,6 +468,41 @@ test("record writes at the revision or digest the caller read and refuses stale,
|
|
|
468
468
|
assert.match(gone.text, /holds wtfp.project.source\/v1|no longer exists/);
|
|
469
469
|
}));
|
|
470
470
|
|
|
471
|
+
test("a section write may not add a link to a missing artifact or a claim id another claim holds", () =>
|
|
472
|
+
withDesk(async (host, workspace) => {
|
|
473
|
+
const sectionFile = ".planning/sections/introduction/section.json";
|
|
474
|
+
const section = read(workspace, sectionFile);
|
|
475
|
+
const artifacts = section.artifacts as Json;
|
|
476
|
+
const dangling = await host.tool("record", {
|
|
477
|
+
uri: "project://sections/introduction",
|
|
478
|
+
record: { ...section, artifacts: { ...artifacts, context: "project://sections/introduction/context" } },
|
|
479
|
+
expect_sha256: sha(workspace, sectionFile),
|
|
480
|
+
});
|
|
481
|
+
assert.match(dangling.text, /links project:\/\/sections\/introduction\/context, which has no file yet\. Write the artifact first/);
|
|
482
|
+
assert.deepEqual(read(workspace, sectionFile).artifacts, artifacts);
|
|
483
|
+
put(workspace, ".planning/sections/introduction/context.md", "# Context\n");
|
|
484
|
+
const linked = await host.tool("record", {
|
|
485
|
+
uri: "project://sections/introduction",
|
|
486
|
+
record: { ...section, artifacts: { ...artifacts, context: "project://sections/introduction/context" } },
|
|
487
|
+
expect_sha256: sha(workspace, sectionFile),
|
|
488
|
+
});
|
|
489
|
+
assert.equal(linked.isError, undefined, linked.text);
|
|
490
|
+
|
|
491
|
+
const claim = { id: "claim-flush", statement: "Flushes dominate logging cost.", status: "planned", evidence_required: false, evidence_uris: [] };
|
|
492
|
+
const current = read(workspace, sectionFile);
|
|
493
|
+
const claimed = await host.tool("record", { uri: "project://sections/introduction", record: { ...current, claims: [claim] }, expect_sha256: sha(workspace, sectionFile) });
|
|
494
|
+
assert.equal(claimed.isError, undefined, claimed.text);
|
|
495
|
+
const { updated_at: _updated, revision: _revision, ...base } = read(workspace, sectionFile);
|
|
496
|
+
const methods = { ...base, id: "methods", title: "Methods", status: "not-started", artifacts: { plans: [], reviews: [] }, checkpoint_uris: [], claims: [claim] };
|
|
497
|
+
const duplicate = await host.tool("record", { uri: "project://sections/methods", record: methods });
|
|
498
|
+
assert.match(duplicate.text, /claim-flush is already a claim of project:\/\/sections\/introduction\. Each claim needs an id no other claim in the project holds/);
|
|
499
|
+
const twice = await host.tool("record", { uri: "project://sections/methods", record: { ...methods, claims: [{ ...claim, id: "claim-cost" }, { ...claim, id: "claim-cost" }] } });
|
|
500
|
+
assert.match(twice.text, /claim-cost appears twice in this record/);
|
|
501
|
+
assert.equal(existsSync(path.join(workspace, ".planning/sections/methods/section.json")), false);
|
|
502
|
+
const fresh = await host.tool("record", { uri: "project://sections/methods", record: { ...methods, claims: [{ ...claim, id: "claim-method" }] } });
|
|
503
|
+
assert.equal(fresh.isError, undefined, fresh.text);
|
|
504
|
+
}));
|
|
505
|
+
|
|
471
506
|
test("record refuses wrong type, id, project and unknown fields without touching the destination", () =>
|
|
472
507
|
withDesk(async (host, workspace) => {
|
|
473
508
|
const before = sha(workspace, ".planning/sections/introduction/section.json");
|
|
@@ -532,10 +567,10 @@ test("no record write or file write escapes through a symbolic link", () =>
|
|
|
532
567
|
// A link that lands in paper/ is judged where it lands (W2).
|
|
533
568
|
symlinkSync(path.join(workspace, "paper"), path.join(workspace, "drafts"));
|
|
534
569
|
assert.match(blocked(await write(host, "drafts/introduction.md")) ?? "", /cannot be written yet/);
|
|
535
|
-
//
|
|
570
|
+
// PanCode follows a dangling link to its target, here outside the project, and refuses the write if the link changes after the hook.
|
|
536
571
|
symlinkSync(path.join(outside, "missing"), path.join(workspace, "paper/dangling.md"));
|
|
537
572
|
assert.equal(blocked(await write(host, "paper/dangling.md")), null);
|
|
538
|
-
// A link
|
|
573
|
+
// A link PanCode cannot resolve, such as a loop, is refused.
|
|
539
574
|
symlinkSync("loop", path.join(workspace, "paper/loop"));
|
|
540
575
|
assert.match(blocked(await write(host, "paper/loop/draft.md")) ?? "", /could not resolve/);
|
|
541
576
|
} finally {
|
|
@@ -582,6 +617,57 @@ test("a gate answer is recorded as a sealed interaction bound to what the author
|
|
|
582
617
|
assert.match(again.text, /already resolved by the author at this desk/);
|
|
583
618
|
}));
|
|
584
619
|
|
|
620
|
+
test("resume on a pause checkpoint returns the project to active in the same write; expire leaves it paused", () =>
|
|
621
|
+
withDesk(async (host, workspace) => {
|
|
622
|
+
const pause = (id: string): void => {
|
|
623
|
+
put(workspace, `.planning/checkpoints/${id}.json`, {
|
|
624
|
+
schema: "wtfp.project.checkpoint/v1",
|
|
625
|
+
id,
|
|
626
|
+
project_id: PROJECT,
|
|
627
|
+
kind: "human-action",
|
|
628
|
+
status: "pending",
|
|
629
|
+
blocking: true,
|
|
630
|
+
scope_uri: "project://sections/introduction",
|
|
631
|
+
request: "Resume writing the introduction?",
|
|
632
|
+
options: [
|
|
633
|
+
{ id: "resume", label: "Resume", implication: "The project returns to active." },
|
|
634
|
+
{ id: "expire", label: "Expire", implication: "The checkpoint closes and the project stays paused." },
|
|
635
|
+
],
|
|
636
|
+
resume_action: "write-section",
|
|
637
|
+
created_at: AT,
|
|
638
|
+
});
|
|
639
|
+
const state = read(workspace, ".planning/state.json");
|
|
640
|
+
put(workspace, ".planning/state.json", { ...state, status: "paused", active_checkpoint_uris: [`project://checkpoints/${id}`] });
|
|
641
|
+
};
|
|
642
|
+
pause("pause-expire");
|
|
643
|
+
await answer(host, "pause-expire", "expire");
|
|
644
|
+
assert.deepEqual([read(workspace, ".planning/state.json").status, read(workspace, ".planning/state.json").active_checkpoint_uris], ["paused", []]);
|
|
645
|
+
|
|
646
|
+
pause("pause-resume");
|
|
647
|
+
const before = read(workspace, ".planning/state.json").revision as number;
|
|
648
|
+
const key = await ask(host, "pause-resume");
|
|
649
|
+
const done = await host.interview({ id: "gate-one", step: key, nav: "next", answers: { choice: "resume" } });
|
|
650
|
+
assert.match("done" in done ? done.text : "", /pause-resume: Resume\. The project is active again/);
|
|
651
|
+
const state = read(workspace, ".planning/state.json");
|
|
652
|
+
assert.deepEqual([state.status, state.phase, state.active_checkpoint_uris, state.revision], ["active", "writing", [], before + 1]);
|
|
653
|
+
assert.deepEqual([(state.last_transition as Json).from, (state.last_transition as Json).to], ["paused", "active"]);
|
|
654
|
+
const report = (await host.command("validate")).text;
|
|
655
|
+
assert.match(report, /records valid against their schemas/);
|
|
656
|
+
assert.doesNotMatch(report, /project:\/\/(state|checkpoints\/pause-)/);
|
|
657
|
+
}));
|
|
658
|
+
|
|
659
|
+
test("the author's card for a batch of gate answers names what was chosen and leaves the model's instructions out", () =>
|
|
660
|
+
withDesk(async (host) => {
|
|
661
|
+
await answer(host, PLAN_GATE, "approve");
|
|
662
|
+
const started = await host.command("check-todos");
|
|
663
|
+
const next = await host.interview({ id: "gate", step: started.interview?.step.key as string, nav: "next", answers: { choice: "workflow-first" } });
|
|
664
|
+
assert.ok("done" in next);
|
|
665
|
+
assert.match(next.text, /checkpoint-framing: Workflow first\. The desk wrote .*read any of them again/);
|
|
666
|
+
const card = JSON.stringify(next.card);
|
|
667
|
+
assert.match(card, /Recorded: checkpoint-framing: Workflow first\./);
|
|
668
|
+
assert.doesNotMatch(card, /The desk wrote|read any of them again/);
|
|
669
|
+
}, SERVED));
|
|
670
|
+
|
|
585
671
|
test("cancelling, headless asking and keeping a gate pending never resolve it (G2)", () =>
|
|
586
672
|
withDesk(async (host, workspace) => {
|
|
587
673
|
let key = await ask(host, GATE);
|
|
@@ -607,7 +693,7 @@ test("an answer that was not offered, replayed, or meant for another desk record
|
|
|
607
693
|
const forged = await host.interview({ id: "gate-one", step: "gate.0123456789ab", nav: "next", answers: { choice: "workflow-first" } });
|
|
608
694
|
assert.match("done" in forged ? forged.text : "", /matches no open question/);
|
|
609
695
|
const other = project();
|
|
610
|
-
const elsewhere =
|
|
696
|
+
const elsewhere = withPanCodeFacts(await createExtensionTestHost(ROOT, { workspace: other }), other);
|
|
611
697
|
try {
|
|
612
698
|
const foreign = await elsewhere.interview({ id: "gate-one", step: await ask(host, GATE), nav: "next", answers: { choice: "workflow-first" } });
|
|
613
699
|
assert.match("done" in foreign ? foreign.text : "", /matches no open question/);
|
|
@@ -729,7 +815,7 @@ test("the manuscript waits for an author-approved plan whose exact bytes were ap
|
|
|
729
815
|
await answer(host, GATE, "protocol-first");
|
|
730
816
|
assert.match(blocked(await write(host, "paper/introduction.md")) ?? "", /has not answered "Approve the introduction plan\?"/);
|
|
731
817
|
const declined = project();
|
|
732
|
-
const other =
|
|
818
|
+
const other = withPanCodeFacts(await createExtensionTestHost(ROOT, { workspace: declined }), declined);
|
|
733
819
|
try {
|
|
734
820
|
await answer(other, GATE, "protocol-first");
|
|
735
821
|
await answer(other, PLAN_GATE, "revise");
|
|
@@ -1053,7 +1139,7 @@ test("only an advance turn may ask the desk for a step, and the turn's end ends
|
|
|
1053
1139
|
await host.observe({ event: "turn_end", turnId: "t1", outcome: "completed", usage: null });
|
|
1054
1140
|
assert.equal((await nextStep(host)).isError, true, "the drive ends with its turn");
|
|
1055
1141
|
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1056
|
-
//
|
|
1142
|
+
// PanCode continuing the turn after its tool budget or loop guard resumes the drive the turn had.
|
|
1057
1143
|
assert.equal((await nextStep(host)).data.kind, "gate");
|
|
1058
1144
|
await host.observe({ event: "turn_end", turnId: "t2", outcome: "completed", usage: null });
|
|
1059
1145
|
assert.equal((await nextStep(host)).isError, true, "between turns nothing drives");
|
|
@@ -1082,7 +1168,7 @@ test("advance puts each gate to the author, then arms exactly the step the ladde
|
|
|
1082
1168
|
}
|
|
1083
1169
|
assert.deepEqual(asked.sort(), [GATE, PLAN_GATE].sort());
|
|
1084
1170
|
const step = await nextStep(host);
|
|
1085
|
-
assert.deepEqual([step.data.kind, step.data.action, step.data.section, step.data.prompt], ["step", "write-section", "introduction", "
|
|
1171
|
+
assert.deepEqual([step.data.kind, step.data.action, step.data.section, step.data.prompt], ["step", "write-section", "introduction", "dev.pancode/prompts/wtfp/write-section.md"]);
|
|
1086
1172
|
assert.match(step.text, /armed for write-section introduction only/);
|
|
1087
1173
|
assert.equal(blocked(await write(host, "paper/introduction.md")), null, "the armed step may write its manuscript");
|
|
1088
1174
|
assert.ok(blocked(await write(host, ".planning/sections/introduction/plans/second.md")), "but nothing write-section does not declare");
|
|
@@ -1122,8 +1208,8 @@ test("every next_step result restates the driver rule, so a compacted turn can c
|
|
|
1122
1208
|
const step = await nextStep(host);
|
|
1123
1209
|
assert.equal(step.data.kind, "step");
|
|
1124
1210
|
assert.match(step.text, /^Step 1: \/wtfp:write-section introduction\./);
|
|
1125
|
-
assert.match(step.text, /Read and follow <plugin root>\/
|
|
1126
|
-
// Live on
|
|
1211
|
+
assert.match(step.text, /Read and follow <plugin root>\/dev\.pancode\/prompts\/wtfp\/write-section\.md, where <plugin root> is the WTF-P plugin root \(two directories above the base_dir of the loaded wtfp-manage-project skill/);
|
|
1212
|
+
// Live on the 0.8.3 host, the model looked for a tool named audit-milestone and stopped the drive.
|
|
1127
1213
|
assert.match(step.text, /A step is a procedure, not a capability: there is no tool named after its action/);
|
|
1128
1214
|
assert.match(step.text, /invocation input introduction/);
|
|
1129
1215
|
assert.equal(ruleOf(step.text), rule);
|
|
@@ -1393,7 +1479,7 @@ test("status gives an agent the whole project in one read, matching what the des
|
|
|
1393
1479
|
}, SERVED));
|
|
1394
1480
|
|
|
1395
1481
|
// --- the turn_start status reminder ------------------------------------------------
|
|
1396
|
-
//
|
|
1482
|
+
// PanCode fires turn_start once per operator prompt; the desk answers with its status
|
|
1397
1483
|
// only when that prompt armed a WTF-P action or advance in a project.
|
|
1398
1484
|
|
|
1399
1485
|
const turnStart = (host: Host) => host.hook({ point: "turn_start", turnId: "t1" });
|
|
@@ -1422,7 +1508,7 @@ test("a WTF-P turn starts from the desk's status, and no other turn does", () =>
|
|
|
1422
1508
|
assert.equal(reminderOf(await turnStart(host)), null, "no project, no reminder");
|
|
1423
1509
|
}, DRIVEN_PLUGIN));
|
|
1424
1510
|
|
|
1425
|
-
test("a status too long for one
|
|
1511
|
+
test("a status too long for one PanCode effect is cut to 2,000 characters and points at the status tool", () =>
|
|
1426
1512
|
withDesk(async (host, workspace) => {
|
|
1427
1513
|
const outline = read(workspace, ".planning/structure/outline.json");
|
|
1428
1514
|
const extra = Array.from({ length: 60 }, (_, index) => ({
|
|
@@ -1507,7 +1593,7 @@ test("WTF-P workers are dispatched only inside their action and only to manuscri
|
|
|
1507
1593
|
await answer(host, PLAN_GATE, "approve");
|
|
1508
1594
|
const allowed = await dispatch({ agent: "wtfp-section-writer", task: "Draft the introduction." });
|
|
1509
1595
|
assert.deepEqual(rootsOf(rewriteOf(allowed)), [".planning/sections/introduction/summary.md", "paper/introduction.md", "paper/introduction/"]);
|
|
1510
|
-
assert.ok(!Object.keys(rewriteOf(allowed) ?? {}).some((key) => key.startsWith("
|
|
1596
|
+
assert.ok(!Object.keys(rewriteOf(allowed) ?? {}).some((key) => key.startsWith("__pancode_")), "PanCode recomputes its own admission keys for a rewritten call");
|
|
1511
1597
|
const narrowed = await dispatch({ agent: "wtfp-section-writer", task: "Draft.", intent: { write_roots: ["."] } });
|
|
1512
1598
|
assert.deepEqual(rootsOf(rewriteOf(narrowed)), [".planning/sections/introduction/summary.md", "paper/introduction.md", "paper/introduction/"]);
|
|
1513
1599
|
// Roots that already are the confinement, in any order, need no rewrite.
|
|
@@ -1519,7 +1605,7 @@ test("WTF-P workers are dispatched only inside their action and only to manuscri
|
|
|
1519
1605
|
);
|
|
1520
1606
|
assert.match(
|
|
1521
1607
|
blocked(await dispatch({ tasks: [{ agent: "wtfp-section-writer", task: "a" }, { agent: "wtfp-section-writer", task: "b" }] })) ?? "",
|
|
1522
|
-
/
|
|
1608
|
+
/PanCode: parallel writers need disjoint intent\.write_roots/,
|
|
1523
1609
|
);
|
|
1524
1610
|
assert.match(blocked(await dispatch({ agent: "coder", task: "x", intent: { write_roots: ["src"] } })) ?? "", /delegates only to wtfp-argument-verifier, wtfp-section-writer, and this call would start coder/);
|
|
1525
1611
|
assert.ok(existsSync(path.join(workspace, "paper/introduction.md")));
|
|
@@ -1528,7 +1614,7 @@ test("WTF-P workers are dispatched only inside their action and only to manuscri
|
|
|
1528
1614
|
assert.match(blocked(await dispatch({ agent: "wtfp-section-writer", task: "Draft." })) ?? "", /paper\/introduction\/ does not lead where it reads/);
|
|
1529
1615
|
}, SERVED));
|
|
1530
1616
|
|
|
1531
|
-
test("the guard judges the file
|
|
1617
|
+
test("the guard judges the file PanCode's tools open, however the path is spelled (W2)", () =>
|
|
1532
1618
|
withDesk(async (host, workspace) => {
|
|
1533
1619
|
const manuscript = path.join(workspace, "paper/introduction.md");
|
|
1534
1620
|
for (const spelling of ["@paper/introduction.md", `~/${path.relative(homedir(), manuscript)}`, "paper/./introduction.md"])
|
|
@@ -1543,26 +1629,26 @@ test("the guard judges the file Clio's tools open, however the path is spelled (
|
|
|
1543
1629
|
assert.match(blocked(artifact) ?? "", /cannot be written yet/);
|
|
1544
1630
|
const script = await host.hook({ point: "before_tool", tool: "run_script", turnId: "t1", args: { interpreter: "python3", script: "x.py", args: [".planning/interactions/x.json"] } });
|
|
1545
1631
|
assert.match(blocked(script) ?? "", /desk's own records/);
|
|
1546
|
-
const manifest = readFileSync(path.join(ROOT, "
|
|
1632
|
+
const manifest = readFileSync(path.join(ROOT, "pancode-extension.yaml"), "utf8");
|
|
1547
1633
|
const hooked = /on: before_tool, tools: \[([^\]]*)\]/u.exec(manifest)?.[1]?.split(/,\s*/u) ?? [];
|
|
1548
1634
|
for (const tool of ["write", "edit", "artifact", "dispatch", "bash", "run_script", "job"]) assert.ok(hooked.includes(tool), `${tool} is hooked`);
|
|
1549
1635
|
}));
|
|
1550
1636
|
|
|
1551
|
-
test("where
|
|
1637
|
+
test("where PanCode resolves a call's landing and dispatch plan, the desk judges what PanCode resolved", () =>
|
|
1552
1638
|
withDesk(async (host, workspace) => {
|
|
1553
1639
|
const real = realpathSync(workspace);
|
|
1554
1640
|
const manuscript = path.join(real, "paper/introduction.md");
|
|
1555
1641
|
const landed = (args: Json, target: unknown) => host.hook({ point: "before_tool", tool: "write", turnId: "t1", args, target });
|
|
1556
|
-
// The landing
|
|
1642
|
+
// The landing PanCode sends is the file the tool opens, whatever the call spells.
|
|
1557
1643
|
assert.match(blocked(await landed({ path: "notes.md" }, { arg: "path", path: manuscript, resolved: true, workspacePath: "paper/introduction.md" })) ?? "", /cannot be written yet/);
|
|
1558
|
-
// A path the desk could not inspect is judged where
|
|
1644
|
+
// A path the desk could not inspect is judged where PanCode says it lands.
|
|
1559
1645
|
assert.match(blocked(await landed({ path: "/proc/self/cwd/paper/introduction.md" }, { arg: "path", path: manuscript, resolved: true, workspacePath: "paper/introduction.md" })) ?? "", /cannot be written yet/);
|
|
1560
1646
|
// A worker's write in a task worktree is judged at the checkout path it merges into.
|
|
1561
1647
|
assert.match(blocked(await landed({ path: "paper/introduction.md" }, { arg: "path", path: "/elsewhere/worktree/paper/introduction.md", resolved: true, workspacePath: "paper/introduction.md" })) ?? "", /cannot be written yet/);
|
|
1562
|
-
// Without a workspace path, the desk maps
|
|
1648
|
+
// Without a workspace path, the desk maps PanCode's physical path itself.
|
|
1563
1649
|
assert.match(blocked(await landed({ path: "x" }, { arg: "path", path: manuscript, resolved: true })) ?? "", /cannot be written yet/);
|
|
1564
1650
|
assert.equal(blocked(await landed({ path: "/elsewhere/notes.md" }, { arg: "path", path: "/elsewhere/notes.md", resolved: true, workspacePath: null })), null);
|
|
1565
|
-
assert.match(blocked(await landed({ path: "loop/x" }, { arg: "path", path: path.join(real, "loop/x"), resolved: false, workspacePath: null })) ?? "", /
|
|
1651
|
+
assert.match(blocked(await landed({ path: "loop/x" }, { arg: "path", path: path.join(real, "loop/x"), resolved: false, workspacePath: null })) ?? "", /PanCode could not resolve/);
|
|
1566
1652
|
assert.match(blocked(await landed({ path: "x" }, { arg: "path", path: 7, resolved: true })) ?? "", /form the desk cannot read/);
|
|
1567
1653
|
|
|
1568
1654
|
const dispatch = (args: Json, plan: unknown) => host.hook({ point: "before_tool", tool: "dispatch", turnId: "t1", args, dispatch: plan });
|
|
@@ -1570,7 +1656,7 @@ test("where Clio resolves a call's landing and dispatch plan, the desk judges wh
|
|
|
1570
1656
|
const plan = (...tasks: Json[]) => ({ kind: "tasks", mode: "single", tasks });
|
|
1571
1657
|
const coder = { agent: "coder", task: "x", intent: { write_roots: ["src"] } };
|
|
1572
1658
|
assert.equal(blocked(await dispatch(coder, plan(task("coder", { writeRoots: ["src"], writeBoundaries: [path.join(real, "src")] })))), null);
|
|
1573
|
-
//
|
|
1659
|
+
// PanCode resolves auto; a WTF-P agent it picks outside its action is refused like one named.
|
|
1574
1660
|
assert.match(blocked(await dispatch({ agent: "auto", task: "Draft." }, plan(task("wtfp-section-writer")))) ?? "", /run only inside the WTF-P action/);
|
|
1575
1661
|
assert.match(blocked(await dispatch(coder, plan(task("coder", { cwd: path.join(real, "paper") })))) ?? "", /cwd moves the write roots/);
|
|
1576
1662
|
assert.match(
|
|
@@ -1578,19 +1664,19 @@ test("where Clio resolves a call's landing and dispatch plan, the desk judges wh
|
|
|
1578
1664
|
/refuses worktree writers/,
|
|
1579
1665
|
);
|
|
1580
1666
|
assert.match(blocked(await dispatch(coder, plan(task("coder", { writeRoots: ["src"] })))) ?? "", /form the desk cannot read/, "every root has its boundary");
|
|
1581
|
-
// A root lands where
|
|
1667
|
+
// A root lands where PanCode says: one that resolves elsewhere does not lead where it reads, and one on the whole project is no boundary.
|
|
1582
1668
|
assert.match(blocked(await dispatch(coder, plan(task("coder", { writeRoots: ["drafts/"], writeBoundaries: [path.join(real, "paper")] })))) ?? "", /drafts\/ does not lead where it reads/);
|
|
1583
1669
|
assert.match(blocked(await dispatch(coder, plan(task("coder", { writeRoots: ["src", "."], writeBoundaries: [path.join(real, "src"), real] })))) ?? "", /intent\.write_roots/);
|
|
1584
1670
|
assert.match(blocked(await dispatch({}, { kind: "apply-winner", branch: "winner", cwd: real })) ?? "", /compete winner/);
|
|
1585
1671
|
assert.equal(blocked(await dispatch({}, { kind: "list" })), null);
|
|
1586
1672
|
assert.match(blocked(await dispatch(coder, plan({ agent: "coder" }))) ?? "", /form the desk cannot read/);
|
|
1587
1673
|
assert.match(blocked(await dispatch(coder, plan(task("coder", { agent: 7 })))) ?? "", /form the desk cannot read/);
|
|
1588
|
-
// Outside an action, a worker
|
|
1674
|
+
// Outside an action, a worker PanCode runs read-only needs no roots either.
|
|
1589
1675
|
assert.equal(blocked(await dispatch({ agent: "auto", task: "Look." }, plan(task("scout", { readOnly: true })))), null);
|
|
1590
|
-
//
|
|
1591
|
-
assert.equal(blocked(await dispatch({ agent: "coder", task: "x",
|
|
1592
|
-
// A host that has sent facts once lacks them for a call only when
|
|
1593
|
-
assert.match(blocked(await host.hook({ point: "before_tool", tool: "write", turnId: "t1", args: { path: "src/x.md" }, bare: true } as never)) ?? "", /
|
|
1676
|
+
// PanCode could not prepare this call and refuses it itself, with its own reason.
|
|
1677
|
+
assert.equal(blocked(await dispatch({ agent: "coder", task: "x", __pancode_dispatch_plan_preparation_error: "write_roots entries may not start with ./" }, undefined)), null);
|
|
1678
|
+
// A host that has sent facts once lacks them for a call only when PanCode failed on it, and the desk says so.
|
|
1679
|
+
assert.match(blocked(await host.hook({ point: "before_tool", tool: "write", turnId: "t1", args: { path: "src/x.md" }, bare: true } as never)) ?? "", /PanCode sent no landing for this call/);
|
|
1594
1680
|
assert.match(blocked(await dispatch(coder, { kind: "council-of-elders", tasks: [] })) ?? "", /form the desk cannot read/, "an unknown plan is no plan");
|
|
1595
1681
|
// A name that starts with `..` is still inside the project.
|
|
1596
1682
|
assert.equal(blocked(await dispatch({ ...coder, intent: { write_roots: ["..notes/"] } }, plan(task("coder", { writeRoots: ["..notes/"], writeBoundaries: [path.join(real, "..notes")] })))), null);
|
|
@@ -1598,7 +1684,7 @@ test("where Clio resolves a call's landing and dispatch plan, the desk judges wh
|
|
|
1598
1684
|
await host.hook({ point: "prompt_submit", text: "/wtfp:write-section introduction" });
|
|
1599
1685
|
await answer(host, GATE, "protocol-first");
|
|
1600
1686
|
await answer(host, PLAN_GATE, "approve");
|
|
1601
|
-
//
|
|
1687
|
+
// PanCode admits a rewritten call afresh, without the approval a review loop needs, so the desk names the exact roots instead of rewriting.
|
|
1602
1688
|
const roots = [".planning/sections/introduction/summary.md", "paper/introduction.md", "paper/introduction/"];
|
|
1603
1689
|
const review = [task("wtfp-section-writer", { role: "builder" }), task("wtfp-section-reviewer", { role: "reviewer", readOnly: true })];
|
|
1604
1690
|
const loop = await dispatch({ agent: "wtfp-section-writer", tasks: [{ task: "Draft the introduction." }], review: { reviewer: "wtfp-section-reviewer" } }, { kind: "tasks", mode: "review", tasks: review });
|
|
@@ -1607,39 +1693,39 @@ test("where Clio resolves a call's landing and dispatch plan, the desk judges wh
|
|
|
1607
1693
|
const confined = await dispatch({ agent: "wtfp-section-writer", tasks: [{ task: "Draft the introduction.", intent: { write_roots: roots } }], review: { reviewer: "wtfp-section-reviewer" } }, { kind: "tasks", mode: "review", tasks: [sent, review[1]] });
|
|
1608
1694
|
assert.equal(blocked(confined), null, "a loop that already names its roots runs as approved");
|
|
1609
1695
|
assert.equal(rewriteOf(confined), null);
|
|
1610
|
-
// A worker
|
|
1696
|
+
// A worker PanCode runs read-only needs no write roots, whatever its recipe is called.
|
|
1611
1697
|
const reader = await dispatch({ agent: "auto", tasks: [{ task: "Review the introduction." }] }, plan(task("scout", { readOnly: true })));
|
|
1612
1698
|
assert.equal(blocked(reader), null);
|
|
1613
1699
|
assert.equal(rewriteOf(reader), null);
|
|
1614
|
-
// The desk takes that from
|
|
1700
|
+
// The desk takes that from PanCode: a verifier PanCode does not report read-only is confined like any writer.
|
|
1615
1701
|
assert.deepEqual(rootsOf(rewriteOf(await dispatch({ agent: "wtfp-argument-verifier", tasks: [{ task: "Verify." }] }, plan(task("wtfp-argument-verifier"))))), roots);
|
|
1616
|
-
// A writer the action does not delegate to is refused by name, as is
|
|
1702
|
+
// A writer the action does not delegate to is refused by name, as is PanCode's default worker when the call names no agent.
|
|
1617
1703
|
assert.match(blocked(await dispatch({ agent: "wtfp-section-reviewer", tasks: [{ task: "Review." }] }, plan(task("wtfp-section-reviewer")))) ?? "", /delegates only to wtfp-argument-verifier, wtfp-section-writer, and this call would start wtfp-section-reviewer/);
|
|
1618
1704
|
assert.match(blocked(await dispatch({ tasks: [{ task: "Draft." }] }, plan(task("coder")))) ?? "", /would start coder; name the role with agent \(for example agent: "wtfp-section-writer"\)/);
|
|
1619
1705
|
assert.match(
|
|
1620
1706
|
blocked(await dispatch({ agent: "wtfp-argument-verifier", task: "x", intent: { write_roots: ["src"] } }, plan(task("wtfp-argument-verifier", { writeRoots: ["src"], writeBoundaries: [path.join(real, "src")] })))) ?? "",
|
|
1621
1707
|
/src lie outside what write-section may write/,
|
|
1622
1708
|
);
|
|
1623
|
-
// A declared empty write_roots is no boundary to the worker, and
|
|
1709
|
+
// A declared empty write_roots is no boundary to the worker, and PanCode refuses a rewrite that fills it, so the desk names the roots.
|
|
1624
1710
|
assert.match(
|
|
1625
1711
|
blocked(await dispatch({ agent: "wtfp-section-writer", task: "Draft.", intent: { read_roots: [".planning"], write_roots: [] } }, plan(task("wtfp-section-writer")))) ?? "",
|
|
1626
1712
|
/intent without write_roots bounds nothing.*Send intent\.write_roots \.planning\/sections\/introduction\/summary\.md, paper\/introduction\.md, paper\/introduction\//,
|
|
1627
1713
|
);
|
|
1628
1714
|
assert.match(blocked(await dispatch({ agent: "wtfp-section-writer", task: "Draft.", intent: { read_roots: [".planning"] } }, plan(task("wtfp-section-writer")))) ?? "", /intent without write_roots/);
|
|
1629
|
-
// A task
|
|
1630
|
-
const spelled = await dispatch({ agent: "wtfp-section-writer", tasks: ["Draft."],
|
|
1715
|
+
// A task PanCode keeps as a string is confined as a task object, and PanCode's private keys are left for PanCode to recompute.
|
|
1716
|
+
const spelled = await dispatch({ agent: "wtfp-section-writer", tasks: ["Draft."], __pancode_resolved_dispatch_plan: { resolvedBy: "pancode" } }, plan(task("wtfp-section-writer")));
|
|
1631
1717
|
assert.deepEqual(rewriteOf(spelled), { agent: "wtfp-section-writer", tasks: [{ task: "Draft.", intent: { write_roots: roots } }] });
|
|
1632
|
-
//
|
|
1718
|
+
// PanCode's own artifact directory is no project file, but a landing elsewhere in the project, such as through a link, is judged there.
|
|
1633
1719
|
const artifact = (target: unknown) => host.hook({ point: "before_tool", tool: "artifact", turnId: "t1", args: { kind: "plan", content: "x" }, target });
|
|
1634
|
-
assert.equal(blocked(await artifact({ arg: "path", path: path.join(real, ".
|
|
1720
|
+
assert.equal(blocked(await artifact({ arg: "path", path: path.join(real, ".pancode/artifacts/plan.md"), resolved: true, workspacePath: ".pancode/artifacts/plan.md" })), null);
|
|
1635
1721
|
assert.match(blocked(await artifact({ arg: "path", path: path.join(real, "src/plan.md"), resolved: true, workspacePath: "src/plan.md" })) ?? "", /may write only under/);
|
|
1636
1722
|
}, SERVED));
|
|
1637
1723
|
|
|
1638
|
-
test("a
|
|
1724
|
+
test("a PanCode that sends no landing or dispatch plan is refused inside a WTF-P project or action and left alone elsewhere", async () => {
|
|
1639
1725
|
await withDesk(async (host) => {
|
|
1640
1726
|
const bare = (tool: string, args: Json) => host.hook({ point: "before_tool", tool, turnId: "t1", args, bare: true } as never);
|
|
1641
|
-
assert.match(blocked(await bare("write", { path: "src/notes.md" })) ?? "", /needs
|
|
1642
|
-
assert.match(blocked(await bare("dispatch", { agent: "coder", task: "x", intent: { write_roots: ["src/"] } })) ?? "", /needs
|
|
1727
|
+
assert.match(blocked(await bare("write", { path: "src/notes.md" })) ?? "", /needs PanCode 0\.9\.0/);
|
|
1728
|
+
assert.match(blocked(await bare("dispatch", { agent: "coder", task: "x", intent: { write_roots: ["src/"] } })) ?? "", /needs PanCode 0\.9\.0/);
|
|
1643
1729
|
assert.equal(blocked(await bare("dispatch", { list: true })), null);
|
|
1644
1730
|
assert.equal(blocked(await bare("bash", { command: "ls" })), null);
|
|
1645
1731
|
});
|
|
@@ -1650,25 +1736,25 @@ test("a Clio that sends no landing or dispatch plan is refused inside a WTF-P pr
|
|
|
1650
1736
|
assert.equal(blocked(await bare("write", { path: "notes.md" })), null, "a folder that is no WTF-P project is not the desk's to guard");
|
|
1651
1737
|
assert.equal(blocked(await bare("dispatch", { agent: "coder", task: "x" })), null);
|
|
1652
1738
|
await host.hook({ point: "prompt_submit", text: "/wtfp:new-paper durable workflows" });
|
|
1653
|
-
assert.match(blocked(await bare("write", { path: "notes.md" })) ?? "", /needs
|
|
1739
|
+
assert.match(blocked(await bare("write", { path: "notes.md" })) ?? "", /needs PanCode 0\.9\.0/, "inside a WTF-P action it is");
|
|
1654
1740
|
await host.hook({ point: "prompt_submit", text: "thanks" });
|
|
1655
|
-
// With
|
|
1656
|
-
const facts =
|
|
1741
|
+
// With PanCode's facts, only the WTF-P recipes are the desk's business there.
|
|
1742
|
+
const facts = withPanCodeFacts(host, folder);
|
|
1657
1743
|
symlinkSync(os.tmpdir(), path.join(folder, "elsewhere"));
|
|
1658
1744
|
assert.equal(blocked(await facts.hook({ point: "before_tool", tool: "dispatch", turnId: "t1", args: { agent: "coder", task: "x", cwd: "..", intent: { write_roots: ["elsewhere/"] } } } as never)), null);
|
|
1659
1745
|
assert.match(blocked(await facts.hook({ point: "before_tool", tool: "dispatch", turnId: "t1", args: { agent: "wtfp-section-writer", task: "x" } } as never)) ?? "", /run only inside the WTF-P action/);
|
|
1660
1746
|
assert.equal(blocked(await facts.hook({ point: "before_tool", tool: "dispatch", turnId: "t1", args: { agent: "coder", task: "x" }, dispatch: { kind: "council-of-elders" } } as never)), null, "a plan the desk cannot read is no plan, and this folder is not its to guard");
|
|
1661
1747
|
assert.equal(blocked(await facts.hook({ point: "before_tool", tool: "write", turnId: "t1", args: { path: "x.md" }, target: { path: 7 } } as never)), null);
|
|
1662
|
-
// Once this
|
|
1748
|
+
// Once this PanCode has sent facts, a call it sends none for failed in PanCode, and an armed action says so.
|
|
1663
1749
|
await host.hook({ point: "prompt_submit", text: "/wtfp:new-paper durable workflows" });
|
|
1664
|
-
assert.match(blocked(await bare("write", { path: "notes.md" })) ?? "", /
|
|
1750
|
+
assert.match(blocked(await bare("write", { path: "notes.md" })) ?? "", /PanCode sent no landing for this call/);
|
|
1665
1751
|
} finally {
|
|
1666
1752
|
await host.dispose();
|
|
1667
1753
|
rmSync(folder, { recursive: true, force: true });
|
|
1668
1754
|
}
|
|
1669
1755
|
});
|
|
1670
1756
|
|
|
1671
|
-
/** Loads the desk the way
|
|
1757
|
+
/** Loads the desk the way PanCode's runtime child does, prints the before_tool verdict for each call, then the result of each desk tool call. */
|
|
1672
1758
|
const HARNESS = `
|
|
1673
1759
|
import { pathToFileURL } from "node:url";
|
|
1674
1760
|
const [entry, workspace, calls, toolCalls = "[]"] = process.argv.slice(2);
|
|
@@ -1700,7 +1786,7 @@ for (const [name, input] of JSON.parse(toolCalls)) {
|
|
|
1700
1786
|
console.log(JSON.stringify(toolCalls === "[]" ? verdicts : { verdicts, results }));
|
|
1701
1787
|
`;
|
|
1702
1788
|
|
|
1703
|
-
test("under the read and write access
|
|
1789
|
+
test("under the read and write access PanCode grants the desk, it judges every call by the landing and plan PanCode sends (W2)", async () => {
|
|
1704
1790
|
const workspace = project();
|
|
1705
1791
|
const harness = path.join(process.env.TMPDIR as string, `wtfp-host-harness-${process.pid}-${Date.now()}.mjs`);
|
|
1706
1792
|
try {
|
|
@@ -1708,8 +1794,8 @@ test("under the read and write access Clio grants the desk, it judges every call
|
|
|
1708
1794
|
mkdirSync(path.join(workspace, "notes"));
|
|
1709
1795
|
symlinkSync(path.join(workspace, ".planning"), path.join(workspace, "notes/records"));
|
|
1710
1796
|
writeFileSync(harness, HARNESS);
|
|
1711
|
-
// The flags
|
|
1712
|
-
const declared = /fs: \{ read: \[([^\]]*)\], write: \[([^\]]*)\] \}/u.exec(readFileSync(path.join(ROOT, "
|
|
1797
|
+
// The flags PanCode builds from the manifest (runtimePermissionArgs in runtime-process-v2.ts).
|
|
1798
|
+
const declared = /fs: \{ read: \[([^\]]*)\], write: \[([^\]]*)\] \}/u.exec(readFileSync(path.join(ROOT, "pancode-extension.yaml"), "utf8"));
|
|
1713
1799
|
assert.ok(declared, "the manifest declares its file access");
|
|
1714
1800
|
const entries = (list: string): string[] => list.split(",").map((entry) => entry.trim().replace(/^"|"$/gu, "")).filter(Boolean);
|
|
1715
1801
|
const directory = (root: string): string => (root.endsWith(path.sep) ? root : `${root}${path.sep}`);
|
|
@@ -1727,7 +1813,7 @@ test("under the read and write access Clio grants the desk, it judges every call
|
|
|
1727
1813
|
const run = spawnSync(
|
|
1728
1814
|
process.execPath,
|
|
1729
1815
|
["--permission", ...[directory(ROOT), harness, ...read].map((root) => `--allow-fs-read=${root}`), ...write.map((root) => `--allow-fs-write=${root}`), harness, path.join(ROOT, "runtime/extension.ts"), workspace, JSON.stringify(calls.map(([call]) => withFacts({ point: "before_tool", ...call }, workspace)))],
|
|
1730
|
-
{ cwd: workspace, encoding: "utf8"
|
|
1816
|
+
{ cwd: workspace, encoding: "utf8" },
|
|
1731
1817
|
);
|
|
1732
1818
|
assert.equal(run.status, 0, run.stderr);
|
|
1733
1819
|
const verdicts = JSON.parse(run.stdout) as Array<string | null>;
|
|
@@ -1738,7 +1824,7 @@ test("under the read and write access Clio grants the desk, it judges every call
|
|
|
1738
1824
|
}
|
|
1739
1825
|
});
|
|
1740
1826
|
|
|
1741
|
-
test("under the write access
|
|
1827
|
+
test("under the write access PanCode grants the desk, which refuses every flush, a record write still lands whole", () => {
|
|
1742
1828
|
const workspace = project();
|
|
1743
1829
|
const harness = path.join(process.env.TMPDIR as string, `wtfp-host-harness-${process.pid}-${Date.now()}.mjs`);
|
|
1744
1830
|
try {
|
|
@@ -1756,7 +1842,7 @@ test("under the write access Clio grants the desk, which refuses every flush, a
|
|
|
1756
1842
|
"[]",
|
|
1757
1843
|
JSON.stringify([["record", { uri: "project://state", record: { ...state, phase: "reviewing" }, expect_revision: 3 }]]),
|
|
1758
1844
|
],
|
|
1759
|
-
{ cwd: workspace, encoding: "utf8"
|
|
1845
|
+
{ cwd: workspace, encoding: "utf8" },
|
|
1760
1846
|
);
|
|
1761
1847
|
assert.equal(run.status, 0, run.stderr);
|
|
1762
1848
|
const { results } = JSON.parse(run.stdout) as { results: Array<{ isError: boolean; text: string }> };
|
|
@@ -1793,10 +1879,10 @@ test("a manuscript nested under another section's stem is judged by every sectio
|
|
|
1793
1879
|
assert.deepEqual(roots, [".planning/sections/introduction/summary.md", "paper/introduction.md"], "no worker root covers the appendix");
|
|
1794
1880
|
}, SERVED));
|
|
1795
1881
|
|
|
1796
|
-
test("dispatch is judged as
|
|
1882
|
+
test("dispatch is judged as PanCode parses it, and no worker gets an unbounded or record-covering root (W3)", () =>
|
|
1797
1883
|
withDesk(async (host, workspace) => {
|
|
1798
1884
|
const dispatch = (args: Json) => host.hook({ point: "before_tool", tool: "dispatch", turnId: "t1", args });
|
|
1799
|
-
//
|
|
1885
|
+
// PanCode trims agent ids and accepts a batch as a JSON string or a single object.
|
|
1800
1886
|
for (const args of [
|
|
1801
1887
|
{ tasks: [{ agent: "wtfp-section-writer ", task: "Draft." }] },
|
|
1802
1888
|
{ tasks: JSON.stringify([{ agent: "wtfp-section-writer", task: "Draft." }]) },
|
|
@@ -1813,14 +1899,14 @@ test("dispatch is judged as Clio parses it, and no worker gets an unbounded or r
|
|
|
1813
1899
|
// Every spelling the section's manuscript can take is held, not only the file that exists now.
|
|
1814
1900
|
for (const root of ["paper/introduction.tex", "paper/introduction.typ", "paper/introduction", "paper/introduction.v2.md"])
|
|
1815
1901
|
assert.match(blocked(await dispatch({ agent: "coder", task: "x", intent: { write_roots: [root] } })) ?? "", /may not change/, root);
|
|
1816
|
-
assert.match(blocked(await dispatch({ apply_winner: { branch: "
|
|
1817
|
-
//
|
|
1902
|
+
assert.match(blocked(await dispatch({ apply_winner: { branch: "pancode/compete/g/1" } })) ?? "", /cannot see what/);
|
|
1903
|
+
// PanCode resolves write roots against a worker's cwd, and fixes a boundary where a root physically leads.
|
|
1818
1904
|
assert.match(blocked(await dispatch({ agent: "coder", task: "x", cwd: "paper", intent: { write_roots: ["introduction.md"] } })) ?? "", /cwd/);
|
|
1819
1905
|
assert.match(blocked(await dispatch({ tasks: [{ agent: "coder", task: "x", cwd: ".planning", intent: { write_roots: ["checkpoints/"] } }] })) ?? "", /cwd/);
|
|
1820
1906
|
assert.equal(blocked(await dispatch({ agent: "coder", task: "x", cwd: ".", intent: { write_roots: ["src/"] } })), null);
|
|
1821
1907
|
symlinkSync(path.join(workspace, "paper"), path.join(workspace, "drafts"));
|
|
1822
1908
|
assert.match(blocked(await dispatch({ agent: "coder", task: "x", intent: { write_roots: ["drafts/"] } })) ?? "", /does not lead where it reads/);
|
|
1823
|
-
// An action that declares no file outputs never hands a writer an empty list, which
|
|
1909
|
+
// An action that declares no file outputs never hands a writer an empty list, which PanCode reads as no boundary.
|
|
1824
1910
|
await host.hook({ point: "prompt_submit", text: "/wtfp:progress" });
|
|
1825
1911
|
assert.match(blocked(await dispatch({ tasks: [{ agent: "wtfp-section-planner", task: "x" }] })) ?? "", /declares no file outputs/);
|
|
1826
1912
|
const reviewer = await dispatch({ tasks: [{ agent: "wtfp-plan-checker", task: "x" }] });
|
|
@@ -1876,6 +1962,7 @@ test("a pending plan gate cannot be retired by briefly linking a decoy plan", ()
|
|
|
1876
1962
|
await answer(host, GATE, "protocol-first");
|
|
1877
1963
|
const sectionFile = ".planning/sections/introduction/section.json";
|
|
1878
1964
|
const section = read(workspace, sectionFile);
|
|
1965
|
+
writeFileSync(path.join(workspace, ".planning/sections/introduction/plans/decoy.md"), "# Decoy\n");
|
|
1879
1966
|
const decoy = { ...(section.artifacts as Json), plans: [PLAN_URI, "project://sections/introduction/plans/decoy"] };
|
|
1880
1967
|
assert.equal((await host.tool("record", { uri: "project://sections/introduction", record: { ...section, artifacts: decoy }, expect_sha256: sha(workspace, sectionFile) })).isError, undefined);
|
|
1881
1968
|
const checkpoint = read(workspace, `.planning/checkpoints/${PLAN_GATE}.json`);
|
|
@@ -1958,7 +2045,7 @@ test("recovery finishes only a journal of the desk's own record writes", () =>
|
|
|
1958
2045
|
[{ file: "paper/introduction.md", staging: "notes/draft.md", sha256: digest }],
|
|
1959
2046
|
[{ file: ".planning/state.json", staging: "notes/draft.md", sha256: digest }],
|
|
1960
2047
|
]) {
|
|
1961
|
-
put(workspace, ".planning/.wtfp-journal.json", { schema: "wtfp.
|
|
2048
|
+
put(workspace, ".planning/.wtfp-journal.json", { schema: "wtfp.pancode-journal/v1", at: AT, entries });
|
|
1962
2049
|
assert.match((await host.command("validate")).text, /Set aside a journal/);
|
|
1963
2050
|
}
|
|
1964
2051
|
assert.equal(sha(workspace, "paper/introduction.md"), before);
|
|
@@ -2034,7 +2121,7 @@ test("a failure between paired writes leaves a journal the next write completes;
|
|
|
2034
2121
|
test("a fresh process trusts only answers it can verify and reports drift instead of inventing state (L1)", async () => {
|
|
2035
2122
|
const workspace = project();
|
|
2036
2123
|
let key: unknown;
|
|
2037
|
-
const first =
|
|
2124
|
+
const first = withPanCodeFacts(await createExtensionTestHost(ROOT, { workspace, sessionId: "first" }), workspace);
|
|
2038
2125
|
try {
|
|
2039
2126
|
await answer(first, GATE, "protocol-first");
|
|
2040
2127
|
await answer(first, PLAN_GATE, "approve");
|
|
@@ -2043,8 +2130,8 @@ test("a fresh process trusts only answers it can verify and reports drift instea
|
|
|
2043
2130
|
} finally {
|
|
2044
2131
|
await first.dispose();
|
|
2045
2132
|
}
|
|
2046
|
-
const resumed =
|
|
2047
|
-
const elsewhere =
|
|
2133
|
+
const resumed = withPanCodeFacts(await createExtensionTestHost(ROOT, { workspace, sessionId: "resumed" }), workspace);
|
|
2134
|
+
const elsewhere = withPanCodeFacts(await createExtensionTestHost(ROOT, { workspace, sessionId: "other-machine" }), workspace);
|
|
2048
2135
|
try {
|
|
2049
2136
|
await resumed.store.set("seal-key", key);
|
|
2050
2137
|
assert.equal(blocked(await write(resumed, "paper/introduction.md")), null, "the same machine's key verifies the sealed answers");
|
|
@@ -2072,7 +2159,7 @@ test("SIMULATED rehearsal: initialize, outline, reject then approve a plan, draf
|
|
|
2072
2159
|
const workspace = mkdtempSync(path.join(process.env.TMPDIR, "wtfp-desk-rehearsal-"));
|
|
2073
2160
|
const ID = "rehearsal";
|
|
2074
2161
|
const S = "evaluation";
|
|
2075
|
-
let host =
|
|
2162
|
+
let host = withPanCodeFacts(await createExtensionTestHost(ROOT, { workspace, plugin: SERVED, sessionId: "s1" }), workspace);
|
|
2076
2163
|
const turn = async (command: string) => {
|
|
2077
2164
|
await host.observe({ event: "turn_end", turnId: "t", outcome: "completed", usage: null });
|
|
2078
2165
|
const armed = await host.hook({ point: "prompt_submit", text: command });
|
|
@@ -2179,7 +2266,7 @@ test("SIMULATED rehearsal: initialize, outline, reject then approve a plan, draf
|
|
|
2179
2266
|
// A fresh process: no session state, the same machine's store.
|
|
2180
2267
|
const key = (await host.store.get("seal-key")).value;
|
|
2181
2268
|
await host.dispose();
|
|
2182
|
-
host =
|
|
2269
|
+
host = withPanCodeFacts(await createExtensionTestHost(ROOT, { workspace, plugin: SERVED, sessionId: "s2" }), workspace);
|
|
2183
2270
|
await host.store.set("seal-key", key);
|
|
2184
2271
|
const progress = await host.command("progress");
|
|
2185
2272
|
assert.match(progress.text, /evaluation: writing .* plan approved/);
|
|
@@ -2212,7 +2299,7 @@ test("SIMULATED rehearsal: initialize, outline, reject then approve a plan, draf
|
|
|
2212
2299
|
test("the desk enters with its four regions and clears its ambient UI when left in a folder with no project", async () => {
|
|
2213
2300
|
assert.ok(process.env.TMPDIR, "Tests need a task-owned TMPDIR.");
|
|
2214
2301
|
const workspace = mkdtempSync(path.join(process.env.TMPDIR, "wtfp-desk-empty-"));
|
|
2215
|
-
const host =
|
|
2302
|
+
const host = withPanCodeFacts(await createExtensionTestHost(ROOT, { workspace }), workspace);
|
|
2216
2303
|
try {
|
|
2217
2304
|
const entered = await host.command("desk");
|
|
2218
2305
|
assert.deepEqual(entered.workspace, { enter: "desk" });
|