wtf-p 0.8.3 → 0.8.4

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 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.3` is the current stable release and is
22
+ coding-agent hosts. Version `0.8.4` 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.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 |
59
+ | Clio Coder (0.6.3 or newer) | `npx --yes --package=wtf-p@0.8.4 -- 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.4 -- 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.4 -- 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.4 -- 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.4 -- 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.4 -- wtf-p install antigravity` | `agy plugin install <root>/sources/wtfp` | 1.5.3 |
65
+ | Gemini CLI | `npx --yes --package=wtf-p@0.8.4 -- 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.3 -- wtf-p install clio
80
+ npx --yes --package=wtf-p@0.8.4 -- wtf-p install clio
81
81
  cd /path/to/your-paper-or-proposal
82
82
  clio-coder --autonomy yolo
83
83
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtf-p",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
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",
@@ -20,6 +20,7 @@
20
20
  "test:all": "npm test && npm run test:integration",
21
21
  "preflight": "node scripts/preflight.js",
22
22
  "prepack": "npm run check:adapters",
23
+ "prepublishOnly": "node scripts/publish-guard.js",
23
24
  "release": "node scripts/release.js"
24
25
  },
25
26
  "files": [
@@ -2,7 +2,7 @@
2
2
  "schema": "wtfp.generated-adapter/v1",
3
3
  "generatorVersion": 5,
4
4
  "target": "antigravity",
5
- "sourceHash": "1b7709cb517380fd59d5322f0332b6ea395607409f3b03c62f35d39ac2e2c0a1",
5
+ "sourceHash": "c677e578716fd45c077dfd9c3673c77de739b832c7024c4bf816c839f9c838ad",
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": "0f14706706b61b8f70e01f206fdb11a39bd578680e33e68bed4331abfb6f2da6"
225
+ "sha256": "d62abbd8f0e0d28b1c3500f83328e7b3931b1416ef6de640ef03f357037b172f"
226
226
  },
227
227
  {
228
228
  "path": "project/README.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.3",
5
- "description": "Portable academic research and writing workflows (WTF-P 0.8.3)."
4
+ "version": "0.8.4",
5
+ "description": "Portable academic research and writing workflows (WTF-P 0.8.4)."
6
6
  }
@@ -5,14 +5,14 @@
5
5
  },
6
6
  "metadata": {
7
7
  "description": "WTF-P evidence-grounded academic workflow plugin.",
8
- "version": "0.8.3"
8
+ "version": "0.8.4"
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.3",
15
+ "version": "0.8.4",
16
16
  "author": {
17
17
  "name": "akougkas"
18
18
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtfp",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
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": "ef1638cd2bf93d2a023e2b1dd356d44172ca4d07eef1ac2be9d6211882a015d6",
5
+ "sourceHash": "8611a4a3dca0491c2233e09b11900d8fd9b84a71c53c147553a7243af0a86006",
6
6
  "files": [
7
7
  {
8
8
  "path": ".claude-plugin/marketplace.json",
9
- "sha256": "7d30983c2970dfab9e86c90b9710eb8bd63756f8f31aedf21b978d52ba2e0ef6"
9
+ "sha256": "860f76419ed4a8c925559324c514d25212429d2dd5ca1eb6da38407589111c10"
10
10
  },
11
11
  {
12
12
  "path": ".claude-plugin/plugin.json",
13
- "sha256": "9715cd3ad2e0f0c6bd7bb155758096c89268160ac78a7579cb8bdfc843cb6064"
13
+ "sha256": "8f3a5c872e2792796744d1b91523e3d1460b4d9c8abbe956f43324382dff9b4b"
14
14
  },
15
15
  {
16
16
  "path": "actions/add-todo.json",
@@ -314,7 +314,7 @@
314
314
  },
315
315
  {
316
316
  "path": "ai.iowarp.clio/prompts/wtfp/help.md",
317
- "sha256": "9fa7afd9022f965b86627516ad3579c643a7daff31047a4300e1dfa1a997dbdb"
317
+ "sha256": "a28fabb239f3a32d55128ff410dd0dca9e5b15c4957bdf40b340d0f063b8aed4"
318
318
  },
319
319
  {
320
320
  "path": "ai.iowarp.clio/prompts/wtfp/insert-section.md",
@@ -586,7 +586,7 @@
586
586
  },
587
587
  {
588
588
  "path": "plugin.json",
589
- "sha256": "4bacd2dd39dbb98cf59e38e08291839f0fbaa0f17a71a09db4e51064a0f3a57f"
589
+ "sha256": "8323b45f65999e8fe47e1943fb0a7209566151279ee4ee2f59f0f078fd699242"
590
590
  },
591
591
  {
592
592
  "path": "project/README.md",
@@ -4,7 +4,7 @@ display-only: true
4
4
  ---
5
5
 
6
6
  ```text
7
- WTF-P 0.8.3 on Clio Coder: evidence-grounded academic writing
7
+ WTF-P 0.8.4 on Clio Coder: evidence-grounded academic writing
8
8
 
9
9
  Start here
10
10
  /wtfp:new-paper [input]
@@ -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.3",
4
+ "version": "0.8.4",
5
5
  "description": "Portable, evidence-grounded academic research and writing workflows.",
6
6
  "author": {
7
7
  "name": "akougkas"
@@ -2,7 +2,7 @@
2
2
  "schema": "wtfp.generated-adapter/v1",
3
3
  "generatorVersion": 5,
4
4
  "target": "clio-extension",
5
- "sourceHash": "fd9bff2b791c634bbe1fe0f58cb1f087efbf273a38a1ba06687e154be88f1e6b",
5
+ "sourceHash": "08c912a3cd2561d347e0a9fad9ad62d6dba923efa52d81b93cdf50bdc14576c3",
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": "53c7a7e32089bbe8dd9d9f1e0edbf300ad201a6c37b6b537662b4ffdc8d352fd"
157
+ "sha256": "dca1365dd96667848f2b26c81e013862585c940dc1946f9185bd14bf680b514a"
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": "5c246d57034a713f0ab632b7663db5731fb2ffd9d9b7e2a1d2403f4625377984"
265
+ "sha256": "c2f27306f375691ec2999d9984fd8a5bab5eba5f1f0d66f944c1cdfbd5ec47ba"
266
266
  },
267
267
  {
268
268
  "path": "runtime/extension.ts",
269
- "sha256": "c452c7672b539262a240bffb25cb55a53fd07bcc32bd7700cdd50dada6cda78e"
269
+ "sha256": "83a596a3e464be2e039cbe2cb3b2df962992b5c6500e7370c3d51584679f0ca5"
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.3
5
+ version: 0.8.4
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,56 +903,18 @@ 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 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"));
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)));
920
908
  const capped = await host.tool("read_record", { uri: "project://sources" });
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>/);
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"]);
928
913
  // Sections are a family too, read from each section's own directory.
929
914
  const sections = await host.tool("read_record", { uri: "project://sections" });
930
915
  assert.deepEqual(((sections.data as Json).records as Json[]).map((entry) => entry.uri), ["project://sections/introduction"]);
931
916
  }, SERVED));
932
917
 
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
-
956
918
  test("a literature-heavy section that records no claim needing evidence is not covered", () =>
957
919
  withDesk(async (host, workspace) => {
958
920
  const outline = read(workspace, ".planning/structure/outline.json");
@@ -2540,83 +2540,13 @@ function notARecord(uri: string): string {
2540
2540
  const FAMILY_LIMIT = 48 * 1024;
2541
2541
 
2542
2542
  /**
2543
- * How much record JSON a family read returns in full. Live, audit-milestone
2544
- * and submit-milestone read every validation of a delivered paper in full,
2545
- * over 100 KB, which every later call of the turn resent; past this budget a
2546
- * family read lists one digest row per record instead.
2543
+ * Every record of one family, such as `project://sources`, in one call: each
2544
+ * as a single read returns it, until the family outgrows FAMILY_LIMIT; the
2545
+ * rest are named so they can be read one at a time.
2547
2546
  */
2548
- const FAMILY_FULL_LIMIT = 16 * 1024;
2549
-
2550
- const FAMILIES = ["sections", "sources", "evidence", "checkpoints", "validations", "interactions"] as const;
2551
- const FAMILY_URI = new RegExp(`^project://(${FAMILIES.join("|")})/?\\*?(?:\\?(.*))?$`, "u");
2552
-
2553
- /** A family read's query: `section` narrows it to one section's records, `after` pages past a record id. */
2554
- function familyQuery(uri: string, query: string | undefined): { section: string | null; after: string | null } {
2555
- const parsed: { section: string | null; after: string | null } = { section: null, after: null };
2556
- for (const pair of (query ?? "").split("&").filter(Boolean)) {
2557
- const [key, value = ""] = pair.split("=");
2558
- if ((key !== "section" && key !== "after") || !new RegExp(`^${IDENTIFIER}$`, "u").test(value))
2559
- throw new Error(`${uri} has an unknown query; a family read takes section=<section id> and after=<record id>, such as project://validations?section=introduction`);
2560
- parsed[key] = value;
2561
- }
2562
- return parsed;
2563
- }
2564
-
2565
- /** The URIs a section owns, and its claims, so a family read can keep only the records about it. */
2566
- function sectionReach(workspace: string, desk: Desk, section: string): { prefix: string; owned: string[]; claims: Set<string>; evidence: Set<string> } {
2567
- const row = desk.sections.find((entry) => entry.id === section);
2568
- if (!row && readBytes(workspace, `.planning/sections/${section}/section.json`) === null)
2569
- throw new Error(`there is no section ${section}; read project://sections for the section ids`);
2570
- const record = readRecord(workspace, `.planning/sections/${section}/section.json`);
2571
- const claims = Array.isArray(record?.claims) ? (record.claims as Json[]) : [];
2572
- return {
2573
- prefix: `project://sections/${section}`,
2574
- owned: scopes(section, row?.manuscript ?? null),
2575
- claims: new Set(claims.map((claim) => text(claim.id)).filter(Boolean)),
2576
- evidence: new Set(claims.flatMap((claim) => (Array.isArray(claim.evidence_uris) ? claim.evidence_uris.map(String) : []))),
2577
- };
2578
- }
2579
-
2580
- function within(uri: unknown, reach: { prefix: string; owned: string[] }): boolean {
2581
- const value = text(uri);
2582
- return value === reach.prefix || value.startsWith(`${reach.prefix}/`) || reach.owned.includes(value);
2583
- }
2584
-
2585
- /** One line of a family listed by digest: what the record is and its outcome, with the version to write it back. */
2586
- function digestRow(collection: string, read: Json): Json {
2587
- const record = (read.record ?? {}) as Json;
2588
- const row: Json = { uri: read.uri, ...(read.revision === null ? {} : { revision: read.revision }), sha256: read.sha256 };
2589
- const pick = (...keys: string[]) => {
2590
- for (const key of keys) {
2591
- const value = record[key];
2592
- if (value !== undefined && value !== null) row[key] = typeof value === "string" && value.length > 160 ? `${value.slice(0, 159)}…` : value;
2593
- }
2594
- };
2595
- if (collection === "validations") {
2596
- pick("action_id", "validator_role", "subject_uri", "status", "executed_at");
2597
- const checks = Array.isArray(record.checks) ? (record.checks as Json[]) : [];
2598
- row.failed_checks = checks.filter((check) => check.status !== "passed").map((check) => check.id);
2599
- row.issues = Array.isArray(record.issues) ? record.issues.length : 0;
2600
- } else if (collection === "checkpoints") {
2601
- pick("kind", "scope_uri", "status", "blocking", "created_at");
2602
- if (read.trust !== undefined) row.trust = read.trust;
2603
- } else if (collection === "sections") pick("title", "status", "word_count", "word_target", "wave");
2604
- else if (collection === "sources") pick("citation_key", "title", "year", "kind", "status");
2605
- else if (collection === "evidence") pick("claim_id", "source_uri", "relation", "confidence", "verified_at");
2606
- else pick("kind", "subject_uri", "outcome", "selected_option", "answered_at");
2607
- return row;
2608
- }
2609
-
2610
- /**
2611
- * The records of one family, such as `project://sources`, in one call: in
2612
- * full while they fit FAMILY_FULL_LIMIT, otherwise one digest row each, so a
2613
- * grown family never floods the turn. `?section=` keeps only one section's
2614
- * records; `?after=` pages past FAMILY_LIMIT.
2615
- */
2616
- function readFamily(ctx: ExtensionContextV2, desk: Desk, collection: string, query: { section: string | null; after: string | null }): { text: string; data: unknown } {
2547
+ function readFamily(ctx: ExtensionContextV2, desk: Desk, collection: string, after: string | null = null): { text: string; data: unknown } {
2617
2548
  const workspace = ctx.snapshot.workspace;
2618
2549
  const identifier = new RegExp(`^${IDENTIFIER}$`, "u");
2619
- const reach = query.section === null ? null : sectionReach(workspace, desk, query.section);
2620
2550
  let ids: string[];
2621
2551
  if (collection === "sections") {
2622
2552
  const directory = contained(workspace, ".planning/sections");
@@ -2628,83 +2558,49 @@ function readFamily(ctx: ExtensionContextV2, desk: Desk, collection: string, que
2628
2558
  .map((entry) => entry.name)
2629
2559
  .sort();
2630
2560
  } else ids = listJson(workspace, `.planning/${collection}`).map((file) => path.posix.basename(file, ".json")).filter((id) => identifier.test(id));
2631
- const reads: Json[] = [];
2561
+ const records: unknown[] = [];
2562
+ const omitted: string[] = [];
2632
2563
  const failed: string[] = [];
2564
+ let size = 0;
2565
+ const total = ids.length;
2566
+ if (after !== null) ids = ids.filter((id) => id > after);
2633
2567
  for (const id of ids) {
2568
+ if (omitted.length > 0) {
2569
+ omitted.push(id);
2570
+ continue;
2571
+ }
2572
+ let one: { data: unknown };
2634
2573
  try {
2635
- reads.push(readTool(ctx, desk, `project://${collection}/${id}`).data as Json);
2574
+ one = readTool(ctx, desk, `project://${collection}/${id}`);
2636
2575
  } catch (error) {
2637
2576
  failed.push(`${id} (${error instanceof Error ? error.message : String(error)})`);
2577
+ continue;
2638
2578
  }
2639
- }
2640
- // Interactions answer checkpoints, so a section's interactions are those about its checkpoints.
2641
- const sectionCheckpoints =
2642
- reach && collection === "interactions"
2643
- ? new Set(listJson(workspace, ".planning/checkpoints").flatMap((file) => {
2644
- const checkpoint = readRecord(workspace, file);
2645
- return checkpoint && within(checkpoint.scope_uri, reach) ? [`project://checkpoints/${path.posix.basename(file, ".json")}`] : [];
2646
- }))
2647
- : null;
2648
- const sectionSources =
2649
- reach && collection === "sources"
2650
- ? new Set(listJson(workspace, ".planning/evidence").flatMap((file) => {
2651
- const evidence = readRecord(workspace, file);
2652
- const uri = `project://evidence/${path.posix.basename(file, ".json")}`;
2653
- return evidence && (reach.claims.has(text(evidence.claim_id)) || reach.evidence.has(uri)) ? [text(evidence.source_uri)] : [];
2654
- }))
2655
- : null;
2656
- const about = (read: Json): boolean => {
2657
- if (!reach) return true;
2658
- const record = (read.record ?? {}) as Json;
2659
- if (collection === "sections") return read.uri === reach.prefix;
2660
- if (collection === "validations") return within(record.subject_uri, reach);
2661
- if (collection === "checkpoints") return within(record.scope_uri, reach);
2662
- if (collection === "evidence") return reach.claims.has(text(record.claim_id)) || reach.evidence.has(text(read.uri));
2663
- if (collection === "sources") return sectionSources?.has(text(read.uri)) ?? false;
2664
- return within(record.subject_uri, reach) || (sectionCheckpoints?.has(text(record.subject_uri)) ?? false);
2665
- };
2666
- const selected = reads.filter(about);
2667
- const total = selected.length;
2668
- const fullSize = selected.reduce((sum, read) => sum + JSON.stringify(read).length, 0);
2669
- const digest = fullSize > FAMILY_FULL_LIMIT;
2670
- const pending = query.after === null ? selected : selected.filter((read) => String(read.uri).split("/").pop()! > (query.after as string));
2671
- const records: Json[] = [];
2672
- const omitted: string[] = [];
2673
- let size = 0;
2674
- for (const read of pending) {
2675
- const entry = digest ? digestRow(collection, read) : read;
2676
- const length = JSON.stringify(entry).length;
2677
- if (omitted.length > 0 || (records.length > 0 && size + length > FAMILY_LIMIT)) {
2678
- omitted.push(String(read.uri).split("/").pop() ?? "");
2579
+ const length = JSON.stringify(one.data).length;
2580
+ if (records.length > 0 && size + length > FAMILY_LIMIT) {
2581
+ omitted.push(id);
2679
2582
  continue;
2680
2583
  }
2681
- records.push(entry);
2584
+ records.push(one.data);
2682
2585
  size += length;
2683
2586
  }
2684
2587
  const uri = `project://${collection}`;
2685
- const scope = query.section === null ? uri : `${uri}?section=${query.section}`;
2686
- const next = [query.section === null ? "" : `section=${query.section}`, `after=${String(records[records.length - 1]?.uri ?? "").split("/").pop()}`].filter(Boolean).join("&");
2687
- const held = query.section === null ? "" : ` about section ${query.section}`;
2688
2588
  return {
2689
2589
  text: [
2690
- total === 0
2691
- ? `${uri} holds no records${held} yet.`
2692
- : digest
2693
- ? `${uri} holds ${total} ${total === 1 ? "record" : "records"}${held}, ${Math.round(fullSize / 1024)} KB in full, so this read lists ${records.length}${query.after !== null ? ` after ${query.after}` : ""} as one digest row each: what it is, its outcome, and the version to pass back to record. Read a record at its uri for every field${query.section === null ? ", or keep one section's records with ?section=<section id>" : ""}.`
2694
- : `${uri} holds ${total} ${total === 1 ? "record" : "records"}${held}; ${records.length}${query.after !== null ? ` after ${query.after}` : ""} returned in full, each with the revision and sha256 to pass back to record.`,
2695
- omitted.length > 0 ? `${omitted.length} more not returned, to keep this read small; read the next page with ${uri}?${next}.` : "",
2590
+ total === 0 ? `${uri} holds no records yet.` : `${uri} holds ${total} ${total === 1 ? "record" : "records"}; ${records.length}${after !== null ? ` after ${after}` : ""} returned in full, each with the revision and sha256 to pass back to record.`,
2591
+ omitted.length > 0 ? `${omitted.length} more not returned, to keep this read small; read the next page with ${uri}?after=${String((records[records.length - 1] as Json | undefined)?.uri ?? "").split("/").pop()}.` : "",
2696
2592
  failed.length > 0 ? `Not readable: ${failed.join("; ")}.` : "",
2697
2593
  ]
2698
2594
  .filter(Boolean)
2699
2595
  .join(" "),
2700
- data: { uri: scope, form: digest ? "digest" : "full", records, omitted, ...(failed.length > 0 ? { failed } : {}) },
2596
+ data: { uri, records, omitted, ...(failed.length > 0 ? { failed } : {}) },
2701
2597
  };
2702
2598
  }
2703
2599
 
2704
2600
  function readTool(ctx: ExtensionContextV2, desk: Desk, uri: string): { text: string; data: unknown } {
2705
2601
  const workspace = ctx.snapshot.workspace;
2706
- const family = FAMILY_URI.exec(uri);
2707
- if (family) return readFamily(ctx, desk, family[1] as string, familyQuery(uri, family[2]));
2602
+ const family = new RegExp(`^project://(sections|sources|evidence|checkpoints|validations|interactions)/?\\*?(?:\\?after=(${IDENTIFIER}))?$`, "u").exec(uri);
2603
+ if (family) return readFamily(ctx, desk, family[1] as string, family[2] ?? null);
2708
2604
  const route = RECORD_URIS.find((entry) => entry.pattern.test(uri));
2709
2605
  if (!route) throw new Error(notARecord(uri));
2710
2606
  const file = route.file(route.pattern.exec(uri)?.[1] ?? "");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtfp",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "Evidence-grounded academic research, planning, writing, review, and delivery workflows.",
5
5
  "author": {
6
6
  "name": "akougkas",
@@ -2,11 +2,11 @@
2
2
  "schema": "wtfp.generated-adapter/v1",
3
3
  "generatorVersion": 5,
4
4
  "target": "codex",
5
- "sourceHash": "0fb9aea2244de5e00fe420c3f841308c20226cacdbd1e9fb7d0039f4d1dd5151",
5
+ "sourceHash": "44668138082405e0d15bea07cbddbc5660ba0213b39a1a90c575559bd93f48d4",
6
6
  "files": [
7
7
  {
8
8
  "path": ".codex-plugin/plugin.json",
9
- "sha256": "812e3c6f4ab20c15e659b123bc904bc7d595b2c7c1188f41311de63b944a66f7"
9
+ "sha256": "a119daff97ad53f30fe0e4a3a7a9538860fa344943bc1ff3a91138233daac071"
10
10
  },
11
11
  {
12
12
  "path": "actions/add-todo.json",
@@ -226,7 +226,7 @@
226
226
  },
227
227
  {
228
228
  "path": "plugin.json",
229
- "sha256": "9e9946ab2875a35a9e65703030e4416caa3736bdc4c536db432451d389014ee5"
229
+ "sha256": "eb20bc2e6f9173b4c79b835c35b4ccb2e1750940c76e5dbd1d2bfd8dd3356004"
230
230
  },
231
231
  {
232
232
  "path": "project/README.md",
@@ -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.3",
4
+ "version": "0.8.4",
5
5
  "description": "Portable, evidence-grounded academic research and writing workflows.",
6
6
  "author": {
7
7
  "name": "akougkas"
@@ -2,11 +2,11 @@
2
2
  "schema": "wtfp.generated-adapter/v1",
3
3
  "generatorVersion": 5,
4
4
  "target": "copilot-marketplace",
5
- "sourceHash": "43886bbfd1eb3f3d65c20dcedf1f4c60c12cc2e0f0ec2ed90b58d8d46f968c46",
5
+ "sourceHash": "693b9d8fa932727479be53609f40d88a434e9325be092f719ce0f721c6535624",
6
6
  "files": [
7
7
  {
8
8
  "path": "marketplace.json",
9
- "sha256": "8c559d73c1526d5539a5904d08a31bde337853cd14463d64370b1b6fb288ac69"
9
+ "sha256": "fc8fd935dff1fec37b50187c75ebc2e51b31bad773651a50c80953073aa55bc5"
10
10
  },
11
11
  {
12
12
  "path": "project/.github/agents/wtfp-argument-verifier.agent.md",
@@ -5,14 +5,14 @@
5
5
  },
6
6
  "metadata": {
7
7
  "description": "WTF-P research workflow plugins",
8
- "version": "0.8.3"
8
+ "version": "0.8.4"
9
9
  },
10
10
  "plugins": [
11
11
  {
12
12
  "name": "wtfp",
13
13
  "source": "./plugins/wtfp",
14
14
  "description": "Portable academic research and writing workflows.",
15
- "version": "0.8.3",
15
+ "version": "0.8.4",
16
16
  "author": {
17
17
  "name": "akougkas"
18
18
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtfp",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "Portable academic research and writing workflows with stable wtfp actions.",
5
5
  "author": {
6
6
  "name": "akougkas",
@@ -2,11 +2,11 @@
2
2
  "schema": "wtfp.generated-adapter/v1",
3
3
  "generatorVersion": 5,
4
4
  "target": "copilot",
5
- "sourceHash": "71c3ba2e43dbe3aded23b72142e10182b9e173674633b1df71ae4c6bfce6a8c8",
5
+ "sourceHash": "d89330408064281e02568b950d978a95394ceb6927512d31e96cd5a19920cfb7",
6
6
  "files": [
7
7
  {
8
8
  "path": ".claude-plugin/plugin.json",
9
- "sha256": "9715cd3ad2e0f0c6bd7bb155758096c89268160ac78a7579cb8bdfc843cb6064"
9
+ "sha256": "8f3a5c872e2792796744d1b91523e3d1460b4d9c8abbe956f43324382dff9b4b"
10
10
  },
11
11
  {
12
12
  "path": "actions/add-todo.json",
@@ -2,7 +2,7 @@
2
2
  "schema": "wtfp.generated-adapter/v1",
3
3
  "generatorVersion": 5,
4
4
  "target": "gemini",
5
- "sourceHash": "3c0dda179ad2464b5b29eae3e3f71741782b7a369a7c2a73a1a3583ca2b41312",
5
+ "sourceHash": "67d4ec7ad09a7e0457ea5e9d52756034cd0a5d93db5b693a8942fe6e343ad4eb",
6
6
  "files": [
7
7
  {
8
8
  "path": "actions/add-todo.json",
@@ -370,7 +370,7 @@
370
370
  },
371
371
  {
372
372
  "path": "gemini-extension.json",
373
- "sha256": "d6a09bb4ca5c600519747a0c83b880949514e73958fe758b21b5a12c947e7f1d"
373
+ "sha256": "3cf3233ae42cdea3401da1e6690d600f71fc2852696f7422a756f33e4bca115e"
374
374
  },
375
375
  {
376
376
  "path": "GEMINI.md",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtfp",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "Portable academic research and writing workflows for Gemini CLI.",
5
5
  "contextFileName": "GEMINI.md"
6
6
  }
@@ -2,7 +2,7 @@
2
2
  "schema": "wtfp.generated-adapter/v1",
3
3
  "generatorVersion": 5,
4
4
  "target": "portable-plugin",
5
- "sourceHash": "adf102abbc89e260a81119fec1d06508722f7d5090e7907f77fd36f1f89a2f15",
5
+ "sourceHash": "cdb620c7a98af75a0874bcb1cb2db8c25c989d64a76a8fcc7de3a821737ce66c",
6
6
  "files": [
7
7
  {
8
8
  "path": "actions/add-todo.json",
@@ -262,7 +262,7 @@
262
262
  },
263
263
  {
264
264
  "path": "ai.iowarp.clio/prompts/wtfp/help.md",
265
- "sha256": "e906dd97bd886fa7add9a74fb248a8388d822de953dc4b625258fdbe79718378"
265
+ "sha256": "97e9758c414f60b044d67c31b41800f2c8a5a67a4c0b19f98d31ee80fd097565"
266
266
  },
267
267
  {
268
268
  "path": "ai.iowarp.clio/prompts/wtfp/insert-section.md",
@@ -370,7 +370,7 @@
370
370
  },
371
371
  {
372
372
  "path": "plugin.json",
373
- "sha256": "65573657fba746182939d28fdb5428a286755d936f704074dfca4de8a135418b"
373
+ "sha256": "cc23ad6c6a93f9123224e3c8a431e8091987a9838f2ebeabba7426d2cfed68d5"
374
374
  },
375
375
  {
376
376
  "path": "project/README.md",
@@ -4,7 +4,7 @@ display-only: true
4
4
  ---
5
5
 
6
6
  ```text
7
- WTF-P 0.8.3 on Clio Coder: evidence-grounded academic writing
7
+ WTF-P 0.8.4 on Clio Coder: evidence-grounded academic writing
8
8
 
9
9
  Start here
10
10
  /wtfp:new-paper [input]
@@ -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.3",
4
+ "version": "0.8.4",
5
5
  "description": "Portable, evidence-grounded academic research and writing workflows.",
6
6
  "author": {
7
7
  "name": "akougkas"