wtf-p 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/bin/lib/adapter-compiler.js +154 -35
- package/bin/lib/clio-registration.js +44 -17
- package/bin/uninstall.js +19 -4
- package/package.json +3 -3
- package/protocol/actions/checkpoint.json +10 -1
- package/protocol/actions/execute-outline.json +10 -2
- package/protocol/actions/export-latex.json +15 -2
- package/protocol/actions/plan-revision.json +17 -4
- package/protocol/actions/polish-prose.json +13 -3
- package/protocol/actions/research-gap.json +16 -3
- package/protocol/actions/verify-work.json +7 -2
- package/protocol/project/README.md +37 -0
- package/protocol/project/schemas/interaction.schema.json +100 -0
- package/protocol/project/templates/interaction.json +16 -0
- package/protocol/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/protocol/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/protocol/skills/wtfp-plan-section/SKILL.md +1 -1
- package/protocol/skills/wtfp-plan-section/references/actions.md +4 -3
- package/protocol/skills/wtfp-research-literature/SKILL.md +1 -1
- package/protocol/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/protocol/skills/wtfp-write-section/SKILL.md +1 -1
- package/protocol/skills/wtfp-write-section/references/actions.md +1 -1
- package/protocol/workflows/checkpoint.md +2 -2
- package/protocol/workflows/execute-outline.md +2 -2
- package/protocol/workflows/export-latex.md +4 -4
- package/protocol/workflows/plan-revision.md +4 -3
- package/protocol/workflows/plan-section.md +2 -2
- package/protocol/workflows/polish-prose.md +3 -3
- package/protocol/workflows/research-gap.md +2 -2
- package/protocol/workflows/verify-work.md +3 -3
- package/protocol/workflows/write-section.md +2 -2
- package/vendors/antigravity/.wtfp-generated.json +172 -172
- package/vendors/antigravity/actions/checkpoint.json +10 -1
- package/vendors/antigravity/actions/execute-outline.json +10 -2
- package/vendors/antigravity/actions/export-latex.json +15 -2
- package/vendors/antigravity/actions/plan-revision.json +17 -4
- package/vendors/antigravity/actions/polish-prose.json +13 -3
- package/vendors/antigravity/actions/research-gap.json +16 -3
- package/vendors/antigravity/actions/verify-work.json +7 -2
- package/vendors/antigravity/plugin.json +2 -1
- package/vendors/antigravity/project/README.md +37 -0
- package/vendors/antigravity/project/schemas/interaction.schema.json +100 -0
- package/vendors/antigravity/project/templates/interaction.json +16 -0
- package/vendors/antigravity/rules/wtfp-project-state.md +41 -1
- package/vendors/antigravity/{commands/wtfp-add-todo.md → skills/wtfp-add-todo/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-analyze-bib.md → skills/wtfp-analyze-bib/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-audit-milestone.md → skills/wtfp-audit-milestone/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-check-refs.md → skills/wtfp-check-refs/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-check-todos.md → skills/wtfp-check-todos/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-checkpoint.md → skills/wtfp-checkpoint/SKILL.md} +4 -3
- package/vendors/antigravity/{commands/wtfp-contribute.md → skills/wtfp-contribute/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-create-outline.md → skills/wtfp-create-outline/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-create-poster.md → skills/wtfp-create-poster/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-create-slides.md → skills/wtfp-create-slides/SKILL.md} +2 -1
- package/vendors/antigravity/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/antigravity/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/antigravity/{commands/wtfp-discuss-section.md → skills/wtfp-discuss-section/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-execute-outline.md → skills/wtfp-execute-outline/SKILL.md} +4 -3
- package/vendors/antigravity/{commands/wtfp-export-latex.md → skills/wtfp-export-latex/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-help.md → skills/wtfp-help/SKILL.md} +3 -2
- package/vendors/antigravity/{commands/wtfp-insert-section.md → skills/wtfp-insert-section/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-list-assumptions.md → skills/wtfp-list-assumptions/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-map-project.md → skills/wtfp-map-project/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-new-paper.md → skills/wtfp-new-paper/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-pause-writing.md → skills/wtfp-pause-writing/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-plan-milestone-gaps.md → skills/wtfp-plan-milestone-gaps/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-plan-revision.md → skills/wtfp-plan-revision/SKILL.md} +10 -4
- package/vendors/antigravity/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/antigravity/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/antigravity/{commands/wtfp-polish-prose.md → skills/wtfp-polish-prose/SKILL.md} +9 -4
- package/vendors/antigravity/{commands/wtfp-progress.md → skills/wtfp-progress/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-quick.md → skills/wtfp-quick/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-remove-section.md → skills/wtfp-remove-section/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-report-bug.md → skills/wtfp-report-bug/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-request-feature.md → skills/wtfp-request-feature/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-research-gap.md → skills/wtfp-research-gap/SKILL.md} +2 -1
- package/vendors/antigravity/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/antigravity/{commands/wtfp-resume-writing.md → skills/wtfp-resume-writing/SKILL.md} +2 -1
- package/vendors/antigravity/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/antigravity/{commands/wtfp-review-section.md → skills/wtfp-review-section/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-settings.md → skills/wtfp-settings/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-submit-milestone.md → skills/wtfp-submit-milestone/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-update.md → skills/wtfp-update/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-verify-work.md → skills/wtfp-verify-work/SKILL.md} +5 -4
- package/vendors/antigravity/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/antigravity/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/antigravity/workflows/checkpoint.md +2 -2
- package/vendors/antigravity/workflows/execute-outline.md +2 -2
- package/vendors/antigravity/workflows/export-latex.md +4 -4
- package/vendors/antigravity/workflows/plan-revision.md +4 -3
- package/vendors/antigravity/workflows/plan-section.md +2 -2
- package/vendors/antigravity/workflows/polish-prose.md +3 -3
- package/vendors/antigravity/workflows/research-gap.md +2 -2
- package/vendors/antigravity/workflows/verify-work.md +3 -3
- 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 +84 -76
- package/vendors/claude/actions/checkpoint.json +10 -1
- package/vendors/claude/actions/execute-outline.json +10 -2
- package/vendors/claude/actions/export-latex.json +15 -2
- package/vendors/claude/actions/plan-revision.json +17 -4
- package/vendors/claude/actions/polish-prose.json +13 -3
- package/vendors/claude/actions/research-gap.json +16 -3
- package/vendors/claude/actions/verify-work.json +7 -2
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-argument-verifier.md +3 -3
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-coherence-checker.md +3 -3
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-plan-checker.md +3 -3
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-section-reviewer.md +3 -3
- package/vendors/claude/ai.iowarp.clio/fleets/wtfp-draft-review.md +1 -1
- package/vendors/claude/ai.iowarp.clio/fleets/wtfp-plan-section.md +1 -1
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/add-todo.md +8 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/analyze-bib.md +22 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/audit-milestone.md +10 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/check-refs.md +22 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/check-todos.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/checkpoint.md +11 -2
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/create-outline.md +21 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/create-poster.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/create-slides.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/discuss-section.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/execute-outline.md +24 -3
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/export-latex.md +14 -4
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/help.md +1 -1
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/insert-section.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/list-assumptions.md +6 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/map-project.md +8 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/new-paper.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/pause-writing.md +8 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/plan-milestone-gaps.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/plan-revision.md +17 -3
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/plan-section.md +24 -3
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/polish-prose.md +28 -3
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/progress.md +7 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/quick.md +21 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/research-gap.md +25 -2
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/resume-writing.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/review-section.md +19 -1
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/settings.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/submit-milestone.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/verify-work.md +12 -3
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/write-section.md +24 -3
- package/vendors/claude/commands/checkpoint.md +2 -2
- package/vendors/claude/commands/execute-outline.md +2 -2
- package/vendors/claude/commands/export-latex.md +4 -4
- package/vendors/claude/commands/plan-revision.md +8 -3
- package/vendors/claude/commands/plan-section.md +2 -2
- package/vendors/claude/commands/polish-prose.md +7 -3
- package/vendors/claude/commands/research-gap.md +2 -2
- package/vendors/claude/commands/verify-work.md +3 -3
- package/vendors/claude/commands/write-section.md +2 -2
- package/vendors/claude/output-styles/wtfp-academic-writing.md +5 -5
- package/vendors/claude/plugin.json +1 -1
- package/vendors/claude/project/README.md +37 -0
- package/vendors/claude/project/schemas/interaction.schema.json +100 -0
- package/vendors/claude/project/templates/interaction.json +16 -0
- package/vendors/claude/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/claude/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/claude/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/claude/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/claude/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/claude/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/claude/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/claude/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/claude/workflows/checkpoint.md +2 -2
- package/vendors/claude/workflows/execute-outline.md +2 -2
- package/vendors/claude/workflows/export-latex.md +4 -4
- package/vendors/claude/workflows/plan-revision.md +4 -3
- package/vendors/claude/workflows/plan-section.md +2 -2
- package/vendors/claude/workflows/polish-prose.md +3 -3
- package/vendors/claude/workflows/research-gap.md +2 -2
- package/vendors/claude/workflows/verify-work.md +3 -3
- package/vendors/claude/workflows/write-section.md +2 -2
- package/vendors/clio-extension/.wtfp-generated.json +25 -13
- package/vendors/clio-extension/actions/checkpoint.json +10 -1
- package/vendors/clio-extension/actions/execute-outline.json +10 -2
- package/vendors/clio-extension/actions/export-latex.json +15 -2
- package/vendors/clio-extension/actions/plan-revision.json +17 -4
- package/vendors/clio-extension/actions/polish-prose.json +13 -3
- package/vendors/clio-extension/actions/research-gap.json +16 -3
- package/vendors/clio-extension/actions/verify-work.json +7 -2
- package/vendors/clio-extension/clio-coder-extension.yaml +33 -10
- package/vendors/clio-extension/compatibility/action-availability.json +2 -2
- package/vendors/clio-extension/project/schemas/interaction.schema.json +100 -0
- package/vendors/clio-extension/runtime/claim-coverage.cjs +332 -0
- package/vendors/clio-extension/runtime/desk-trust.cjs +112 -0
- package/vendors/clio-extension/runtime/extension.test.ts +1385 -66
- package/vendors/clio-extension/runtime/extension.ts +2226 -473
- package/vendors/clio-extension/runtime/write-guard.json +563 -18
- package/vendors/codex/plugins/wtfp/.codex-plugin/plugin.json +1 -1
- package/vendors/codex/plugins/wtfp/.wtfp-generated.json +36 -28
- package/vendors/codex/plugins/wtfp/actions/checkpoint.json +10 -1
- package/vendors/codex/plugins/wtfp/actions/execute-outline.json +10 -2
- package/vendors/codex/plugins/wtfp/actions/export-latex.json +15 -2
- package/vendors/codex/plugins/wtfp/actions/plan-revision.json +17 -4
- package/vendors/codex/plugins/wtfp/actions/polish-prose.json +13 -3
- package/vendors/codex/plugins/wtfp/actions/research-gap.json +16 -3
- package/vendors/codex/plugins/wtfp/actions/verify-work.json +7 -2
- package/vendors/codex/plugins/wtfp/plugin.json +1 -1
- package/vendors/codex/plugins/wtfp/project/README.md +37 -0
- package/vendors/codex/plugins/wtfp/project/schemas/interaction.schema.json +100 -0
- package/vendors/codex/plugins/wtfp/project/templates/interaction.json +16 -0
- package/vendors/codex/plugins/wtfp/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/codex/plugins/wtfp/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/codex/plugins/wtfp/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/codex/plugins/wtfp/workflows/checkpoint.md +2 -2
- package/vendors/codex/plugins/wtfp/workflows/execute-outline.md +2 -2
- package/vendors/codex/plugins/wtfp/workflows/export-latex.md +4 -4
- package/vendors/codex/plugins/wtfp/workflows/plan-revision.md +4 -3
- package/vendors/codex/plugins/wtfp/workflows/plan-section.md +2 -2
- package/vendors/codex/plugins/wtfp/workflows/polish-prose.md +3 -3
- package/vendors/codex/plugins/wtfp/workflows/research-gap.md +2 -2
- package/vendors/codex/plugins/wtfp/workflows/verify-work.md +3 -3
- package/vendors/codex/plugins/wtfp/workflows/write-section.md +2 -2
- package/vendors/copilot/.wtfp-generated.json +43 -35
- 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 +42 -34
- package/vendors/copilot/plugins/wtfp/actions/checkpoint.json +10 -1
- package/vendors/copilot/plugins/wtfp/actions/execute-outline.json +10 -2
- package/vendors/copilot/plugins/wtfp/actions/export-latex.json +15 -2
- package/vendors/copilot/plugins/wtfp/actions/plan-revision.json +17 -4
- package/vendors/copilot/plugins/wtfp/actions/polish-prose.json +13 -3
- package/vendors/copilot/plugins/wtfp/actions/research-gap.json +16 -3
- package/vendors/copilot/plugins/wtfp/actions/verify-work.json +7 -2
- package/vendors/copilot/plugins/wtfp/commands/wtfp-checkpoint.md +2 -2
- package/vendors/copilot/plugins/wtfp/commands/wtfp-execute-outline.md +2 -2
- package/vendors/copilot/plugins/wtfp/commands/wtfp-plan-revision.md +8 -3
- package/vendors/copilot/plugins/wtfp/commands/wtfp-plan-section.md +2 -2
- package/vendors/copilot/plugins/wtfp/commands/wtfp-polish-prose.md +7 -3
- package/vendors/copilot/plugins/wtfp/commands/wtfp-verify-work.md +3 -3
- package/vendors/copilot/plugins/wtfp/commands/wtfp-write-section.md +2 -2
- package/vendors/copilot/plugins/wtfp/project/README.md +37 -0
- package/vendors/copilot/plugins/wtfp/project/schemas/interaction.schema.json +100 -0
- package/vendors/copilot/plugins/wtfp/project/templates/interaction.json +16 -0
- package/vendors/copilot/plugins/wtfp/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/copilot/plugins/wtfp/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/copilot/plugins/wtfp/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/copilot/plugins/wtfp/workflows/checkpoint.md +2 -2
- package/vendors/copilot/plugins/wtfp/workflows/execute-outline.md +2 -2
- package/vendors/copilot/plugins/wtfp/workflows/export-latex.md +4 -4
- package/vendors/copilot/plugins/wtfp/workflows/plan-revision.md +4 -3
- package/vendors/copilot/plugins/wtfp/workflows/plan-section.md +2 -2
- package/vendors/copilot/plugins/wtfp/workflows/polish-prose.md +3 -3
- package/vendors/copilot/plugins/wtfp/workflows/research-gap.md +2 -2
- package/vendors/copilot/plugins/wtfp/workflows/verify-work.md +3 -3
- package/vendors/copilot/plugins/wtfp/workflows/write-section.md +2 -2
- package/vendors/copilot/project/.github/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/copilot/project/.github/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/copilot/project/.github/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/copilot/project/.github/wtfp/actions/checkpoint.json +10 -1
- package/vendors/copilot/project/.github/wtfp/actions/execute-outline.json +10 -2
- package/vendors/copilot/project/.github/wtfp/actions/export-latex.json +15 -2
- package/vendors/copilot/project/.github/wtfp/actions/plan-revision.json +17 -4
- package/vendors/copilot/project/.github/wtfp/actions/polish-prose.json +13 -3
- package/vendors/copilot/project/.github/wtfp/actions/research-gap.json +16 -3
- package/vendors/copilot/project/.github/wtfp/actions/verify-work.json +7 -2
- package/vendors/copilot/project/.github/wtfp/project/README.md +37 -0
- package/vendors/copilot/project/.github/wtfp/project/schemas/interaction.schema.json +100 -0
- package/vendors/copilot/project/.github/wtfp/project/templates/interaction.json +16 -0
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/copilot/project/.github/wtfp/workflows/checkpoint.md +2 -2
- package/vendors/copilot/project/.github/wtfp/workflows/execute-outline.md +2 -2
- package/vendors/copilot/project/.github/wtfp/workflows/export-latex.md +4 -4
- package/vendors/copilot/project/.github/wtfp/workflows/plan-revision.md +4 -3
- package/vendors/copilot/project/.github/wtfp/workflows/plan-section.md +2 -2
- package/vendors/copilot/project/.github/wtfp/workflows/polish-prose.md +3 -3
- package/vendors/copilot/project/.github/wtfp/workflows/research-gap.md +2 -2
- package/vendors/copilot/project/.github/wtfp/workflows/verify-work.md +3 -3
- package/vendors/copilot/project/.github/wtfp/workflows/write-section.md +2 -2
- package/vendors/gemini/.wtfp-generated.json +61 -53
- package/vendors/gemini/actions/checkpoint.json +10 -1
- package/vendors/gemini/actions/execute-outline.json +10 -2
- package/vendors/gemini/actions/export-latex.json +15 -2
- package/vendors/gemini/actions/plan-revision.json +17 -4
- package/vendors/gemini/actions/polish-prose.json +13 -3
- package/vendors/gemini/actions/research-gap.json +16 -3
- package/vendors/gemini/actions/verify-work.json +7 -2
- package/vendors/gemini/commands/wtfp/add-todo.toml +37 -0
- package/vendors/gemini/commands/wtfp/check-todos.toml +37 -0
- package/vendors/gemini/commands/wtfp/checkpoint.toml +49 -3
- package/vendors/gemini/commands/wtfp/create-outline.toml +37 -0
- package/vendors/gemini/commands/wtfp/create-poster.toml +40 -3
- package/vendors/gemini/commands/wtfp/create-slides.toml +40 -3
- package/vendors/gemini/commands/wtfp/discuss-section.toml +42 -4
- package/vendors/gemini/commands/wtfp/execute-outline.toml +51 -6
- package/vendors/gemini/commands/wtfp/help.toml +37 -0
- package/vendors/gemini/commands/wtfp/insert-section.toml +42 -4
- package/vendors/gemini/commands/wtfp/list-assumptions.toml +42 -4
- package/vendors/gemini/commands/wtfp/map-project.toml +37 -0
- package/vendors/gemini/commands/wtfp/new-paper.toml +37 -0
- package/vendors/gemini/commands/wtfp/pause-writing.toml +37 -0
- package/vendors/gemini/commands/wtfp/plan-milestone-gaps.toml +38 -1
- package/vendors/gemini/commands/wtfp/plan-revision.toml +310 -11
- package/vendors/gemini/commands/wtfp/plan-section.toml +44 -6
- package/vendors/gemini/commands/wtfp/polish-prose.toml +281 -7
- package/vendors/gemini/commands/wtfp/progress.toml +37 -0
- package/vendors/gemini/commands/wtfp/quick.toml +39 -2
- package/vendors/gemini/commands/wtfp/resume-writing.toml +37 -0
- package/vendors/gemini/commands/wtfp/review-section.toml +38 -1
- package/vendors/gemini/commands/wtfp/settings.toml +37 -0
- package/vendors/gemini/commands/wtfp/submit-milestone.toml +40 -3
- package/vendors/gemini/commands/wtfp/verify-work.toml +48 -6
- package/vendors/gemini/commands/wtfp/write-section.toml +41 -4
- package/vendors/gemini/gemini-extension.json +1 -1
- package/vendors/gemini/project/README.md +37 -0
- package/vendors/gemini/project/schemas/interaction.schema.json +100 -0
- package/vendors/gemini/project/templates/interaction.json +16 -0
- package/vendors/gemini/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/gemini/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/gemini/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/gemini/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/gemini/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/gemini/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/gemini/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/gemini/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/gemini/workflows/checkpoint.md +2 -2
- package/vendors/gemini/workflows/execute-outline.md +2 -2
- package/vendors/gemini/workflows/export-latex.md +4 -4
- package/vendors/gemini/workflows/plan-revision.md +4 -3
- package/vendors/gemini/workflows/plan-section.md +2 -2
- package/vendors/gemini/workflows/polish-prose.md +3 -3
- package/vendors/gemini/workflows/research-gap.md +2 -2
- package/vendors/gemini/workflows/verify-work.md +3 -3
- package/vendors/gemini/workflows/write-section.md +2 -2
- package/vendors/opencode/.wtfp-generated.json +60 -52
- package/vendors/opencode/actions/checkpoint.json +10 -1
- package/vendors/opencode/actions/execute-outline.json +10 -2
- package/vendors/opencode/actions/export-latex.json +15 -2
- package/vendors/opencode/actions/plan-revision.json +17 -4
- package/vendors/opencode/actions/polish-prose.json +13 -3
- package/vendors/opencode/actions/research-gap.json +16 -3
- package/vendors/opencode/actions/verify-work.json +7 -2
- package/vendors/opencode/commands/wtfp/add-todo.md +37 -0
- package/vendors/opencode/commands/wtfp/check-todos.md +37 -0
- package/vendors/opencode/commands/wtfp/checkpoint.md +49 -3
- package/vendors/opencode/commands/wtfp/create-outline.md +37 -0
- package/vendors/opencode/commands/wtfp/create-poster.md +40 -3
- package/vendors/opencode/commands/wtfp/create-slides.md +40 -3
- package/vendors/opencode/commands/wtfp/discuss-section.md +42 -4
- package/vendors/opencode/commands/wtfp/execute-outline.md +51 -6
- package/vendors/opencode/commands/wtfp/help.md +37 -0
- package/vendors/opencode/commands/wtfp/insert-section.md +42 -4
- package/vendors/opencode/commands/wtfp/list-assumptions.md +42 -4
- package/vendors/opencode/commands/wtfp/map-project.md +37 -0
- package/vendors/opencode/commands/wtfp/new-paper.md +37 -0
- package/vendors/opencode/commands/wtfp/pause-writing.md +37 -0
- package/vendors/opencode/commands/wtfp/plan-milestone-gaps.md +38 -1
- package/vendors/opencode/commands/wtfp/plan-revision.md +310 -11
- package/vendors/opencode/commands/wtfp/plan-section.md +44 -6
- package/vendors/opencode/commands/wtfp/polish-prose.md +281 -7
- package/vendors/opencode/commands/wtfp/progress.md +37 -0
- package/vendors/opencode/commands/wtfp/quick.md +39 -2
- package/vendors/opencode/commands/wtfp/resume-writing.md +37 -0
- package/vendors/opencode/commands/wtfp/review-section.md +38 -1
- package/vendors/opencode/commands/wtfp/settings.md +37 -0
- package/vendors/opencode/commands/wtfp/submit-milestone.md +40 -3
- package/vendors/opencode/commands/wtfp/verify-work.md +48 -6
- package/vendors/opencode/commands/wtfp/write-section.md +41 -4
- package/vendors/opencode/project/README.md +37 -0
- package/vendors/opencode/project/schemas/interaction.schema.json +100 -0
- package/vendors/opencode/project/templates/interaction.json +16 -0
- package/vendors/opencode/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/opencode/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/opencode/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/opencode/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/opencode/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/opencode/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/opencode/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/opencode/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/opencode/workflows/checkpoint.md +2 -2
- package/vendors/opencode/workflows/execute-outline.md +2 -2
- package/vendors/opencode/workflows/export-latex.md +4 -4
- package/vendors/opencode/workflows/plan-revision.md +4 -3
- package/vendors/opencode/workflows/plan-section.md +2 -2
- package/vendors/opencode/workflows/polish-prose.md +3 -3
- package/vendors/opencode/workflows/research-gap.md +2 -2
- package/vendors/opencode/workflows/verify-work.md +3 -3
- package/vendors/opencode/workflows/write-section.md +2 -2
- package/vendors/plugin/.wtfp-generated.json +73 -65
- package/vendors/plugin/actions/checkpoint.json +10 -1
- package/vendors/plugin/actions/execute-outline.json +10 -2
- package/vendors/plugin/actions/export-latex.json +15 -2
- package/vendors/plugin/actions/plan-revision.json +17 -4
- package/vendors/plugin/actions/polish-prose.json +13 -3
- package/vendors/plugin/actions/research-gap.json +16 -3
- package/vendors/plugin/actions/verify-work.json +7 -2
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-argument-verifier.md +3 -3
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-coherence-checker.md +3 -3
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-plan-checker.md +3 -3
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-section-reviewer.md +3 -3
- package/vendors/plugin/ai.iowarp.clio/playbooks/wtfp-draft-review.md +1 -1
- package/vendors/plugin/ai.iowarp.clio/playbooks/wtfp-plan-section.md +1 -1
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/add-todo.md +15 -2
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/analyze-bib.md +30 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/audit-milestone.md +18 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/check-refs.md +30 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/check-todos.md +17 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/checkpoint.md +19 -5
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/create-outline.md +29 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/create-poster.md +9 -0
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/create-slides.md +9 -0
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/discuss-section.md +17 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/execute-outline.md +33 -6
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/export-latex.md +26 -21
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/help.md +1 -1
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/insert-section.md +17 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/list-assumptions.md +6 -0
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/map-project.md +15 -2
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/new-paper.md +17 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/pause-writing.md +15 -2
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-milestone-gaps.md +17 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-revision.md +25 -18
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-section.md +32 -6
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/polish-prose.md +33 -6
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/progress.md +7 -0
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/quick.md +30 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/research-gap.md +33 -5
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/resume-writing.md +17 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/review-section.md +27 -4
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/settings.md +17 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/submit-milestone.md +17 -3
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/verify-work.md +20 -6
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/write-section.md +33 -6
- package/vendors/plugin/compatibility/action-availability.json +2 -2
- package/vendors/plugin/plugin.json +2 -2
- package/vendors/plugin/project/README.md +37 -0
- package/vendors/plugin/project/schemas/interaction.schema.json +100 -0
- package/vendors/plugin/project/templates/interaction.json +16 -0
- package/vendors/plugin/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/plugin/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/plugin/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/plugin/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/plugin/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/plugin/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/plugin/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/plugin/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/plugin/workflows/checkpoint.md +2 -2
- package/vendors/plugin/workflows/execute-outline.md +2 -2
- package/vendors/plugin/workflows/export-latex.md +4 -4
- package/vendors/plugin/workflows/plan-revision.md +4 -3
- package/vendors/plugin/workflows/plan-section.md +2 -2
- package/vendors/plugin/workflows/polish-prose.md +3 -3
- package/vendors/plugin/workflows/research-gap.md +2 -2
- package/vendors/plugin/workflows/verify-work.md +3 -3
- package/vendors/plugin/workflows/write-section.md +2 -2
- package/vendors/antigravity/commands/wtfp-plan-section.md +0 -78
- package/vendors/antigravity/commands/wtfp-write-section.md +0 -77
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
// Generated by WTF-P adapter compiler v5 from evaluation/lib/claim-coverage.js; do not edit.
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// Structural claim coverage for a portable WTF-P project. It checks that each
|
|
5
|
+
// section claim links to evidence that resolves, belongs to the project,
|
|
6
|
+
// names the claim, rests on a usable source, and was inspected deeply enough
|
|
7
|
+
// to support anything. It never judges whether a passage actually supports a
|
|
8
|
+
// sentence: that semantic question belongs to an independent reviewer, and
|
|
9
|
+
// every report says so. The adapter compiler copies this file into the Clio
|
|
10
|
+
// desk as runtime/claim-coverage.cjs, so it stays dependency-free and pure.
|
|
11
|
+
|
|
12
|
+
const STRUCTURAL_SCOPE = 'Structural check of claim, evidence and source records only; whether a cited passage supports its claim needs independent review.';
|
|
13
|
+
|
|
14
|
+
// `primary-data` is direct inspection of the material itself and supports a
|
|
15
|
+
// claim as fully as full text, but only a source inspected as primary data can
|
|
16
|
+
// stand behind it: reading a paper is not inspecting its data.
|
|
17
|
+
const INSPECTION_RANK = Object.freeze({ metadata: 0, abstract: 1, 'full-text': 2, 'primary-data': 3 });
|
|
18
|
+
|
|
19
|
+
const SEVERITY_ORDER = Object.freeze(['blocker', 'error', 'warning', 'info']);
|
|
20
|
+
|
|
21
|
+
function finding(severity, code, subject, message) {
|
|
22
|
+
return { severity, code, subject, message };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function rank(depth) {
|
|
26
|
+
return Object.prototype.hasOwnProperty.call(INSPECTION_RANK, depth) ? INSPECTION_RANK[depth] : -1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// A LaTeX citation command and what follows it: optional arguments in
|
|
30
|
+
// brackets or parentheses, then one braced key list, or one per citation for
|
|
31
|
+
// the multi-cite commands whose names end in `s` (`\cites{a}{b}`). Matched
|
|
32
|
+
// case-insensitively, so `\Cite` and `\Textcite` count too.
|
|
33
|
+
const LATEX_CITE = /\\([a-z]*cite[a-z]*)\*?/giu;
|
|
34
|
+
|
|
35
|
+
function bracketed(body, start, open, close) {
|
|
36
|
+
let depth = 0;
|
|
37
|
+
for (let index = start; index < body.length; index += 1) {
|
|
38
|
+
if (body[index] === open) depth += 1;
|
|
39
|
+
else if (body[index] === close && --depth === 0) return index + 1;
|
|
40
|
+
}
|
|
41
|
+
return -1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function latexCitations(body, keys, unparsed) {
|
|
45
|
+
for (const match of body.matchAll(LATEX_CITE)) {
|
|
46
|
+
// \nocite adds bibliography entries without citing them in the text.
|
|
47
|
+
if (/^nocite$/iu.test(match[1])) continue;
|
|
48
|
+
const multi = /s$/iu.test(match[1]);
|
|
49
|
+
let at = match.index + match[0].length;
|
|
50
|
+
let groups = 0;
|
|
51
|
+
for (;;) {
|
|
52
|
+
while (at < body.length && /\s/u.test(body[at])) at += 1;
|
|
53
|
+
const open = body[at];
|
|
54
|
+
if (open === '[' || open === '(') {
|
|
55
|
+
const end = bracketed(body, at, open, open === '[' ? ']' : ')');
|
|
56
|
+
if (end < 0) break;
|
|
57
|
+
at = end;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (open !== '{' || (groups > 0 && !multi)) break;
|
|
61
|
+
const end = bracketed(body, at, '{', '}');
|
|
62
|
+
if (end < 0) break;
|
|
63
|
+
for (const key of body.slice(at + 1, end - 1).split(',')) if (key.trim()) keys.add(key.trim());
|
|
64
|
+
groups += 1;
|
|
65
|
+
at = end;
|
|
66
|
+
}
|
|
67
|
+
if (groups === 0) unparsed.add(match[0].trim());
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Citation keys in Markdown (`[@key]`, `@key`, `@{key}`), LaTeX (`\cite{a,b}`
|
|
73
|
+
* and its variants) and Typst (`@key`, `#cite(<key>)`, `#cite(label("key"))`).
|
|
74
|
+
* Code spans and blocks are removed first so code never reads as a citation.
|
|
75
|
+
* `unparsed` lists citation commands whose keys could not be read; they fail
|
|
76
|
+
* closed rather than being treated as citing nothing.
|
|
77
|
+
*/
|
|
78
|
+
function citationScan(text, file) {
|
|
79
|
+
const keys = new Set();
|
|
80
|
+
const unparsed = new Set();
|
|
81
|
+
let body = String(text)
|
|
82
|
+
.replace(/```[\s\S]*?```/gu, ' ')
|
|
83
|
+
.replace(/`[^`\n]*`/gu, ' ')
|
|
84
|
+
.replace(/<!--[\s\S]*?-->/gu, ' ');
|
|
85
|
+
if (/\.tex$/u.test(file)) {
|
|
86
|
+
body = body.replace(/(^|[^\\])%.*$/gmu, '$1');
|
|
87
|
+
latexCitations(body, keys, unparsed);
|
|
88
|
+
return { keys: [...keys].sort(), unparsed: [...unparsed].sort() };
|
|
89
|
+
}
|
|
90
|
+
for (const match of body.matchAll(/#cite\(\s*<([^>\s]+)>/gu)) keys.add(match[1]);
|
|
91
|
+
for (const match of body.matchAll(/#cite\(\s*label\(\s*"([^"]+)"\s*\)/gu)) keys.add(match[1]);
|
|
92
|
+
for (const match of body.matchAll(/(^|[^\w@])@\{([^}]+)\}/gmu)) keys.add(match[2].trim());
|
|
93
|
+
// A bare `@` preceded by a word character is an e-mail address, not a citation.
|
|
94
|
+
for (const match of body.matchAll(/(^|[^\w@])@([A-Za-z0-9][A-Za-z0-9:_-]*[A-Za-z0-9]|[A-Za-z0-9])/gmu)) keys.add(match[2]);
|
|
95
|
+
return { keys: [...keys].sort(), unparsed: [...unparsed].sort() };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function citationKeys(text, file) {
|
|
99
|
+
return citationScan(text, file).keys;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Records keyed by logical URI. An id carried by more than one record names
|
|
104
|
+
* none of them, so every one is left out and reported instead of one winning
|
|
105
|
+
* by file order. `entries` are `{ file, record }`.
|
|
106
|
+
*/
|
|
107
|
+
function indexRecords(entries, collection, location = null) {
|
|
108
|
+
const groups = new Map();
|
|
109
|
+
const ignored = [];
|
|
110
|
+
for (const entry of entries) {
|
|
111
|
+
const id = entry.record && entry.record.id;
|
|
112
|
+
if (typeof id !== 'string') continue;
|
|
113
|
+
// A logical URI resolves to one protocol file; a record anywhere else is not the one it names.
|
|
114
|
+
if (location && entry.file !== location(id)) {
|
|
115
|
+
ignored.push({ file: entry.file, reason: `a record with the id ${id} belongs at ${location(id)}` });
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (!groups.has(id)) groups.set(id, []);
|
|
119
|
+
groups.get(id).push(entry);
|
|
120
|
+
}
|
|
121
|
+
const byUri = {};
|
|
122
|
+
for (const [id, group] of [...groups.entries()].sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))) {
|
|
123
|
+
if (group.length === 1) byUri[`project://${collection}/${id}`] = group[0].record;
|
|
124
|
+
else ignored.push(...group.map(entry => ({ file: entry.file, reason: `${group.length} records carry the id ${id}, so none of them counts` })));
|
|
125
|
+
}
|
|
126
|
+
ignored.sort((left, right) => (left.file < right.file ? -1 : left.file > right.file ? 1 : 0));
|
|
127
|
+
return { byUri, ignored };
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Analyze one project's claims. `input` holds already-loaded records:
|
|
132
|
+
* projectId: the manifest id
|
|
133
|
+
* outline: the outline record, or null
|
|
134
|
+
* sections: [{ uri, record }]
|
|
135
|
+
* evidence: { [uri]: record }
|
|
136
|
+
* sources: { [uri]: record }
|
|
137
|
+
* manuscripts: [{ section, file, text }] for citation-key resolution (optional)
|
|
138
|
+
* ignored: [{ file, reason }] records the loader left out (optional)
|
|
139
|
+
* unread: [{ section, file, reason }] manuscripts the loader could not read (optional)
|
|
140
|
+
* Unreadable records are the caller's to report; a missing URI here is dangling.
|
|
141
|
+
*/
|
|
142
|
+
function analyzeCoverage(input) {
|
|
143
|
+
const projectId = input.projectId;
|
|
144
|
+
const evidence = input.evidence || {};
|
|
145
|
+
const sources = input.sources || {};
|
|
146
|
+
const findings = [];
|
|
147
|
+
const claims = [];
|
|
148
|
+
const researchRequired = new Map(
|
|
149
|
+
((input.outline && Array.isArray(input.outline.sections)) ? input.outline.sections : [])
|
|
150
|
+
.map(entry => [entry.id, Boolean(entry.research && entry.research.required)])
|
|
151
|
+
);
|
|
152
|
+
for (const item of input.ignored || []) {
|
|
153
|
+
findings.push(finding('error', 'record-ignored', item.file, `${item.file} was left out of coverage: ${item.reason}.`));
|
|
154
|
+
}
|
|
155
|
+
for (const item of input.unread || []) {
|
|
156
|
+
findings.push(finding('error', 'manuscript-unread', `project://sections/${item.section}`, `${item.file} could not be checked for citations: ${item.reason}.`));
|
|
157
|
+
}
|
|
158
|
+
// Evidence names its claim by id alone, so a claim id must name one claim in the whole project.
|
|
159
|
+
const claimCount = new Map();
|
|
160
|
+
for (const { record } of input.sections || []) {
|
|
161
|
+
for (const claim of Array.isArray(record.claims) ? record.claims : []) claimCount.set(claim.id, (claimCount.get(claim.id) || 0) + 1);
|
|
162
|
+
}
|
|
163
|
+
const reused = new Set([...claimCount].filter(([, count]) => count > 1).map(([id]) => id));
|
|
164
|
+
// Contradictions on record for a claim, linked from it or not.
|
|
165
|
+
const contradictionsOnRecord = new Map();
|
|
166
|
+
for (const [evidenceUri, item] of Object.entries(evidence)) {
|
|
167
|
+
if (!item || item.relation !== 'contradicts' || item.project_id !== projectId) continue;
|
|
168
|
+
if (!contradictionsOnRecord.has(item.claim_id)) contradictionsOnRecord.set(item.claim_id, []);
|
|
169
|
+
contradictionsOnRecord.get(item.claim_id).push(evidenceUri);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
for (const { uri, record } of input.sections || []) {
|
|
173
|
+
const sectionId = record.id;
|
|
174
|
+
for (const claim of Array.isArray(record.claims) ? record.claims : []) {
|
|
175
|
+
const subject = `${uri}#${claim.id}`;
|
|
176
|
+
const drafted = claim.status === 'drafted' || claim.status === 'verified';
|
|
177
|
+
let best = -1;
|
|
178
|
+
let supports = 0;
|
|
179
|
+
let contradicts = 0;
|
|
180
|
+
if (reused.has(claim.id)) {
|
|
181
|
+
findings.push(finding('error', 'claim-id-duplicate', subject, `Another claim in the project also has the id ${claim.id}, so no evidence can say which one it supports; give each claim its own id.`));
|
|
182
|
+
claims.push({ section: sectionId, claim: claim.id, status: claim.status, evidence_required: claim.evidence_required === true, support: 'none', contested: false, research_required: researchRequired.get(sectionId) === true });
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
const linked = new Set(Array.isArray(claim.evidence_uris) ? claim.evidence_uris : []);
|
|
186
|
+
for (const evidenceUri of contradictionsOnRecord.get(claim.id) || []) {
|
|
187
|
+
if (linked.has(evidenceUri)) continue;
|
|
188
|
+
contradicts += 1;
|
|
189
|
+
findings.push(finding(claim.status === 'verified' ? 'blocker' : drafted ? 'error' : 'warning', 'evidence-contradicts-unlinked', subject, `${evidenceUri} records that its source contradicts the claim, but the claim does not link it; the claim is contested until the author resolves it.`));
|
|
190
|
+
}
|
|
191
|
+
for (const evidenceUri of linked) {
|
|
192
|
+
const item = evidence[evidenceUri];
|
|
193
|
+
if (!item) {
|
|
194
|
+
findings.push(finding('error', 'evidence-dangling', subject, `${evidenceUri} does not resolve to an evidence record.`));
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
if (item.project_id !== projectId) {
|
|
198
|
+
findings.push(finding('error', 'evidence-cross-project', subject, `${evidenceUri} belongs to project ${item.project_id}, not ${projectId}.`));
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
if (item.claim_id !== claim.id) {
|
|
202
|
+
findings.push(finding('error', 'evidence-claim-mismatch', subject, `${evidenceUri} interprets claim ${item.claim_id}, not ${claim.id}.`));
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
const source = sources[item.source_uri];
|
|
206
|
+
if (!source) {
|
|
207
|
+
findings.push(finding('error', 'source-dangling', subject, `${evidenceUri} cites ${item.source_uri}, which does not resolve.`));
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
if (source.project_id !== projectId) {
|
|
211
|
+
findings.push(finding('error', 'source-cross-project', subject, `${item.source_uri} belongs to project ${source.project_id}, not ${projectId}.`));
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
if (item.relation === 'contradicts') {
|
|
215
|
+
contradicts += 1;
|
|
216
|
+
findings.push(finding(claim.status === 'verified' ? 'blocker' : drafted ? 'error' : 'warning', 'evidence-contradicts', subject, `${evidenceUri} records that ${item.source_uri} contradicts the claim; the claim is contested until the author resolves it.`));
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
if (item.relation !== 'supports') continue;
|
|
220
|
+
if (source.status === 'retracted' || source.status === 'unavailable') {
|
|
221
|
+
findings.push(finding(claim.status === 'verified' ? 'blocker' : 'error', `source-${source.status}`, subject, `${item.source_uri} is ${source.status}; it cannot support the claim.`));
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
if (source.status !== 'verified') {
|
|
225
|
+
findings.push(finding('warning', 'source-provisional', subject, `${item.source_uri} is ${source.status}; a search candidate or unverified identity cannot support a claim until its record is verified.`));
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
const depth = rank(item.inspection_depth);
|
|
229
|
+
const sourceDepth = rank(source.provenance && source.provenance.inspection_depth);
|
|
230
|
+
if (depth > sourceDepth) {
|
|
231
|
+
findings.push(finding('error', 'inspection-exceeds-source', subject, `${evidenceUri} claims ${item.inspection_depth} inspection, but ${item.source_uri} records only ${source.provenance ? source.provenance.inspection_depth : 'no'} inspection.`));
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
if (depth < 1) {
|
|
235
|
+
findings.push(finding('warning', 'inspection-metadata-only', subject, `${evidenceUri} rests on metadata alone; a resolvable identifier is not support for a claim.`));
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
supports += 1;
|
|
239
|
+
best = Math.max(best, depth);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
const support = best >= INSPECTION_RANK['full-text'] ? 'full' : best === INSPECTION_RANK.abstract ? 'partial' : 'none';
|
|
243
|
+
const required = claim.evidence_required === true && claim.status !== 'rejected';
|
|
244
|
+
if (required && support === 'none') {
|
|
245
|
+
const none = !Array.isArray(claim.evidence_uris) || claim.evidence_uris.length === 0;
|
|
246
|
+
findings.push(finding(
|
|
247
|
+
claim.status === 'verified' ? 'blocker' : drafted ? 'error' : 'warning',
|
|
248
|
+
none ? 'evidence-missing' : 'support-missing',
|
|
249
|
+
subject,
|
|
250
|
+
none
|
|
251
|
+
? `The claim requires evidence and links none.`
|
|
252
|
+
: `The claim requires evidence and none of its links qualifies as support.`
|
|
253
|
+
));
|
|
254
|
+
} else if (required && support === 'partial') {
|
|
255
|
+
findings.push(finding('info', 'support-abstract-only', subject, 'The strongest support was inspected at abstract depth; keep the sentence no stronger than the abstract states.'));
|
|
256
|
+
}
|
|
257
|
+
if (claim.status === 'verified' && contradicts > 0 && supports === 0) {
|
|
258
|
+
findings.push(finding('blocker', 'verified-against-evidence', subject, 'The claim is marked verified while its only linked evidence contradicts it.'));
|
|
259
|
+
}
|
|
260
|
+
claims.push({
|
|
261
|
+
section: sectionId,
|
|
262
|
+
claim: claim.id,
|
|
263
|
+
status: claim.status,
|
|
264
|
+
evidence_required: claim.evidence_required === true,
|
|
265
|
+
support,
|
|
266
|
+
contested: contradicts > 0,
|
|
267
|
+
research_required: researchRequired.get(sectionId) === true
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// An outline claim that a started section does not record cannot have support behind it.
|
|
273
|
+
const recorded = new Map((input.sections || []).map(({ record }) => [record.id, new Set((Array.isArray(record.claims) ? record.claims : []).map(claim => claim.id))]));
|
|
274
|
+
for (const entry of (input.outline && Array.isArray(input.outline.sections)) ? input.outline.sections : []) {
|
|
275
|
+
if (!recorded.has(entry.id)) continue;
|
|
276
|
+
for (const claimId of Array.isArray(entry.claim_ids) ? entry.claim_ids : []) {
|
|
277
|
+
if (recorded.get(entry.id).has(claimId)) continue;
|
|
278
|
+
findings.push(finding('error', 'claim-missing', `project://sections/${entry.id}#${claimId}`, `The outline assigns ${claimId} to ${entry.id}, but the section record does not record it.`));
|
|
279
|
+
claims.push({ section: entry.id, claim: claimId, status: 'missing', evidence_required: true, support: 'none', contested: false, research_required: researchRequired.get(entry.id) === true });
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const keys = new Map();
|
|
284
|
+
for (const source of Object.values(sources)) {
|
|
285
|
+
if (!source || typeof source.citation_key !== 'string') continue;
|
|
286
|
+
if (!keys.has(source.citation_key)) keys.set(source.citation_key, []);
|
|
287
|
+
keys.get(source.citation_key).push(source);
|
|
288
|
+
}
|
|
289
|
+
for (const manuscript of input.manuscripts || []) {
|
|
290
|
+
const scanned = citationScan(manuscript.text, manuscript.file);
|
|
291
|
+
for (const command of scanned.unparsed) {
|
|
292
|
+
findings.push(finding('error', 'citation-unparsed', `project://sections/${manuscript.section}`, `${manuscript.file} uses ${command}, whose keys could not be read; write it as a plain citation so its source can be checked.`));
|
|
293
|
+
}
|
|
294
|
+
for (const key of scanned.keys) {
|
|
295
|
+
const carriers = keys.get(key) || [];
|
|
296
|
+
const source = carriers[0];
|
|
297
|
+
const subject = `project://sections/${manuscript.section}`;
|
|
298
|
+
if (!source) findings.push(finding('error', 'citation-unresolved', subject, `${manuscript.file} cites ${key}, which no source record carries.`));
|
|
299
|
+
else if (carriers.length > 1) findings.push(finding('error', 'citation-ambiguous', subject, `${manuscript.file} cites ${key}, which ${carriers.length} source records carry.`));
|
|
300
|
+
else if (source.project_id !== projectId) {
|
|
301
|
+
findings.push(finding('error', 'citation-cross-project', subject, `${manuscript.file} cites ${key}, whose source belongs to project ${source.project_id}.`));
|
|
302
|
+
} else if (source.status === 'retracted' || source.status === 'unavailable') {
|
|
303
|
+
findings.push(finding('error', `citation-${source.status}`, subject, `${manuscript.file} cites ${key}, whose source is ${source.status}.`));
|
|
304
|
+
} else if (source.status !== 'verified') {
|
|
305
|
+
findings.push(finding('error', 'citation-provisional', subject, `${manuscript.file} cites ${key}, whose source is ${source.status}; a candidate is not a citation until its record is verified.`));
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
findings.sort((left, right) =>
|
|
311
|
+
SEVERITY_ORDER.indexOf(left.severity) - SEVERITY_ORDER.indexOf(right.severity) ||
|
|
312
|
+
left.subject.localeCompare(right.subject) ||
|
|
313
|
+
left.code.localeCompare(right.code));
|
|
314
|
+
return { scope: STRUCTURAL_SCOPE, findings, claims };
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/** Required claims of one section that have no qualifying support or stand contested, by claim id. */
|
|
318
|
+
function unsupportedRequired(report, sectionId) {
|
|
319
|
+
return report.claims
|
|
320
|
+
.filter(claim => claim.section === sectionId && claim.evidence_required && claim.status !== 'rejected' && (claim.support === 'none' || claim.contested))
|
|
321
|
+
.map(claim => claim.claim);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
module.exports = {
|
|
325
|
+
INSPECTION_RANK,
|
|
326
|
+
STRUCTURAL_SCOPE,
|
|
327
|
+
analyzeCoverage,
|
|
328
|
+
citationKeys,
|
|
329
|
+
citationScan,
|
|
330
|
+
indexRecords,
|
|
331
|
+
unsupportedRequired
|
|
332
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Generated by WTF-P adapter compiler v5 from evaluation/lib/desk-trust.js; do not edit.
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// Whether a checkpoint's recorded answer is the author's, decided from the
|
|
5
|
+
// project's own records and the desk's seal key. The Clio desk and the
|
|
6
|
+
// campaign collector share this one implementation: the adapter compiler
|
|
7
|
+
// copies it into the desk as runtime/desk-trust.cjs, so it stays pure and
|
|
8
|
+
// depends on nothing but node:crypto.
|
|
9
|
+
//
|
|
10
|
+
// `attested` means an interaction sealed under this key, given at the desk's
|
|
11
|
+
// interview, still matches the checkpoint it answered; `unattested` is a
|
|
12
|
+
// resolution no such interaction stands behind; `foreign` was sealed under
|
|
13
|
+
// another key and cannot be checked here.
|
|
14
|
+
|
|
15
|
+
const crypto = require('crypto');
|
|
16
|
+
|
|
17
|
+
const SEAL_METHOD = 'hmac-sha256';
|
|
18
|
+
const CHANNEL = 'attested-interview';
|
|
19
|
+
|
|
20
|
+
function sha256(data) {
|
|
21
|
+
return crypto.createHash('sha256').update(data).digest('hex');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** JSON with object keys in code-unit order and no insignificant whitespace; the input to every digest and seal. */
|
|
25
|
+
function canonical(value) {
|
|
26
|
+
if (Array.isArray(value)) return `[${value.map(canonical).join(',')}]`;
|
|
27
|
+
if (value !== null && typeof value === 'object') {
|
|
28
|
+
return `{${Object.keys(value).filter(key => value[key] !== undefined).sort()
|
|
29
|
+
.map(key => `${JSON.stringify(key)}:${canonical(value[key])}`).join(',')}}`;
|
|
30
|
+
}
|
|
31
|
+
return JSON.stringify(value);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** What a checkpoint asks, independent of whether and how it was answered. */
|
|
35
|
+
function checkpointDigest(record) {
|
|
36
|
+
const asked = { ...record };
|
|
37
|
+
for (const key of ['status', 'resolution', 'file', 'trust', 'answer']) delete asked[key];
|
|
38
|
+
return sha256(canonical(asked));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function keyId(key) {
|
|
42
|
+
return sha256(key).slice(0, 16);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function mac(body, key) {
|
|
46
|
+
return crypto.createHmac('sha256', key).update(canonical(body)).digest('hex');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The desk's seal over an interaction record: an HMAC of its canonical form under this machine's key. */
|
|
50
|
+
function seal(record, key) {
|
|
51
|
+
const body = { ...record };
|
|
52
|
+
delete body.seal;
|
|
53
|
+
return { ...body, seal: { method: SEAL_METHOD, key_id: keyId(key), mac: mac(body, key) } };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Checks a seal in exactly the form `seal` writes it; any other spelling is invalid, never valid. */
|
|
57
|
+
function sealState(record, key) {
|
|
58
|
+
const value = record.seal;
|
|
59
|
+
if (value === undefined) return 'unsealed';
|
|
60
|
+
if (
|
|
61
|
+
value === null || typeof value !== 'object' || Array.isArray(value) ||
|
|
62
|
+
Object.keys(value).length !== 3 ||
|
|
63
|
+
value.method !== SEAL_METHOD ||
|
|
64
|
+
typeof value.key_id !== 'string' || !/^[a-f0-9]{16}$/u.test(value.key_id) ||
|
|
65
|
+
typeof value.mac !== 'string' || !/^[a-f0-9]{64}$/u.test(value.mac)
|
|
66
|
+
) return 'invalid';
|
|
67
|
+
if (!key || value.key_id !== keyId(key)) return 'foreign';
|
|
68
|
+
const body = { ...record };
|
|
69
|
+
delete body.seal;
|
|
70
|
+
const expected = Buffer.from(mac(body, key), 'hex');
|
|
71
|
+
const actual = Buffer.from(value.mac, 'hex');
|
|
72
|
+
return actual.length === expected.length && crypto.timingSafeEqual(actual, expected) ? 'valid' : 'invalid';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** The outcome an interaction must carry to stand behind a checkpoint's recorded resolution. */
|
|
76
|
+
function matchesResolution(interaction, checkpoint) {
|
|
77
|
+
if (interaction.kind !== 'checkpoint-answer' || interaction.channel !== CHANNEL) return false;
|
|
78
|
+
if (interaction.subject_uri !== `project://checkpoints/${checkpoint.id}`) return false;
|
|
79
|
+
if (checkpoint.status === 'waived') return interaction.outcome === 'waived';
|
|
80
|
+
const option = checkpoint.resolution && checkpoint.resolution.selected_option;
|
|
81
|
+
return option ? interaction.outcome === 'selected' && interaction.selected_option === option : interaction.outcome === 'done';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The trust of one checkpoint's recorded state: `snapshot`, `pending`,
|
|
86
|
+
* `expired` and `policy` come from the checkpoint alone; a resolution is
|
|
87
|
+
* `attested` only by the newest matching interaction with a valid seal, for
|
|
88
|
+
* this project and for exactly what the checkpoint asks.
|
|
89
|
+
*/
|
|
90
|
+
function trustOf(checkpoint, interactions, key, projectId) {
|
|
91
|
+
if (checkpoint.kind === 'state-snapshot') return { trust: 'snapshot' };
|
|
92
|
+
const status = checkpoint.status || 'pending';
|
|
93
|
+
if (status === 'pending') return { trust: 'pending' };
|
|
94
|
+
if (status === 'expired') return { trust: 'expired' };
|
|
95
|
+
if (checkpoint.resolution && checkpoint.resolution.resolved_by === 'policy') return { trust: 'policy' };
|
|
96
|
+
const digest = checkpointDigest(checkpoint);
|
|
97
|
+
let foreign = false;
|
|
98
|
+
const answers = interactions
|
|
99
|
+
.filter(interaction =>
|
|
100
|
+
matchesResolution(interaction, { ...checkpoint, status }) &&
|
|
101
|
+
interaction.project_id === projectId &&
|
|
102
|
+
interaction.presented && interaction.presented.content_sha256 === digest)
|
|
103
|
+
.sort((a, b) => String(b.answered_at || '').localeCompare(String(a.answered_at || '')));
|
|
104
|
+
for (const interaction of answers) {
|
|
105
|
+
const state = sealState(interaction, key);
|
|
106
|
+
if (state === 'valid') return { trust: 'attested', answer: interaction };
|
|
107
|
+
if (state === 'foreign') foreign = true;
|
|
108
|
+
}
|
|
109
|
+
return { trust: foreign ? 'foreign' : 'unattested' };
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
module.exports = { CHANNEL, SEAL_METHOD, canonical, checkpointDigest, keyId, matchesResolution, seal, sealState, trustOf };
|