wtf-p 0.8.1 → 0.8.2
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 +33 -18
- package/bin/lib/adapter-compiler.js +269 -55
- package/package.json +1 -1
- package/protocol/actions/advance.json +232 -0
- package/protocol/actions/plan-revision.json +8 -3
- package/protocol/actions/verify-work.json +6 -2
- package/protocol/aliases.lock.json +1 -0
- package/protocol/catalog.json +4 -2
- package/protocol/project/README.md +2 -0
- package/protocol/roles/research-synthesizer.md +1 -1
- package/protocol/skills/wtfp-manage-project/SKILL.md +2 -1
- package/protocol/skills/wtfp-manage-project/references/actions.md +13 -1
- package/protocol/skills/wtfp-plan-section/references/actions.md +1 -1
- package/protocol/skills/wtfp-research-literature/references/actions.md +1 -1
- package/protocol/skills/wtfp-review-manuscript/references/actions.md +2 -1
- package/protocol/workflows/advance.md +38 -0
- package/protocol/workflows/discuss-section.md +1 -1
- package/protocol/workflows/plan-revision.md +3 -3
- package/protocol/workflows/plan-section.md +1 -1
- package/protocol/workflows/research-gap.md +3 -3
- package/protocol/workflows/verify-work.md +4 -2
- package/protocol/workflows/write-section.md +2 -2
- package/vendors/antigravity/.wtfp-generated.json +54 -42
- package/vendors/antigravity/actions/advance.json +232 -0
- package/vendors/antigravity/actions/plan-revision.json +8 -3
- package/vendors/antigravity/actions/verify-work.json +6 -2
- package/vendors/antigravity/agents/wtfp-research-synthesizer.md +1 -1
- package/vendors/antigravity/aliases.lock.json +1 -0
- package/vendors/antigravity/catalog.json +4 -2
- package/vendors/antigravity/compatibility/action-availability.json +13 -1
- package/vendors/antigravity/plugin.json +2 -2
- package/vendors/antigravity/project/README.md +2 -0
- package/vendors/antigravity/roles/research-synthesizer.md +1 -1
- package/vendors/antigravity/rules/wtfp-project-state.md +2 -0
- package/vendors/antigravity/skills/wtfp-add-todo/SKILL.md +0 -2
- package/vendors/antigravity/skills/wtfp-advance/SKILL.md +18 -0
- package/vendors/antigravity/skills/wtfp-checkpoint/SKILL.md +0 -14
- package/vendors/antigravity/skills/wtfp-create-outline/SKILL.md +0 -8
- package/vendors/antigravity/skills/wtfp-create-poster/SKILL.md +1 -6
- package/vendors/antigravity/skills/wtfp-create-slides/SKILL.md +1 -6
- package/vendors/antigravity/skills/wtfp-discuss-section/SKILL.md +1 -5
- package/vendors/antigravity/skills/wtfp-execute-outline/SKILL.md +0 -10
- package/vendors/antigravity/skills/wtfp-help/SKILL.md +1 -1
- package/vendors/antigravity/skills/wtfp-list-assumptions/SKILL.md +1 -10
- package/vendors/antigravity/skills/wtfp-manage-project/SKILL.md +2 -1
- package/vendors/antigravity/skills/wtfp-manage-project/references/actions.md +29 -1
- package/vendors/antigravity/skills/wtfp-pause-writing/SKILL.md +0 -6
- package/vendors/antigravity/skills/wtfp-plan-milestone-gaps/SKILL.md +0 -6
- package/vendors/antigravity/skills/wtfp-plan-revision/SKILL.md +5 -11
- package/vendors/antigravity/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/antigravity/skills/wtfp-polish-prose/SKILL.md +0 -6
- package/vendors/antigravity/skills/wtfp-progress/SKILL.md +1 -22
- package/vendors/antigravity/skills/wtfp-quick/SKILL.md +0 -4
- package/vendors/antigravity/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/antigravity/skills/wtfp-resume-writing/SKILL.md +0 -12
- package/vendors/antigravity/skills/wtfp-review-manuscript/references/actions.md +2 -1
- package/vendors/antigravity/skills/wtfp-review-section/SKILL.md +0 -8
- package/vendors/antigravity/skills/wtfp-submit-milestone/SKILL.md +0 -12
- package/vendors/antigravity/skills/wtfp-verify-work/SKILL.md +6 -4
- package/vendors/antigravity/tools/README.md +1 -1
- package/vendors/antigravity/workflows/advance.md +38 -0
- package/vendors/antigravity/workflows/discuss-section.md +1 -1
- package/vendors/antigravity/workflows/plan-revision.md +3 -3
- package/vendors/antigravity/workflows/plan-section.md +1 -1
- package/vendors/antigravity/workflows/research-gap.md +3 -3
- package/vendors/antigravity/workflows/verify-work.md +4 -2
- package/vendors/antigravity/workflows/write-section.md +2 -2
- package/vendors/claude/.claude-plugin/marketplace.json +2 -2
- package/vendors/claude/.claude-plugin/plugin.json +1 -1
- package/vendors/claude/.wtfp-generated.json +108 -92
- package/vendors/claude/actions/advance.json +232 -0
- package/vendors/claude/actions/plan-revision.json +8 -3
- package/vendors/claude/actions/verify-work.json +6 -2
- package/vendors/claude/agents/wtfp-research-synthesizer.md +1 -1
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-argument-verifier.md +4 -5
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-citation-expert.md +5 -5
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-citation-formatter.md +3 -3
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-coherence-checker.md +6 -7
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-outliner.md +3 -3
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-plan-checker.md +4 -5
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-prose-polisher.md +4 -4
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-research-synthesizer.md +6 -6
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-section-planner.md +3 -3
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-section-reviewer.md +6 -7
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-section-writer.md +3 -3
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/add-todo.md +0 -2
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/advance.md +15 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/analyze-bib.md +4 -8
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/audit-milestone.md +2 -16
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/check-refs.md +4 -8
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/check-todos.md +2 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/checkpoint.md +2 -14
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/create-outline.md +4 -10
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/create-poster.md +3 -6
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/create-slides.md +3 -6
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/discuss-section.md +3 -5
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/execute-outline.md +4 -12
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/export-latex.md +2 -8
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/help.md +4 -1
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/insert-section.md +2 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/list-assumptions.md +1 -10
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/new-paper.md +2 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/pause-writing.md +0 -6
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/plan-milestone-gaps.md +2 -6
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/plan-revision.md +7 -11
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/plan-section.md +5 -15
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/polish-prose.md +4 -8
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/progress.md +3 -22
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/quick.md +4 -6
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/research-gap.md +12 -14
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/resume-writing.md +2 -12
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/review-section.md +4 -10
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/settings.md +2 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/submit-milestone.md +2 -12
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/verify-work.md +8 -4
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/write-section.md +6 -14
- package/vendors/claude/aliases.lock.json +1 -0
- package/vendors/claude/catalog.json +4 -2
- package/vendors/claude/commands/add-todo.md +0 -2
- package/vendors/claude/commands/advance.md +16 -0
- package/vendors/claude/commands/analyze-bib.md +0 -6
- package/vendors/claude/commands/audit-milestone.md +0 -16
- package/vendors/claude/commands/check-refs.md +0 -6
- package/vendors/claude/commands/checkpoint.md +0 -14
- package/vendors/claude/commands/create-outline.md +0 -8
- package/vendors/claude/commands/create-poster.md +1 -6
- package/vendors/claude/commands/create-slides.md +1 -6
- package/vendors/claude/commands/discuss-section.md +1 -5
- package/vendors/claude/commands/execute-outline.md +0 -10
- package/vendors/claude/commands/export-latex.md +0 -8
- package/vendors/claude/commands/help.md +1 -1
- package/vendors/claude/commands/list-assumptions.md +1 -10
- package/vendors/claude/commands/pause-writing.md +0 -6
- package/vendors/claude/commands/plan-milestone-gaps.md +0 -6
- package/vendors/claude/commands/plan-revision.md +5 -11
- package/vendors/claude/commands/plan-section.md +1 -13
- package/vendors/claude/commands/polish-prose.md +0 -6
- package/vendors/claude/commands/progress.md +1 -22
- package/vendors/claude/commands/quick.md +0 -4
- package/vendors/claude/commands/research-gap.md +3 -11
- package/vendors/claude/commands/resume-writing.md +0 -12
- package/vendors/claude/commands/review-section.md +0 -8
- package/vendors/claude/commands/submit-milestone.md +0 -12
- package/vendors/claude/commands/verify-work.md +6 -4
- package/vendors/claude/commands/write-section.md +2 -12
- package/vendors/claude/compatibility/action-availability.json +10 -1
- package/vendors/claude/output-styles/wtfp-academic-writing.md +2 -2
- package/vendors/claude/plugin.json +15 -1
- package/vendors/claude/project/README.md +2 -0
- package/vendors/claude/roles/research-synthesizer.md +1 -1
- package/vendors/claude/skills/wtfp-manage-project/SKILL.md +2 -1
- package/vendors/claude/skills/wtfp-manage-project/references/actions.md +29 -1
- package/vendors/claude/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/claude/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/claude/skills/wtfp-review-manuscript/references/actions.md +2 -1
- package/vendors/claude/tools/README.md +1 -1
- package/vendors/claude/workflows/advance.md +38 -0
- package/vendors/claude/workflows/discuss-section.md +1 -1
- package/vendors/claude/workflows/plan-revision.md +3 -3
- package/vendors/claude/workflows/plan-section.md +1 -1
- package/vendors/claude/workflows/research-gap.md +3 -3
- package/vendors/claude/workflows/verify-work.md +4 -2
- package/vendors/claude/workflows/write-section.md +2 -2
- package/vendors/clio-extension/.wtfp-generated.json +56 -8
- package/vendors/clio-extension/actions/advance.json +232 -0
- package/vendors/clio-extension/actions/plan-revision.json +8 -3
- package/vendors/clio-extension/actions/verify-work.json +6 -2
- package/vendors/clio-extension/clio-coder-extension.yaml +19 -4
- package/vendors/clio-extension/compatibility/action-availability.json +9 -3
- package/vendors/clio-extension/project/templates/checkpoint.json +25 -0
- package/vendors/clio-extension/project/templates/config.json +31 -0
- package/vendors/clio-extension/project/templates/decisions.json +35 -0
- package/vendors/clio-extension/project/templates/evidence.json +18 -0
- package/vendors/clio-extension/project/templates/interaction.json +16 -0
- package/vendors/clio-extension/project/templates/manifest.json +30 -0
- package/vendors/clio-extension/project/templates/outline.json +38 -0
- package/vendors/clio-extension/project/templates/section.json +32 -0
- package/vendors/clio-extension/project/templates/source.json +20 -0
- package/vendors/clio-extension/project/templates/state.json +22 -0
- package/vendors/clio-extension/project/templates/validation.json +32 -0
- package/vendors/clio-extension/runtime/extension.test.ts +656 -6
- package/vendors/clio-extension/runtime/extension.ts +885 -41
- package/vendors/clio-extension/runtime/write-guard.json +66 -0
- package/vendors/codex/plugins/wtfp/.codex-plugin/plugin.json +1 -1
- package/vendors/codex/plugins/wtfp/.wtfp-generated.json +31 -23
- package/vendors/codex/plugins/wtfp/actions/advance.json +232 -0
- package/vendors/codex/plugins/wtfp/actions/plan-revision.json +8 -3
- package/vendors/codex/plugins/wtfp/actions/verify-work.json +6 -2
- package/vendors/codex/plugins/wtfp/agents/wtfp-research-synthesizer.toml +1 -1
- package/vendors/codex/plugins/wtfp/aliases.lock.json +1 -0
- package/vendors/codex/plugins/wtfp/catalog.json +4 -2
- package/vendors/codex/plugins/wtfp/compatibility/action-availability.json +13 -1
- package/vendors/codex/plugins/wtfp/plugin.json +1 -1
- package/vendors/codex/plugins/wtfp/project/README.md +2 -0
- package/vendors/codex/plugins/wtfp/roles/research-synthesizer.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-manage-project/SKILL.md +2 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-manage-project/references/actions.md +29 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-review-manuscript/references/actions.md +2 -1
- package/vendors/codex/plugins/wtfp/tools/README.md +1 -1
- package/vendors/codex/plugins/wtfp/workflows/advance.md +38 -0
- package/vendors/codex/plugins/wtfp/workflows/discuss-section.md +1 -1
- package/vendors/codex/plugins/wtfp/workflows/plan-revision.md +3 -3
- package/vendors/codex/plugins/wtfp/workflows/plan-section.md +1 -1
- package/vendors/codex/plugins/wtfp/workflows/research-gap.md +3 -3
- package/vendors/codex/plugins/wtfp/workflows/verify-work.md +4 -2
- package/vendors/codex/plugins/wtfp/workflows/write-section.md +2 -2
- package/vendors/copilot/.wtfp-generated.json +43 -31
- 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 +55 -43
- package/vendors/copilot/plugins/wtfp/actions/advance.json +232 -0
- package/vendors/copilot/plugins/wtfp/actions/plan-revision.json +8 -3
- package/vendors/copilot/plugins/wtfp/actions/verify-work.json +6 -2
- package/vendors/copilot/plugins/wtfp/agents/wtfp-research-synthesizer.md +1 -1
- package/vendors/copilot/plugins/wtfp/aliases.lock.json +1 -0
- package/vendors/copilot/plugins/wtfp/catalog.json +4 -2
- package/vendors/copilot/plugins/wtfp/commands/wtfp-add-todo.md +0 -2
- package/vendors/copilot/plugins/wtfp/commands/wtfp-advance.md +17 -0
- package/vendors/copilot/plugins/wtfp/commands/wtfp-checkpoint.md +0 -14
- package/vendors/copilot/plugins/wtfp/commands/wtfp-create-outline.md +0 -8
- package/vendors/copilot/plugins/wtfp/commands/wtfp-create-poster.md +1 -6
- package/vendors/copilot/plugins/wtfp/commands/wtfp-create-slides.md +1 -6
- package/vendors/copilot/plugins/wtfp/commands/wtfp-discuss-section.md +1 -5
- package/vendors/copilot/plugins/wtfp/commands/wtfp-execute-outline.md +0 -10
- package/vendors/copilot/plugins/wtfp/commands/wtfp-help.md +1 -1
- package/vendors/copilot/plugins/wtfp/commands/wtfp-list-assumptions.md +1 -10
- package/vendors/copilot/plugins/wtfp/commands/wtfp-pause-writing.md +0 -6
- package/vendors/copilot/plugins/wtfp/commands/wtfp-plan-milestone-gaps.md +0 -6
- package/vendors/copilot/plugins/wtfp/commands/wtfp-plan-revision.md +5 -11
- package/vendors/copilot/plugins/wtfp/commands/wtfp-plan-section.md +1 -13
- package/vendors/copilot/plugins/wtfp/commands/wtfp-polish-prose.md +0 -6
- package/vendors/copilot/plugins/wtfp/commands/wtfp-progress.md +1 -22
- package/vendors/copilot/plugins/wtfp/commands/wtfp-quick.md +0 -4
- package/vendors/copilot/plugins/wtfp/commands/wtfp-resume-writing.md +0 -12
- package/vendors/copilot/plugins/wtfp/commands/wtfp-review-section.md +0 -8
- package/vendors/copilot/plugins/wtfp/commands/wtfp-submit-milestone.md +0 -12
- package/vendors/copilot/plugins/wtfp/commands/wtfp-verify-work.md +6 -4
- package/vendors/copilot/plugins/wtfp/commands/wtfp-write-section.md +2 -12
- package/vendors/copilot/plugins/wtfp/compatibility/action-availability.json +13 -1
- package/vendors/copilot/plugins/wtfp/project/README.md +2 -0
- package/vendors/copilot/plugins/wtfp/roles/research-synthesizer.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-manage-project/SKILL.md +2 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-manage-project/references/actions.md +29 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-review-manuscript/references/actions.md +2 -1
- package/vendors/copilot/plugins/wtfp/tools/README.md +1 -1
- package/vendors/copilot/plugins/wtfp/workflows/advance.md +38 -0
- package/vendors/copilot/plugins/wtfp/workflows/discuss-section.md +1 -1
- package/vendors/copilot/plugins/wtfp/workflows/plan-revision.md +3 -3
- package/vendors/copilot/plugins/wtfp/workflows/plan-section.md +1 -1
- package/vendors/copilot/plugins/wtfp/workflows/research-gap.md +3 -3
- package/vendors/copilot/plugins/wtfp/workflows/verify-work.md +4 -2
- package/vendors/copilot/plugins/wtfp/workflows/write-section.md +2 -2
- package/vendors/copilot/project/.github/agents/wtfp-research-synthesizer.agent.md +1 -1
- package/vendors/copilot/project/.github/prompts/wtfp-add-todo.prompt.md +0 -2
- package/vendors/copilot/project/.github/prompts/wtfp-advance.prompt.md +18 -0
- package/vendors/copilot/project/.github/prompts/wtfp-help.prompt.md +1 -1
- package/vendors/copilot/project/.github/prompts/wtfp-list-assumptions.prompt.md +1 -10
- package/vendors/copilot/project/.github/prompts/wtfp-pause-writing.prompt.md +0 -6
- package/vendors/copilot/project/.github/skills/wtfp-manage-project/SKILL.md +2 -1
- package/vendors/copilot/project/.github/skills/wtfp-manage-project/references/actions.md +25 -1
- package/vendors/copilot/project/.github/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-review-manuscript/references/actions.md +2 -1
- package/vendors/copilot/project/.github/wtfp/actions/advance.json +232 -0
- package/vendors/copilot/project/.github/wtfp/actions/plan-revision.json +8 -3
- package/vendors/copilot/project/.github/wtfp/actions/verify-work.json +6 -2
- package/vendors/copilot/project/.github/wtfp/aliases.lock.json +1 -0
- package/vendors/copilot/project/.github/wtfp/catalog.json +4 -2
- package/vendors/copilot/project/.github/wtfp/compatibility/action-availability.json +14 -1
- package/vendors/copilot/project/.github/wtfp/project/README.md +2 -0
- package/vendors/copilot/project/.github/wtfp/roles/research-synthesizer.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-manage-project/SKILL.md +2 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-manage-project/references/actions.md +13 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-review-manuscript/references/actions.md +2 -1
- package/vendors/copilot/project/.github/wtfp/workflows/advance.md +38 -0
- package/vendors/copilot/project/.github/wtfp/workflows/discuss-section.md +1 -1
- package/vendors/copilot/project/.github/wtfp/workflows/plan-revision.md +3 -3
- package/vendors/copilot/project/.github/wtfp/workflows/plan-section.md +1 -1
- package/vendors/copilot/project/.github/wtfp/workflows/research-gap.md +3 -3
- package/vendors/copilot/project/.github/wtfp/workflows/verify-work.md +4 -2
- package/vendors/copilot/project/.github/wtfp/workflows/write-section.md +2 -2
- package/vendors/copilot/project/README.md +1 -1
- package/vendors/gemini/.wtfp-generated.json +60 -48
- package/vendors/gemini/actions/advance.json +232 -0
- package/vendors/gemini/actions/plan-revision.json +8 -3
- package/vendors/gemini/actions/verify-work.json +6 -2
- package/vendors/gemini/agents/wtfp-research-synthesizer.md +1 -1
- package/vendors/gemini/aliases.lock.json +1 -0
- package/vendors/gemini/catalog.json +4 -2
- package/vendors/gemini/commands/wtfp/add-todo.toml +17 -144
- package/vendors/gemini/commands/wtfp/advance.toml +14 -0
- package/vendors/gemini/commands/wtfp/check-todos.toml +17 -2
- package/vendors/gemini/commands/wtfp/checkpoint.toml +17 -735
- package/vendors/gemini/commands/wtfp/create-outline.toml +2 -431
- package/vendors/gemini/commands/wtfp/create-poster.toml +3 -296
- package/vendors/gemini/commands/wtfp/create-slides.toml +3 -296
- package/vendors/gemini/commands/wtfp/discuss-section.toml +4 -259
- package/vendors/gemini/commands/wtfp/execute-outline.toml +2 -480
- package/vendors/gemini/commands/wtfp/help.toml +7 -3
- package/vendors/gemini/commands/wtfp/insert-section.toml +3 -1
- package/vendors/gemini/commands/wtfp/list-assumptions.toml +4 -510
- package/vendors/gemini/commands/wtfp/map-project.toml +2 -0
- package/vendors/gemini/commands/wtfp/new-paper.toml +2 -0
- package/vendors/gemini/commands/wtfp/pause-writing.toml +17 -309
- package/vendors/gemini/commands/wtfp/plan-milestone-gaps.toml +4 -369
- package/vendors/gemini/commands/wtfp/plan-revision.toml +76 -423
- package/vendors/gemini/commands/wtfp/plan-section.toml +4 -624
- package/vendors/gemini/commands/wtfp/polish-prose.toml +4 -329
- package/vendors/gemini/commands/wtfp/progress.toml +18 -1143
- package/vendors/gemini/commands/wtfp/quick.toml +2 -218
- package/vendors/gemini/commands/wtfp/resume-writing.toml +17 -698
- package/vendors/gemini/commands/wtfp/review-section.toml +4 -410
- package/vendors/gemini/commands/wtfp/settings.toml +17 -2
- package/vendors/gemini/commands/wtfp/submit-milestone.toml +2 -617
- package/vendors/gemini/commands/wtfp/verify-work.toml +123 -53
- package/vendors/gemini/commands/wtfp/write-section.toml +4 -482
- package/vendors/gemini/compatibility/action-availability.json +13 -1
- package/vendors/gemini/gemini-extension.json +1 -1
- package/vendors/gemini/project/README.md +2 -0
- package/vendors/gemini/roles/research-synthesizer.md +1 -1
- package/vendors/gemini/skills/wtfp-manage-project/SKILL.md +2 -1
- package/vendors/gemini/skills/wtfp-manage-project/references/actions.md +29 -1
- package/vendors/gemini/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/gemini/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/gemini/skills/wtfp-review-manuscript/references/actions.md +2 -1
- package/vendors/gemini/tools/README.md +1 -1
- package/vendors/gemini/workflows/advance.md +38 -0
- package/vendors/gemini/workflows/discuss-section.md +1 -1
- package/vendors/gemini/workflows/plan-revision.md +3 -3
- package/vendors/gemini/workflows/plan-section.md +1 -1
- package/vendors/gemini/workflows/research-gap.md +3 -3
- package/vendors/gemini/workflows/verify-work.md +4 -2
- package/vendors/gemini/workflows/write-section.md +2 -2
- package/vendors/opencode/.wtfp-generated.json +59 -47
- package/vendors/opencode/actions/advance.json +232 -0
- package/vendors/opencode/actions/plan-revision.json +8 -3
- package/vendors/opencode/actions/verify-work.json +6 -2
- package/vendors/opencode/agents/wtfp/research-synthesizer.md +1 -1
- package/vendors/opencode/aliases.lock.json +1 -0
- package/vendors/opencode/catalog.json +4 -2
- package/vendors/opencode/commands/wtfp/add-todo.md +17 -144
- package/vendors/opencode/commands/wtfp/advance.md +16 -0
- package/vendors/opencode/commands/wtfp/check-todos.md +17 -2
- package/vendors/opencode/commands/wtfp/checkpoint.md +17 -735
- package/vendors/opencode/commands/wtfp/create-outline.md +2 -431
- package/vendors/opencode/commands/wtfp/create-poster.md +3 -296
- package/vendors/opencode/commands/wtfp/create-slides.md +3 -296
- package/vendors/opencode/commands/wtfp/discuss-section.md +4 -259
- package/vendors/opencode/commands/wtfp/execute-outline.md +2 -480
- package/vendors/opencode/commands/wtfp/help.md +7 -3
- package/vendors/opencode/commands/wtfp/insert-section.md +3 -1
- package/vendors/opencode/commands/wtfp/list-assumptions.md +4 -510
- package/vendors/opencode/commands/wtfp/map-project.md +2 -0
- package/vendors/opencode/commands/wtfp/new-paper.md +2 -0
- package/vendors/opencode/commands/wtfp/pause-writing.md +17 -309
- package/vendors/opencode/commands/wtfp/plan-milestone-gaps.md +4 -369
- package/vendors/opencode/commands/wtfp/plan-revision.md +76 -423
- package/vendors/opencode/commands/wtfp/plan-section.md +4 -624
- package/vendors/opencode/commands/wtfp/polish-prose.md +4 -329
- package/vendors/opencode/commands/wtfp/progress.md +18 -1143
- package/vendors/opencode/commands/wtfp/quick.md +2 -218
- package/vendors/opencode/commands/wtfp/resume-writing.md +17 -698
- package/vendors/opencode/commands/wtfp/review-section.md +4 -410
- package/vendors/opencode/commands/wtfp/settings.md +17 -2
- package/vendors/opencode/commands/wtfp/submit-milestone.md +2 -617
- package/vendors/opencode/commands/wtfp/verify-work.md +123 -53
- package/vendors/opencode/commands/wtfp/write-section.md +4 -482
- package/vendors/opencode/compatibility/action-availability.json +13 -1
- package/vendors/opencode/project/README.md +2 -0
- package/vendors/opencode/roles/research-synthesizer.md +1 -1
- package/vendors/opencode/skills/wtfp-manage-project/SKILL.md +2 -1
- package/vendors/opencode/skills/wtfp-manage-project/references/actions.md +29 -1
- package/vendors/opencode/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/opencode/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/opencode/skills/wtfp-review-manuscript/references/actions.md +2 -1
- package/vendors/opencode/tools/README.md +1 -1
- package/vendors/opencode/workflows/advance.md +38 -0
- package/vendors/opencode/workflows/discuss-section.md +1 -1
- package/vendors/opencode/workflows/plan-revision.md +3 -3
- package/vendors/opencode/workflows/plan-section.md +1 -1
- package/vendors/opencode/workflows/research-gap.md +3 -3
- package/vendors/opencode/workflows/verify-work.md +4 -2
- package/vendors/opencode/workflows/write-section.md +2 -2
- package/vendors/plugin/.wtfp-generated.json +75 -63
- package/vendors/plugin/actions/advance.json +232 -0
- package/vendors/plugin/actions/plan-revision.json +8 -3
- package/vendors/plugin/actions/verify-work.json +6 -2
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-argument-verifier.md +4 -5
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-citation-expert.md +5 -5
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-citation-formatter.md +3 -3
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-coherence-checker.md +6 -7
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-outliner.md +3 -3
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-plan-checker.md +4 -5
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-prose-polisher.md +4 -4
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-research-synthesizer.md +6 -6
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-section-planner.md +3 -3
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-section-reviewer.md +6 -7
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-section-writer.md +3 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/add-todo.md +7 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/advance.md +101 -0
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/analyze-bib.md +11 -19
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/audit-milestone.md +10 -4
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/check-refs.md +12 -6
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/check-todos.md +10 -4
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/checkpoint.md +10 -4
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/create-outline.md +11 -19
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/create-poster.md +18 -13
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/create-slides.md +18 -13
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/discuss-section.md +11 -5
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/execute-outline.md +12 -6
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/export-latex.md +10 -4
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/help.md +4 -1
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/insert-section.md +10 -4
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/list-assumptions.md +15 -17
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/map-project.md +7 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/new-paper.md +10 -4
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/pause-writing.md +7 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-milestone-gaps.md +10 -4
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-revision.md +13 -7
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-section.md +13 -7
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/polish-prose.md +12 -6
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/progress.md +19 -30
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/quick.md +12 -6
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/research-gap.md +20 -10
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/resume-writing.md +10 -4
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/review-section.md +12 -6
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/settings.md +10 -4
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/submit-milestone.md +12 -4
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/verify-work.md +14 -6
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/write-section.md +14 -8
- package/vendors/plugin/aliases.lock.json +1 -0
- package/vendors/plugin/catalog.json +4 -2
- package/vendors/plugin/compatibility/action-availability.json +9 -3
- package/vendors/plugin/plugin.json +15 -1
- package/vendors/plugin/project/README.md +2 -0
- package/vendors/plugin/roles/research-synthesizer.md +1 -1
- package/vendors/plugin/skills/wtfp-manage-project/SKILL.md +2 -1
- package/vendors/plugin/skills/wtfp-manage-project/references/actions.md +13 -1
- package/vendors/plugin/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/plugin/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/plugin/skills/wtfp-review-manuscript/references/actions.md +2 -1
- package/vendors/plugin/tools/README.md +1 -1
- package/vendors/plugin/workflows/advance.md +38 -0
- package/vendors/plugin/workflows/discuss-section.md +1 -1
- package/vendors/plugin/workflows/plan-revision.md +3 -3
- package/vendors/plugin/workflows/plan-section.md +1 -1
- package/vendors/plugin/workflows/research-gap.md +3 -3
- package/vendors/plugin/workflows/verify-work.md +4 -2
- package/vendors/plugin/workflows/write-section.md +2 -2
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import assert from "node:assert/strict";
|
|
11
11
|
import { createHash, createHmac } from "node:crypto";
|
|
12
12
|
import { spawnSync } from "node:child_process";
|
|
13
|
-
import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, readlinkSync, realpathSync, rmSync, statSync, symlinkSync, writeFileSync } from "node:fs";
|
|
13
|
+
import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, readlinkSync, realpathSync, rmSync, statSync, symlinkSync, utimesSync, writeFileSync } from "node:fs";
|
|
14
14
|
import os, { homedir } from "node:os";
|
|
15
15
|
import path from "node:path";
|
|
16
16
|
import { test } from "node:test";
|
|
@@ -162,6 +162,8 @@ function project(): string {
|
|
|
162
162
|
"paper/introduction.md",
|
|
163
163
|
"---\ntitle: Introduction\n---\n# Introduction\n\nShared memory changes the cost of logging [@smith2024]. It's a well-known trade-off.\n\n```c\nint flush = 1;\n```\n",
|
|
164
164
|
);
|
|
165
|
+
// The desk test clock starts at the epoch; the existing draft is a day older than any approval a test gives.
|
|
166
|
+
utimesSync(path.join(workspace, "paper/introduction.md"), new Date(-86_400_000), new Date(-86_400_000));
|
|
165
167
|
return workspace;
|
|
166
168
|
}
|
|
167
169
|
|
|
@@ -388,7 +390,8 @@ function clioPlan(prepared: Json, workspace: string): Json {
|
|
|
388
390
|
|
|
389
391
|
/** A before_tool event as Clio 0.6.3 sends it, unless the test sent its own facts. */
|
|
390
392
|
function withFacts(event: Json, workspace: string): Json {
|
|
391
|
-
|
|
393
|
+
// Clio sends the same landing at after_tool as at before_tool.
|
|
394
|
+
if ((event.point !== "before_tool" && event.point !== "after_tool") || "target" in event || "dispatch" in event) return event;
|
|
392
395
|
const args = (event.args ?? {}) as Json;
|
|
393
396
|
if (event.tool === "dispatch") {
|
|
394
397
|
const prepared = clioPrepare(args);
|
|
@@ -475,6 +478,9 @@ test("record refuses wrong type, id, project and unknown fields without touching
|
|
|
475
478
|
[{ ...section, id: "methods" }, /whose id is introduction/],
|
|
476
479
|
[{ ...section, project_id: "another-project" }, /belongs to project another-project/],
|
|
477
480
|
[{ ...section, surprise: true }, /would not validate: .*unknown property surprise|surprise/],
|
|
481
|
+
// A model fixes what it is told; it is told the missing project_id and every schema error at once.
|
|
482
|
+
[(({ project_id: _omitted, ...rest }) => rest)(section), /needs project_id "desk-test"/],
|
|
483
|
+
[{ ...section, surprise: true, other: 1 }, /would not validate: .*surprise.*; .*other/],
|
|
478
484
|
];
|
|
479
485
|
for (const [record, pattern] of cases) {
|
|
480
486
|
const refused = await host.tool("record", { uri: "project://sections/introduction", record, expect_sha256 });
|
|
@@ -482,6 +488,36 @@ test("record refuses wrong type, id, project and unknown fields without touching
|
|
|
482
488
|
assert.match(refused.text, pattern);
|
|
483
489
|
}
|
|
484
490
|
assert.equal(sha(workspace, ".planning/sections/introduction/section.json"), before);
|
|
491
|
+
// An authored artifact is not a record; the refusal names its file instead of leaving the model to search.
|
|
492
|
+
const artifact = await host.tool("read_record", { uri: "project://sections/introduction/context" });
|
|
493
|
+
assert.match(artifact.text, /authored artifact, not a JSON record; read or write \.planning\/sections\/introduction\/context\.md with the file tools/);
|
|
494
|
+
const plan = await host.tool("read_record", { uri: "project://sections/introduction/plans/initial" });
|
|
495
|
+
assert.match(plan.text, /\.planning\/sections\/introduction\/plans\/initial\.md/);
|
|
496
|
+
// A record that does not exist yet comes with its example, and so does a refused create (live: four calls, one field each).
|
|
497
|
+
const missing = await host.tool("read_record", { uri: "project://sections/methods" });
|
|
498
|
+
assert.match(missing.text, /does not exist yet[\s\S]*A section record looks like this example[\s\S]*"outline_uri"/);
|
|
499
|
+
const bare = await host.tool("record", { uri: "project://sections/methods", record: { schema: "wtfp.project.section/v1", id: "methods", project_id: PROJECT, title: "Methods" } });
|
|
500
|
+
assert.match(bare.text, /would not validate[\s\S]*A section record looks like this example[\s\S]*"word_target"/);
|
|
501
|
+
// A model has no clock: a validation created without executed_at gets the desk's time.
|
|
502
|
+
const unstamped = { schema: "wtfp.project.validation/v1", id: "introduction-stamped", project_id: PROJECT, subject_uri: "project://paper/introduction", validator_role: "section-reviewer", action_id: "review-section", status: "passed", checks: [{ id: "plan-criteria", status: "passed", summary: "Every plan criterion holds.", evidence: ["Stated."] }], issues: [], next_actions: [], effects_applied: [] };
|
|
503
|
+
const stamped = await host.tool("record", { uri: "project://validations/introduction-stamped", record: unstamped });
|
|
504
|
+
assert.equal(stamped.isError, undefined, stamped.text);
|
|
505
|
+
assert.match(String(read(workspace, ".planning/validations/introduction-stamped.json").executed_at), /^\d{4}-\d{2}-\d{2}T/);
|
|
506
|
+
// An invented time, live a few minutes in the future, is replaced too: it ordered a review after the answer it preceded.
|
|
507
|
+
await host.tool("record", { uri: "project://validations/introduction-invented", record: { ...unstamped, id: "introduction-invented", executed_at: "2099-01-01T00:00:00Z" } });
|
|
508
|
+
assert.ok(String(read(workspace, ".planning/validations/introduction-invented.json").executed_at) < "2099", "the desk's time replaces the model's");
|
|
509
|
+
assert.match((await host.tool("read_record", { uri: "project://checkpoints/never-made" })).text, /omit updated_at and created_at, which the desk sets/);
|
|
510
|
+
// Live, a long record closed early and left its last fields beside it; the desk names them.
|
|
511
|
+
const strayFields = await host.tool("record", { uri: "project://validations/stray", record: { schema: "wtfp.project.validation/v1", id: "stray", project_id: PROJECT, subject_uri: "project://paper/introduction", validator_role: "section-reviewer", action_id: "review-section", status: "passed", checks: [{ id: "c", status: "passed", summary: "Holds.", evidence: ["Stated."] }] }, issues: [], next_actions: [], effects_applied: [] });
|
|
512
|
+
assert.equal(strayFields.isError, undefined, strayFields.text);
|
|
513
|
+
assert.match(strayFields.text, /^issues, next_actions, effects_applied arrived beside record and were moved inside it/);
|
|
514
|
+
assert.deepEqual(read(workspace, ".planning/validations/stray.json").next_actions, []);
|
|
515
|
+
const notFields = await host.tool("record", { uri: "project://validations/stray-2", record: { schema: "wtfp.project.validation/v1" }, surprise: 1 });
|
|
516
|
+
assert.match(notFields.text, /surprise is not a record tool argument/);
|
|
517
|
+
const update = await host.tool("record", { uri: "project://sections/introduction", record: { ...section, surprise: true }, expect_sha256 });
|
|
518
|
+
assert.doesNotMatch(update.text, /looks like this example/, "an update is refused without the example");
|
|
519
|
+
const snake = await host.tool("read_record", { uri: "project://checkpoints/confirm_outline" });
|
|
520
|
+
assert.match(snake.text, /invalid id; record ids are lowercase .* such as confirm-outline/);
|
|
485
521
|
}));
|
|
486
522
|
|
|
487
523
|
test("no record write or file write escapes through a symbolic link", () =>
|
|
@@ -781,6 +817,125 @@ test("literature-heavy sections wait for verified evidence behind their required
|
|
|
781
817
|
assert.match((await host.command("validate")).text, /manuscript-unread project:\/\/sections\/introduction: project:\/\/materials\/notes could not be checked/);
|
|
782
818
|
}, SERVED));
|
|
783
819
|
|
|
820
|
+
test("an author's note on a gate answer reaches the next step, and typed text asks again instead of answering", () =>
|
|
821
|
+
withDesk(async (host, workspace) => {
|
|
822
|
+
await answer(host, GATE, "protocol-first");
|
|
823
|
+
// Free text names no option: the same gate comes back with how to attach the text, and nothing is recorded.
|
|
824
|
+
const key = await ask(host, PLAN_GATE);
|
|
825
|
+
const typed = await host.interview({ id: "gate-one", step: key, nav: "next", answers: { choice: "Split the claim in two." }, other: { choice: true } } as never);
|
|
826
|
+
assert.ok(!("done" in typed), "the gate is asked again");
|
|
827
|
+
assert.match(JSON.stringify(typed.step.intro), /attach your text to it with \[n\] note/);
|
|
828
|
+
assert.equal((read(workspace, `.planning/checkpoints/${PLAN_GATE}.json`) as Json).status, "pending");
|
|
829
|
+
// An option with a note records both; the note is the author's own, inside the sealed answer's checkpoint.
|
|
830
|
+
const done = await host.interview({ id: "gate-one", step: typed.step.key, nav: "next", answers: { choice: "revise" }, notes: { choice: "Split the claim\nin two." } } as never);
|
|
831
|
+
assert.ok("done" in done, JSON.stringify(done));
|
|
832
|
+
const resolved = read(workspace, `.planning/checkpoints/${PLAN_GATE}.json`);
|
|
833
|
+
assert.equal((resolved.resolution as Json).selected_option, "revise");
|
|
834
|
+
assert.match(String((resolved.resolution as Json).summary), /The author's note: Split the claim in two\.$/);
|
|
835
|
+
const ready = await host.tool("readiness", { section: "introduction" });
|
|
836
|
+
assert.match(ready.text, /not approve, with this note for the next plan: Split the claim in two\./);
|
|
837
|
+
}, SERVED));
|
|
838
|
+
|
|
839
|
+
test("a complete draft goes to submit-milestone on a fresh audit with no errors, and back to audit after any later write", () =>
|
|
840
|
+
withDesk(async (host, workspace) => {
|
|
841
|
+
await answer(host, GATE, "protocol-first");
|
|
842
|
+
await answer(host, PLAN_GATE, "approve");
|
|
843
|
+
put(workspace, ".planning/sections/introduction/section.json", { ...read(workspace, ".planning/sections/introduction/section.json"), status: "complete" });
|
|
844
|
+
const nextOf = async () => (((await host.tool("status", {})).data as Json).next as Json).action;
|
|
845
|
+
assert.equal(await nextOf(), "audit-milestone");
|
|
846
|
+
const audit = { schema: "wtfp.project.validation/v1", id: "milestone-audit-01", project_id: PROJECT, subject_uri: "project://state", validator_role: "coherence-checker", action_id: "audit-milestone", status: "issues-found", checks: [{ id: "readiness", status: "passed", summary: "Every section is complete.", evidence: ["Stated."] }], issues: [{ severity: "warning", summary: "One source is metadata-only." }], next_actions: [], effects_applied: [], executed_at: AT };
|
|
847
|
+
put(workspace, ".planning/validations/milestone-audit-01.json", audit);
|
|
848
|
+
assert.equal(await nextOf(), "submit-milestone", "warnings alone do not hold delivery");
|
|
849
|
+
put(workspace, ".planning/validations/milestone-audit-01.json", { ...audit, issues: [{ severity: "error", summary: "A citation does not resolve." }] });
|
|
850
|
+
assert.equal(await nextOf(), "plan-milestone-gaps");
|
|
851
|
+
put(workspace, ".planning/validations/milestone-audit-01.json", audit);
|
|
852
|
+
// A passed submission delivers the draft; an audit after it keeps it delivered.
|
|
853
|
+
put(workspace, ".planning/validations/milestone-01.json", { ...audit, id: "milestone-01", action_id: "submit-milestone", status: "passed", issues: [] });
|
|
854
|
+
put(workspace, ".planning/validations/milestone-audit-02.json", { ...audit, id: "milestone-audit-02" });
|
|
855
|
+
assert.equal(await nextOf(), null, "delivered");
|
|
856
|
+
assert.match(String(((((await host.tool("status", {})).data as Json).next as Json).reason)), /^Delivered/);
|
|
857
|
+
const later = Date.now() / 1000 + 60;
|
|
858
|
+
utimesSync(path.join(workspace, "paper/introduction.md"), later, later);
|
|
859
|
+
assert.equal(await nextOf(), "audit-milestone", "an audit of an earlier draft does not stand for this one");
|
|
860
|
+
}, SERVED));
|
|
861
|
+
|
|
862
|
+
test("submit-milestone archives the whole project once, by digest, and nothing else may", () =>
|
|
863
|
+
withDesk(async (host, workspace) => {
|
|
864
|
+
const refused = await host.tool("archive", { archive: "draft-01" });
|
|
865
|
+
assert.match(refused.text, /nothing armed does not declare archiving project:\/\/archives\/draft-01/);
|
|
866
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:submit-milestone" });
|
|
867
|
+
const made = await host.tool("archive", { archive: "draft-01" });
|
|
868
|
+
assert.equal(made.isError, undefined, made.text);
|
|
869
|
+
const manifest = read(workspace, ".planning/archives/draft-01/manifest.json");
|
|
870
|
+
const files = manifest.files as Array<{ path: string; sha256: string }>;
|
|
871
|
+
assert.ok(files.some((file) => file.path === ".planning/project.json") && files.some((file) => file.path === "paper/introduction.md"));
|
|
872
|
+
for (const file of files) assert.equal(sha(workspace, `.planning/archives/draft-01/${file.path}`), file.sha256, file.path);
|
|
873
|
+
assert.match((await host.tool("archive", { archive: "draft-01" })).text, /already exists, and an archive is immutable/);
|
|
874
|
+
const again = await host.tool("archive", { archive: "draft-02" });
|
|
875
|
+
assert.ok(!(read(workspace, ".planning/archives/draft-02/manifest.json").files as Array<{ path: string }>).some((file) => file.path.startsWith(".planning/archives/")), again.text);
|
|
876
|
+
}, { id: "wtfp", prompts: [...SERVED.prompts, "wtfp:submit-milestone"] }));
|
|
877
|
+
|
|
878
|
+
test("the author's approval links the plan it approves, in the same commit", () =>
|
|
879
|
+
withDesk(async (host, workspace) => {
|
|
880
|
+
const section = read(workspace, ".planning/sections/introduction/section.json");
|
|
881
|
+
put(workspace, ".planning/sections/introduction/section.json", { ...section, status: "not-started", artifacts: { ...(section.artifacts as Json), plans: [] } });
|
|
882
|
+
await answer(host, GATE, "protocol-first");
|
|
883
|
+
assert.match(await answer(host, PLAN_GATE, "approve"), /The desk linked project:\/\/sections\/introduction\/plans\/initial in project:\/\/sections\/introduction with this answer; do not link it again\. The desk wrote project:\/\/checkpoints\/approve-initial, project:\/\/state, project:\/\/sections\/introduction; read any of them again before writing it/);
|
|
884
|
+
const linked = read(workspace, ".planning/sections/introduction/section.json");
|
|
885
|
+
assert.deepEqual((linked.artifacts as Json).plans, [PLAN_URI]);
|
|
886
|
+
assert.equal(linked.status, "planned");
|
|
887
|
+
assert.equal(((await host.tool("readiness", { section: "introduction" })).data as Json).ready, true);
|
|
888
|
+
}, SERVED));
|
|
889
|
+
|
|
890
|
+
test("a family URI reads every record of that family in one call, and names what it leaves out", () =>
|
|
891
|
+
withDesk(async (host, workspace) => {
|
|
892
|
+
const source = (id: string, title: string) => ({
|
|
893
|
+
schema: "wtfp.project.source/v1", id, project_id: PROJECT, kind: "journal-article", title, creators: ["A. Author"], year: 2025,
|
|
894
|
+
identifiers: { doi: `10.1234/${id}` }, citation_key: id.replace(/-/gu, ""), status: "verified",
|
|
895
|
+
provenance: { discovered_via: "scholarly-index", inspection_depth: "full-text", verified_at: AT },
|
|
896
|
+
});
|
|
897
|
+
const empty = await host.tool("read_record", { uri: "project://sources" });
|
|
898
|
+
assert.match(empty.text, /project:\/\/sources holds no records yet/);
|
|
899
|
+
put(workspace, ".planning/sources/source-a.json", source("source-a", "A"));
|
|
900
|
+
put(workspace, ".planning/sources/source-b.json", source("source-b", "B"));
|
|
901
|
+
const both = await host.tool("read_record", { uri: "project://sources/*" });
|
|
902
|
+
assert.match(both.text, /holds 2 records; 2 returned in full/);
|
|
903
|
+
const records = (both.data as Json).records as Json[];
|
|
904
|
+
assert.deepEqual(records.map((entry) => (entry.record as Json).id), ["source-a", "source-b"]);
|
|
905
|
+
assert.equal(records[0]?.sha256, (await host.tool("read_record", { uri: "project://sources/source-a" }) as { data: Json }).data.sha256);
|
|
906
|
+
// A family past the read's budget returns what fits and names the rest.
|
|
907
|
+
put(workspace, ".planning/sources/source-c.json", source("source-c", "C".repeat(60 * 1024)));
|
|
908
|
+
const capped = await host.tool("read_record", { uri: "project://sources" });
|
|
909
|
+
assert.deepEqual((capped.data as Json).omitted, ["source-c"]);
|
|
910
|
+
assert.match(capped.text, /1 more not returned, to keep this read small; read the next page with project:\/\/sources\?after=source-b/);
|
|
911
|
+
const next = await host.tool("read_record", { uri: "project://sources?after=source-b" });
|
|
912
|
+
assert.deepEqual(((next.data as Json).records as Json[]).map((entry) => (entry.record as Json).id), ["source-c"]);
|
|
913
|
+
// Sections are a family too, read from each section's own directory.
|
|
914
|
+
const sections = await host.tool("read_record", { uri: "project://sections" });
|
|
915
|
+
assert.deepEqual(((sections.data as Json).records as Json[]).map((entry) => entry.uri), ["project://sections/introduction"]);
|
|
916
|
+
}, SERVED));
|
|
917
|
+
|
|
918
|
+
test("a literature-heavy section that records no claim needing evidence is not covered", () =>
|
|
919
|
+
withDesk(async (host, workspace) => {
|
|
920
|
+
const outline = read(workspace, ".planning/structure/outline.json");
|
|
921
|
+
const [entry] = outline.sections as Json[];
|
|
922
|
+
put(workspace, ".planning/structure/outline.json", { ...outline, sections: [{ ...entry, research: { required: true, topics: ["logging"] } }] });
|
|
923
|
+
await answer(host, GATE, "protocol-first");
|
|
924
|
+
await answer(host, PLAN_GATE, "approve");
|
|
925
|
+
const ready = await host.tool("readiness", { section: "introduction" });
|
|
926
|
+
assert.equal((ready.data as Json).ready, false, "no claims means nothing shows the sources cover it");
|
|
927
|
+
assert.match(ready.text, /records no claim that needs evidence.*run research-gap first/);
|
|
928
|
+
assert.match(blocked(await write(host, "paper/introduction.md")) ?? "", /research-gap/);
|
|
929
|
+
// A rejected claim, or one that needs no evidence, covers nothing either.
|
|
930
|
+
const section = read(workspace, ".planning/sections/introduction/section.json");
|
|
931
|
+
const claim = { id: "claim-flush", statement: "Flushes dominate logging cost.", status: "rejected", evidence_required: true, evidence_uris: [] };
|
|
932
|
+
put(workspace, ".planning/sections/introduction/section.json", { ...section, claims: [claim, { ...claim, id: "claim-scope", status: "planned", evidence_required: false }] });
|
|
933
|
+
assert.equal(((await host.tool("readiness", { section: "introduction" })).data as Json).ready, false);
|
|
934
|
+
// Turning research off is the author's way to draft without it.
|
|
935
|
+
put(workspace, ".planning/structure/outline.json", { ...outline, sections: [{ ...entry, research: { required: false, topics: [] } }] });
|
|
936
|
+
assert.equal(((await host.tool("readiness", { section: "introduction" })).data as Json).ready, true);
|
|
937
|
+
}, SERVED));
|
|
938
|
+
|
|
784
939
|
test("a section file counts only for the section whose id names its directory", () =>
|
|
785
940
|
withDesk(async (host, workspace) => {
|
|
786
941
|
const outline = read(workspace, ".planning/structure/outline.json");
|
|
@@ -848,6 +1003,470 @@ test("an armed action writes only what its contract declares, for the section it
|
|
|
848
1003
|
assert.match(blocked(await write(host, ".planning/sections/introduction/notes.md")) ?? "", /declares no file outputs/);
|
|
849
1004
|
}, SERVED));
|
|
850
1005
|
|
|
1006
|
+
// --- the advance driver ------------------------------------------------------------
|
|
1007
|
+
// `/wtfp:advance` runs one long turn. The desk, never the model, picks each step
|
|
1008
|
+
// by the progress ladder and arms the write guard for that action alone; a gate
|
|
1009
|
+
// stops the run until the author answers it at the desk.
|
|
1010
|
+
|
|
1011
|
+
const DRIVEN_PLUGIN = {
|
|
1012
|
+
id: "wtfp",
|
|
1013
|
+
prompts: [...SERVED.prompts, "wtfp:advance", "wtfp:review-section", "wtfp:discuss-section", "wtfp:create-outline", "wtfp:verify-work", "wtfp:plan-revision"],
|
|
1014
|
+
};
|
|
1015
|
+
/** Stamps the manuscript as written `offsetMs` from the desk's clock, after or before the plan's approval. */
|
|
1016
|
+
const drafted = (host: Host, workspace: string, offsetMs: number): void => {
|
|
1017
|
+
const at = new Date(host.now + offsetMs);
|
|
1018
|
+
utimesSync(path.join(workspace, "paper/introduction.md"), at, at);
|
|
1019
|
+
};
|
|
1020
|
+
const nextStep = async (host: Host): Promise<{ text: string; data: Json; isError?: boolean }> => {
|
|
1021
|
+
const result = await host.tool("next_step", {});
|
|
1022
|
+
return { text: result.text, data: (result.data ?? {}) as Json, ...(result.isError ? { isError: true } : {}) };
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
test("only an advance turn may ask the desk for a step, and the turn's end ends the run", () =>
|
|
1026
|
+
withDesk(async (host) => {
|
|
1027
|
+
assert.equal((await nextStep(host)).isError, true, "no drive outside an advance turn");
|
|
1028
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:write-section introduction" });
|
|
1029
|
+
assert.equal((await nextStep(host)).isError, true, "an ordinary action cannot drive");
|
|
1030
|
+
const armed = await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1031
|
+
assert.match(JSON.stringify(armed.effects), /WTF-P driver armed/);
|
|
1032
|
+
assert.match(blocked(await write(host, "paper/introduction.md")) ?? "", /nothing is armed between \/wtfp:advance steps.*Call extension_wtfp__next_step/, "nothing is writable before the desk arms a step, and the refusal says how to get one");
|
|
1033
|
+
assert.equal((await nextStep(host)).data.kind, "gate");
|
|
1034
|
+
await host.observe({ event: "turn_end", turnId: "t1", outcome: "completed", usage: null });
|
|
1035
|
+
assert.equal((await nextStep(host)).isError, true, "the drive ends with its turn");
|
|
1036
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1037
|
+
// Clio continuing the turn after its tool budget or loop guard resumes the drive the turn had.
|
|
1038
|
+
assert.equal((await nextStep(host)).data.kind, "gate");
|
|
1039
|
+
await host.observe({ event: "turn_end", turnId: "t2", outcome: "completed", usage: null });
|
|
1040
|
+
assert.equal((await nextStep(host)).isError, true, "between turns nothing drives");
|
|
1041
|
+
await host.hook({ point: "prompt_submit", text: "Continue.", origin: "continuation", continuation: { index: 1, cap: 3 } } as never);
|
|
1042
|
+
const resumed = await nextStep(host);
|
|
1043
|
+
assert.notEqual(resumed.isError, true, resumed.text);
|
|
1044
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:progress" });
|
|
1045
|
+
assert.equal((await nextStep(host)).isError, true, "any other prompt ends the drive");
|
|
1046
|
+
await host.observe({ event: "turn_end", turnId: "t3", outcome: "completed", usage: null });
|
|
1047
|
+
await host.hook({ point: "prompt_submit", text: "Continue.", origin: "continuation", continuation: { index: 1, cap: 3 } } as never);
|
|
1048
|
+
assert.equal((await nextStep(host)).isError, true, "a continuation resumes only the drive its own turn had");
|
|
1049
|
+
}, DRIVEN_PLUGIN));
|
|
1050
|
+
|
|
1051
|
+
test("advance puts each gate to the author, then arms exactly the step the ladder names", () =>
|
|
1052
|
+
withDesk(async (host, workspace) => {
|
|
1053
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1054
|
+
// The desk names the gates in its own order; each is answered as the author would.
|
|
1055
|
+
const choices: Record<string, string> = { [GATE]: "protocol-first", [PLAN_GATE]: "approve" };
|
|
1056
|
+
const asked: string[] = [];
|
|
1057
|
+
for (let round = 0; round < 2; round += 1) {
|
|
1058
|
+
const gate = await nextStep(host);
|
|
1059
|
+
assert.equal(gate.data.kind, "gate", gate.text);
|
|
1060
|
+
asked.push(gate.data.checkpoint as string);
|
|
1061
|
+
assert.match(blocked(await write(host, "paper/introduction.md")) ?? "", /nothing is armed between \/wtfp:advance steps/, "a gate leaves nothing armed");
|
|
1062
|
+
await answer(host, gate.data.checkpoint as string, choices[gate.data.checkpoint as string] as string);
|
|
1063
|
+
}
|
|
1064
|
+
assert.deepEqual(asked.sort(), [GATE, PLAN_GATE].sort());
|
|
1065
|
+
const step = await nextStep(host);
|
|
1066
|
+
assert.deepEqual([step.data.kind, step.data.action, step.data.section, step.data.prompt], ["step", "write-section", "introduction", "ai.iowarp.clio/prompts/wtfp/write-section.md"]);
|
|
1067
|
+
assert.match(step.text, /armed for write-section introduction only/);
|
|
1068
|
+
assert.equal(blocked(await write(host, "paper/introduction.md")), null, "the armed step may write its manuscript");
|
|
1069
|
+
assert.ok(blocked(await write(host, ".planning/sections/introduction/plans/second.md")), "but nothing write-section does not declare");
|
|
1070
|
+
const outline = read(workspace, ".planning/structure/outline.json");
|
|
1071
|
+
const undeclared = await host.tool("record", { uri: "project://structure/outline", record: { ...outline, thesis: "Changed." }, expect_revision: 1 });
|
|
1072
|
+
assert.match(undeclared.text, /write-section does not declare updating project:\/\/structure\/outline/);
|
|
1073
|
+
// The drafted section moves to review, and the desk arms the review next, not the draft.
|
|
1074
|
+
drafted(host, workspace, 60_000);
|
|
1075
|
+
put(workspace, ".planning/sections/introduction/section.json", { ...read(workspace, ".planning/sections/introduction/section.json"), status: "reviewing" });
|
|
1076
|
+
const review = await nextStep(host);
|
|
1077
|
+
assert.deepEqual([review.data.kind, review.data.action, review.data.section], ["step", "review-section", "introduction"]);
|
|
1078
|
+
assert.ok(blocked(await write(host, "paper/introduction.md")), "the review step may not touch the manuscript the draft step could");
|
|
1079
|
+
// A step that changed nothing the ladder reads is handed back once to record its outputs, then not run again.
|
|
1080
|
+
const finish = await nextStep(host);
|
|
1081
|
+
assert.deepEqual([finish.data.kind, finish.data.action, finish.data.finish], ["step", "review-section", true]);
|
|
1082
|
+
assert.match(finish.text, /Continue \/wtfp:review-section introduction; it has not failed\. It recorded nothing.*project:\/\/sections\/introduction\/reviews\/\{review\}/);
|
|
1083
|
+
const again = await nextStep(host);
|
|
1084
|
+
assert.equal(again.data.kind, "stop");
|
|
1085
|
+
assert.match(again.text, /changed nothing/);
|
|
1086
|
+
assert.match(blocked(await write(host, "paper/introduction.md")) ?? "", /nothing is armed between \/wtfp:advance steps/, "a stop disarms the last step");
|
|
1087
|
+
}, DRIVEN_PLUGIN));
|
|
1088
|
+
|
|
1089
|
+
test("every next_step result restates the driver rule, so a compacted turn can continue from the last result alone", () =>
|
|
1090
|
+
withDesk(async (host) => {
|
|
1091
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1092
|
+
const ruleOf = (text: string): string => /Driver rule for this \/wtfp:advance run: .*$/u.exec(text)?.[0] ?? "";
|
|
1093
|
+
const gate = await nextStep(host);
|
|
1094
|
+
assert.equal(gate.data.kind, "gate");
|
|
1095
|
+
assert.match(gate.text, new RegExp(`Call extension_wtfp__gate with checkpoint ${gate.data.checkpoint as string}\\.`));
|
|
1096
|
+
const rule = ruleOf(gate.text);
|
|
1097
|
+
assert.match(rule, /the desk, not you, picks every step/);
|
|
1098
|
+
assert.match(rule, /call extension_wtfp__next_step/);
|
|
1099
|
+
assert.match(rule, /call extension_wtfp__gate with the checkpoint it names and then extension_wtfp__next_step/);
|
|
1100
|
+
assert.match(rule, /on a stop, a failed step or a refused call report the steps taken and end the turn/);
|
|
1101
|
+
await answer(host, GATE, "protocol-first");
|
|
1102
|
+
await answer(host, PLAN_GATE, "approve");
|
|
1103
|
+
const step = await nextStep(host);
|
|
1104
|
+
assert.equal(step.data.kind, "step");
|
|
1105
|
+
assert.match(step.text, /^Step 1: \/wtfp:write-section introduction\./);
|
|
1106
|
+
assert.match(step.text, /Read and follow <plugin root>\/ai\.iowarp\.clio\/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/);
|
|
1107
|
+
assert.match(step.text, /invocation input introduction/);
|
|
1108
|
+
assert.equal(ruleOf(step.text), rule);
|
|
1109
|
+
const finish = await nextStep(host);
|
|
1110
|
+
assert.equal(finish.data.finish, true);
|
|
1111
|
+
assert.equal(ruleOf(finish.text), rule);
|
|
1112
|
+
const stop = await nextStep(host);
|
|
1113
|
+
assert.equal(stop.data.kind, "stop");
|
|
1114
|
+
assert.equal(ruleOf(stop.text), rule);
|
|
1115
|
+
}, DRIVEN_PLUGIN));
|
|
1116
|
+
|
|
1117
|
+
test("a gate the author keeps pending, or that no author can answer, stops the run with the gate open", () =>
|
|
1118
|
+
withDesk(async (host, workspace) => {
|
|
1119
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1120
|
+
const first = (await nextStep(host)).data.checkpoint as string;
|
|
1121
|
+
assert.ok([GATE, PLAN_GATE].includes(first));
|
|
1122
|
+
await answer(host, first, "__keep");
|
|
1123
|
+
const kept = await nextStep(host);
|
|
1124
|
+
assert.equal(kept.data.kind, "stop");
|
|
1125
|
+
assert.match(kept.text, new RegExp(`${first} is still waiting on you`));
|
|
1126
|
+
assert.equal((read(workspace, `.planning/checkpoints/${first}.json`) as Json).status, "pending");
|
|
1127
|
+
await host.observe({ event: "turn_end", turnId: "t1", outcome: "completed", usage: null });
|
|
1128
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1129
|
+
assert.equal((await nextStep(host)).data.checkpoint, first, "a new run asks the kept gate again");
|
|
1130
|
+
const recorded = interactions(workspace).length;
|
|
1131
|
+
const key = await ask(host, first);
|
|
1132
|
+
await host.interview({ id: "gate-one", step: key, nav: "cancel", answers: {}, reason: "headless" });
|
|
1133
|
+
const headless = await nextStep(host);
|
|
1134
|
+
assert.equal(headless.data.kind, "stop");
|
|
1135
|
+
assert.equal((read(workspace, `.planning/checkpoints/${first}.json`) as Json).status, "pending");
|
|
1136
|
+
assert.equal(interactions(workspace).length, recorded, "no answer was recorded for an author who was never asked");
|
|
1137
|
+
}, DRIVEN_PLUGIN));
|
|
1138
|
+
|
|
1139
|
+
test("advance never starts a project and never runs an action the plugin does not serve", () =>
|
|
1140
|
+
withDesk(async (host, workspace) => {
|
|
1141
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1142
|
+
await answer(host, GATE, "protocol-first");
|
|
1143
|
+
await answer(host, PLAN_GATE, "approve");
|
|
1144
|
+
// write-section is next, but this plugin serves only advance.
|
|
1145
|
+
const unserved = await nextStep(host);
|
|
1146
|
+
assert.equal(unserved.data.kind, "stop");
|
|
1147
|
+
assert.match(unserved.text, /needs the WTF-P plugin/);
|
|
1148
|
+
rmSync(path.join(workspace, ".planning"), { recursive: true, force: true });
|
|
1149
|
+
const empty = await nextStep(host);
|
|
1150
|
+
assert.equal(empty.data.kind, "stop");
|
|
1151
|
+
assert.match(empty.text, /never starts one/);
|
|
1152
|
+
}, { id: "wtfp", prompts: ["wtfp:advance"] }));
|
|
1153
|
+
|
|
1154
|
+
test("advance creates the section records an outline lists before any section step", () =>
|
|
1155
|
+
withDesk(async (host, workspace) => {
|
|
1156
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1157
|
+
await answer(host, GATE, "protocol-first");
|
|
1158
|
+
await answer(host, PLAN_GATE, "approve");
|
|
1159
|
+
// new-paper leaves an outline with no section records; only create-outline may create one.
|
|
1160
|
+
rmSync(path.join(workspace, ".planning/sections/introduction/section.json"));
|
|
1161
|
+
const step = await nextStep(host);
|
|
1162
|
+
assert.deepEqual([step.data.kind, step.data.action, step.data.section], ["step", "create-outline", null], step.text);
|
|
1163
|
+
assert.match(step.text, /lists introduction without a section record/);
|
|
1164
|
+
}, DRIVEN_PLUGIN));
|
|
1165
|
+
|
|
1166
|
+
test("after review the author accepts a section or sends it back, and advance follows the sealed answer", () =>
|
|
1167
|
+
withDesk(async (host, workspace) => {
|
|
1168
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1169
|
+
await answer(host, GATE, "protocol-first");
|
|
1170
|
+
await answer(host, PLAN_GATE, "approve");
|
|
1171
|
+
drafted(host, workspace, 60_000);
|
|
1172
|
+
const sectionFile = ".planning/sections/introduction/section.json";
|
|
1173
|
+
const validation = (id: string, action: string, at: string): Json => ({
|
|
1174
|
+
schema: "wtfp.project.validation/v1",
|
|
1175
|
+
id,
|
|
1176
|
+
project_id: PROJECT,
|
|
1177
|
+
subject_uri: "project://paper/introduction",
|
|
1178
|
+
validator_role: action === "review-section" ? "section-reviewer" : "author",
|
|
1179
|
+
action_id: action,
|
|
1180
|
+
status: "passed",
|
|
1181
|
+
checks: [{ id: "plan-criteria", status: "passed", summary: "Every plan criterion holds.", evidence: ["The bottleneck and contribution are stated."] }],
|
|
1182
|
+
issues: [],
|
|
1183
|
+
next_actions: [],
|
|
1184
|
+
effects_applied: [],
|
|
1185
|
+
executed_at: at,
|
|
1186
|
+
});
|
|
1187
|
+
put(workspace, sectionFile, { ...read(workspace, sectionFile), status: "reviewing" });
|
|
1188
|
+
put(workspace, ".planning/validations/introduction-review.json", validation("introduction-review", "review-section", "2026-09-01T10:00:00Z"));
|
|
1189
|
+
// Review is critique only; the author's acceptance is verify-work's.
|
|
1190
|
+
const verify = await nextStep(host);
|
|
1191
|
+
assert.deepEqual([verify.data.kind, verify.data.action, verify.data.section], ["step", "verify-work", "introduction"], verify.text);
|
|
1192
|
+
assert.match(verify.text, /is reviewed; the author checks it against its plan/);
|
|
1193
|
+
put(workspace, ".planning/validations/introduction-verified.json", validation("introduction-verified", "verify-work", "2026-09-01T11:00:00Z"));
|
|
1194
|
+
put(workspace, ".planning/checkpoints/accept-introduction.json", {
|
|
1195
|
+
schema: "wtfp.project.checkpoint/v1",
|
|
1196
|
+
id: "accept-introduction",
|
|
1197
|
+
project_id: PROJECT,
|
|
1198
|
+
kind: "decision",
|
|
1199
|
+
status: "pending",
|
|
1200
|
+
blocking: true,
|
|
1201
|
+
scope_uri: "project://validations/introduction-verified",
|
|
1202
|
+
request: "Accept the introduction as written?",
|
|
1203
|
+
options: [
|
|
1204
|
+
{ id: "accept", label: "Revise", implication: "A checkpoint may label its options as it likes." },
|
|
1205
|
+
{ id: "revise", label: "Accept", implication: "The desk's own words decide what reads as acceptance." },
|
|
1206
|
+
],
|
|
1207
|
+
resume_action: "verify-work",
|
|
1208
|
+
created_at: "2026-09-01T11:00:00Z",
|
|
1209
|
+
});
|
|
1210
|
+
const gate = await nextStep(host);
|
|
1211
|
+
assert.deepEqual([gate.data.kind, gate.data.checkpoint], ["gate", "accept-introduction"], gate.text);
|
|
1212
|
+
const asked = await host.tool("gate", { checkpoint: "accept-introduction" });
|
|
1213
|
+
const options = asked.interview?.step.questions[0]?.options ?? [];
|
|
1214
|
+
assert.match(options.find((option) => option.value === "accept")?.label ?? "", /^Accept this section as written/);
|
|
1215
|
+
assert.ok(!options.some((option) => option.value !== "accept" && /^accept/iu.test(option.label)), "no other option may read as acceptance");
|
|
1216
|
+
await host.interview({ id: "gate-one", step: asked.interview?.step.key as string, nav: "next", answers: { choice: "revise" } });
|
|
1217
|
+
const revise = await nextStep(host);
|
|
1218
|
+
assert.deepEqual([revise.data.kind, revise.data.action, revise.data.section], ["step", "plan-revision", "introduction"], revise.text);
|
|
1219
|
+
// A later review supersedes that verification, so the author is asked again.
|
|
1220
|
+
put(workspace, ".planning/validations/introduction-review-2.json", validation("introduction-review-2", "review-section", "2026-09-01T12:00:00Z"));
|
|
1221
|
+
const again = await nextStep(host);
|
|
1222
|
+
assert.deepEqual([again.data.action, again.data.section], ["verify-work", "introduction"], again.text);
|
|
1223
|
+
assert.match(again.text, /is reviewed; the author checks it against its plan/);
|
|
1224
|
+
}, DRIVEN_PLUGIN));
|
|
1225
|
+
|
|
1226
|
+
test("a reviewed section whose approved revision plan no draft has applied goes back to write-section", () =>
|
|
1227
|
+
withDesk(async (host, workspace) => {
|
|
1228
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1229
|
+
await answer(host, GATE, "protocol-first");
|
|
1230
|
+
// The draft predates the plan the author approves now: live, plan-02 was approved and advance armed review again.
|
|
1231
|
+
await host.advance(7_200_000);
|
|
1232
|
+
drafted(host, workspace, -3_600_000);
|
|
1233
|
+
await answer(host, PLAN_GATE, "approve");
|
|
1234
|
+
const sectionFile = ".planning/sections/introduction/section.json";
|
|
1235
|
+
put(workspace, sectionFile, { ...read(workspace, sectionFile), status: "reviewing", artifacts: { ...(read(workspace, sectionFile).artifacts as Json), reviews: ["project://sections/introduction/reviews/review-01"] } });
|
|
1236
|
+
const rewrite = await nextStep(host);
|
|
1237
|
+
assert.deepEqual([rewrite.data.kind, rewrite.data.action, rewrite.data.section], ["step", "write-section", "introduction"], rewrite.text);
|
|
1238
|
+
assert.match(rewrite.text, /approved revision plan that no draft has applied yet/);
|
|
1239
|
+
// Once the draft is written after the approval, it is reviewed again: the earlier review read the earlier draft.
|
|
1240
|
+
drafted(host, workspace, 60_000);
|
|
1241
|
+
const review = await nextStep(host);
|
|
1242
|
+
assert.deepEqual([review.data.action, review.data.section], ["review-section", "introduction"], review.text);
|
|
1243
|
+
}, DRIVEN_PLUGIN));
|
|
1244
|
+
|
|
1245
|
+
test("a section drafted from its approved plan goes to review even if its record still says writing", () =>
|
|
1246
|
+
withDesk(async (host, workspace) => {
|
|
1247
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1248
|
+
await answer(host, GATE, "protocol-first");
|
|
1249
|
+
await answer(host, PLAN_GATE, "approve");
|
|
1250
|
+
// Live, write-section drafted method-admission but left status writing, and the desk re-armed the draft.
|
|
1251
|
+
drafted(host, workspace, 60_000);
|
|
1252
|
+
const sectionFile = ".planning/sections/introduction/section.json";
|
|
1253
|
+
put(workspace, sectionFile, { ...read(workspace, sectionFile), status: "writing" });
|
|
1254
|
+
const review = await nextStep(host);
|
|
1255
|
+
assert.deepEqual([review.data.kind, review.data.action, review.data.section], ["step", "review-section", "introduction"], review.text);
|
|
1256
|
+
assert.match(review.text, /is drafted and waits for review/);
|
|
1257
|
+
// Live, the review was recorded but the status stayed writing, and the desk named the review again.
|
|
1258
|
+
const reviewFile = ".planning/validations/introduction-review.json";
|
|
1259
|
+
put(workspace, reviewFile, {
|
|
1260
|
+
schema: "wtfp.project.validation/v1", id: "introduction-review", project_id: PROJECT, subject_uri: "project://paper/introduction",
|
|
1261
|
+
validator_role: "section-reviewer", action_id: "review-section", status: "passed",
|
|
1262
|
+
checks: [{ id: "plan-criteria", status: "passed", summary: "Every plan criterion holds.", evidence: ["Stated."] }],
|
|
1263
|
+
issues: [], next_actions: [], effects_applied: [], executed_at: "2026-09-01T10:00:00Z",
|
|
1264
|
+
});
|
|
1265
|
+
const after = new Date(host.now + 120_000);
|
|
1266
|
+
utimesSync(path.join(workspace, reviewFile), after, after);
|
|
1267
|
+
const verify = await nextStep(host);
|
|
1268
|
+
assert.deepEqual([verify.data.action, verify.data.section], ["verify-work", "introduction"], verify.text);
|
|
1269
|
+
}, DRIVEN_PLUGIN));
|
|
1270
|
+
|
|
1271
|
+
test("a review counts only for the draft it read", () =>
|
|
1272
|
+
withDesk(async (host, workspace) => {
|
|
1273
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1274
|
+
await answer(host, GATE, "protocol-first");
|
|
1275
|
+
await answer(host, PLAN_GATE, "approve");
|
|
1276
|
+
drafted(host, workspace, 60_000);
|
|
1277
|
+
const sectionFile = ".planning/sections/introduction/section.json";
|
|
1278
|
+
put(workspace, sectionFile, { ...read(workspace, sectionFile), status: "reviewing" });
|
|
1279
|
+
const reviewFile = ".planning/validations/introduction-review.json";
|
|
1280
|
+
put(workspace, reviewFile, {
|
|
1281
|
+
schema: "wtfp.project.validation/v1", id: "introduction-review", project_id: PROJECT, subject_uri: "project://paper/introduction",
|
|
1282
|
+
validator_role: "section-reviewer", action_id: "review-section", status: "passed",
|
|
1283
|
+
checks: [{ id: "plan-criteria", status: "passed", summary: "Every plan criterion holds.", evidence: ["Stated."] }],
|
|
1284
|
+
issues: [], next_actions: [], effects_applied: [], executed_at: "2026-09-01T10:00:00Z",
|
|
1285
|
+
});
|
|
1286
|
+
// The desk recorded the review after the draft, so it covers it: the author checks it next.
|
|
1287
|
+
const after = new Date(host.now + 120_000);
|
|
1288
|
+
utimesSync(path.join(workspace, reviewFile), after, after);
|
|
1289
|
+
assert.equal((await nextStep(host)).data.action, "verify-work");
|
|
1290
|
+
// A revision written after that review waits for a new one, whatever the review claims as its time.
|
|
1291
|
+
drafted(host, workspace, 180_000);
|
|
1292
|
+
const again = await nextStep(host);
|
|
1293
|
+
assert.deepEqual([again.data.action, again.data.section], ["review-section", "introduction"], again.text);
|
|
1294
|
+
}, DRIVEN_PLUGIN));
|
|
1295
|
+
|
|
1296
|
+
test("an accepted section is handed back to verify-work, which marks it complete", () =>
|
|
1297
|
+
withDesk(async (host, workspace) => {
|
|
1298
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1299
|
+
await answer(host, GATE, "protocol-first");
|
|
1300
|
+
await answer(host, PLAN_GATE, "approve");
|
|
1301
|
+
drafted(host, workspace, 60_000);
|
|
1302
|
+
const sectionFile = ".planning/sections/introduction/section.json";
|
|
1303
|
+
put(workspace, sectionFile, { ...read(workspace, sectionFile), status: "reviewing" });
|
|
1304
|
+
for (const [id, action, at] of [["introduction-review", "review-section", "2026-09-01T10:00:00Z"], ["introduction-verified", "verify-work", "2026-09-01T11:00:00Z"]])
|
|
1305
|
+
put(workspace, `.planning/validations/${id}.json`, {
|
|
1306
|
+
schema: "wtfp.project.validation/v1",
|
|
1307
|
+
id,
|
|
1308
|
+
project_id: PROJECT,
|
|
1309
|
+
subject_uri: "project://sections/introduction",
|
|
1310
|
+
validator_role: "author",
|
|
1311
|
+
action_id: action,
|
|
1312
|
+
status: "passed",
|
|
1313
|
+
checks: [],
|
|
1314
|
+
issues: [],
|
|
1315
|
+
next_actions: [],
|
|
1316
|
+
effects_applied: [],
|
|
1317
|
+
executed_at: at,
|
|
1318
|
+
});
|
|
1319
|
+
put(workspace, ".planning/checkpoints/accept-introduction.json", {
|
|
1320
|
+
schema: "wtfp.project.checkpoint/v1",
|
|
1321
|
+
id: "accept-introduction",
|
|
1322
|
+
project_id: PROJECT,
|
|
1323
|
+
kind: "decision",
|
|
1324
|
+
status: "pending",
|
|
1325
|
+
blocking: true,
|
|
1326
|
+
scope_uri: "project://validations/introduction-verified",
|
|
1327
|
+
request: "Accept the introduction as written?",
|
|
1328
|
+
options: [
|
|
1329
|
+
{ id: "accept", label: "Accept", implication: "Mark it complete." },
|
|
1330
|
+
{ id: "revise", label: "Revise", implication: "Plan a revision." },
|
|
1331
|
+
],
|
|
1332
|
+
resume_action: "verify-work",
|
|
1333
|
+
created_at: "2026-09-01T11:00:00Z",
|
|
1334
|
+
});
|
|
1335
|
+
assert.equal((await nextStep(host)).data.kind, "gate");
|
|
1336
|
+
await answer(host, "accept-introduction", "accept");
|
|
1337
|
+
const apply = await nextStep(host);
|
|
1338
|
+
assert.deepEqual([apply.data.kind, apply.data.action, apply.data.section], ["step", "verify-work", "introduction"], apply.text);
|
|
1339
|
+
assert.match(apply.text, /accepted Introduction; verify-work marks it complete/);
|
|
1340
|
+
}, DRIVEN_PLUGIN));
|
|
1341
|
+
|
|
1342
|
+
test("the desk's advance key fills the advance prompt only while the plugin serves it", () =>
|
|
1343
|
+
withDesk(async (host) => {
|
|
1344
|
+
const filled = await host.action("advance");
|
|
1345
|
+
assert.equal(filled.text, "/wtfp:advance");
|
|
1346
|
+
}, DRIVEN_PLUGIN));
|
|
1347
|
+
|
|
1348
|
+
test("status gives an agent the whole project in one read, matching what the desk draws", () =>
|
|
1349
|
+
withDesk(async (host, workspace) => {
|
|
1350
|
+
const status = await host.tool("status", {});
|
|
1351
|
+
const data = status.data as Json;
|
|
1352
|
+
assert.equal(data.present, true);
|
|
1353
|
+
assert.equal(data.phase, "writing");
|
|
1354
|
+
const [section] = data.sections as Json[];
|
|
1355
|
+
assert.equal(section?.id, "introduction");
|
|
1356
|
+
assert.equal((section?.plan as Json).state, "awaiting");
|
|
1357
|
+
assert.ok((section?.blockers as string[]).length > 0, "a gated section reports why it cannot be drafted");
|
|
1358
|
+
assert.deepEqual((data.open_gates as Json[]).map((gate) => gate.id).sort(), [GATE, PLAN_GATE].sort());
|
|
1359
|
+
assert.ok(((data.next as Json).gate as string) !== null);
|
|
1360
|
+
assert.match(status.text, /introduction: planned/);
|
|
1361
|
+
rmSync(path.join(workspace, ".planning"), { recursive: true, force: true });
|
|
1362
|
+
assert.equal(((await host.tool("status", {})).data as Json).present, false);
|
|
1363
|
+
}, SERVED));
|
|
1364
|
+
|
|
1365
|
+
// --- the turn_start status reminder ------------------------------------------------
|
|
1366
|
+
// Clio fires turn_start once per operator prompt; the desk answers with its status
|
|
1367
|
+
// only when that prompt armed a WTF-P action or advance in a project.
|
|
1368
|
+
|
|
1369
|
+
const turnStart = (host: Host) => host.hook({ point: "turn_start", turnId: "t1" });
|
|
1370
|
+
const reminderOf = (result: { effects?: Array<{ kind: string }> }): string | null =>
|
|
1371
|
+
(result.effects?.find((effect) => effect.kind === "inject_reminder") as { message?: string } | undefined)?.message ?? null;
|
|
1372
|
+
|
|
1373
|
+
test("a WTF-P turn starts from the desk's status, and no other turn does", () =>
|
|
1374
|
+
withDesk(async (host, workspace) => {
|
|
1375
|
+
assert.equal(reminderOf(await turnStart(host)), null, "nothing armed, nothing injected");
|
|
1376
|
+
await host.hook({ point: "prompt_submit", text: "explain the flush bottleneck" });
|
|
1377
|
+
assert.equal(reminderOf(await turnStart(host)), null, "an ordinary prompt gets no reminder");
|
|
1378
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:plan-section introduction" });
|
|
1379
|
+
const armed = await turnStart(host);
|
|
1380
|
+
const message = reminderOf(armed) ?? "";
|
|
1381
|
+
assert.match(message, /^WTF-P desk status at the start of this turn/);
|
|
1382
|
+
assert.match(message, /introduction: planned/);
|
|
1383
|
+
assert.match(message, new RegExp(`Open gates: .*${GATE}`));
|
|
1384
|
+
assert.ok(message.length <= 2000);
|
|
1385
|
+
assert.equal((armed.effects as Array<{ kind: string; audience?: string }>)[0]?.audience, "model");
|
|
1386
|
+
await host.observe({ event: "turn_end", turnId: "t1", outcome: "completed", usage: null });
|
|
1387
|
+
assert.equal(reminderOf(await turnStart(host)), null, "the turn's end disarms the reminder");
|
|
1388
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1389
|
+
assert.match(reminderOf(await turnStart(host)) ?? "", /WTF-P desk status/, "an advance run starts from the status too");
|
|
1390
|
+
rmSync(path.join(workspace, ".planning"), { recursive: true, force: true });
|
|
1391
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1392
|
+
assert.equal(reminderOf(await turnStart(host)), null, "no project, no reminder");
|
|
1393
|
+
}, DRIVEN_PLUGIN));
|
|
1394
|
+
|
|
1395
|
+
test("a status too long for one Clio effect is cut to 2,000 characters and points at the status tool", () =>
|
|
1396
|
+
withDesk(async (host, workspace) => {
|
|
1397
|
+
const outline = read(workspace, ".planning/structure/outline.json");
|
|
1398
|
+
const extra = Array.from({ length: 60 }, (_, index) => ({
|
|
1399
|
+
...((outline.sections as Json[])[0] as Json),
|
|
1400
|
+
id: `appendix-measurement-detail-${String(index).padStart(2, "0")}`,
|
|
1401
|
+
title: `Appendix ${index}`,
|
|
1402
|
+
wave: 2,
|
|
1403
|
+
depends_on: ["introduction"],
|
|
1404
|
+
}));
|
|
1405
|
+
put(workspace, ".planning/structure/outline.json", { ...outline, sections: [...(outline.sections as Json[]), ...extra] });
|
|
1406
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:progress" });
|
|
1407
|
+
const message = reminderOf(await turnStart(host)) ?? "";
|
|
1408
|
+
assert.ok(message.length > 1990 && message.length <= 2000, `length ${message.length}`);
|
|
1409
|
+
assert.match(message, /… \(truncated; call extension_wtfp__status\)$/);
|
|
1410
|
+
assert.equal(((await host.tool("status", {})).data as { sections: Json[] }).sections.length, 61, "the full status stays one call away");
|
|
1411
|
+
}, SERVED));
|
|
1412
|
+
|
|
1413
|
+
// --- the manuscript write note ------------------------------------------------------
|
|
1414
|
+
// A write that changes a manuscript the armed action may measure gets one note on
|
|
1415
|
+
// its result naming the measure_section call. It spends none of the turn's shared
|
|
1416
|
+
// continuation budget, and the desk declares no turn_end hook at all.
|
|
1417
|
+
|
|
1418
|
+
const wrote = (host: Host, target: string, outcome: "ok" | "error" = "ok") =>
|
|
1419
|
+
host.hook({ point: "after_tool", tool: "write", turnId: "t1", outcome, durationMs: 1, args: { path: target } } as never);
|
|
1420
|
+
const noteOf = (result: { effects?: Array<{ kind: string }> }): string | null =>
|
|
1421
|
+
(result.effects?.find((effect) => effect.kind === "annotate_tool_result") as { message?: string } | undefined)?.message ?? null;
|
|
1422
|
+
|
|
1423
|
+
test("a manuscript write inside an action that may measure it is noted once with the exact measure_section call", () =>
|
|
1424
|
+
withDesk(async (host) => {
|
|
1425
|
+
assert.equal(noteOf(await wrote(host, "paper/introduction.md")), null, "nothing armed, no note");
|
|
1426
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:progress" });
|
|
1427
|
+
assert.equal(noteOf(await wrote(host, "paper/introduction.md")), null, "an action that declares no manuscript gets no note");
|
|
1428
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:write-section introduction" });
|
|
1429
|
+
assert.equal(noteOf(await wrote(host, "paper/introduction.md", "error")), null, "a failed write changed nothing");
|
|
1430
|
+
assert.equal(noteOf(await wrote(host, ".planning/sections/introduction/summary.md")), null, "only a manuscript is measured");
|
|
1431
|
+
const note = noteOf(await wrote(host, "paper/introduction.md")) ?? "";
|
|
1432
|
+
assert.match(note, /^WTF-P: paper\/introduction\.md is the manuscript of introduction/);
|
|
1433
|
+
assert.match(note, /gateway\(op="call", capability="extension_wtfp__measure_section", args=\{section: "introduction"\}\)/);
|
|
1434
|
+
assert.match(note, /A dispatched worker leaves this call to the action that dispatched it/);
|
|
1435
|
+
assert.equal(noteOf(await wrote(host, "paper/introduction.md")), null, "noted once per section");
|
|
1436
|
+
assert.match((await host.tool("measure_section", { section: "introduction" })).text, /has 11 body words/);
|
|
1437
|
+
assert.ok(noteOf(await wrote(host, "paper/introduction.md")), "a write after measuring is noted again");
|
|
1438
|
+
await host.observe({ event: "turn_end", turnId: "t1", outcome: "completed", usage: null });
|
|
1439
|
+
assert.equal(noteOf(await wrote(host, "paper/introduction.md")), null, "the turn's end disarms the note");
|
|
1440
|
+
}, SERVED));
|
|
1441
|
+
|
|
1442
|
+
test("inside an advance run only the armed step's manuscript writes are noted", () =>
|
|
1443
|
+
withDesk(async (host) => {
|
|
1444
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1445
|
+
assert.equal(noteOf(await wrote(host, "paper/introduction.md")), null, "an idle run measures nothing");
|
|
1446
|
+
await answer(host, GATE, "protocol-first");
|
|
1447
|
+
await answer(host, PLAN_GATE, "approve");
|
|
1448
|
+
assert.equal((await nextStep(host)).data.action, "write-section");
|
|
1449
|
+
assert.match(noteOf(await wrote(host, "paper/introduction.md")) ?? "", /args=\{section: "introduction"\}/);
|
|
1450
|
+
assert.equal((await nextStep(host)).data.finish, true, "an unchanged step is handed back once");
|
|
1451
|
+
assert.equal((await nextStep(host)).data.kind, "stop");
|
|
1452
|
+
assert.equal(noteOf(await wrote(host, "paper/introduction.md")), null, "after a stop nothing is armed to measure");
|
|
1453
|
+
}, DRIVEN_PLUGIN));
|
|
1454
|
+
|
|
1455
|
+
test("inside a WTF-P action every question goes to the author as one only the author may answer", () =>
|
|
1456
|
+
withDesk(async (host) => {
|
|
1457
|
+
const ask = (args: Json) => host.hook({ point: "before_tool", tool: "ask_user", turnId: "t1", args });
|
|
1458
|
+
const question = { question: "Lead with the protocol?", options: [{ label: "Yes" }, { label: "No" }] };
|
|
1459
|
+
assert.equal(rewriteOf(await ask({ action: "ask", questions: [question] })), null, "outside an action the desk leaves questions alone");
|
|
1460
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:discuss-section introduction" });
|
|
1461
|
+
const marked = rewriteOf(await ask({ action: "ask", questions: [question] }));
|
|
1462
|
+
assert.deepEqual((marked?.questions as Json[] | undefined)?.[0], { ...question, operator_only: true });
|
|
1463
|
+
assert.match(blocked(await ask({ action: "ask", questions: [question, { question: "And the venue?" }] })) ?? "", /one call at a time, each with operator_only: true and its own options/);
|
|
1464
|
+
assert.equal(rewriteOf(await ask({ action: "ask", questions: [{ ...question, operator_only: true }] })), null, "a question already marked passes unchanged");
|
|
1465
|
+
assert.equal(blocked(await ask({ action: "complete", decisions: [] })), null);
|
|
1466
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:advance" });
|
|
1467
|
+
assert.ok(rewriteOf(await ask({ action: "ask", questions: [question] })), "an advance turn marks them too");
|
|
1468
|
+
}, DRIVEN_PLUGIN));
|
|
1469
|
+
|
|
851
1470
|
test("WTF-P workers are dispatched only inside their action and only to manuscripts that are ready (W3)", () =>
|
|
852
1471
|
withDesk(async (host, workspace) => {
|
|
853
1472
|
const dispatch = (args: Json) => host.hook({ point: "before_tool", tool: "dispatch", turnId: "t1", args });
|
|
@@ -863,11 +1482,16 @@ test("WTF-P workers are dispatched only inside their action and only to manuscri
|
|
|
863
1482
|
assert.deepEqual(rootsOf(rewriteOf(narrowed)), [".planning/sections/introduction/summary.md", "paper/introduction.md", "paper/introduction/"]);
|
|
864
1483
|
// Roots that already are the confinement, in any order, need no rewrite.
|
|
865
1484
|
assert.equal(rewriteOf(await dispatch({ agent: "wtfp-section-writer", task: "Draft.", intent: { write_roots: ["paper/introduction/", "paper/introduction.md", ".planning/sections/introduction/summary.md"] } })), null);
|
|
1485
|
+
// Live, a local model named project:// URIs and a .planning/paper path; the refusal names the workspace roots it would accept.
|
|
1486
|
+
assert.match(
|
|
1487
|
+
blocked(await dispatch({ agent: "wtfp-section-writer", task: "Draft.", intent: { write_roots: ["project://paper/introduction", ".planning/paper/introduction.md"] } })) ?? "",
|
|
1488
|
+
/names write_roots .*\.planning\/paper\/introduction\.md.*project:.*which reach no manuscript .* give it intent\.write_roots .*paper\/introduction\.md.* \(workspace paths, not project:\/\/ URIs\)/,
|
|
1489
|
+
);
|
|
866
1490
|
assert.match(
|
|
867
1491
|
blocked(await dispatch({ tasks: [{ agent: "wtfp-section-writer", task: "a" }, { agent: "wtfp-section-writer", task: "b" }] })) ?? "",
|
|
868
1492
|
/Clio: parallel writers need disjoint intent\.write_roots/,
|
|
869
1493
|
);
|
|
870
|
-
assert.match(blocked(await dispatch({ agent: "coder", task: "x", intent: { write_roots: ["src"] } })) ?? "", /
|
|
1494
|
+
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/);
|
|
871
1495
|
assert.ok(existsSync(path.join(workspace, "paper/introduction.md")));
|
|
872
1496
|
// A root the action itself grants is refused when a link makes it lead somewhere else.
|
|
873
1497
|
symlinkSync(path.join(workspace, ".planning/sections"), path.join(workspace, "paper/introduction"));
|
|
@@ -957,8 +1581,21 @@ test("where Clio resolves a call's landing and dispatch plan, the desk judges wh
|
|
|
957
1581
|
const reader = await dispatch({ agent: "auto", tasks: [{ task: "Review the introduction." }] }, plan(task("scout", { readOnly: true })));
|
|
958
1582
|
assert.equal(blocked(reader), null);
|
|
959
1583
|
assert.equal(rewriteOf(reader), null);
|
|
960
|
-
// The desk takes that from Clio: a
|
|
961
|
-
assert.deepEqual(rootsOf(rewriteOf(await dispatch({ agent: "wtfp-
|
|
1584
|
+
// The desk takes that from Clio: a verifier Clio does not report read-only is confined like any writer.
|
|
1585
|
+
assert.deepEqual(rootsOf(rewriteOf(await dispatch({ agent: "wtfp-argument-verifier", tasks: [{ task: "Verify." }] }, plan(task("wtfp-argument-verifier"))))), roots);
|
|
1586
|
+
// A writer the action does not delegate to is refused by name, as is Clio's default worker when the call names no agent.
|
|
1587
|
+
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/);
|
|
1588
|
+
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"\)/);
|
|
1589
|
+
assert.match(
|
|
1590
|
+
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")] })))) ?? "",
|
|
1591
|
+
/src lie outside what write-section may write/,
|
|
1592
|
+
);
|
|
1593
|
+
// A declared empty write_roots is no boundary to the worker, and Clio refuses a rewrite that fills it, so the desk names the roots.
|
|
1594
|
+
assert.match(
|
|
1595
|
+
blocked(await dispatch({ agent: "wtfp-section-writer", task: "Draft.", intent: { read_roots: [".planning"], write_roots: [] } }, plan(task("wtfp-section-writer")))) ?? "",
|
|
1596
|
+
/intent without write_roots bounds nothing.*Send intent\.write_roots \.planning\/sections\/introduction\/summary\.md, paper\/introduction\.md, paper\/introduction\//,
|
|
1597
|
+
);
|
|
1598
|
+
assert.match(blocked(await dispatch({ agent: "wtfp-section-writer", task: "Draft.", intent: { read_roots: [".planning"] } }, plan(task("wtfp-section-writer")))) ?? "", /intent without write_roots/);
|
|
962
1599
|
// A task Clio keeps as a string is confined as a task object, and Clio's private keys are left for Clio to recompute.
|
|
963
1600
|
const spelled = await dispatch({ agent: "wtfp-section-writer", tasks: ["Draft."], __clio_resolved_dispatch_plan: { resolvedBy: "clio" } }, plan(task("wtfp-section-writer")));
|
|
964
1601
|
assert.deepEqual(rewriteOf(spelled), { agent: "wtfp-section-writer", tasks: [{ task: "Draft.", intent: { write_roots: roots } }] });
|
|
@@ -1305,12 +1942,25 @@ test("measure_section counts body words by the desk's one method and commits the
|
|
|
1305
1942
|
withDesk(async (host, workspace) => {
|
|
1306
1943
|
const measured = await host.tool("measure_section", { section: "introduction" });
|
|
1307
1944
|
assert.equal(measured.isError, undefined, measured.text);
|
|
1308
|
-
assert.deepEqual(measured.data, { words: 11, target: 100, file: "paper/introduction.md", total: 11 });
|
|
1945
|
+
assert.deepEqual(measured.data, { words: 11, target: 100, file: "paper/introduction.md", total: 11, recorded: true });
|
|
1309
1946
|
assert.equal(read(workspace, ".planning/sections/introduction/section.json").word_count, 11);
|
|
1310
1947
|
assert.equal((read(workspace, ".planning/state.json").progress as Json).word_count, 11);
|
|
1311
1948
|
assert.equal(read(workspace, ".planning/state.json").revision, 4);
|
|
1312
1949
|
}));
|
|
1313
1950
|
|
|
1951
|
+
test("an action that may not record a count still gets the desk's count instead of counting by hand", () =>
|
|
1952
|
+
withDesk(async (host, workspace) => {
|
|
1953
|
+
// Live, review-section was refused measure_section and the model counted words with a script.
|
|
1954
|
+
await host.hook({ point: "prompt_submit", text: "/wtfp:review-section introduction" });
|
|
1955
|
+
const before = read(workspace, ".planning/state.json").revision;
|
|
1956
|
+
const measured = await host.tool("measure_section", { section: "introduction" });
|
|
1957
|
+
assert.equal(measured.isError, undefined, measured.text);
|
|
1958
|
+
assert.equal((measured.data as Json).words, 11);
|
|
1959
|
+
assert.equal((measured.data as Json).recorded, false);
|
|
1960
|
+
assert.match(measured.text, /Not recorded: .*review-section does not update the section's word count; use this count instead of counting by hand/);
|
|
1961
|
+
assert.equal(read(workspace, ".planning/state.json").revision, before, "nothing was written");
|
|
1962
|
+
}, DRIVEN_PLUGIN));
|
|
1963
|
+
|
|
1314
1964
|
test("a failure between paired writes leaves a journal the next write completes; one before the commit point leaves nothing (R2)", () =>
|
|
1315
1965
|
withDesk(async (host, workspace) => {
|
|
1316
1966
|
process.env.WTFP_DESK_TEST_FAULT = "between-renames";
|