From eda241973659e611d2eb7dabddaba8ee9cebc7f3 Mon Sep 17 00:00:00 2001 From: vraspar Date: Mon, 17 Aug 2026 03:07:58 -0400 Subject: [PATCH] feat(publish): let one piece claim every search it answered MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `tenjin publish --search-id` repeats, up to ten per piece. A research thread fans out into many searchIds, and until now the piece published back against one while the siblings were closed as `regenerated` — false twice over, and it counted every sibling of a converting loop as a MISS. Each id closes its own local loop with publish attribution (relinking one an `outcome` already closed, exactly as a single id does today), and the JSON envelope reports per id under `searches`, so an id this machine never recorded warns for itself instead of costing the others their close. A lone id keeps the flat `search` field. On the wire, one id stays the bare string it has always been and several become an array, so a single-search publish is byte-identical against a server that predates the array. Closes #167. Co-Authored-By: Claude Fable 5 --- .changeset/publish-multi-search-id.md | 25 ++++ docs/command-reference.md | 38 +++--- skills/tenjin-publish/SKILL.md | 6 +- src/cli.test.ts | 22 ++++ src/cli.ts | 8 +- src/commands/publish.test.ts | 174 +++++++++++++++++++++++--- src/commands/publish.ts | 98 ++++++++------- src/lib/posts-api.test.ts | 30 +++++ src/lib/posts-api.ts | 62 +++++++-- src/mcp/server.ts | 5 +- 10 files changed, 369 insertions(+), 99 deletions(-) create mode 100644 .changeset/publish-multi-search-id.md diff --git a/.changeset/publish-multi-search-id.md b/.changeset/publish-multi-search-id.md new file mode 100644 index 0000000..a8577d5 --- /dev/null +++ b/.changeset/publish-multi-search-id.md @@ -0,0 +1,25 @@ +--- +'tenjin-cli': patch +--- + +One piece can now claim every search it answered. + +`tenjin publish --search-id` repeats, up to ten searches per piece. A research +thread fans out into many searchIds — one investigation last month logged ten +MISSes for what was a single question — and until now the piece published back +against one of them while the other nine were closed one at a time as +`regenerated`. That was false twice over: they were not re-derived, they were +answered by the same piece, and MISS-to-publish conversion counted every sibling +of the thread as a failure. + +Every named id closes its own local loop with publish attribution, re-linking one +an `outcome` already closed exactly as a single id does today, and the JSON +envelope reports each id separately (`searches`), so an id this machine has never +recorded warns for itself instead of taking the rest down with it. A lone id +keeps the flat `search` field callers already read. Repeats collapse. A `--draft` +still answers nobody and sends no attribution at all. + +On the wire, one id ships as the bare string it has always been, so a +single-search publish is byte-identical against a server that predates this; +several ship as an array, which needs the array-accepting post-create deployed +first. diff --git a/docs/command-reference.md b/docs/command-reference.md index 70c32fd..e909748 100644 --- a/docs/command-reference.md +++ b/docs/command-reference.md @@ -164,25 +164,25 @@ Reports how a search ended. Publishes Markdown with optional metadata and a local safety scan. Hard blocks cannot be bypassed. -| Flag | Effect | -| -------------------------- | --------------------------------------------------- | -| `--search-id ` | Link the piece to the search it answers. | -| `--draft` | Save privately instead of publishing. | -| `--price ` | Set the post price. | -| `--excerpt ` | Public preview. | -| `--mode ` | `review`, `auto`, or `full-auto` for this run. | -| `--yes` | Clear warning findings and the review confirmation. | -| `--question ` | Question this piece answers. Repeatable. | -| `--task ` | Task this piece supports. Repeatable. | -| `--scope ` | What the piece covers. | -| `--exclusions ` | What it does not cover. | -| `--applies-to ` | Applicability metadata. Repeatable. | -| `--as-of