From 8abdee3fd4c970f6441207cb263fc980fa3c58e6 Mon Sep 17 00:00:00 2001 From: "Claude Code (agent)" Date: Mon, 9 Nov 2026 06:31:51 +0100 Subject: [PATCH 1/5] AGENT-1583: document-studio, DOCX versions in Storage (new-version, mark-authoritative) Add the new-version action (fingerprint, office_compare_v1 redline, per-document versions manifest with optimistic control) and mark-authoritative (manual confirmation, previous authoritative becomes superseded). Module 0.2.0. Co-Authored-By: Claude Opus 5.5 --- catalog.json | 16 +- document-studio/README.md | 21 +- .../document-studio-mark-authoritative.json | 124 ++++++++ .../document-studio-new-version.json | 104 +++++++ document-studio/module.yaml | 14 +- inventory/modules.json | 48 +++- modules.json | 4 +- tooling/document-studio/build.py | 257 ++++++++++++++++- tooling/document-studio/tests/test_module.py | 269 +++++++++++++++++- 9 files changed, 841 insertions(+), 16 deletions(-) create mode 100644 document-studio/agents/main/workflows/document-studio-mark-authoritative.json create mode 100644 document-studio/agents/main/workflows/document-studio-new-version.json diff --git a/catalog.json b/catalog.json index 4595178..87e3078 100644 --- a/catalog.json +++ b/catalog.json @@ -643,11 +643,11 @@ { "key": "document-studio", "name": "Document studio", - "version": "0.1.0", + "version": "0.2.0", "subpath": "document-studio", "manifest": "document-studio/module.yaml", - "manifest_sha256": "89c05d34793969a8fccb1b767f9b6aa87bda29d6fb9edaf4f80e1f827e2a0299", - "tree_sha256": "5cc05c17fa5dea65b2b71bd76521530f4aa046fcb50a915c6b3aff3eb4bcb268", + "manifest_sha256": "2e09f02654084161cdea77ebbdeb479e7da92034c5939b63cfb73402747cdecb", + "tree_sha256": "91e63a07777f3dd53228d31acd0cff2dfe7b5bbd15cae127529c185ba4fe68fc", "description": { "en": "Document studio: draft business documents from a brief, render them to PDF from templates and the company profile, review, approve and issue them with a number, and keep every revision in Storage.", "fr": "Studio de documents : rédiger des documents professionnels depuis un brief, les rendre en PDF avec des gabarits et la fiche entreprise, les relire, les approuver et les émettre avec un numéro, en gardant chaque révision dans Storage." @@ -692,6 +692,14 @@ { "key": "document-studio-profile-save", "name": "Save the company profile" + }, + { + "key": "document-studio-new-version", + "name": "Add a DOCX version" + }, + { + "key": "document-studio-mark-authoritative", + "name": "Mark a version authoritative" } ], "queries": [ @@ -712,7 +720,7 @@ "model": "free" }, "maturity": "preview", - "workflows": 11, + "workflows": 13, "miniapps": 1 }, { diff --git a/document-studio/README.md b/document-studio/README.md index 1e24b28..8e14143 100644 --- a/document-studio/README.md +++ b/document-studio/README.md @@ -22,6 +22,8 @@ messages) is French; `fr` is the only locale in V0. | `document-studio-publish` | requires `approved` and `confirmation_manuelle`. Reserves the next number, renders in `final` mode, stores the issued PDF, moves to `issued` | | `document-studio-cancel` | moves to `cancelled` with a reason. An issued number is never reused | | `document-studio-export` | refuses a cancelled document (`document_cancelled`); otherwise copies the issued PDF (or the latest render, flagged as a draft) to a Storage path outside `/document-studio/`, with its SHA-256. Mail and SFTP are out of V0 | +| `document-studio-new-version` | adds a DOCX version of an existing document from a Storage file (`source_path`, `author`): fingerprints it, compares it with the previous version through the MCP tool `office_compare_v1`, stores the redline (tracked changes) and appends the version to the versions manifest. Refuses a stale `base_version` or `base_manifest_sha256` (`base_version_conflict`) and a cancelled document. Same request again: nothing is written (`replayed`) | +| `document-studio-mark-authoritative` | makes one version the authoritative one (`confirmation_manuelle` required, refused before any read otherwise); the previously authoritative version becomes `superseded`. No version file is modified | | `document-studio-profile-save` | validates and stores the company profile and brand (`/document-studio/profile.json`), with manual confirmation | | `document-studio-list` | lists the documents (identifier, title, status, number, revision, latest hash) | | `document-studio-review-read` | full record of a document and previews of its latest render, for the MiniApp | @@ -51,6 +53,8 @@ The Module never approves on a person's behalf. - `/document-studio/docs//r-/`: PDF and previews of one render attempt (12 first characters of the PDF SHA-256, so a losing attempt never overwrites another attempt's file). - `/document-studio/docs//issued/-.pdf`: the issued PDF. - `/document-studio/numbers/