wtf-p 0.8.2 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +9 -9
  2. package/bin/lib/adapter-compiler.js +7 -3
  3. package/package.json +1 -1
  4. package/protocol/workflows/review-section.md +2 -2
  5. package/vendors/antigravity/.wtfp-generated.json +4 -4
  6. package/vendors/antigravity/plugin.json +2 -2
  7. package/vendors/antigravity/skills/wtfp-review-section/SKILL.md +2 -2
  8. package/vendors/antigravity/workflows/review-section.md +2 -2
  9. package/vendors/claude/.claude-plugin/marketplace.json +2 -2
  10. package/vendors/claude/.claude-plugin/plugin.json +1 -1
  11. package/vendors/claude/.wtfp-generated.json +12 -12
  12. package/vendors/claude/ai.iowarp.clio/agents/wtfp-section-writer.md +2 -0
  13. package/vendors/claude/ai.iowarp.clio/prompts/wtfp/execute-outline.md +1 -1
  14. package/vendors/claude/ai.iowarp.clio/prompts/wtfp/help.md +1 -1
  15. package/vendors/claude/ai.iowarp.clio/prompts/wtfp/plan-section.md +1 -1
  16. package/vendors/claude/ai.iowarp.clio/prompts/wtfp/review-section.md +3 -3
  17. package/vendors/claude/ai.iowarp.clio/prompts/wtfp/write-section.md +1 -1
  18. package/vendors/claude/commands/review-section.md +2 -2
  19. package/vendors/claude/plugin.json +1 -1
  20. package/vendors/claude/workflows/review-section.md +2 -2
  21. package/vendors/clio-extension/.wtfp-generated.json +4 -4
  22. package/vendors/clio-extension/clio-coder-extension.yaml +1 -1
  23. package/vendors/clio-extension/runtime/extension.test.ts +75 -7
  24. package/vendors/clio-extension/runtime/extension.ts +174 -32
  25. package/vendors/codex/plugins/wtfp/.codex-plugin/plugin.json +1 -1
  26. package/vendors/codex/plugins/wtfp/.wtfp-generated.json +4 -4
  27. package/vendors/codex/plugins/wtfp/plugin.json +1 -1
  28. package/vendors/codex/plugins/wtfp/workflows/review-section.md +2 -2
  29. package/vendors/copilot/.wtfp-generated.json +3 -3
  30. package/vendors/copilot/marketplace.json +2 -2
  31. package/vendors/copilot/plugins/wtfp/.claude-plugin/plugin.json +1 -1
  32. package/vendors/copilot/plugins/wtfp/.wtfp-generated.json +4 -4
  33. package/vendors/copilot/plugins/wtfp/commands/wtfp-review-section.md +2 -2
  34. package/vendors/copilot/plugins/wtfp/workflows/review-section.md +2 -2
  35. package/vendors/copilot/project/.github/wtfp/workflows/review-section.md +2 -2
  36. package/vendors/gemini/.wtfp-generated.json +4 -4
  37. package/vendors/gemini/commands/wtfp/review-section.toml +2 -2
  38. package/vendors/gemini/gemini-extension.json +1 -1
  39. package/vendors/gemini/workflows/review-section.md +2 -2
  40. package/vendors/opencode/.wtfp-generated.json +3 -3
  41. package/vendors/opencode/commands/wtfp/review-section.md +2 -2
  42. package/vendors/opencode/workflows/review-section.md +2 -2
  43. package/vendors/plugin/.wtfp-generated.json +15 -15
  44. package/vendors/plugin/ai.iowarp.clio/agents/wtfp-section-writer.md +2 -0
  45. package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/advance.md +2 -2
  46. package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/checkpoint.md +1 -1
  47. package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/discuss-section.md +1 -1
  48. package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/execute-outline.md +2 -2
  49. package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/help.md +1 -1
  50. package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-milestone-gaps.md +1 -1
  51. package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-revision.md +1 -1
  52. package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-section.md +2 -2
  53. package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/review-section.md +3 -3
  54. package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/verify-work.md +1 -1
  55. package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/write-section.md +3 -3
  56. package/vendors/plugin/plugin.json +1 -1
  57. package/vendors/plugin/workflows/review-section.md +2 -2
package/README.md CHANGED
@@ -19,7 +19,7 @@ the scientific judgment. The agent keeps the bookkeeping and does bounded jobs.
19
19
 
20
20
  It ships as one canonical [Agent Plugins 1.0.0](https://agent-plugins.org)
21
21
  bundle that a deterministic compiler projects into a native package for seven
22
- coding-agent hosts. Version `0.8.2` is the current stable release and is
22
+ coding-agent hosts. Version `0.8.3` is the current stable release and is
23
23
  what npm `latest` resolves to; v0.5 remains installable by explicit version.
24
24
 
25
25
  **Optional CiteNexus research backend (since 0.7.0):** `citation-search --backend=cite-nexus`
@@ -56,13 +56,13 @@ registers it with the host's native plugin lifecycle where one exists.
56
56
 
57
57
  | Host | Install | Native registration the installer performs | Verified with |
58
58
  | --- | --- | --- | --- |
59
- | Clio Coder (0.6.3 or newer) | `npx --yes --package=wtf-p@0.8.2 -- wtf-p install clio` | `clio-coder library install <staged-bundle> --user` and `clio-coder library inspect plugin:wtfp --user --json`, then `clio-coder extensions install <staged-extension> --user` and `clio-coder extensions list --user --json` | Clio Coder 0.8.2 release: desk tests 61/61 and a full `/wtfp:advance` drive to a delivered milestone |
60
- | Claude Code | `npx --yes --package=wtf-p@0.8.2 -- wtf-p install claude` | `claude plugin marketplace add <root>/marketplaces/wtfp --scope user`, then `claude plugin install wtfp@wtfp --scope user -y` | 2.1.319 |
61
- | Codex | `npx --yes --package=wtf-p@0.8.2 -- wtf-p install codex` | `codex plugin marketplace add <root>/marketplaces/wtfp`, then `codex plugin add wtfp@wtfp --json`; agents copied to `$CODEX_HOME/agents/` | 0.163.0 |
62
- | GitHub Copilot CLI | `npx --yes --package=wtf-p@0.8.2 -- wtf-p install copilot` | `copilot plugin marketplace add <root>/marketplaces/wtfp`, then `copilot plugin install wtfp@wtfp` | 1.0.107 |
63
- | OpenCode | `npx --yes --package=wtf-p@0.8.2 -- wtf-p install opencode` | Files under the OpenCode config root; OpenCode discovers them by directory | 1.19.5 |
64
- | Antigravity CLI | `npx --yes --package=wtf-p@0.8.2 -- wtf-p install antigravity` | `agy plugin install <root>/sources/wtfp` | 1.5.3 |
65
- | Gemini CLI | `npx --yes --package=wtf-p@0.8.2 -- wtf-p install gemini` | Files under `<root>/extensions/wtfp`; Gemini discovers the extension by directory | 0.67.0 |
59
+ | Clio Coder (0.6.3 or newer) | `npx --yes --package=wtf-p@0.8.3 -- wtf-p install clio` | `clio-coder library install <staged-bundle> --user` and `clio-coder library inspect plugin:wtfp --user --json`, then `clio-coder extensions install <staged-extension> --user` and `clio-coder extensions list --user --json` | Clio Coder 0.8.3 release: desk tests 61/61 and a brownfield revision driven back to a delivered milestone |
60
+ | Claude Code | `npx --yes --package=wtf-p@0.8.3 -- wtf-p install claude` | `claude plugin marketplace add <root>/marketplaces/wtfp --scope user`, then `claude plugin install wtfp@wtfp --scope user -y` | 2.1.319 |
61
+ | Codex | `npx --yes --package=wtf-p@0.8.3 -- wtf-p install codex` | `codex plugin marketplace add <root>/marketplaces/wtfp`, then `codex plugin add wtfp@wtfp --json`; agents copied to `$CODEX_HOME/agents/` | 0.163.0 |
62
+ | GitHub Copilot CLI | `npx --yes --package=wtf-p@0.8.3 -- wtf-p install copilot` | `copilot plugin marketplace add <root>/marketplaces/wtfp`, then `copilot plugin install wtfp@wtfp` | 1.0.107 |
63
+ | OpenCode | `npx --yes --package=wtf-p@0.8.3 -- wtf-p install opencode` | Files under the OpenCode config root; OpenCode discovers them by directory | 1.19.5 |
64
+ | Antigravity CLI | `npx --yes --package=wtf-p@0.8.3 -- wtf-p install antigravity` | `agy plugin install <root>/sources/wtfp` | 1.5.3 |
65
+ | Gemini CLI | `npx --yes --package=wtf-p@0.8.3 -- wtf-p install gemini` | Files under `<root>/extensions/wtfp`; Gemini discovers the extension by directory | 0.67.0 |
66
66
 
67
67
  "Verified" means native discovery in a disposable profile on this exact
68
68
  envelope, with the commands recorded in
@@ -77,7 +77,7 @@ the old executable instead.
77
77
  ## Sixty-second start
78
78
 
79
79
  ```bash
80
- npx --yes --package=wtf-p@0.8.2 -- wtf-p install clio
80
+ npx --yes --package=wtf-p@0.8.3 -- wtf-p install clio
81
81
  cd /path/to/your-paper-or-proposal
82
82
  clio-coder --autonomy yolo
83
83
  ```
@@ -643,7 +643,7 @@ function clioUserGateBody(action, deskTools = false) {
643
643
  // A local model tried every branch of a two-way rule in turn; state only the one this action can take.
644
644
  const createsCheckpoint = action.produces.some((output) => output.uri === 'project://checkpoints/{checkpoint}' && output.mode === 'create');
645
645
  const route = createsCheckpoint
646
- ? 'For a pending checkpoint in the declared gate\'s exact scope, call `extension_wtfp__gate` with its ID; the desk shows it to the author and seals the answer. When none exists yet, create it pending through `extension_wtfp__record`, then call `extension_wtfp__gate` with its ID.'
646
+ ? 'For a pending checkpoint in the declared gate\'s exact scope, call `extension_wtfp__gate` with its ID; the desk shows it to the author and seals the answer. When none exists yet, create it pending through `extension_wtfp__record`, then call `extension_wtfp__gate` with its ID. The gate is the only place its question is asked: never ask it, or a preview of it, with `ask_user`, or the author answers twice.'
647
647
  : 'This action creates no checkpoint, so ask its gate question with `ask_user` and act on the structured answer; call `extension_wtfp__gate` only for a pending checkpoint `extension_wtfp__status` lists in the gate\'s exact scope, and never create one.';
648
648
  if (deskTools) return [
649
649
  '## Clio user-gate binding',
@@ -708,7 +708,9 @@ function clioDeskWorkflowBody(action, workflowBody) {
708
708
  .replace(/^Manuscript prose and supporting context,[^\n]+$/m,
709
709
  'Write prose and linked artifacts with native file tools; keep their authored formats. The record tool handles JSON records only, never manuscript text, deletion or archives.');
710
710
  if (action.id === 'write-section') body = body.replace(/^3\. Read the persisted manuscript text back[^\n]+$/m,
711
- '3. Read back the persisted manuscript, call `extension_wtfp__measure_section` with its section ID, and use the returned body count and target tolerance for validation and the summary; never use a worker self-report or hand-count words.');
711
+ '3. Read back the persisted manuscript, call `extension_wtfp__measure_section` with its section ID, and use the returned body count and target tolerance for validation and the summary; never use a worker self-report or hand-count words.')
712
+ .replace(/^4\. Create or update the required Markdown summary with that measured count,[^\n]+$/m,
713
+ '4. A dispatched writer has no word counter, so tell it to write the summary without a count; then add the measured count to the summary yourself and read back both manuscript and summary. Missing, empty, or inconsistent output is a failed completion condition, not permission to link a path that does not exist.');
712
714
  if (action.id === 'check-todos') body = body
713
715
  .replace(/^2\. Ask the user[^\n]+$/m, '2. Call `extension_wtfp__gate` for each selected pending checkpoint; the parked interview records the author\'s answer.')
714
716
  .replace(/^3\. Apply only[^\n]+$/m, '3. Read back the resulting checkpoint and state; retained or cancelled gates remain pending.');
@@ -920,7 +922,7 @@ function renderMarkdownCommand(action, workflowBody, target, availability, deskT
920
922
  const reviewerPhrasing = clioReviewers.length ? ` ${clioReviewers.join(', ')} ${clioReviewers.length === 1 ? 'is' : 'are'} read-only: begin each task for ${clioReviewers.length === 1 ? 'it' : 'them'} with "Review", because Clio refuses a read-only agent a task it reads as a change.` : '';
921
923
  const inlineRoles = target === 'clio' ? clioInlineRoles(action, reviewers, deskTools) : [];
922
924
  const inlineBody = inlineRoles.length ? `## Clio role binding\n\nThis action writes only JSON records, which on Clio only \`extension_wtfp__record\` writes, so a dispatched ${inlineRoles.map((role) => `\`wtfp-${role}\``).join(', ')} would have nothing it may write and the desk refuses it. Do ${inlineRoles.length === 1 ? 'that role\'s' : 'those roles\''} work in this turn yourself, following the skill loaded above, and write each record through \`extension_wtfp__record\`. Do not dispatch ${inlineRoles.length === 1 ? 'it' : 'them'}.` : '';
923
- const userGateBody = target === 'clio' ? [clioUserGateBody(action, deskTools), clioResearchConnectionBody(action), inlineBody, action.delegation.length > inlineRoles.length ? `## Clio role-result binding\n\nDispatch the declared specialist roles using these exact Clio agent IDs: ${clioRoles}. Do not substitute generic coder or verifier agents. Give every dispatched task an \`agent\` and an \`intent\` with workspace-relative \`read_roots\`, and keep absolute paths and \`project://\` URIs out of the task text, so Clio admits the scope you declare instead of inferring one from the prose. If a named agent is unavailable, report that blocker and stop instead of silently changing roles.${reviewerPhrasing}\n\nRead the single wtfp.role-result entry in native validations and parse its evidence string as portable role-result JSON.${clioReviewers.length ? ` A read-only reviewer returns only a verdict and checks, no wtfp.role-result entry: treat its report as completed, each failed check as an issue, and a fail verdict as a revise recommendation.` : ''} Validate its schema, role and action against the dispatched task. Missing, duplicate or malformed outcomes fail closed. On needs_input ask the author through ask_user and redispatch with the response; on blocked or failed stop and report the issue. Only completed permits downstream work, and it never substitutes for an author gate or artifact readback.` : ''].filter(Boolean).join('\n\n') : '';
925
+ const userGateBody = target === 'clio' ? [clioUserGateBody(action, deskTools), clioResearchConnectionBody(action), inlineBody, action.delegation.length > inlineRoles.length ? `## Clio role-result binding\n\nDispatch the declared specialist roles using these exact Clio agent IDs: ${clioRoles}. Do not substitute generic coder or verifier agents. Give every dispatched task an \`agent\` and an \`intent\` with workspace-relative \`read_roots\`, and keep absolute paths and \`project://\` URIs out of the task text, so Clio admits the scope you declare instead of inferring one from the prose. If a named agent is unavailable, report that blocker and stop instead of silently changing roles.${reviewerPhrasing}\n\nRead the single wtfp.role-result entry in native validations and parse its evidence string as portable role-result JSON.${clioReviewers.length ? ` A read-only reviewer returns only a verdict and checks, no wtfp.role-result entry: treat its report as completed, each failed check as an issue, and a fail verdict as a revise recommendation. Clio's dispatch result calls such a run's validation failed when a check did not pass; that is the review's finding, not a failed run, so record it as the action's procedure says.` : ''} Validate its schema, role and action against the dispatched task. Missing, duplicate or malformed outcomes fail closed. On needs_input ask the author through ask_user and redispatch with the response; on blocked or failed stop and report the issue. Only completed permits downstream work, and it never substitutes for an author gate or artifact readback.` : ''].filter(Boolean).join('\n\n') : '';
924
926
  lines.push(
925
927
  '---',
926
928
  '',
@@ -1232,6 +1234,8 @@ function renderClioRole(role, slug) {
1232
1234
  ...(verifier ? ['**Output:** your final message is one JSON object, `{"verdict":"pass|fail","checks":[...]}`, and nothing else. Do every step below as checks in that object, not as a Markdown review; the exact form is in the Clio result contract at the end.', ''] : []),
1233
1235
  nativeWorkflowBody(roleBodyWithoutPortableResult(role), 'clio'),
1234
1236
  '',
1237
+ // Live on Clio 0.8.3, a writer that could not count words returned blocked and stopped the drive.
1238
+ ...(/word count/i.test(roleBodyWithoutPortableResult(role)) ? ['On Clio a worker holds no word counter. The dispatching action measures the persisted manuscript after you return and writes that count into the summary, so write the summary without a count. A count you cannot take never blocks this role: return completed when the rest is done.', ''] : []),
1235
1239
  '## Clio result contract',
1236
1240
  '',
1237
1241
  nativeResult,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtf-p",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Portable, evidence-grounded academic writing workflows (papers, proposals, posters, presentations) for Clio Coder, Claude Code, Codex, GitHub Copilot CLI, OpenCode, Antigravity CLI, and Gemini CLI.",
5
5
  "bin": {
6
6
  "wtfp": "bin/install.js",
@@ -21,8 +21,8 @@ Manuscript prose and supporting context, research, plan, review, summary, handof
21
21
 
22
22
  ## Procedure
23
23
 
24
- 1. Resolve one manuscript section, its outline claims, context, plan, research, summary, decisions, evidence, neighboring prose, and review rubric.
25
- 2. Dispatch one read-only review of claim coverage, reasoning, evidence, citations, coherence, prose, and requirements. If the structured result is malformed, allow at most one corrective retry for result-contract compliance; never retry until a reviewer says pass, and do not retry warning-only or explicitly accepted debt.
24
+ 1. Resolve one manuscript section, its outline claims, context, plan, research, summary, decisions, evidence, neighboring prose, and review rubric. Review the current draft against the section's goal, claims, decisions, and the plans that shaped its content. A revision plan's preservation or no-change criteria governed that revision and its verification; they are not criteria for a later review.
25
+ 2. Dispatch one read-only review of claim coverage, reasoning, evidence, citations, coherence, prose, and requirements. If the structured result is malformed, allow at most one corrective retry for result-contract compliance; never retry until a reviewer says pass, and do not retry warning-only or explicitly accepted debt. A reviewer's fail verdict is the review's result, not a failed run: record the review and an `issues-found` validation with each failed check as an issue.
26
26
  3. Write layer, confidence, location, impact, recommendation, and other rich detail in the Markdown review. Encode the read-only validation using only members allowed by the closed v1 schema; issue objects contain only severity, summary, and optional evidence, and the root never gains an `input_revisions` member. Disputed findings go through a user gate; accepted warning debt remains an `issues-found` result and does not authorize manuscript edits.
27
27
  4. Update only the section record to link the review. Review does not write project state, create a pause checkpoint or handoff, invoke pause implicitly, or invent a `paused` phase; leave lifecycle transitions to their owning actions.
28
28
 
@@ -2,7 +2,7 @@
2
2
  "schema": "wtfp.generated-adapter/v1",
3
3
  "generatorVersion": 5,
4
4
  "target": "antigravity",
5
- "sourceHash": "2978d2b2a0dad523e14a8d2a733d98310a9e3fce6911ed6eaa7b69ecff1ce3c9",
5
+ "sourceHash": "1b7709cb517380fd59d5322f0332b6ea395607409f3b03c62f35d39ac2e2c0a1",
6
6
  "files": [
7
7
  {
8
8
  "path": "actions/add-todo.json",
@@ -222,7 +222,7 @@
222
222
  },
223
223
  {
224
224
  "path": "plugin.json",
225
- "sha256": "548abd0c986f786bf4ab5264622ba60f9601a6a54544a7aa7b2eab92087fca95"
225
+ "sha256": "0f14706706b61b8f70e01f206fdb11a39bd578680e33e68bed4331abfb6f2da6"
226
226
  },
227
227
  {
228
228
  "path": "project/README.md",
@@ -578,7 +578,7 @@
578
578
  },
579
579
  {
580
580
  "path": "skills/wtfp-review-section/SKILL.md",
581
- "sha256": "0a21821a604f10b9dd6a8b359db81572718173f467adcffe86da8b2c2730486e"
581
+ "sha256": "739aee1ea05f18bf8d12831233016afb76cfd7814df2eadb2d480fc17d5a4a00"
582
582
  },
583
583
  {
584
584
  "path": "skills/wtfp-settings/SKILL.md",
@@ -814,7 +814,7 @@
814
814
  },
815
815
  {
816
816
  "path": "workflows/review-section.md",
817
- "sha256": "a85252f9bf6067602548c0355817f27e3689fc10ec9292441da09a5351045a6a"
817
+ "sha256": "a3df01d14a7fe0480bb8663347496acdeeed967042f189e25c8b017aa7e01c0c"
818
818
  },
819
819
  {
820
820
  "path": "workflows/settings.md",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://antigravity.google/schemas/v1/plugin.json",
3
3
  "name": "wtfp",
4
- "version": "0.8.2",
5
- "description": "Portable academic research and writing workflows (WTF-P 0.8.2)."
4
+ "version": "0.8.3",
5
+ "description": "Portable academic research and writing workflows (WTF-P 0.8.3)."
6
6
  }
@@ -30,8 +30,8 @@ Manuscript prose and supporting context, research, plan, review, summary, handof
30
30
 
31
31
  ## Procedure
32
32
 
33
- 1. Resolve one manuscript section, its outline claims, context, plan, research, summary, decisions, evidence, neighboring prose, and review rubric.
34
- 2. Dispatch one read-only review of claim coverage, reasoning, evidence, citations, coherence, prose, and requirements. If the structured result is malformed, allow at most one corrective retry for result-contract compliance; never retry until a reviewer says pass, and do not retry warning-only or explicitly accepted debt.
33
+ 1. Resolve one manuscript section, its outline claims, context, plan, research, summary, decisions, evidence, neighboring prose, and review rubric. Review the current draft against the section's goal, claims, decisions, and the plans that shaped its content. A revision plan's preservation or no-change criteria governed that revision and its verification; they are not criteria for a later review.
34
+ 2. Dispatch one read-only review of claim coverage, reasoning, evidence, citations, coherence, prose, and requirements. If the structured result is malformed, allow at most one corrective retry for result-contract compliance; never retry until a reviewer says pass, and do not retry warning-only or explicitly accepted debt. A reviewer's fail verdict is the review's result, not a failed run: record the review and an `issues-found` validation with each failed check as an issue.
35
35
  3. Write layer, confidence, location, impact, recommendation, and other rich detail in the Markdown review. Encode the read-only validation using only members allowed by the closed v1 schema; issue objects contain only severity, summary, and optional evidence, and the root never gains an `input_revisions` member. Disputed findings go through a user gate; accepted warning debt remains an `issues-found` result and does not authorize manuscript edits.
36
36
  4. Update only the section record to link the review. Review does not write project state, create a pause checkpoint or handoff, invoke pause implicitly, or invent a `paused` phase; leave lifecycle transitions to their owning actions.
37
37
 
@@ -21,8 +21,8 @@ Manuscript prose and supporting context, research, plan, review, summary, handof
21
21
 
22
22
  ## Procedure
23
23
 
24
- 1. Resolve one manuscript section, its outline claims, context, plan, research, summary, decisions, evidence, neighboring prose, and review rubric.
25
- 2. Dispatch one read-only review of claim coverage, reasoning, evidence, citations, coherence, prose, and requirements. If the structured result is malformed, allow at most one corrective retry for result-contract compliance; never retry until a reviewer says pass, and do not retry warning-only or explicitly accepted debt.
24
+ 1. Resolve one manuscript section, its outline claims, context, plan, research, summary, decisions, evidence, neighboring prose, and review rubric. Review the current draft against the section's goal, claims, decisions, and the plans that shaped its content. A revision plan's preservation or no-change criteria governed that revision and its verification; they are not criteria for a later review.
25
+ 2. Dispatch one read-only review of claim coverage, reasoning, evidence, citations, coherence, prose, and requirements. If the structured result is malformed, allow at most one corrective retry for result-contract compliance; never retry until a reviewer says pass, and do not retry warning-only or explicitly accepted debt. A reviewer's fail verdict is the review's result, not a failed run: record the review and an `issues-found` validation with each failed check as an issue.
26
26
  3. Write layer, confidence, location, impact, recommendation, and other rich detail in the Markdown review. Encode the read-only validation using only members allowed by the closed v1 schema; issue objects contain only severity, summary, and optional evidence, and the root never gains an `input_revisions` member. Disputed findings go through a user gate; accepted warning debt remains an `issues-found` result and does not authorize manuscript edits.
27
27
  4. Update only the section record to link the review. Review does not write project state, create a pause checkpoint or handoff, invoke pause implicitly, or invent a `paused` phase; leave lifecycle transitions to their owning actions.
28
28
 
@@ -5,14 +5,14 @@
5
5
  },
6
6
  "metadata": {
7
7
  "description": "WTF-P evidence-grounded academic workflow plugin.",
8
- "version": "0.8.2"
8
+ "version": "0.8.3"
9
9
  },
10
10
  "plugins": [
11
11
  {
12
12
  "name": "wtfp",
13
13
  "source": "./",
14
14
  "description": "Portable academic research and writing workflows.",
15
- "version": "0.8.2",
15
+ "version": "0.8.3",
16
16
  "author": {
17
17
  "name": "akougkas"
18
18
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtfp",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Portable academic research and writing workflows with stable wtfp actions.",
5
5
  "author": {
6
6
  "name": "akougkas",
@@ -2,15 +2,15 @@
2
2
  "schema": "wtfp.generated-adapter/v1",
3
3
  "generatorVersion": 5,
4
4
  "target": "claude",
5
- "sourceHash": "e740e85578efd95b7f513ea03bbed267f7162b9b87be5bd7d8619ffa59b2772c",
5
+ "sourceHash": "ef1638cd2bf93d2a023e2b1dd356d44172ca4d07eef1ac2be9d6211882a015d6",
6
6
  "files": [
7
7
  {
8
8
  "path": ".claude-plugin/marketplace.json",
9
- "sha256": "063da18d0ced5cf4db507391744622918eed9db9a68a71a48ea4710fd5092748"
9
+ "sha256": "7d30983c2970dfab9e86c90b9710eb8bd63756f8f31aedf21b978d52ba2e0ef6"
10
10
  },
11
11
  {
12
12
  "path": ".claude-plugin/plugin.json",
13
- "sha256": "d3a5ab8f021de345bc8b3a5c85630bce486473e913eab2d3c31db59caa7050fd"
13
+ "sha256": "9715cd3ad2e0f0c6bd7bb155758096c89268160ac78a7579cb8bdfc843cb6064"
14
14
  },
15
15
  {
16
16
  "path": "actions/add-todo.json",
@@ -246,7 +246,7 @@
246
246
  },
247
247
  {
248
248
  "path": "ai.iowarp.clio/agents/wtfp-section-writer.md",
249
- "sha256": "d85a1b9af18c376cbcc2e5930ff74f880661865234509319a0e3b61eb9f73cd4"
249
+ "sha256": "e0247578c03b442fb97b86116e172f00be77b5aa3a52973e6a6a227572b81d8b"
250
250
  },
251
251
  {
252
252
  "path": "ai.iowarp.clio/fleets/wtfp-draft-review.md",
@@ -306,7 +306,7 @@
306
306
  },
307
307
  {
308
308
  "path": "ai.iowarp.clio/prompts/wtfp/execute-outline.md",
309
- "sha256": "f651f7dc4c955ca39abee380e21066ca6a4e9282ca19cd797c08354609409d43"
309
+ "sha256": "c801d659c1967d1b02feab52419c87ec7f60d09cd158140c791ec75b5f4e93ca"
310
310
  },
311
311
  {
312
312
  "path": "ai.iowarp.clio/prompts/wtfp/export-latex.md",
@@ -314,7 +314,7 @@
314
314
  },
315
315
  {
316
316
  "path": "ai.iowarp.clio/prompts/wtfp/help.md",
317
- "sha256": "3a95981adc65700fa2c73693eca40e3c1e725f47969e52a3612188c9a29aeb92"
317
+ "sha256": "9fa7afd9022f965b86627516ad3579c643a7daff31047a4300e1dfa1a997dbdb"
318
318
  },
319
319
  {
320
320
  "path": "ai.iowarp.clio/prompts/wtfp/insert-section.md",
@@ -346,7 +346,7 @@
346
346
  },
347
347
  {
348
348
  "path": "ai.iowarp.clio/prompts/wtfp/plan-section.md",
349
- "sha256": "f5a2752a11caae87acda0ff767b7f613c8d37b940aa0aaf7e79e7f61ec9c5000"
349
+ "sha256": "44b0da325e40538bc09a21ed1fcd66368f7877beb7d55ac76eff248c70d40874"
350
350
  },
351
351
  {
352
352
  "path": "ai.iowarp.clio/prompts/wtfp/polish-prose.md",
@@ -382,7 +382,7 @@
382
382
  },
383
383
  {
384
384
  "path": "ai.iowarp.clio/prompts/wtfp/review-section.md",
385
- "sha256": "1bdd3f82371af2929d84bf69ee6b7237a7c4c3f05b5e7473332b779fe20e9137"
385
+ "sha256": "375a3964fef8c0b98bf3a72d0aa0b0a2928fbed14dd13d8e432141e65b078e49"
386
386
  },
387
387
  {
388
388
  "path": "ai.iowarp.clio/prompts/wtfp/settings.md",
@@ -402,7 +402,7 @@
402
402
  },
403
403
  {
404
404
  "path": "ai.iowarp.clio/prompts/wtfp/write-section.md",
405
- "sha256": "bf370d5b6da54a39899850b9a65f3db79f38ae80e89223df82f80ee9beea19d0"
405
+ "sha256": "36b466919863e7c145f39183659d5e2fac790c04aef174281da42c0dfdbc09eb"
406
406
  },
407
407
  {
408
408
  "path": "aliases.lock.json",
@@ -538,7 +538,7 @@
538
538
  },
539
539
  {
540
540
  "path": "commands/review-section.md",
541
- "sha256": "3a763302db3e4e68795747319c7eab6a07354cab6358df8eef75942c00101e80"
541
+ "sha256": "53e3b14e89b901606e08684d93af9ab4d947a41ee6892906049c3a4952c9cfae"
542
542
  },
543
543
  {
544
544
  "path": "commands/settings.md",
@@ -586,7 +586,7 @@
586
586
  },
587
587
  {
588
588
  "path": "plugin.json",
589
- "sha256": "c4c1b76d59d4a7f8fa42dc68f3350cf0697774f07ee5500af700e3bf089b5b5b"
589
+ "sha256": "4bacd2dd39dbb98cf59e38e08291839f0fbaa0f17a71a09db4e51064a0f3a57f"
590
590
  },
591
591
  {
592
592
  "path": "project/README.md",
@@ -1042,7 +1042,7 @@
1042
1042
  },
1043
1043
  {
1044
1044
  "path": "workflows/review-section.md",
1045
- "sha256": "a85252f9bf6067602548c0355817f27e3689fc10ec9292441da09a5351045a6a"
1045
+ "sha256": "a3df01d14a7fe0480bb8663347496acdeeed967042f189e25c8b017aa7e01c0c"
1046
1046
  },
1047
1047
  {
1048
1048
  "path": "workflows/settings.md",
@@ -59,6 +59,8 @@ Execute an approved section plan into evidence-grounded academic prose or the ex
59
59
  - Do not commit, delete, rename, publish, or perform destructive operations unless the exact effect is granted by the action contract.
60
60
  - Do not initiate human interaction. Encode checkpoint needs in the result for the orchestrator.
61
61
 
62
+ On Clio a worker holds no word counter. The dispatching action measures the persisted manuscript after you return and writes that count into the summary, so write the summary without a count. A count you cannot take never blocks this role: return completed when the rest is done.
63
+
62
64
  ## Clio result contract
63
65
 
64
66
  Your entire final response must be one JSON object: {"mutatedPaths":["..."],"validations":[{"name":"...","passed":true,"evidence":"..."}]}. Report only paths changed in this run and validations actually performed.
@@ -84,6 +84,6 @@ Every question `ask_user` puts to the author here is the author's to answer: ask
84
84
 
85
85
  Dispatch the declared specialist roles using these exact Clio agent IDs: `wtfp-section-writer`, `wtfp-coherence-checker`. Do not substitute generic coder or verifier agents. Give every dispatched task an `agent` and an `intent` with workspace-relative `read_roots`, and keep absolute paths and `project://` URIs out of the task text, so Clio admits the scope you declare instead of inferring one from the prose. If a named agent is unavailable, report that blocker and stop instead of silently changing roles. `wtfp-coherence-checker` is read-only: begin each task for it with "Review", because Clio refuses a read-only agent a task it reads as a change.
86
86
 
87
- Read the single wtfp.role-result entry in native validations and parse its evidence string as portable role-result JSON. A read-only reviewer returns only a verdict and checks, no wtfp.role-result entry: treat its report as completed, each failed check as an issue, and a fail verdict as a revise recommendation. Validate its schema, role and action against the dispatched task. Missing, duplicate or malformed outcomes fail closed. On needs_input ask the author through ask_user and redispatch with the response; on blocked or failed stop and report the issue. Only completed permits downstream work, and it never substitutes for an author gate or artifact readback.
87
+ Read the single wtfp.role-result entry in native validations and parse its evidence string as portable role-result JSON. A read-only reviewer returns only a verdict and checks, no wtfp.role-result entry: treat its report as completed, each failed check as an issue, and a fail verdict as a revise recommendation. Clio's dispatch result calls such a run's validation failed when a check did not pass; that is the review's finding, not a failed run, so record it as the action's procedure says. Validate its schema, role and action against the dispatched task. Missing, duplicate or malformed outcomes fail closed. On needs_input ask the author through ask_user and redispatch with the response; on blocked or failed stop and report the issue. Only completed permits downstream work, and it never substitutes for an author gate or artifact readback.
88
88
 
89
89
  <!-- Generated by WTF-P adapter compiler v5 from protocol/actions/execute-outline; do not edit. -->
@@ -4,7 +4,7 @@ display-only: true
4
4
  ---
5
5
 
6
6
  ```text
7
- WTF-P 0.8.2 on Clio Coder: evidence-grounded academic writing
7
+ WTF-P 0.8.3 on Clio Coder: evidence-grounded academic writing
8
8
 
9
9
  Start here
10
10
  /wtfp:new-paper [input]
@@ -85,6 +85,6 @@ Every question `ask_user` puts to the author here is the author's to answer: ask
85
85
 
86
86
  Dispatch the declared specialist roles using these exact Clio agent IDs: `wtfp-section-planner`, `wtfp-plan-checker`. Do not substitute generic coder or verifier agents. Give every dispatched task an `agent` and an `intent` with workspace-relative `read_roots`, and keep absolute paths and `project://` URIs out of the task text, so Clio admits the scope you declare instead of inferring one from the prose. If a named agent is unavailable, report that blocker and stop instead of silently changing roles. `wtfp-plan-checker` is read-only: begin each task for it with "Review", because Clio refuses a read-only agent a task it reads as a change.
87
87
 
88
- Read the single wtfp.role-result entry in native validations and parse its evidence string as portable role-result JSON. A read-only reviewer returns only a verdict and checks, no wtfp.role-result entry: treat its report as completed, each failed check as an issue, and a fail verdict as a revise recommendation. Validate its schema, role and action against the dispatched task. Missing, duplicate or malformed outcomes fail closed. On needs_input ask the author through ask_user and redispatch with the response; on blocked or failed stop and report the issue. Only completed permits downstream work, and it never substitutes for an author gate or artifact readback.
88
+ Read the single wtfp.role-result entry in native validations and parse its evidence string as portable role-result JSON. A read-only reviewer returns only a verdict and checks, no wtfp.role-result entry: treat its report as completed, each failed check as an issue, and a fail verdict as a revise recommendation. Clio's dispatch result calls such a run's validation failed when a check did not pass; that is the review's finding, not a failed run, so record it as the action's procedure says. Validate its schema, role and action against the dispatched task. Missing, duplicate or malformed outcomes fail closed. On needs_input ask the author through ask_user and redispatch with the response; on blocked or failed stop and report the issue. Only completed permits downstream work, and it never substitutes for an author gate or artifact readback.
89
89
 
90
90
  <!-- Generated by WTF-P adapter compiler v5 from protocol/actions/plan-section; do not edit. -->
@@ -38,8 +38,8 @@ Manuscript prose and supporting context, research, plan, review, summary, handof
38
38
 
39
39
  ## Procedure
40
40
 
41
- 1. Resolve one manuscript section, its outline claims, context, plan, research, summary, decisions, evidence, neighboring prose, and review rubric.
42
- 2. Dispatch one read-only review of claim coverage, reasoning, evidence, citations, coherence, prose, and requirements. If the structured result is malformed, allow at most one corrective retry for result-contract compliance; never retry until a reviewer says pass, and do not retry warning-only or explicitly accepted debt.
41
+ 1. Resolve one manuscript section, its outline claims, context, plan, research, summary, decisions, evidence, neighboring prose, and review rubric. Review the current draft against the section's goal, claims, decisions, and the plans that shaped its content. A revision plan's preservation or no-change criteria governed that revision and its verification; they are not criteria for a later review.
42
+ 2. Dispatch one read-only review of claim coverage, reasoning, evidence, citations, coherence, prose, and requirements. If the structured result is malformed, allow at most one corrective retry for result-contract compliance; never retry until a reviewer says pass, and do not retry warning-only or explicitly accepted debt. A reviewer's fail verdict is the review's result, not a failed run: record the review and an `issues-found` validation with each failed check as an issue.
43
43
  3. Write layer, confidence, location, impact, recommendation, and other rich detail in the Markdown review. Encode the read-only validation using only members allowed by the closed v1 schema; issue objects contain only severity, summary, and optional evidence, and the root never gains an `input_revisions` member. Disputed findings go through a user gate; accepted warning debt remains an `issues-found` result and does not authorize manuscript edits.
44
44
  4. Update only the section record to link the review. Review does not write project state, create a pause checkpoint or handoff, invoke pause implicitly, or invent a `paused` phase; leave lifecycle transitions to their owning actions.
45
45
 
@@ -76,6 +76,6 @@ Every question `ask_user` puts to the author here is the author's to answer: ask
76
76
 
77
77
  Dispatch the declared specialist roles using these exact Clio agent IDs: `wtfp-section-reviewer`. Do not substitute generic coder or verifier agents. Give every dispatched task an `agent` and an `intent` with workspace-relative `read_roots`, and keep absolute paths and `project://` URIs out of the task text, so Clio admits the scope you declare instead of inferring one from the prose. If a named agent is unavailable, report that blocker and stop instead of silently changing roles. `wtfp-section-reviewer` is read-only: begin each task for it with "Review", because Clio refuses a read-only agent a task it reads as a change.
78
78
 
79
- Read the single wtfp.role-result entry in native validations and parse its evidence string as portable role-result JSON. A read-only reviewer returns only a verdict and checks, no wtfp.role-result entry: treat its report as completed, each failed check as an issue, and a fail verdict as a revise recommendation. Validate its schema, role and action against the dispatched task. Missing, duplicate or malformed outcomes fail closed. On needs_input ask the author through ask_user and redispatch with the response; on blocked or failed stop and report the issue. Only completed permits downstream work, and it never substitutes for an author gate or artifact readback.
79
+ Read the single wtfp.role-result entry in native validations and parse its evidence string as portable role-result JSON. A read-only reviewer returns only a verdict and checks, no wtfp.role-result entry: treat its report as completed, each failed check as an issue, and a fail verdict as a revise recommendation. Clio's dispatch result calls such a run's validation failed when a check did not pass; that is the review's finding, not a failed run, so record it as the action's procedure says. Validate its schema, role and action against the dispatched task. Missing, duplicate or malformed outcomes fail closed. On needs_input ask the author through ask_user and redispatch with the response; on blocked or failed stop and report the issue. Only completed permits downstream work, and it never substitutes for an author gate or artifact readback.
80
80
 
81
81
  <!-- Generated by WTF-P adapter compiler v5 from protocol/actions/review-section; do not edit. -->
@@ -86,6 +86,6 @@ Every question `ask_user` puts to the author here is the author's to answer: ask
86
86
 
87
87
  Dispatch the declared specialist roles using these exact Clio agent IDs: `wtfp-section-writer`, `wtfp-argument-verifier`. Do not substitute generic coder or verifier agents. Give every dispatched task an `agent` and an `intent` with workspace-relative `read_roots`, and keep absolute paths and `project://` URIs out of the task text, so Clio admits the scope you declare instead of inferring one from the prose. If a named agent is unavailable, report that blocker and stop instead of silently changing roles. `wtfp-argument-verifier` is read-only: begin each task for it with "Review", because Clio refuses a read-only agent a task it reads as a change.
88
88
 
89
- Read the single wtfp.role-result entry in native validations and parse its evidence string as portable role-result JSON. A read-only reviewer returns only a verdict and checks, no wtfp.role-result entry: treat its report as completed, each failed check as an issue, and a fail verdict as a revise recommendation. Validate its schema, role and action against the dispatched task. Missing, duplicate or malformed outcomes fail closed. On needs_input ask the author through ask_user and redispatch with the response; on blocked or failed stop and report the issue. Only completed permits downstream work, and it never substitutes for an author gate or artifact readback.
89
+ Read the single wtfp.role-result entry in native validations and parse its evidence string as portable role-result JSON. A read-only reviewer returns only a verdict and checks, no wtfp.role-result entry: treat its report as completed, each failed check as an issue, and a fail verdict as a revise recommendation. Clio's dispatch result calls such a run's validation failed when a check did not pass; that is the review's finding, not a failed run, so record it as the action's procedure says. Validate its schema, role and action against the dispatched task. Missing, duplicate or malformed outcomes fail closed. On needs_input ask the author through ask_user and redispatch with the response; on blocked or failed stop and report the issue. Only completed permits downstream work, and it never substitutes for an author gate or artifact readback.
90
90
 
91
91
  <!-- Generated by WTF-P adapter compiler v5 from protocol/actions/write-section; do not edit. -->
@@ -28,8 +28,8 @@ Manuscript prose and supporting context, research, plan, review, summary, handof
28
28
 
29
29
  ## Procedure
30
30
 
31
- 1. Resolve one manuscript section, its outline claims, context, plan, research, summary, decisions, evidence, neighboring prose, and review rubric.
32
- 2. Dispatch one read-only review of claim coverage, reasoning, evidence, citations, coherence, prose, and requirements. If the structured result is malformed, allow at most one corrective retry for result-contract compliance; never retry until a reviewer says pass, and do not retry warning-only or explicitly accepted debt.
31
+ 1. Resolve one manuscript section, its outline claims, context, plan, research, summary, decisions, evidence, neighboring prose, and review rubric. Review the current draft against the section's goal, claims, decisions, and the plans that shaped its content. A revision plan's preservation or no-change criteria governed that revision and its verification; they are not criteria for a later review.
32
+ 2. Dispatch one read-only review of claim coverage, reasoning, evidence, citations, coherence, prose, and requirements. If the structured result is malformed, allow at most one corrective retry for result-contract compliance; never retry until a reviewer says pass, and do not retry warning-only or explicitly accepted debt. A reviewer's fail verdict is the review's result, not a failed run: record the review and an `issues-found` validation with each failed check as an issue.
33
33
  3. Write layer, confidence, location, impact, recommendation, and other rich detail in the Markdown review. Encode the read-only validation using only members allowed by the closed v1 schema; issue objects contain only severity, summary, and optional evidence, and the root never gains an `input_revisions` member. Disputed findings go through a user gate; accepted warning debt remains an `issues-found` result and does not authorize manuscript edits.
34
34
  4. Update only the section record to link the review. Review does not write project state, create a pause checkpoint or handoff, invoke pause implicitly, or invent a `paused` phase; leave lifecycle transitions to their owning actions.
35
35
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "wtfp",
4
- "version": "0.8.2",
4
+ "version": "0.8.3",
5
5
  "description": "Portable, evidence-grounded academic research and writing workflows.",
6
6
  "author": {
7
7
  "name": "akougkas"
@@ -21,8 +21,8 @@ Manuscript prose and supporting context, research, plan, review, summary, handof
21
21
 
22
22
  ## Procedure
23
23
 
24
- 1. Resolve one manuscript section, its outline claims, context, plan, research, summary, decisions, evidence, neighboring prose, and review rubric.
25
- 2. Dispatch one read-only review of claim coverage, reasoning, evidence, citations, coherence, prose, and requirements. If the structured result is malformed, allow at most one corrective retry for result-contract compliance; never retry until a reviewer says pass, and do not retry warning-only or explicitly accepted debt.
24
+ 1. Resolve one manuscript section, its outline claims, context, plan, research, summary, decisions, evidence, neighboring prose, and review rubric. Review the current draft against the section's goal, claims, decisions, and the plans that shaped its content. A revision plan's preservation or no-change criteria governed that revision and its verification; they are not criteria for a later review.
25
+ 2. Dispatch one read-only review of claim coverage, reasoning, evidence, citations, coherence, prose, and requirements. If the structured result is malformed, allow at most one corrective retry for result-contract compliance; never retry until a reviewer says pass, and do not retry warning-only or explicitly accepted debt. A reviewer's fail verdict is the review's result, not a failed run: record the review and an `issues-found` validation with each failed check as an issue.
26
26
  3. Write layer, confidence, location, impact, recommendation, and other rich detail in the Markdown review. Encode the read-only validation using only members allowed by the closed v1 schema; issue objects contain only severity, summary, and optional evidence, and the root never gains an `input_revisions` member. Disputed findings go through a user gate; accepted warning debt remains an `issues-found` result and does not authorize manuscript edits.
27
27
  4. Update only the section record to link the review. Review does not write project state, create a pause checkpoint or handoff, invoke pause implicitly, or invent a `paused` phase; leave lifecycle transitions to their owning actions.
28
28
 
@@ -2,7 +2,7 @@
2
2
  "schema": "wtfp.generated-adapter/v1",
3
3
  "generatorVersion": 5,
4
4
  "target": "clio-extension",
5
- "sourceHash": "a43f142ea915a672795ed1911856e260b785769cd602e4306774a83d164b0d50",
5
+ "sourceHash": "fd9bff2b791c634bbe1fe0f58cb1f087efbf273a38a1ba06687e154be88f1e6b",
6
6
  "files": [
7
7
  {
8
8
  "path": "actions/add-todo.json",
@@ -154,7 +154,7 @@
154
154
  },
155
155
  {
156
156
  "path": "clio-coder-extension.yaml",
157
- "sha256": "cc856a7e2fde79cbd9df11513545e879bdcf631b6b9dfab327898b577f324046"
157
+ "sha256": "53c7a7e32089bbe8dd9d9f1e0edbf300ad201a6c37b6b537662b4ffdc8d352fd"
158
158
  },
159
159
  {
160
160
  "path": "compatibility/action-availability.json",
@@ -262,11 +262,11 @@
262
262
  },
263
263
  {
264
264
  "path": "runtime/extension.test.ts",
265
- "sha256": "441d800b2fb7d5b0ddb9fbee82db47e037ba1face65c5a8781af93cb2255756b"
265
+ "sha256": "5c246d57034a713f0ab632b7663db5731fb2ffd9d9b7e2a1d2403f4625377984"
266
266
  },
267
267
  {
268
268
  "path": "runtime/extension.ts",
269
- "sha256": "620d9a4b97fa945cb6acc4b2cf25843860c1252723aa092cc42521bf9a82edb7"
269
+ "sha256": "c452c7672b539262a240bffb25cb55a53fd07bcc32bd7700cdd50dada6cda78e"
270
270
  },
271
271
  {
272
272
  "path": "runtime/json-schema.cjs",
@@ -2,7 +2,7 @@
2
2
  id: wtfp
3
3
  plugin: wtfp
4
4
  name: WTF-P
5
- version: 0.8.2
5
+ version: 0.8.3
6
6
  description: "The WTF-P writing desk for Clio Coder; paper state, gates and the write guard run in code."
7
7
  compatibility: { clio: ">=0.6.3" }
8
8
  runtime:
@@ -903,18 +903,56 @@ test("a family URI reads every record of that family in one call, and names what
903
903
  const records = (both.data as Json).records as Json[];
904
904
  assert.deepEqual(records.map((entry) => (entry.record as Json).id), ["source-a", "source-b"]);
905
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)));
906
+ // A family too large to return in full lists one digest row per record, with the version to write it back.
907
+ put(workspace, ".planning/sources/source-c.json", source("source-c", "C".repeat(20 * 1024)));
908
+ const listed = await host.tool("read_record", { uri: "project://sources" });
909
+ assert.equal((listed.data as Json).form, "digest");
910
+ assert.match(listed.text, /holds 3 records, 2\d KB in full, so this read lists 3 as one digest row each.*Read a record at its uri for every field, or keep one section's records with \?section=<section id>/);
911
+ const rows = (listed.data as Json).records as Json[];
912
+ assert.deepEqual(rows.map((row) => row.citation_key), ["sourcea", "sourceb", "sourcec"]);
913
+ assert.equal(rows[0]?.sha256, records[0]?.sha256);
914
+ assert.equal(rows[0]?.record, undefined, "a digest row carries no record body");
915
+ assert.ok(String(rows[2]?.title).length <= 160, "a digest row bounds its text");
916
+ // Past the page budget, the rest is named for the next page.
917
+ for (const id of ["source-d", "source-e", "source-f", "source-g"]) put(workspace, `.planning/sources/${id}.json`, source(id, "x".repeat(20 * 1024)));
918
+ const many = Array.from({ length: 300 }, (_, index) => `source-z${index}`);
919
+ for (const id of many) put(workspace, `.planning/sources/${id}.json`, source(id, "Z"));
908
920
  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"]);
921
+ const omitted = (capped.data as Json).omitted as string[];
922
+ assert.ok(omitted.length > 0);
923
+ const last = String((((capped.data as Json).records as Json[]).at(-1) as Json).uri).split("/").pop();
924
+ assert.match(capped.text, new RegExp(`${omitted.length} more not returned, to keep this read small; read the next page with project://sources\\?after=${last}`));
925
+ const next = await host.tool("read_record", { uri: `project://sources?after=${last}` });
926
+ assert.equal(((next.data as Json).records as Json[])[0]?.uri, `project://sources/${omitted[0]}`);
927
+ assert.match((await host.tool("read_record", { uri: "project://sources?sort=year" })).text, /^Not read: .*takes section=<section id> and after=<record id>/);
913
928
  // Sections are a family too, read from each section's own directory.
914
929
  const sections = await host.tool("read_record", { uri: "project://sections" });
915
930
  assert.deepEqual(((sections.data as Json).records as Json[]).map((entry) => entry.uri), ["project://sections/introduction"]);
916
931
  }, SERVED));
917
932
 
933
+ test("a family read narrowed to one section keeps only the records about it", () =>
934
+ withDesk(async (host, workspace) => {
935
+ const validation = (id: string, subject: string) => ({
936
+ schema: "wtfp.project.validation/v1", id, project_id: PROJECT, subject_uri: subject, validator_role: "argument-verifier", action_id: "verify-work",
937
+ status: "issues-found", checks: [{ id: "claims", status: "failed", summary: "A claim is unsupported.", evidence: ["paragraph 2"] }], issues: ["unsupported claim"], next_actions: [], effects_applied: [], executed_at: AT,
938
+ });
939
+ put(workspace, ".planning/validations/introduction-verified.json", validation("introduction-verified", "project://sections/introduction"));
940
+ put(workspace, ".planning/validations/introduction-plan-checked.json", validation("introduction-plan-checked", "project://sections/introduction/plans/initial"));
941
+ put(workspace, ".planning/validations/methods-verified.json", validation("methods-verified", "project://sections/methods"));
942
+ const narrowed = await host.tool("read_record", { uri: "project://validations?section=introduction" });
943
+ assert.deepEqual(((narrowed.data as Json).records as Json[]).map((entry) => entry.uri), ["project://validations/introduction-plan-checked", "project://validations/introduction-verified"]);
944
+ assert.match(narrowed.text, /holds 2 records about section introduction; 2 returned in full/);
945
+ assert.equal((narrowed.data as Json).uri, "project://validations?section=introduction");
946
+ // Past the full budget the narrowed family is listed by digest, each row naming its failed checks.
947
+ for (let index = 0; index < 12; index++) put(workspace, `.planning/validations/introduction-review-${index}.json`, { ...validation(`introduction-review-${index}`, "project://sections/introduction"), issues: ["x".repeat(2048)] });
948
+ const digest = await host.tool("read_record", { uri: "project://validations?section=introduction" });
949
+ assert.equal((digest.data as Json).form, "digest");
950
+ const row = ((digest.data as Json).records as Json[])[0] as Json;
951
+ assert.deepEqual([row.action_id, row.status, row.failed_checks, row.issues], ["verify-work", "issues-found", ["claims"], 1]);
952
+ assert.ok(((digest.data as Json).records as Json[]).every((entry) => String(entry.uri).includes("introduction")));
953
+ assert.match((await host.tool("read_record", { uri: "project://validations?section=nowhere" })).text, /^Not read: there is no section nowhere/);
954
+ }, SERVED));
955
+
918
956
  test("a literature-heavy section that records no claim needing evidence is not covered", () =>
919
957
  withDesk(async (host, workspace) => {
920
958
  const outline = read(workspace, ".planning/structure/outline.json");
@@ -1013,10 +1051,29 @@ const DRIVEN_PLUGIN = {
1013
1051
  prompts: [...SERVED.prompts, "wtfp:advance", "wtfp:review-section", "wtfp:discuss-section", "wtfp:create-outline", "wtfp:verify-work", "wtfp:plan-revision"],
1014
1052
  };
1015
1053
  /** 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 => {
1054
+ /** The writer saves the manuscript at this offset without finishing write-section. */
1055
+ const saved = (host: Host, workspace: string, offsetMs: number): void => {
1017
1056
  const at = new Date(host.now + offsetMs);
1018
1057
  utimesSync(path.join(workspace, "paper/introduction.md"), at, at);
1019
1058
  };
1059
+ /** write-section drafts the manuscript at this offset and records its validation. */
1060
+ const drafted = (host: Host, workspace: string, offsetMs: number): void => {
1061
+ saved(host, workspace, offsetMs);
1062
+ put(workspace, ".planning/validations/introduction-written.json", {
1063
+ schema: "wtfp.project.validation/v1",
1064
+ id: "introduction-written",
1065
+ project_id: PROJECT,
1066
+ subject_uri: "project://paper/introduction",
1067
+ validator_role: "section-writer",
1068
+ action_id: "write-section",
1069
+ status: "passed",
1070
+ checks: [{ id: "plan-criteria", status: "passed", summary: "The draft satisfies its plan.", evidence: ["paper/introduction.md"] }],
1071
+ issues: [],
1072
+ next_actions: [],
1073
+ effects_applied: [],
1074
+ executed_at: new Date(host.now + offsetMs).toISOString().replace(/\.\d{3}Z$/u, "Z"),
1075
+ });
1076
+ };
1020
1077
  const nextStep = async (host: Host): Promise<{ text: string; data: Json; isError?: boolean }> => {
1021
1078
  const result = await host.tool("next_step", {});
1022
1079
  return { text: result.text, data: (result.data ?? {}) as Json, ...(result.isError ? { isError: true } : {}) };
@@ -1104,6 +1161,8 @@ test("every next_step result restates the driver rule, so a compacted turn can c
1104
1161
  assert.equal(step.data.kind, "step");
1105
1162
  assert.match(step.text, /^Step 1: \/wtfp:write-section introduction\./);
1106
1163
  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/);
1164
+ // Live on Clio 0.8.3, the model looked for a tool named audit-milestone and stopped the drive.
1165
+ assert.match(step.text, /A step is a procedure, not a capability: there is no tool named after its action/);
1107
1166
  assert.match(step.text, /invocation input introduction/);
1108
1167
  assert.equal(ruleOf(step.text), rule);
1109
1168
  const finish = await nextStep(host);
@@ -1236,6 +1295,15 @@ test("a reviewed section whose approved revision plan no draft has applied goes
1236
1295
  const rewrite = await nextStep(host);
1237
1296
  assert.deepEqual([rewrite.data.kind, rewrite.data.action, rewrite.data.section], ["step", "write-section", "introduction"], rewrite.text);
1238
1297
  assert.match(rewrite.text, /approved revision plan that no draft has applied yet/);
1298
+ // A manuscript saved after the approval without write-section's validation is not drafted yet: live, a writer
1299
+ // saved the revision, could not count it, and the desk sent the section to review with a stale count and summary.
1300
+ saved(host, workspace, 30_000);
1301
+ put(workspace, sectionFile, { ...read(workspace, sectionFile), word_count: 286 });
1302
+ const unfinished = await nextStep(host);
1303
+ assert.deepEqual([unfinished.data.action, unfinished.data.section], ["write-section", "introduction"], unfinished.text);
1304
+ assert.match(unfinished.text, /draft for its approved plan is saved, but write-section has not finished it/);
1305
+ // The same step armed again after progress says so, instead of reading like the first arming.
1306
+ assert.match(unfinished.text, /Continue \/wtfp:write-section introduction: it made progress but has not finished, so the desk arms it again on purpose; this is not a loop/);
1239
1307
  // Once the draft is written after the approval, it is reviewed again: the earlier review read the earlier draft.
1240
1308
  drafted(host, workspace, 60_000);
1241
1309
  const review = await nextStep(host);