wtf-p 0.7.3 → 0.8.0
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 +16 -12
- package/bin/commands/install-logic.js +1 -1
- package/bin/lib/adapter-compiler.js +175 -56
- package/bin/lib/clio-registration.js +127 -36
- package/bin/lib/manifest.js +11 -3
- package/bin/uninstall.js +3 -2
- package/package.json +1 -1
- package/protocol/actions/research-gap.json +1 -1
- package/protocol/roles/research-synthesizer.md +1 -1
- package/protocol/skills/wtfp-plan-section/references/actions.md +1 -1
- package/protocol/skills/wtfp-research-literature/references/actions.md +1 -1
- package/protocol/skills/wtfp-write-section/references/actions.md +1 -1
- package/protocol/workflows/plan-section.md +3 -2
- package/protocol/workflows/research-gap.md +2 -2
- package/protocol/workflows/write-section.md +1 -1
- package/vendors/antigravity/.wtfp-generated.json +18 -14
- package/vendors/antigravity/actions/research-gap.json +1 -1
- package/vendors/antigravity/agents/wtfp-research-synthesizer.md +1 -1
- package/vendors/antigravity/commands/wtfp-plan-section.md +3 -2
- package/vendors/antigravity/commands/wtfp-write-section.md +1 -1
- package/vendors/antigravity/plugin.json +1 -1
- package/vendors/antigravity/roles/research-synthesizer.md +1 -1
- package/vendors/antigravity/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/antigravity/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/antigravity/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/antigravity/tools/README.md +1 -1
- package/vendors/antigravity/tools/package.json +1 -0
- package/vendors/antigravity/workflows/plan-section.md +3 -2
- package/vendors/antigravity/workflows/research-gap.md +2 -2
- package/vendors/antigravity/workflows/write-section.md +1 -1
- package/vendors/claude/.claude-plugin/marketplace.json +2 -2
- package/vendors/claude/.claude-plugin/plugin.json +1 -1
- package/vendors/claude/.wtfp-generated.json +33 -29
- package/vendors/claude/actions/research-gap.json +1 -1
- package/vendors/claude/agents/wtfp-research-synthesizer.md +1 -1
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-research-synthesizer.md +1 -1
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/analyze-bib.md +2 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/check-refs.md +2 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/create-outline.md +2 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/execute-outline.md +2 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/help.md +1 -1
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/plan-section.md +5 -2
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/polish-prose.md +2 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/quick.md +2 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/research-gap.md +8 -2
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/review-section.md +2 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/write-section.md +3 -1
- package/vendors/claude/commands/plan-section.md +3 -2
- package/vendors/claude/commands/research-gap.md +2 -2
- package/vendors/claude/commands/write-section.md +1 -1
- package/vendors/claude/plugin.json +1 -1
- package/vendors/claude/roles/research-synthesizer.md +1 -1
- package/vendors/claude/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/claude/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/claude/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/claude/tools/README.md +1 -1
- package/vendors/claude/tools/package.json +1 -0
- package/vendors/claude/workflows/plan-section.md +3 -2
- package/vendors/claude/workflows/research-gap.md +2 -2
- package/vendors/claude/workflows/write-section.md +1 -1
- package/vendors/clio-extension/.wtfp-generated.json +228 -0
- package/vendors/clio-extension/actions/add-todo.json +52 -0
- package/vendors/clio-extension/actions/analyze-bib.json +97 -0
- package/vendors/clio-extension/actions/audit-milestone.json +63 -0
- package/vendors/clio-extension/actions/check-refs.json +80 -0
- package/vendors/clio-extension/actions/check-todos.json +52 -0
- package/vendors/clio-extension/actions/checkpoint.json +76 -0
- package/vendors/clio-extension/actions/contribute.json +57 -0
- package/vendors/clio-extension/actions/create-outline.json +84 -0
- package/vendors/clio-extension/actions/create-poster.json +54 -0
- package/vendors/clio-extension/actions/create-slides.json +54 -0
- package/vendors/clio-extension/actions/discuss-section.json +76 -0
- package/vendors/clio-extension/actions/execute-outline.json +116 -0
- package/vendors/clio-extension/actions/export-latex.json +65 -0
- package/vendors/clio-extension/actions/help.json +30 -0
- package/vendors/clio-extension/actions/insert-section.json +61 -0
- package/vendors/clio-extension/actions/list-assumptions.json +35 -0
- package/vendors/clio-extension/actions/map-project.json +71 -0
- package/vendors/clio-extension/actions/new-paper.json +70 -0
- package/vendors/clio-extension/actions/pause-writing.json +71 -0
- package/vendors/clio-extension/actions/plan-milestone-gaps.json +57 -0
- package/vendors/clio-extension/actions/plan-revision.json +58 -0
- package/vendors/clio-extension/actions/plan-section.json +100 -0
- package/vendors/clio-extension/actions/polish-prose.json +69 -0
- package/vendors/clio-extension/actions/progress.json +51 -0
- package/vendors/clio-extension/actions/quick.json +70 -0
- package/vendors/clio-extension/actions/remove-section.json +63 -0
- package/vendors/clio-extension/actions/report-bug.json +47 -0
- package/vendors/clio-extension/actions/request-feature.json +47 -0
- package/vendors/clio-extension/actions/research-gap.json +102 -0
- package/vendors/clio-extension/actions/resume-writing.json +65 -0
- package/vendors/clio-extension/actions/review-section.json +83 -0
- package/vendors/clio-extension/actions/settings.json +47 -0
- package/vendors/clio-extension/actions/submit-milestone.json +77 -0
- package/vendors/clio-extension/actions/update.json +42 -0
- package/vendors/clio-extension/actions/verify-work.json +63 -0
- package/vendors/clio-extension/actions/write-section.json +115 -0
- package/vendors/clio-extension/clio-coder-extension.yaml +53 -0
- package/vendors/clio-extension/compatibility/action-availability.json +295 -0
- package/vendors/clio-extension/project/schemas/checkpoint.schema.json +102 -0
- package/vendors/clio-extension/project/schemas/common.schema.json +33 -0
- package/vendors/clio-extension/project/schemas/config.schema.json +69 -0
- package/vendors/clio-extension/project/schemas/decisions.schema.json +31 -0
- package/vendors/clio-extension/project/schemas/evidence.schema.json +48 -0
- package/vendors/clio-extension/project/schemas/manifest.schema.json +102 -0
- package/vendors/clio-extension/project/schemas/outline.schema.json +67 -0
- package/vendors/clio-extension/project/schemas/section.schema.json +95 -0
- package/vendors/clio-extension/project/schemas/source.schema.json +73 -0
- package/vendors/clio-extension/project/schemas/state.schema.json +58 -0
- package/vendors/clio-extension/project/schemas/validation.schema.json +74 -0
- package/vendors/clio-extension/runtime/extension.test.ts +248 -0
- package/vendors/clio-extension/runtime/extension.ts +1321 -0
- package/vendors/clio-extension/runtime/json-schema.cjs +304 -0
- package/vendors/clio-extension/runtime/package.json +3 -0
- package/vendors/clio-extension/runtime/write-guard.json +21 -0
- package/vendors/clio-extension/skins/wtfp.json +20 -0
- package/vendors/codex/plugins/wtfp/.codex-plugin/plugin.json +1 -1
- package/vendors/codex/plugins/wtfp/.wtfp-generated.json +17 -13
- package/vendors/codex/plugins/wtfp/actions/research-gap.json +1 -1
- package/vendors/codex/plugins/wtfp/agents/wtfp-research-synthesizer.toml +1 -1
- package/vendors/codex/plugins/wtfp/plugin.json +1 -1
- package/vendors/codex/plugins/wtfp/roles/research-synthesizer.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/codex/plugins/wtfp/tools/README.md +1 -1
- package/vendors/codex/plugins/wtfp/tools/package.json +1 -0
- package/vendors/codex/plugins/wtfp/workflows/plan-section.md +3 -2
- package/vendors/codex/plugins/wtfp/workflows/research-gap.md +2 -2
- package/vendors/codex/plugins/wtfp/workflows/write-section.md +1 -1
- package/vendors/copilot/.wtfp-generated.json +14 -14
- 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 +18 -14
- package/vendors/copilot/plugins/wtfp/actions/research-gap.json +1 -1
- package/vendors/copilot/plugins/wtfp/agents/wtfp-research-synthesizer.md +1 -1
- package/vendors/copilot/plugins/wtfp/commands/wtfp-plan-section.md +3 -2
- package/vendors/copilot/plugins/wtfp/commands/wtfp-write-section.md +1 -1
- package/vendors/copilot/plugins/wtfp/roles/research-synthesizer.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/copilot/plugins/wtfp/tools/README.md +1 -1
- package/vendors/copilot/plugins/wtfp/tools/package.json +1 -0
- package/vendors/copilot/plugins/wtfp/workflows/plan-section.md +3 -2
- package/vendors/copilot/plugins/wtfp/workflows/research-gap.md +2 -2
- package/vendors/copilot/plugins/wtfp/workflows/write-section.md +1 -1
- package/vendors/copilot/project/.github/agents/wtfp-research-synthesizer.agent.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/copilot/project/.github/wtfp/actions/research-gap.json +1 -1
- package/vendors/copilot/project/.github/wtfp/roles/research-synthesizer.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/copilot/project/.github/wtfp/workflows/plan-section.md +3 -2
- package/vendors/copilot/project/.github/wtfp/workflows/research-gap.md +2 -2
- package/vendors/copilot/project/.github/wtfp/workflows/write-section.md +1 -1
- package/vendors/gemini/.wtfp-generated.json +24 -20
- package/vendors/gemini/actions/research-gap.json +1 -1
- package/vendors/gemini/agents/wtfp-research-synthesizer.md +1 -1
- package/vendors/gemini/commands/wtfp/discuss-section.toml +1 -1
- package/vendors/gemini/commands/wtfp/execute-outline.toml +1 -1
- package/vendors/gemini/commands/wtfp/insert-section.toml +1 -1
- package/vendors/gemini/commands/wtfp/list-assumptions.toml +1 -1
- package/vendors/gemini/commands/wtfp/plan-revision.toml +1 -1
- package/vendors/gemini/commands/wtfp/plan-section.toml +4 -3
- package/vendors/gemini/commands/wtfp/quick.toml +1 -1
- package/vendors/gemini/commands/wtfp/write-section.toml +2 -2
- package/vendors/gemini/gemini-extension.json +1 -1
- package/vendors/gemini/roles/research-synthesizer.md +1 -1
- package/vendors/gemini/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/gemini/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/gemini/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/gemini/tools/README.md +1 -1
- package/vendors/gemini/tools/package.json +1 -0
- package/vendors/gemini/workflows/plan-section.md +3 -2
- package/vendors/gemini/workflows/research-gap.md +2 -2
- package/vendors/gemini/workflows/write-section.md +1 -1
- package/vendors/opencode/.wtfp-generated.json +23 -19
- package/vendors/opencode/actions/research-gap.json +1 -1
- package/vendors/opencode/agents/wtfp/research-synthesizer.md +1 -1
- package/vendors/opencode/commands/wtfp/discuss-section.md +1 -1
- package/vendors/opencode/commands/wtfp/execute-outline.md +1 -1
- package/vendors/opencode/commands/wtfp/insert-section.md +1 -1
- package/vendors/opencode/commands/wtfp/list-assumptions.md +1 -1
- package/vendors/opencode/commands/wtfp/plan-revision.md +1 -1
- package/vendors/opencode/commands/wtfp/plan-section.md +4 -3
- package/vendors/opencode/commands/wtfp/quick.md +1 -1
- package/vendors/opencode/commands/wtfp/write-section.md +2 -2
- package/vendors/opencode/roles/research-synthesizer.md +1 -1
- package/vendors/opencode/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/opencode/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/opencode/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/opencode/tools/README.md +1 -1
- package/vendors/opencode/tools/package.json +1 -0
- package/vendors/opencode/workflows/plan-section.md +3 -2
- package/vendors/opencode/workflows/research-gap.md +2 -2
- package/vendors/opencode/workflows/write-section.md +1 -1
- package/vendors/plugin/.wtfp-generated.json +44 -40
- package/vendors/plugin/actions/research-gap.json +1 -1
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-research-synthesizer.md +1 -1
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/add-todo.md +6 -12
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/analyze-bib.md +9 -19
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/audit-milestone.md +7 -25
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/check-refs.md +9 -15
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/check-todos.md +9 -13
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/checkpoint.md +7 -27
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/create-outline.md +9 -25
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/discuss-section.md +7 -17
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/execute-outline.md +10 -27
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/help.md +2 -2
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/insert-section.md +7 -13
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/map-project.md +6 -14
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/new-paper.md +7 -17
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/pause-writing.md +6 -18
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-milestone-gaps.md +7 -15
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-section.md +12 -29
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/polish-prose.md +10 -15
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/quick.md +10 -15
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/research-gap.md +15 -23
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/resume-writing.md +7 -23
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/review-section.md +9 -19
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/settings.md +7 -9
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/submit-milestone.md +7 -25
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/verify-work.md +7 -15
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/write-section.md +11 -29
- package/vendors/plugin/compatibility/action-availability.json +16 -1
- package/vendors/plugin/plugin.json +7 -7
- package/vendors/plugin/roles/research-synthesizer.md +1 -1
- package/vendors/plugin/skills/wtfp-plan-section/references/actions.md +1 -1
- package/vendors/plugin/skills/wtfp-research-literature/references/actions.md +1 -1
- package/vendors/plugin/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/plugin/tools/README.md +1 -1
- package/vendors/plugin/tools/package.json +1 -0
- package/vendors/plugin/workflows/plan-section.md +3 -2
- package/vendors/plugin/workflows/research-gap.md +2 -2
- package/vendors/plugin/workflows/write-section.md +1 -1
- /package/vendors/plugin/ai.iowarp.clio/{fleets → playbooks}/wtfp-draft-review.md +0 -0
- /package/vendors/plugin/ai.iowarp.clio/{fleets → playbooks}/wtfp-plan-section.md +0 -0
|
@@ -5,9 +5,9 @@ const path = require('path');
|
|
|
5
5
|
const { createTargetGuard, resolveOwnedPath, sha256Buffer } = require('./ownership');
|
|
6
6
|
|
|
7
7
|
// Clio owns integrity, provenance, drift and enable/disable for an installed
|
|
8
|
-
// plugin. WTF-P owns two much smaller things: the exact bytes it
|
|
9
|
-
// (its v2 receipt) and the guarantee that
|
|
10
|
-
// generated
|
|
8
|
+
// plugin or extension. WTF-P owns two much smaller things: the exact bytes it
|
|
9
|
+
// publishes (its v2 receipt) and the guarantee that each tree handed to Clio
|
|
10
|
+
// is the generated package and nothing else.
|
|
11
11
|
function treeFiles(root) {
|
|
12
12
|
const files = new Map();
|
|
13
13
|
function visit(directory) {
|
|
@@ -37,10 +37,11 @@ function scopeOptions(targetDir, options) {
|
|
|
37
37
|
return { ...options, cwd, scope: project ? 'project' : 'user' };
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
function generatedBundle(root) {
|
|
40
|
+
function generatedBundle(root, target = 'portable-plugin') {
|
|
41
41
|
const inventoryPath = path.join(root, '.wtfp-generated.json');
|
|
42
|
+
if (!fs.existsSync(inventoryPath)) return null;
|
|
42
43
|
const inventory = JSON.parse(fs.readFileSync(inventoryPath, 'utf8'));
|
|
43
|
-
if (inventory.schema !== 'wtfp.generated-adapter/v1' || inventory.target !==
|
|
44
|
+
if (inventory.schema !== 'wtfp.generated-adapter/v1' || inventory.target !== target) {
|
|
44
45
|
return null;
|
|
45
46
|
}
|
|
46
47
|
const expected = new Map(inventory.files.map(file => [file.path, file.sha256]));
|
|
@@ -108,42 +109,110 @@ function installedListEntry(stdout, targetDir, native, scope) {
|
|
|
108
109
|
return matches[0];
|
|
109
110
|
}
|
|
110
111
|
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
function installedExtensionEntry(stdout, targetDir, native, scope) {
|
|
113
|
+
const listing = JSON.parse(stdout);
|
|
114
|
+
if (!listing || !Array.isArray(listing.extensions)) {
|
|
115
|
+
throw new Error('Clio extensions list did not return an extensions array');
|
|
116
|
+
}
|
|
117
|
+
for (const entry of listing.extensions) {
|
|
118
|
+
if (!installedRecord(entry)) throw new Error('Clio extensions list returned a malformed installed extension');
|
|
119
|
+
}
|
|
120
|
+
const matches = listing.extensions.filter(entry => entry.id === native.id && entry.scope === scope &&
|
|
121
|
+
sameRoot(entry.rootPath, path.join(targetDir, native.source)));
|
|
122
|
+
if (matches.length > 1) throw new Error('Clio extensions list returned duplicate installed extension identities');
|
|
123
|
+
return matches[0];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// The two Clio packages WTF-P installs, plugin first. Each is its own Clio
|
|
127
|
+
// install with its own lifecycle command, generated inventory and checks.
|
|
128
|
+
function clioPackages(native) {
|
|
129
|
+
const plugin = {
|
|
130
|
+
noun: 'plugin', command: 'library', id: native.id, source: native.source, inventory: 'portable-plugin',
|
|
131
|
+
deferral: 'Clio activation requires an intact generated bundle without extra or modified files',
|
|
132
|
+
list: () => ['library', 'list', '--kind', 'plugin', '--json'],
|
|
133
|
+
listed: (stdout, targetDir, scope) => installedListEntry(stdout, targetDir, native, scope),
|
|
134
|
+
// `inspect` returns the installed record for the explicitly selected scope.
|
|
135
|
+
verify: scope => ['library', 'inspect', native.id, `--${scope}`, '--json'],
|
|
136
|
+
verified: (stdout, targetDir, scope) => verifiedEntry(stdout, targetDir, native, scope)
|
|
137
|
+
};
|
|
138
|
+
if (!native.extension) return [plugin];
|
|
139
|
+
const extension = native.extension;
|
|
140
|
+
const listed = (stdout, targetDir, scope) => installedExtensionEntry(stdout, targetDir, extension, scope);
|
|
141
|
+
return [plugin, {
|
|
142
|
+
noun: 'extension', command: 'extensions', id: extension.id, source: extension.source, inventory: 'clio-extension',
|
|
143
|
+
deferral: 'Clio extension activation requires an intact generated extension without extra or modified files',
|
|
144
|
+
list: scope => ['extensions', 'list', `--${scope}`, '--json'],
|
|
145
|
+
listed,
|
|
146
|
+
verify: scope => ['extensions', 'list', `--${scope}`, '--json'],
|
|
147
|
+
verified: listed
|
|
148
|
+
}];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Registration is what WTF-P is responsible for. Whether the operator has a
|
|
152
|
+
// package switched on is Clio's state and their decision, so it is reported,
|
|
113
153
|
// never asserted and never changed.
|
|
114
154
|
function registered(entry) {
|
|
115
155
|
return Boolean(entry) && entry.valid === true &&
|
|
116
156
|
Array.isArray(entry.diagnostics) && entry.diagnostics.length === 0;
|
|
117
157
|
}
|
|
118
158
|
|
|
119
|
-
function disabledNotice(
|
|
120
|
-
return `Clio reports ${
|
|
159
|
+
function disabledNotice(pkg, scope) {
|
|
160
|
+
return `Clio reports ${pkg.id} as installed but disabled. WTF-P does not change that preference; run clio-coder ${pkg.command} enable ${pkg.id} --${scope} to switch it back on.`;
|
|
121
161
|
}
|
|
122
162
|
|
|
163
|
+
// Install the plugin, then the extension. A failure in the second compensates
|
|
164
|
+
// the first, and the returned compensator undoes both in reverse order.
|
|
123
165
|
function activateClio(targetDir, native, suppliedOptions) {
|
|
124
166
|
const options = scopeOptions(targetDir, suppliedOptions);
|
|
167
|
+
const activated = [];
|
|
168
|
+
try {
|
|
169
|
+
for (const pkg of clioPackages(native)) {
|
|
170
|
+
const result = activatePackage(targetDir, pkg, options);
|
|
171
|
+
activated.push(result);
|
|
172
|
+
if (result.status !== 'registered') break;
|
|
173
|
+
}
|
|
174
|
+
} catch (error) {
|
|
175
|
+
const failures = activated.reverse().flatMap(result => typeof result.rollback === 'function' ? result.rollback() : []);
|
|
176
|
+
if (failures.length) error.nativeRollbackFailures = [...(error.nativeRollbackFailures || []), ...failures];
|
|
177
|
+
throw error;
|
|
178
|
+
}
|
|
179
|
+
if (activated.length === 1) return activated[0];
|
|
180
|
+
const last = activated[activated.length - 1];
|
|
181
|
+
const notices = activated.map(result => result.notice).filter(Boolean);
|
|
182
|
+
return {
|
|
183
|
+
status: last.status, executable: 'clio-coder',
|
|
184
|
+
...(last.reason ? { reason: last.reason } : {}),
|
|
185
|
+
results: activated.flatMap(result => result.results),
|
|
186
|
+
...(notices.length ? { notice: notices.join(' ') } : {}),
|
|
187
|
+
rollback() {
|
|
188
|
+
return [...activated].reverse().flatMap(result => typeof result.rollback === 'function' ? result.rollback() : []);
|
|
189
|
+
},
|
|
190
|
+
commit() {
|
|
191
|
+
const warnings = activated.map(result => typeof result.commit === 'function' ? result.commit() : undefined).filter(Boolean);
|
|
192
|
+
return warnings.length ? warnings.join('; ') : undefined;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function activatePackage(targetDir, pkg, options) {
|
|
125
198
|
const { execute, environment } = options;
|
|
126
199
|
const guard = createTargetGuard(targetDir);
|
|
127
|
-
const root = resolveOwnedPath(targetDir,
|
|
200
|
+
const root = resolveOwnedPath(targetDir, pkg.source, guard);
|
|
128
201
|
const publishedFiles = treeFiles(root);
|
|
129
|
-
const expected = generatedBundle(root);
|
|
202
|
+
const expected = generatedBundle(root, pkg.inventory);
|
|
130
203
|
if (!expected || !sameTree(expected, publishedFiles)) {
|
|
131
|
-
return {
|
|
132
|
-
status: 'deferred',
|
|
133
|
-
reason: 'Clio activation requires an intact generated bundle without extra or modified files',
|
|
134
|
-
results: []
|
|
135
|
-
};
|
|
204
|
+
return { status: 'deferred', reason: pkg.deferral, results: [] };
|
|
136
205
|
}
|
|
137
206
|
|
|
138
207
|
const results = [];
|
|
139
|
-
const priorList = execute('clio-coder',
|
|
208
|
+
const priorList = execute('clio-coder', pkg.list(options.scope), environment, options);
|
|
140
209
|
if (priorList.status === 'unavailable') return { status: 'unavailable', executable: 'clio-coder', results };
|
|
141
210
|
results.push(priorList);
|
|
142
|
-
const priorEntry =
|
|
211
|
+
const priorEntry = pkg.listed(priorList.stdout, targetDir, options.scope);
|
|
143
212
|
if (registered(priorEntry)) {
|
|
144
213
|
return {
|
|
145
214
|
status: 'registered', executable: 'clio-coder', results,
|
|
146
|
-
...(priorEntry.enabled === false ? { notice: disabledNotice(
|
|
215
|
+
...(priorEntry.enabled === false ? { notice: disabledNotice(pkg, options.scope) } : {})
|
|
147
216
|
};
|
|
148
217
|
}
|
|
149
218
|
|
|
@@ -152,7 +221,7 @@ function activateClio(targetDir, native, suppliedOptions) {
|
|
|
152
221
|
// until the receipt is durable lets a failed registration put the previous
|
|
153
222
|
// installation back before the file transaction rolls it back.
|
|
154
223
|
const staging = fs.mkdtempSync(path.join(path.dirname(root), '.wtfp-staged-'));
|
|
155
|
-
const source = path.join(staging,
|
|
224
|
+
const source = path.join(staging, pkg.id);
|
|
156
225
|
fs.renameSync(root, source);
|
|
157
226
|
let finished = false;
|
|
158
227
|
|
|
@@ -163,15 +232,15 @@ function activateClio(targetDir, native, suppliedOptions) {
|
|
|
163
232
|
if (!sameTree(publishedFiles, treeFiles(root))) {
|
|
164
233
|
throw new Error('Clio content changed concurrently; recovery tree preserved');
|
|
165
234
|
}
|
|
166
|
-
const removal = execute('clio-coder', [
|
|
235
|
+
const removal = execute('clio-coder', [pkg.command, 'remove', pkg.id, `--${options.scope}`, '--json'], environment,
|
|
167
236
|
{ ...options, allowAlreadyAbsent: true });
|
|
168
237
|
results.push(removal);
|
|
169
238
|
if (removal.status === 'unavailable') throw new Error('Clio became unavailable during rollback');
|
|
170
239
|
}
|
|
171
240
|
if (fs.existsSync(root)) throw new Error('Clio rollback did not remove the replacement');
|
|
172
|
-
const after = execute('clio-coder',
|
|
241
|
+
const after = execute('clio-coder', pkg.list(options.scope), environment, options);
|
|
173
242
|
results.push(after);
|
|
174
|
-
if (after.status === 'unavailable' ||
|
|
243
|
+
if (after.status === 'unavailable' || pkg.listed(after.stdout, targetDir, options.scope)) {
|
|
175
244
|
throw new Error('Clio rollback did not clear the replacement registration');
|
|
176
245
|
}
|
|
177
246
|
fs.renameSync(source, root);
|
|
@@ -184,22 +253,22 @@ function activateClio(targetDir, native, suppliedOptions) {
|
|
|
184
253
|
}
|
|
185
254
|
|
|
186
255
|
try {
|
|
187
|
-
const installation = execute('clio-coder', [
|
|
256
|
+
const installation = execute('clio-coder', [pkg.command, 'install', source, `--${options.scope}`, '--json'], environment, options);
|
|
188
257
|
results.push(installation);
|
|
189
258
|
if (installation.status === 'unavailable') throw new Error('Clio became unavailable during installation');
|
|
190
|
-
const inspected = execute('clio-coder',
|
|
259
|
+
const inspected = execute('clio-coder', pkg.verify(options.scope), environment, options);
|
|
191
260
|
results.push(inspected);
|
|
192
261
|
if (inspected.status === 'unavailable') throw new Error('Clio became unavailable during verification');
|
|
193
|
-
const entry =
|
|
262
|
+
const entry = pkg.verified(inspected.stdout, targetDir, options.scope);
|
|
194
263
|
if (!registered(entry) || !sameTree(publishedFiles, treeFiles(root))) {
|
|
195
|
-
throw new Error(
|
|
264
|
+
throw new Error(`Clio did not report the exact WTF-P ${pkg.noun} as installed and valid with zero diagnostics`);
|
|
196
265
|
}
|
|
197
266
|
if (priorEntry && priorEntry.enabled !== entry.enabled) {
|
|
198
|
-
throw new Error(
|
|
267
|
+
throw new Error(`Clio installation changed the existing WTF-P ${pkg.noun} enabled preference`);
|
|
199
268
|
}
|
|
200
269
|
return {
|
|
201
270
|
status: 'registered', executable: 'clio-coder', results, rollback,
|
|
202
|
-
...(entry.enabled === false ? { notice: disabledNotice(
|
|
271
|
+
...(entry.enabled === false ? { notice: disabledNotice(pkg, options.scope) } : {}),
|
|
203
272
|
commit() {
|
|
204
273
|
// Only the private held copy is removed; Clio owns its installed tree.
|
|
205
274
|
finished = true;
|
|
@@ -217,27 +286,49 @@ function activateClio(targetDir, native, suppliedOptions) {
|
|
|
217
286
|
}
|
|
218
287
|
}
|
|
219
288
|
|
|
289
|
+
// Remove the extension, then the plugin, each only when the receipt proves it.
|
|
290
|
+
// `ownedFiles` maps receipt paths below the target to their published hashes.
|
|
220
291
|
function deactivateClio(targetDir, native, suppliedOptions) {
|
|
221
292
|
const options = scopeOptions(targetDir, suppliedOptions);
|
|
293
|
+
const removed = [];
|
|
294
|
+
for (const pkg of clioPackages(native).reverse()) {
|
|
295
|
+
const prefix = `${pkg.source}/`;
|
|
296
|
+
const ownedFiles = options.ownedFiles && new Map([...options.ownedFiles]
|
|
297
|
+
.filter(([file]) => file.startsWith(prefix))
|
|
298
|
+
.map(([file, hash]) => [file.slice(prefix.length), hash]));
|
|
299
|
+
const result = deactivatePackage(targetDir, pkg, { ...options, ownedFiles });
|
|
300
|
+
if (result.status === 'unavailable') return result;
|
|
301
|
+
removed.push(result);
|
|
302
|
+
}
|
|
303
|
+
if (removed.length === 1) return removed[0];
|
|
304
|
+
const deferred = removed.find(result => result.status === 'deferred');
|
|
305
|
+
const results = removed.flatMap(result => result.results);
|
|
306
|
+
if (deferred) return { status: 'deferred', reason: deferred.reason, results };
|
|
307
|
+
return removed.some(result => result.status === 'unregistered')
|
|
308
|
+
? { status: 'unregistered', executable: 'clio-coder', results }
|
|
309
|
+
: { status: 'not-required', results };
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function deactivatePackage(targetDir, pkg, options) {
|
|
222
313
|
const { execute, environment } = options;
|
|
223
314
|
const guard = createTargetGuard(targetDir);
|
|
224
|
-
const listing = execute('clio-coder',
|
|
315
|
+
const listing = execute('clio-coder', pkg.list(options.scope), environment, options);
|
|
225
316
|
if (listing.status === 'unavailable') return { status: 'unavailable', executable: 'clio-coder', results: [] };
|
|
226
|
-
if (!
|
|
317
|
+
if (!pkg.listed(listing.stdout, targetDir, options.scope)) {
|
|
227
318
|
return { status: 'not-required', results: [listing] };
|
|
228
319
|
}
|
|
229
320
|
|
|
230
321
|
// Native removal is recursive. Run it only when the receipt proves that every
|
|
231
322
|
// file below the installed root is one WTF-P published and nobody changed.
|
|
232
|
-
const root = resolveOwnedPath(targetDir,
|
|
323
|
+
const root = resolveOwnedPath(targetDir, pkg.source, guard);
|
|
233
324
|
const ownedFiles = options.ownedFiles;
|
|
234
325
|
if (!ownedFiles || !sameTree(treeFiles(root), ownedFiles)) {
|
|
235
|
-
return { status: 'deferred', reason:
|
|
326
|
+
return { status: 'deferred', reason: `Clio native removal would include unowned or modified ${pkg.noun} files`, results: [listing] };
|
|
236
327
|
}
|
|
237
|
-
const result = execute('clio-coder', [
|
|
328
|
+
const result = execute('clio-coder', [pkg.command, 'remove', pkg.id, `--${options.scope}`, '--json'], environment, options);
|
|
238
329
|
if (result.status === 'unavailable') return { status: 'unavailable', executable: 'clio-coder', results: [listing] };
|
|
239
|
-
const after = execute('clio-coder',
|
|
240
|
-
if (after.status === 'unavailable' || fs.existsSync(root) ||
|
|
330
|
+
const after = execute('clio-coder', pkg.list(options.scope), environment, options);
|
|
331
|
+
if (after.status === 'unavailable' || fs.existsSync(root) || pkg.listed(after.stdout, targetDir, options.scope)) {
|
|
241
332
|
throw new Error('Clio removal did not clear WTF-P content and registration');
|
|
242
333
|
}
|
|
243
334
|
return { status: 'unregistered', executable: 'clio-coder', results: [listing, result, after] };
|
package/bin/lib/manifest.js
CHANGED
|
@@ -67,8 +67,9 @@ const MANIFEST = {
|
|
|
67
67
|
source: 'marketplaces/wtfp'
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
-
// Clio consumes the canonical Agent Plugins bundle through its
|
|
71
|
-
// lifecycle
|
|
70
|
+
// Clio consumes the canonical Agent Plugins bundle through its plugin
|
|
71
|
+
// lifecycle and the desk through its extension lifecycle: two packages, two
|
|
72
|
+
// Clio installs, one WTF-P receipt.
|
|
72
73
|
clio: {
|
|
73
74
|
name: 'Clio Coder',
|
|
74
75
|
configDirEnv: 'CLIO_CODER_CONFIG_DIR',
|
|
@@ -80,6 +81,12 @@ const MANIFEST = {
|
|
|
80
81
|
src: path.join(ROOT, 'vendors', 'plugin'),
|
|
81
82
|
dest: 'plugins/wtfp',
|
|
82
83
|
type: 'dir'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 'extension',
|
|
87
|
+
src: path.join(ROOT, 'vendors', 'clio-extension'),
|
|
88
|
+
dest: 'extensions/wtfp',
|
|
89
|
+
type: 'dir'
|
|
83
90
|
}
|
|
84
91
|
],
|
|
85
92
|
discovery: {
|
|
@@ -89,7 +96,8 @@ const MANIFEST = {
|
|
|
89
96
|
native: {
|
|
90
97
|
kind: 'clio-plugin',
|
|
91
98
|
id: 'wtfp',
|
|
92
|
-
source: 'plugins/wtfp'
|
|
99
|
+
source: 'plugins/wtfp',
|
|
100
|
+
extension: { id: 'wtfp', source: 'extensions/wtfp' }
|
|
93
101
|
}
|
|
94
102
|
},
|
|
95
103
|
codex: {
|
package/bin/uninstall.js
CHANGED
|
@@ -780,9 +780,10 @@ async function uninstall(runtime, options, out) {
|
|
|
780
780
|
vendorConfig.native,
|
|
781
781
|
{ ...(vendorKey === 'clio' && plan.receipt.scope === 'project'
|
|
782
782
|
? { scope: 'project', cwd: path.dirname(targetDir) } : {}),
|
|
783
|
+
// Receipt paths below the target; Clio checks each package root against them.
|
|
783
784
|
ownedFiles: new Map(plan.items
|
|
784
|
-
.filter(item => item.
|
|
785
|
-
.map(item => [item.path
|
|
785
|
+
.filter(item => item.state === 'unchanged')
|
|
786
|
+
.map(item => [item.path, item.entry.sha256])) }
|
|
786
787
|
);
|
|
787
788
|
if (nativeRemoval.status === 'unavailable' && !options.hasQuiet) {
|
|
788
789
|
out.warn(`${nativeRemoval.executable} is unavailable; removing the WTF-P-owned staging files without changing the client's native registry.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wtf-p",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
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",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
"id": "user.gate",
|
|
99
|
-
"scope": "
|
|
99
|
+
"scope": "unapproved or paid external providers and bounded query set, plus author-owned research scope and depth decisions"
|
|
100
100
|
}
|
|
101
101
|
]
|
|
102
102
|
}
|
|
@@ -42,7 +42,7 @@ Investigate the literature needed to plan and write a specific section well. The
|
|
|
42
42
|
## Boundaries
|
|
43
43
|
|
|
44
44
|
- This is a `mutation-report` role. It may write only the research and suggestion artifacts authorized by the invoking action.
|
|
45
|
-
-
|
|
45
|
+
- An operator-configured, trusted read-only CiteNexus MCP connection may search bounded public scholarly metadata without a second per-query gate. In an explicitly selected full-auto host session for this research action, `citation-search --backend=cite-nexus` may also search `crossref`, `datacite`, `europe_pmc`, or `arxiv` without another gate. Other providers or modes require explicit network approval naming providers and query bounds. Honor offline flags and host refusals. Returned results stay candidates, and this role never performs a bibliography write.
|
|
46
46
|
- Never fabricate a citation, identifier, quotation, metadata field, source conclusion, or claim of exhaustive coverage.
|
|
47
47
|
- Never overwrite an existing `project://sources/{source}` record. Additions remain provisional until identity and provenance are verified by an authorized action.
|
|
48
48
|
- Do not explore alternatives that author decisions explicitly deferred or rejected.
|
|
@@ -46,7 +46,7 @@ Contract: [protocol/actions/plan-section.json](../../../actions/plan-section.jso
|
|
|
46
46
|
2. Read the complete planning context before decomposing work: manifest, config, state, decisions, outline, section record, context, research, source/evidence records, relevant prior summaries, and the bounded `project://validations/*` collection.
|
|
47
47
|
3. Before any specialist dispatch, filter the validation records to candidates whose `subject_uri` is exactly `project://structure/outline` and whose `action_id` is exactly `create-outline`. A candidate is current only when `executed_at >= outline.updated_at`. Because the v1 validation schema carries no outline revision or content hash, disclose that this timestamp test is a conservative freshness proxy.
|
|
48
48
|
4. Require exactly one current candidate and require its `status` to be `passed`. Separately verify that the current outline and target section are consistent with all current locked and deferred author choices: honor locked choices and do not treat deferred choices as resolved. A missing, stale, ambiguous, or non-passing candidate, or a decision contradiction, blocks all specialist dispatch and every plan, section, state, or validation write. Only a recovery checkpoint may be proposed on this blocked path, and it may be written only after a complete record preview and explicit author approval.
|
|
49
|
-
5. If the section is literature-heavy
|
|
49
|
+
5. If the section is literature-heavy, require a section-specific research artifact and resolvable source/evidence records for its planned claims before dispatch or approval. Run `research-gap` with the configured CiteNexus backend when available; if coverage remains insufficient, record a research checkpoint and stop. Search candidates alone are not verified citations. Do not manufacture citations to keep planning moving.
|
|
50
50
|
6. Summarize the section goal, claims, evidence, manuscript artifact, dependencies, and open decisions at `config.gates.confirm_plan`.
|
|
51
51
|
7. After the prerequisites pass, require `section-planner` in a bounded delegated pass to create one or more immutable Markdown `project://sections/{section}/plans/{plan}` artifacts. Each plan must declare:
|
|
52
52
|
- stable section and plan identifiers;
|
|
@@ -14,7 +14,7 @@ Contract: [protocol/actions/research-gap.json](../../../actions/research-gap.jso
|
|
|
14
14
|
- `standard`: run a focused, reproducible search across the most relevant categories;
|
|
15
15
|
- `deep`: map foundational, recent, competing, gap-defining, and methodological work, including important disagreements and intellectual lineage.
|
|
16
16
|
5. Form search questions and inclusion criteria before searching. Record databases or corpora, query strings, date, filters, and stopping rule.
|
|
17
|
-
6. Search authoritative scholarly sources
|
|
17
|
+
6. Search authoritative scholarly sources with bounded queries. Two routes need no second per-query author gate: a host connection the operator already configured and authorized for read-only public scholarly metadata search, or the bundled CiteNexus dispatcher in a host session explicitly set to full-auto for this research action when every selected provider is a free, no-key public index (`crossref`, `datacite`, `europe_pmc`, or `arxiv`). Record provider IDs, query strings, date, and result limits in the research artifact. Do not send unpublished manuscript text, private notes, or credentials as search terms. Outside those routes, first disclose the providers and bounded query set and obtain explicit author approval. The dispatcher runs only `citation-search --backend=cite-nexus` with an explicit `--providers` list; honor an operator-set offline flag or any host refusal. Returned results stay candidates, and this action performs no bibliography write. Deduplicate candidates by persistent identifier, then normalized title.
|
|
18
18
|
7. Verify each retained source from its primary record or publication. Create a `project://sources/{source}` record with title, creators, year, source kind, identifiers, citation key, status, provenance, inspection depth, and verification time.
|
|
19
19
|
8. Read enough of each source to distinguish its actual claim, method, population, result, and limitation. Do not cite an abstract-only impression as full-paper evidence.
|
|
20
20
|
9. Create `project://evidence/{evidence}` separately for each retained claim-level interpretation, with relation, locator, limitations, confidence, and inspection depth. Synthesize by question rather than listing papers; identify consensus, disagreement, methodological differences, missing evidence, and defensible positioning.
|
|
@@ -8,7 +8,7 @@ Contract: [protocol/actions/write-section.json](../../../actions/write-section.j
|
|
|
8
8
|
|
|
9
9
|
1. Require an exact `project://sections/{section}/plans/{plan}` artifact linked from `project://sections/{section}` and verify its declared inputs, outputs, dependencies, validation, and approval state.
|
|
10
10
|
2. If a corresponding summary or manuscript output exists, show the overwrite or merge impact and require explicit re-execution approval.
|
|
11
|
-
3. Read the plan, `project://manifest`, `project://state`, `project://decisions`, `project://structure/outline`, section context and research, relevant source/evidence records, and enough neighboring prose to maintain continuity.
|
|
11
|
+
3. Read the plan, `project://manifest`, `project://state`, `project://decisions`, `project://structure/outline`, section context and research, relevant source/evidence records, and enough neighboring prose to maintain continuity. For a literature-heavy section, require research and verified source/evidence coverage of the plan's factual claims before drafting. Route missing coverage through `research-gap` and a checkpoint; do not substitute model memory or search candidates for source records.
|
|
12
12
|
4. Present the plan objective, output path, target words, evidence obligations, and checkpoints at the configured writing gate.
|
|
13
13
|
5. Execute tasks in order against the exact `project://paper/{artifact}` output. For each task:
|
|
14
14
|
- establish the paragraph or subsection's rhetorical job;
|
|
@@ -24,8 +24,9 @@ Manuscript prose and supporting context, research, plan, review, summary, handof
|
|
|
24
24
|
1. Resolve one section record, load its linked context, research, evidence, decisions, and outline constraints, and enumerate the bounded `project://validations/*` collection before any specialist dispatch.
|
|
25
25
|
2. Filter those records to candidates whose `subject_uri` is exactly `project://structure/outline` and whose `action_id` is exactly `create-outline`. A candidate is current only when `executed_at >= outline.updated_at`. Because the v1 validation schema carries no outline revision or content hash, disclose that this timestamp test is a conservative freshness proxy.
|
|
26
26
|
3. Require exactly one current candidate and require its `status` to be `passed`. Separately verify that the current outline and target section are consistent with all current locked and deferred author choices: honor locked choices and do not treat deferred choices as resolved. A missing, stale, ambiguous, or non-passing candidate, or a decision contradiction, blocks all specialist dispatch and every plan, section, state, or validation write. Only a recovery checkpoint may be proposed on this blocked path, and it may be written only after a complete record preview and explicit author approval.
|
|
27
|
-
4.
|
|
28
|
-
5.
|
|
27
|
+
4. For a literature-heavy section, first require a section-specific research artifact plus resolvable source/evidence records that cover the planned claims. If they are absent or insufficient, run `research-gap` with the configured CiteNexus backend when available, verify candidate metadata against the returned records, and stop planning with an explicit research checkpoint if evidence remains insufficient. Never invent citations or treat search candidates as verified sources.
|
|
28
|
+
5. Only after those prerequisites pass, delegate a bounded plan to `section-planner`, then require a fresh `plan-checker` pass over claim coverage, dependencies, file scope, citations, and decision fidelity. Dispatch the exact WTF-P specialist roles; generic coder and verifier roles do not satisfy this workflow.
|
|
29
|
+
6. At confirm_plan, preview the plan and validation; on approval link the plan, update section status to planned, and reconcile state. Create a checkpoint for unresolved judgment instead of bypassing the required checker.
|
|
29
30
|
|
|
30
31
|
## Safety and completion
|
|
31
32
|
|
|
@@ -22,7 +22,7 @@ Manuscript prose and supporting context, research, plan, review, summary, handof
|
|
|
22
22
|
## Procedure
|
|
23
23
|
|
|
24
24
|
1. Resolve the research question and section scope against locked/deferred decisions; agree on depth and source constraints.
|
|
25
|
-
2.
|
|
25
|
+
2. Prefer an operator-configured, trusted read-only CiteNexus MCP connection for bounded public metadata searches when the host has already authorized it. In an explicitly selected full-auto host session for this research action, the bundled CiteNexus dispatcher may also search the free no-key public indexes `crossref`, `datacite`, `europe_pmc`, and `arxiv` without a second per-query author gate; use only selected relevant indexes with an explicit `--providers` list. Record provider IDs, queries, date, and result limits; never send unpublished manuscript text or private notes as search terms. For any other route, first obtain explicit author approval naming the providers and bounded query set. Results remain candidates and this action performs no bibliography write. Verify source identity and inspection depth, and separate source records from claim-level evidence.
|
|
26
26
|
3. Synthesize supported, conflicting, and missing evidence into a Markdown research artifact; link new records and disclose limitations.
|
|
27
27
|
|
|
28
28
|
## Bundled tool execution
|
|
@@ -33,7 +33,7 @@ The declared `tool.execute` effect authorises exactly one command, run from the
|
|
|
33
33
|
node protocol://tools/wtfp-tool.js [--offline] <command> [arguments]
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
Run it with `list` first to read the declared commands, their arguments, their bounds, and the effects each one applies; `protocol://tools/README.md` carries the same table. A command whose effects include `network.*` performs outbound requests.
|
|
36
|
+
Run it with `list` first to read the declared commands, their arguments, their bounds, and the effects each one applies; `protocol://tools/README.md` carries the same table. A command whose effects include `network.*` performs outbound requests. Pass `--offline` (or set `WTFP_TOOL_OFFLINE=1`) until the provider/query gate is approved, except for this action's explicit full-auto public-index route. On that route omit `--offline` only for `citation-search --backend=cite-nexus` with bounded queries and `--providers` drawn from `crossref,datacite,europe_pmc,arxiv`; never override an operator-set offline flag or a host refusal. Never execute another module in this package, never pass a logical `project://` or `wtfp://` URI as a shell argument, and treat every returned record as candidate evidence until it is verified and written to a source or evidence record.
|
|
37
37
|
|
|
38
38
|
## Safety and completion
|
|
39
39
|
|
|
@@ -22,7 +22,7 @@ Manuscript prose and supporting context, research, plan, review, summary, handof
|
|
|
22
22
|
## Procedure
|
|
23
23
|
|
|
24
24
|
1. Require one approved plan and resolve all linked context, research, source/evidence records, decisions, prior summary, existing target, and necessary neighboring prose before choosing create or update.
|
|
25
|
-
2. Draft only the declared manuscript artifact; cite only resolvable sources, preserve author constraints, and stop at blocking decisions.
|
|
25
|
+
2. Before drafting a literature-heavy section, verify that its linked research artifact and source/evidence records cover the plan's factual claims. If coverage is missing, use the declared research workflow and pause at a checkpoint until verified records exist. Draft only the declared manuscript artifact; cite only resolvable sources, preserve author constraints, and stop at blocking decisions. A plausible bibliography entry, search candidate, or model memory is not a verified citation.
|
|
26
26
|
3. Read the persisted manuscript text back and calculate its actual body word count with one deterministic method; never copy a worker self-report, plan target, or summary count into project records. Validate the persisted draft against its plan and word budget.
|
|
27
27
|
4. Create or update the required Markdown summary with that measured count, then 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.
|
|
28
28
|
5. Persist the validation, synchronize the manuscript URI in `manifest.artifacts.manuscripts`, and reconcile section/state records only after manuscript, summary, and validation readback succeeds. If blocked, create the declared checkpoint and stop; do not commit or merge automatically.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schema": "wtfp.generated-adapter/v1",
|
|
3
3
|
"generatorVersion": 5,
|
|
4
4
|
"target": "antigravity",
|
|
5
|
-
"sourceHash": "
|
|
5
|
+
"sourceHash": "c2e93ea50f26a53402f100fe9157834a3841748eebd8cc212648cd615738278d",
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "actions/add-todo.json",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"path": "actions/research-gap.json",
|
|
121
|
-
"sha256": "
|
|
121
|
+
"sha256": "0c26fa663f1d2526cbefcc9750b0a176ddf1ca538a46585a1de48c763fbb1a13"
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
"path": "actions/resume-writing.json",
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
180
|
"path": "agents/wtfp-research-synthesizer.md",
|
|
181
|
-
"sha256": "
|
|
181
|
+
"sha256": "e50c44188d1f655268c35044760a1a314d8d7bf9ece2e9595778c1560b779114"
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
184
|
"path": "agents/wtfp-section-planner.md",
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
},
|
|
287
287
|
{
|
|
288
288
|
"path": "commands/wtfp-plan-section.md",
|
|
289
|
-
"sha256": "
|
|
289
|
+
"sha256": "f36084563180ac559b8e5ff792565a8db6ea9a7c2031bd06ad57ad54f0be94ba"
|
|
290
290
|
},
|
|
291
291
|
{
|
|
292
292
|
"path": "commands/wtfp-polish-prose.md",
|
|
@@ -342,7 +342,7 @@
|
|
|
342
342
|
},
|
|
343
343
|
{
|
|
344
344
|
"path": "commands/wtfp-write-section.md",
|
|
345
|
-
"sha256": "
|
|
345
|
+
"sha256": "100af3ef4be44fe3981023ec5f46bd7a8a3c5a956bb2ec50835ef3a823047275"
|
|
346
346
|
},
|
|
347
347
|
{
|
|
348
348
|
"path": "compatibility/action-availability.json",
|
|
@@ -362,7 +362,7 @@
|
|
|
362
362
|
},
|
|
363
363
|
{
|
|
364
364
|
"path": "plugin.json",
|
|
365
|
-
"sha256": "
|
|
365
|
+
"sha256": "9898153f5524eeea64715c41f2c6fe68f90a312e7f2c2ed08485a448da5ff989"
|
|
366
366
|
},
|
|
367
367
|
{
|
|
368
368
|
"path": "project/README.md",
|
|
@@ -486,7 +486,7 @@
|
|
|
486
486
|
},
|
|
487
487
|
{
|
|
488
488
|
"path": "roles/research-synthesizer.md",
|
|
489
|
-
"sha256": "
|
|
489
|
+
"sha256": "7aa6922f5f819918374b1a87dbda5c12fa6d424be64fc13b4019c380e011306c"
|
|
490
490
|
},
|
|
491
491
|
{
|
|
492
492
|
"path": "roles/section-planner.md",
|
|
@@ -558,7 +558,7 @@
|
|
|
558
558
|
},
|
|
559
559
|
{
|
|
560
560
|
"path": "skills/wtfp-plan-section/references/actions.md",
|
|
561
|
-
"sha256": "
|
|
561
|
+
"sha256": "11d5d27f450857d9a2cd2e06184ba66b4d581e56f6530bd97c82404c8eb06e99"
|
|
562
562
|
},
|
|
563
563
|
{
|
|
564
564
|
"path": "skills/wtfp-plan-section/SKILL.md",
|
|
@@ -570,7 +570,7 @@
|
|
|
570
570
|
},
|
|
571
571
|
{
|
|
572
572
|
"path": "skills/wtfp-research-literature/references/actions.md",
|
|
573
|
-
"sha256": "
|
|
573
|
+
"sha256": "7d2137fa9638782444d88cccf7161ee3afbb5ce9c95bd85fcad57e61b8265d79"
|
|
574
574
|
},
|
|
575
575
|
{
|
|
576
576
|
"path": "skills/wtfp-research-literature/SKILL.md",
|
|
@@ -606,7 +606,7 @@
|
|
|
606
606
|
},
|
|
607
607
|
{
|
|
608
608
|
"path": "skills/wtfp-write-section/references/actions.md",
|
|
609
|
-
"sha256": "
|
|
609
|
+
"sha256": "1fe6f8d50a1abd7a0b338772560317404942874ddd67be458ca24182ea20f7a4"
|
|
610
610
|
},
|
|
611
611
|
{
|
|
612
612
|
"path": "skills/wtfp-write-section/SKILL.md",
|
|
@@ -664,9 +664,13 @@
|
|
|
664
664
|
"path": "tools/citation/semantic-scholar.js",
|
|
665
665
|
"sha256": "df4c1f3d69a28e06dd5285ba46c116bb2731aa940e16b9438c822846f38646f5"
|
|
666
666
|
},
|
|
667
|
+
{
|
|
668
|
+
"path": "tools/package.json",
|
|
669
|
+
"sha256": "dbf8353f77358bc12169b7bb7301e1978d5b503e002ee927229a8993672818fc"
|
|
670
|
+
},
|
|
667
671
|
{
|
|
668
672
|
"path": "tools/README.md",
|
|
669
|
-
"sha256": "
|
|
673
|
+
"sha256": "eb99d2ef30209b409e8c0dbfccaabdf301b6bc50f17013cd8fa381c3c1d69ae2"
|
|
670
674
|
},
|
|
671
675
|
{
|
|
672
676
|
"path": "tools/support/cite-nexus-client.js",
|
|
@@ -762,7 +766,7 @@
|
|
|
762
766
|
},
|
|
763
767
|
{
|
|
764
768
|
"path": "workflows/plan-section.md",
|
|
765
|
-
"sha256": "
|
|
769
|
+
"sha256": "831c20c8afd147a8ba149a46f54591b6f07732983ee916a56c66701c8c701aa2"
|
|
766
770
|
},
|
|
767
771
|
{
|
|
768
772
|
"path": "workflows/polish-prose.md",
|
|
@@ -790,7 +794,7 @@
|
|
|
790
794
|
},
|
|
791
795
|
{
|
|
792
796
|
"path": "workflows/research-gap.md",
|
|
793
|
-
"sha256": "
|
|
797
|
+
"sha256": "02ffe236ba7de12e4b3abbac308c0e1cfc409147147d509616b95baec3fef012"
|
|
794
798
|
},
|
|
795
799
|
{
|
|
796
800
|
"path": "workflows/resume-writing.md",
|
|
@@ -818,7 +822,7 @@
|
|
|
818
822
|
},
|
|
819
823
|
{
|
|
820
824
|
"path": "workflows/write-section.md",
|
|
821
|
-
"sha256": "
|
|
825
|
+
"sha256": "5a2f0efcd11d7f41d941f54b80798ad481773820907fee68bea47f28b7af7bc3"
|
|
822
826
|
}
|
|
823
827
|
]
|
|
824
828
|
}
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
"id": "user.gate",
|
|
99
|
-
"scope": "
|
|
99
|
+
"scope": "unapproved or paid external providers and bounded query set, plus author-owned research scope and depth decisions"
|
|
100
100
|
}
|
|
101
101
|
]
|
|
102
102
|
}
|
|
@@ -48,7 +48,7 @@ Investigate the literature needed to plan and write a specific section well. The
|
|
|
48
48
|
## Boundaries
|
|
49
49
|
|
|
50
50
|
- This is a `mutation-report` role. It may write only the research and suggestion artifacts authorized by the invoking action.
|
|
51
|
-
-
|
|
51
|
+
- An operator-configured, trusted read-only CiteNexus MCP connection may search bounded public scholarly metadata without a second per-query gate. In an explicitly selected full-auto host session for this research action, `citation-search --backend=cite-nexus` may also search `crossref`, `datacite`, `europe_pmc`, or `arxiv` without another gate. Other providers or modes require explicit network approval naming providers and query bounds. Honor offline flags and host refusals. Returned results stay candidates, and this role never performs a bibliography write.
|
|
52
52
|
- Never fabricate a citation, identifier, quotation, metadata field, source conclusion, or claim of exhaustive coverage.
|
|
53
53
|
- Never overwrite an existing `project://sources/{source}` record. Additions remain provisional until identity and provenance are verified by an authorized action.
|
|
54
54
|
- Do not explore alternatives that author decisions explicitly deferred or rejected.
|
|
@@ -32,8 +32,9 @@ Manuscript prose and supporting context, research, plan, review, summary, handof
|
|
|
32
32
|
1. Resolve one section record, load its linked context, research, evidence, decisions, and outline constraints, and enumerate the bounded `project://validations/*` collection before any specialist dispatch.
|
|
33
33
|
2. Filter those records to candidates whose `subject_uri` is exactly `project://structure/outline` and whose `action_id` is exactly `create-outline`. A candidate is current only when `executed_at >= outline.updated_at`. Because the v1 validation schema carries no outline revision or content hash, disclose that this timestamp test is a conservative freshness proxy.
|
|
34
34
|
3. Require exactly one current candidate and require its `status` to be `passed`. Separately verify that the current outline and target section are consistent with all current locked and deferred author choices: honor locked choices and do not treat deferred choices as resolved. A missing, stale, ambiguous, or non-passing candidate, or a decision contradiction, blocks all specialist dispatch and every plan, section, state, or validation write. Only a recovery checkpoint may be proposed on this blocked path, and it may be written only after a complete record preview and explicit author approval.
|
|
35
|
-
4.
|
|
36
|
-
5.
|
|
35
|
+
4. For a literature-heavy section, first require a section-specific research artifact plus resolvable source/evidence records that cover the planned claims. If they are absent or insufficient, run `research-gap` with the configured CiteNexus backend when available, verify candidate metadata against the returned records, and stop planning with an explicit research checkpoint if evidence remains insufficient. Never invent citations or treat search candidates as verified sources.
|
|
36
|
+
5. Only after those prerequisites pass, delegate a bounded plan to `section-planner`, then require a fresh `plan-checker` pass over claim coverage, dependencies, file scope, citations, and decision fidelity. Dispatch the exact WTF-P specialist roles; generic coder and verifier roles do not satisfy this workflow.
|
|
37
|
+
6. At confirm_plan, preview the plan and validation; on approval link the plan, update section status to planned, and reconcile state. Create a checkpoint for unresolved judgment instead of bypassing the required checker.
|
|
37
38
|
|
|
38
39
|
## Safety and completion
|
|
39
40
|
|
|
@@ -30,7 +30,7 @@ Manuscript prose and supporting context, research, plan, review, summary, handof
|
|
|
30
30
|
## Procedure
|
|
31
31
|
|
|
32
32
|
1. Require one approved plan and resolve all linked context, research, source/evidence records, decisions, prior summary, existing target, and necessary neighboring prose before choosing create or update.
|
|
33
|
-
2. Draft only the declared manuscript artifact; cite only resolvable sources, preserve author constraints, and stop at blocking decisions.
|
|
33
|
+
2. Before drafting a literature-heavy section, verify that its linked research artifact and source/evidence records cover the plan's factual claims. If coverage is missing, use the declared research workflow and pause at a checkpoint until verified records exist. Draft only the declared manuscript artifact; cite only resolvable sources, preserve author constraints, and stop at blocking decisions. A plausible bibliography entry, search candidate, or model memory is not a verified citation.
|
|
34
34
|
3. Read the persisted manuscript text back and calculate its actual body word count with one deterministic method; never copy a worker self-report, plan target, or summary count into project records. Validate the persisted draft against its plan and word budget.
|
|
35
35
|
4. Create or update the required Markdown summary with that measured count, then 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.
|
|
36
36
|
5. Persist the validation, synchronize the manuscript URI in `manifest.artifacts.manuscripts`, and reconcile section/state records only after manuscript, summary, and validation readback succeeds. If blocked, create the declared checkpoint and stop; do not commit or merge automatically.
|