From 00cf52962fdd7fe9cff8d29ee75abd284df2e479 Mon Sep 17 00:00:00 2001 From: "Claude Code (agent)" Date: Mon, 2 Nov 2026 10:42:46 +0100 Subject: [PATCH 1/5] Add the enriched public catalog of the Modules (AGENT-1642) catalog.json is the public index a One, an agent or an assistant uses to find a Module before writing one: for each Module of modules.json a description in French and English, capabilities, requirements (runtimes, language model use, MCP connectors, other Modules, extra credentials), price (free for all today), maturity (preview below 1.0) and the two fingerprints a One checks at import, manifest_sha256 and tree_sha256. The tree fingerprint is computed exactly as chatserver's ComputeModuleDirectoryHash does and is tested against a digest that function produced on a fixture; the digests of four real Modules were compared with it as well. It is generated by scripts/catalog.py from the manifests and from hand-written catalog/.yaml files (JSON content, like module.yaml; kept outside the Module directories so that the fingerprint the One computes is unchanged). scripts/catalog.py --check runs in CI next to the inventory check and refuses a stale file, an unknown or missing entry, and any URL, e-mail, IP address, secret shape or internal identifier in the texts, since the repository is public. modules.json v1 is unchanged. README, AGENTS.md and two guides no longer say the repository is private. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/ci.yml | 1 + AGENTS.md | 6 +- README.md | 15 +- catalog.json | 685 ++++++++++++++++++++++++++ catalog/company-memory.yaml | 18 + catalog/content-memory.yaml | 17 + catalog/content.yaml | 17 + catalog/daily-routine.yaml | 16 + catalog/enterprise-admin.yaml | 17 + catalog/image-studio.yaml | 18 + catalog/marketing-launch.yaml | 17 + catalog/support-memory.yaml | 17 + catalog/support.yaml | 16 + catalog/watch-memory.yaml | 17 + catalog/watch.yaml | 17 + catalog/work-cases.yaml | 16 + docs/INSTALLATION.md | 2 +- docs/REPOSITORY_MIGRATION.md | 2 +- scripts/catalog.py | 212 ++++++++ scripts/test.py | 6 +- tooling/catalog/tests/test_catalog.py | 159 ++++++ 21 files changed, 1283 insertions(+), 8 deletions(-) create mode 100644 catalog.json create mode 100644 catalog/company-memory.yaml create mode 100644 catalog/content-memory.yaml create mode 100644 catalog/content.yaml create mode 100644 catalog/daily-routine.yaml create mode 100644 catalog/enterprise-admin.yaml create mode 100644 catalog/image-studio.yaml create mode 100644 catalog/marketing-launch.yaml create mode 100644 catalog/support-memory.yaml create mode 100644 catalog/support.yaml create mode 100644 catalog/watch-memory.yaml create mode 100644 catalog/watch.yaml create mode 100644 catalog/work-cases.yaml create mode 100644 scripts/catalog.py create mode 100644 tooling/catalog/tests/test_catalog.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c773a9e..910a9b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: with: node-version: '22' - run: python3 scripts/inventory.py --check + - run: python3 scripts/catalog.py --check - run: python3 scripts/check.py - run: python3 scripts/test.py - run: git diff --exit-code diff --git a/AGENTS.md b/AGENTS.md index 81f0750..88f7894 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -53,8 +53,12 @@ generators, composers and development tests; `templates/company-in-a-box/` contains consumer assembly and test plans. `modules.json`, `inventory/modules.json` and the template pins are generated by `scripts/inventory.py`. Edit their generator, then regenerate and check. +`catalog.json`, the public enriched index, is generated by `scripts/catalog.py` +from the manifests and the hand-written `catalog/.yaml` files; +edit those, then regenerate. The repository is public: nothing committed here +may hold a secret, customer data, an internal identifier or an internal URL. Before submission run `python3 scripts/inventory.py --check`, -`python3 scripts/check.py`, `PYTHONDONTWRITEBYTECODE=1 python3 scripts/test.py` +`python3 scripts/catalog.py --check`, `python3 scripts/check.py`, `PYTHONDONTWRITEBYTECODE=1 python3 scripts/test.py` and `git diff --check`. Keep the existing secret/distribution checks enabled. Source changes alone do not qualify runtime installation or business use. diff --git a/README.md b/README.md index 8c8b7ad..9619f68 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,9 @@ Reusable application Modules for AgentMaurice, maintained in one repository. Each Module has its own version and a root `module.yaml`; published Module keys, Workflow IDs and MiniApp IDs keep their existing contracts. The repository -remains private and retains the history of `agentmaurice/company-in-a-box`. +is public (since 2026-11-02) and retains the history of `agentmaurice/company-in-a-box`. +Everything committed here is published: no secret, customer data or internal +identifier belongs in it. ## Modules @@ -22,7 +24,15 @@ remains private and retains the history of `agentmaurice/company-in-a-box`. | Support memory adapter | `cib-accompagnement-memory` | [support-memory](support-memory/module.yaml) | | Image studio | `image-studio` | [image-studio](image-studio/module.yaml) | -[modules.json](modules.json) is generated from the manifests. The detailed +[modules.json](modules.json) is generated from the manifests. The enriched +[catalog.json](catalog.json) is the public index of the Modules: for each one a +short description in French and English, its capabilities, what it requires +(runtimes, language model, MCP connectors, other Modules), its price (all free +today) and the fingerprints a One checks at import (`manifest_sha256` and +`tree_sha256`, the latter computed exactly as the One computes it). It is +generated by `scripts/catalog.py` from the manifests and the hand-written +[`catalog/.yaml`](catalog) files (JSON content, like +`module.yaml`); edit those, never `catalog.json`. The detailed [source and migration inventory](inventory/modules.json) records resources, runtimes, dependencies, consumers and source reconciliation. The [repository migration guide](docs/REPOSITORY_MIGRATION.md) maps historical @@ -55,6 +65,7 @@ is needed for these checks: ```sh python3 scripts/inventory.py --check +python3 scripts/catalog.py --check python3 scripts/check.py PYTHONDONTWRITEBYTECODE=1 python3 scripts/test.py git diff --check diff --git a/catalog.json b/catalog.json new file mode 100644 index 0000000..5d4406d --- /dev/null +++ b/catalog.json @@ -0,0 +1,685 @@ +{ + "schema": "agentmaurice.module_catalog/v1", + "schema_version": 1, + "modules": [ + { + "key": "cib-accompagnement", + "name": "Company-in-a-Box — Accompagnement", + "version": "0.2.4", + "subpath": "support", + "manifest": "support/module.yaml", + "manifest_sha256": "26527b3975fa92c8fbf9ea85f9b0531f431037946c101f5413cc01a4db71265c", + "tree_sha256": "461afc86087a8436ee3c1c38773f28d4304c7bbb08ae50ef7081397c847317af", + "description": { + "fr": "Accompagnement : dossiers d'accompagnement manuels (enregistrer, lister, lire, partager), avec garde sur les actions.", + "en": "Support: manual support files (save, list, read, share), with a guard on actions." + }, + "capabilities": [ + "support", + "case-files", + "sharing" + ], + "actions": [ + { + "key": "save", + "name": "save" + }, + { + "key": "share", + "name": "share" + }, + { + "key": "guard_action", + "name": "guard_action" + } + ], + "queries": [ + "list", + "read", + "people" + ], + "requires": { + "runtimes": [ + "deno" + ], + "language_model": false, + "connectors": [], + "credentials": [], + "modules": [] + }, + "price": { + "model": "free" + }, + "maturity": "preview", + "workflows": 6, + "miniapps": 2 + }, + { + "key": "cib-accompagnement-memory", + "name": "Company-in-a-Box — Accompagnement — raccordement mémoire", + "version": "0.2.0", + "subpath": "support-memory", + "manifest": "support-memory/module.yaml", + "manifest_sha256": "9ed65127ed0709ba3a58060c90a3dcd3a9ddbd0c9b34abb12d3c4576394079d3", + "tree_sha256": "7479fa6e70af460c22e1443a83d1aba2654f8680bfc3663ab1cd9b4f0aa5d045", + "description": { + "fr": "Accompagnement et mémoire : proposer un extrait à la mémoire d'entreprise, consulter une révision et chercher dans la mémoire.", + "en": "Support and memory: contribute an excerpt to company memory, read a revision and search the memory." + }, + "capabilities": [ + "support", + "memory", + "search", + "contribution" + ], + "actions": [ + { + "key": "accompagnement-memory-contribute", + "name": "accompagnement-memory-contribute" + } + ], + "queries": [ + "accompagnement-memory-query", + "accompagnement-memory-search" + ], + "requires": { + "runtimes": [ + "deno" + ], + "language_model": false, + "connectors": [], + "credentials": [], + "modules": [ + "cib-accompagnement", + "company-memory" + ] + }, + "price": { + "model": "free" + }, + "maturity": "preview", + "workflows": 3, + "miniapps": 3 + }, + { + "key": "cib-contenu", + "name": "Company-in-a-Box — Contenu", + "version": "0.2.4", + "subpath": "content", + "manifest": "content/module.yaml", + "manifest_sha256": "0089a7cb29ce5c2e332a1f7436d4c60febbb9fda11b0515b8128fd8e6c0d4181", + "tree_sha256": "1af55c7df9103155604b40f03313307e5e8c2128cb99f394267343263086d593", + "description": { + "fr": "Contenu : dossiers de contenu manuels (enregistrer, lister, lire, partager), avec contrôle de fin de relecture.", + "en": "Content: manual content files (save, list, read, share), with a review-completion check." + }, + "capabilities": [ + "content", + "drafts", + "review", + "sharing" + ], + "actions": [ + { + "key": "save", + "name": "save" + }, + { + "key": "share", + "name": "share" + }, + { + "key": "review_completion", + "name": "review_completion" + } + ], + "queries": [ + "list", + "read", + "people" + ], + "requires": { + "runtimes": [ + "deno" + ], + "language_model": false, + "connectors": [], + "credentials": [], + "modules": [] + }, + "price": { + "model": "free" + }, + "maturity": "preview", + "workflows": 6, + "miniapps": 2 + }, + { + "key": "cib-contenu-memory", + "name": "Company-in-a-Box — Contenu — raccordement mémoire", + "version": "0.2.0", + "subpath": "content-memory", + "manifest": "content-memory/module.yaml", + "manifest_sha256": "249e56e9533bece539d2ac0c1d2bfefb0dc65b6d42a7e93cc40022bdc240e2fb", + "tree_sha256": "dede4e31151069c2863666a3497d2ff6889f02efed432289e8a3a5abbcb844cc", + "description": { + "fr": "Contenu et mémoire : proposer un extrait à la mémoire d'entreprise, consulter ou chercher une révision, et rédiger un brouillon depuis une révision validée.", + "en": "Content and memory: contribute an excerpt to company memory, read or search a revision, and draft from a validated revision." + }, + "capabilities": [ + "content", + "memory", + "search", + "drafts" + ], + "actions": [ + { + "key": "contenu-memory-contribute", + "name": "contenu-memory-contribute" + }, + { + "key": "contenu-memory-draft", + "name": "contenu-memory-draft" + } + ], + "queries": [ + "contenu-memory-query", + "contenu-memory-search" + ], + "requires": { + "runtimes": [ + "deno" + ], + "language_model": false, + "connectors": [], + "credentials": [], + "modules": [ + "cib-contenu", + "company-memory" + ] + }, + "price": { + "model": "free" + }, + "maturity": "preview", + "workflows": 4, + "miniapps": 4 + }, + { + "key": "cib-daily-routine", + "name": "Routine quotidienne — dossiers, mémoire et temps", + "version": "0.1.0", + "subpath": "daily-routine", + "manifest": "daily-routine/module.yaml", + "manifest_sha256": "8cd81a40c20c0f44a037055785a1e276f64c90082b670df546e0291b1ae4c6bb", + "tree_sha256": "e34b14d8344e039a282202838d05e0881930df749305b2b5dc0ab45b4423f5b5", + "description": { + "fr": "Routine quotidienne : journal du temps, briefing et bilan, et contexte du jour tiré des dossiers et de la mémoire.", + "en": "Daily routine: time journal, briefing and report, and the day's context drawn from case files and memory." + }, + "capabilities": [ + "time-tracking", + "daily-report", + "context" + ], + "actions": [ + { + "key": "daily-time-save", + "name": "daily-time-save" + } + ], + "queries": [ + "daily-time-read", + "daily-report", + "daily-context" + ], + "requires": { + "runtimes": [ + "deno" + ], + "language_model": false, + "connectors": [], + "credentials": [], + "modules": [ + "cib-accompagnement", + "cib-contenu", + "cib-veille", + "company-memory" + ] + }, + "price": { + "model": "free" + }, + "maturity": "preview", + "workflows": 4, + "miniapps": 3 + }, + { + "key": "cib-enterprise-admin", + "name": "Company-in-a-Box — administration entreprise", + "version": "0.2.2", + "subpath": "enterprise-admin", + "manifest": "enterprise-admin/module.yaml", + "manifest_sha256": "b70c51ca0d95f494a49b349a9997ce328f8cd0f73ae9b2db92af57839e49f543", + "tree_sha256": "56e6d0b9675ecf4e515e3de3ab2703c36a2cbf0bf6113d357be89926b23f6f8e", + "description": { + "fr": "Administration de l'entreprise : vue d'ensemble, gestion, reprise et partage de fiches historiques, contrôle d'approbation.", + "en": "Enterprise administration: overview, management, import and sharing of historical records, approval check." + }, + "capabilities": [ + "administration", + "records", + "sharing", + "approval" + ], + "actions": [ + { + "key": "manage", + "name": "manage" + }, + { + "key": "import-record", + "name": "import-record" + }, + { + "key": "record-share", + "name": "record-share" + } + ], + "queries": [ + "overview", + "approval-check", + "record-read", + "record-people" + ], + "requires": { + "runtimes": [ + "deno" + ], + "language_model": false, + "connectors": [], + "credentials": [], + "modules": [] + }, + "price": { + "model": "free" + }, + "maturity": "preview", + "workflows": 7, + "miniapps": 3 + }, + { + "key": "cib-marketing-launch", + "name": "Company in a Box — Marketing de lancement", + "version": "0.1.0", + "subpath": "marketing-launch", + "manifest": "marketing-launch/module.yaml", + "manifest_sha256": "d6e2d73144a40d2d4695ec77593949434aa841f9fe9343dc9bdff28a3d22f16f", + "tree_sha256": "7d46b90ad8bcb4ebaa49d6c09f51390c17c952e2c9c424ffdca827000110afce", + "description": { + "fr": "Marketing de lancement : campagne, preuves et contenu liés, demandes d'essai, progression, partage et vue Direction.", + "en": "Launch marketing: campaign, linked proofs and content, trial requests, progress, sharing and a management view." + }, + "capabilities": [ + "marketing", + "campaigns", + "trials", + "direction" + ], + "actions": [ + { + "key": "campaign-save", + "name": "campaign-save" + }, + { + "key": "content-link", + "name": "content-link" + }, + { + "key": "request", + "name": "request" + }, + { + "key": "progress", + "name": "progress" + }, + { + "key": "share", + "name": "share" + } + ], + "queries": [ + "read", + "list", + "people", + "summary" + ], + "requires": { + "runtimes": [ + "deno" + ], + "language_model": false, + "connectors": [], + "credentials": [], + "modules": [] + }, + "price": { + "model": "free" + }, + "maturity": "preview", + "workflows": 9, + "miniapps": 6 + }, + { + "key": "cib-veille", + "name": "Company-in-a-Box — Veille", + "version": "0.2.4", + "subpath": "watch", + "manifest": "watch/module.yaml", + "manifest_sha256": "f32db870687d26e4763a3d8eb615ad307bd98b8815963b70eb1cbc191f66fc4c", + "tree_sha256": "09609ae3d3fe36f66815c60f1d456fb3c527c63341654ecfe459f67c3ae6705e", + "description": { + "fr": "Veille : dossiers de veille manuels (enregistrer, lister, lire, partager), avec routage d'un travail de recherche et contrôle de ses résultats.", + "en": "Watch: manual monitoring files (save, list, read, share), with research work routing and result checks." + }, + "capabilities": [ + "watch", + "research", + "case-files", + "sharing" + ], + "actions": [ + { + "key": "save", + "name": "save" + }, + { + "key": "share", + "name": "share" + }, + { + "key": "route_worker", + "name": "route_worker" + }, + { + "key": "check_research", + "name": "check_research" + } + ], + "queries": [ + "list", + "read", + "people" + ], + "requires": { + "runtimes": [ + "deno" + ], + "language_model": false, + "connectors": [], + "credentials": [], + "modules": [] + }, + "price": { + "model": "free" + }, + "maturity": "preview", + "workflows": 7, + "miniapps": 2 + }, + { + "key": "cib-veille-memory", + "name": "Company-in-a-Box — Veille — raccordement mémoire", + "version": "0.2.0", + "subpath": "watch-memory", + "manifest": "watch-memory/module.yaml", + "manifest_sha256": "bf295664b5b9410516edf1c91280d2d4a3199d0b13ecac20c63705a020d9ba59", + "tree_sha256": "853222eabafa65e06f9a29f9da7585466292d81413e4fd97de24d284fc82455b", + "description": { + "fr": "Veille et mémoire : proposer un extrait de veille à la mémoire d'entreprise, consulter une révision et chercher dans la mémoire.", + "en": "Watch and memory: contribute a monitoring excerpt to company memory, read a revision and search the memory." + }, + "capabilities": [ + "watch", + "memory", + "search", + "contribution" + ], + "actions": [ + { + "key": "veille-memory-contribute", + "name": "veille-memory-contribute" + } + ], + "queries": [ + "veille-memory-query", + "veille-memory-search" + ], + "requires": { + "runtimes": [ + "deno" + ], + "language_model": false, + "connectors": [], + "credentials": [], + "modules": [ + "cib-veille", + "company-memory" + ] + }, + "price": { + "model": "free" + }, + "maturity": "preview", + "workflows": 3, + "miniapps": 3 + }, + { + "key": "cib-work-dossiers", + "name": "Company-in-a-Box — dossiers communs", + "version": "0.2.2", + "subpath": "work-cases", + "manifest": "work-cases/module.yaml", + "manifest_sha256": "65ef645f3e093cfa5bc68df154e8b762da1e48df14ae5ab94131bf23af4566cf", + "tree_sha256": "996bb140c42b1847feec99baab2177006d91d2069bb18c49ae8bc72e0e668395", + "description": { + "fr": "Dossiers communs : enregistrer, lister, lire et partager des dossiers, avec un briefing pour la Direction.", + "en": "Shared case files: save, list, read and share files, with a briefing for management." + }, + "capabilities": [ + "case-files", + "sharing", + "direction-briefing" + ], + "actions": [ + { + "key": "save", + "name": "save" + }, + { + "key": "share", + "name": "share" + } + ], + "queries": [ + "read", + "list", + "direction-brief", + "people" + ], + "requires": { + "runtimes": [ + "deno" + ], + "language_model": false, + "connectors": [], + "credentials": [], + "modules": [] + }, + "price": { + "model": "free" + }, + "maturity": "preview", + "workflows": 6, + "miniapps": 2 + }, + { + "key": "company-memory", + "name": "Company Memory", + "version": "0.3.0", + "subpath": "company-memory", + "manifest": "company-memory/module.yaml", + "manifest_sha256": "a26d8495505180a3d75be3ef6b6ea017aaf2467e87e0da0f2e653a4da719314e", + "tree_sha256": "647a0524f2d1e6745ff58dbead425fbff935b86876862d909e337b535774725e", + "description": { + "fr": "Mémoire d'entreprise : capturer des sources, proposer et relire des mises à jour, indexer des révisions et les interroger ou les chercher par mots-clés.", + "en": "Company memory: capture sources, propose and review updates, index revisions, then query or keyword-search them." + }, + "capabilities": [ + "memory", + "knowledge-base", + "search", + "review", + "indexing" + ], + "actions": [ + { + "key": "capture_source", + "name": "capture_source" + }, + { + "key": "propose_update", + "name": "propose_update" + }, + { + "key": "review_update", + "name": "review_update" + }, + { + "key": "index_revision", + "name": "index_revision" + } + ], + "queries": [ + "inspect", + "query", + "health", + "search" + ], + "requires": { + "runtimes": [ + "deno" + ], + "language_model": false, + "connectors": [ + { + "name": "company_memory", + "tools": [ + "memory.entities.upsert", + "memory.query" + ] + }, + { + "name": "brain", + "tools": [ + "brain.document.upsert", + "brain.keyword" + ] + } + ], + "credentials": [], + "modules": [] + }, + "price": { + "model": "free" + }, + "maturity": "preview", + "workflows": 10, + "miniapps": 6 + }, + { + "key": "image-studio", + "name": "Image studio", + "version": "0.1.0", + "subpath": "image-studio", + "manifest": "image-studio/module.yaml", + "manifest_sha256": "b29f62142e391df84b705394d87392d7f790a575c294ecce3e6451c2a4714122", + "tree_sha256": "ff67c21cdf4c87dcc4e192e315f280af1ea763441cdc16ad26af550c396fee82", + "description": { + "fr": "Studio d'images : planifier, produire, relire, publier et exporter des lots d'images, avec feuille de style et profils de sortie.", + "en": "Image studio: plan, produce, review, publish and export image packs, with a style sheet and output profiles." + }, + "capabilities": [ + "images", + "generation", + "review", + "export", + "storage" + ], + "actions": [ + { + "key": "image-studio-pack", + "name": "Produce an image pack" + }, + { + "key": "image-studio-render", + "name": "Render one image" + }, + { + "key": "image-studio-plan", + "name": "Plan an image pack" + }, + { + "key": "image-studio-style-sheet", + "name": "Build a style sheet" + }, + { + "key": "image-studio-produce-asset", + "name": "Produce one asset" + }, + { + "key": "image-studio-asset-finalize", + "name": "Keep an attempt" + }, + { + "key": "image-studio-asset-retry", + "name": "Second attempt" + }, + { + "key": "image-studio-asset-hold", + "name": "Hold an asset" + }, + { + "key": "image-studio-publish", + "name": "Publish a pack to Storage" + }, + { + "key": "image-studio-export", + "name": "Export a stored image" + }, + { + "key": "image-studio-profile-save", + "name": "Save an output profile" + } + ], + "queries": [ + "image-studio-review-read" + ], + "requires": { + "runtimes": [ + "wasm" + ], + "language_model": true, + "connectors": [], + "credentials": [], + "modules": [] + }, + "price": { + "model": "free" + }, + "maturity": "preview", + "workflows": 12, + "miniapps": 1 + } + ] +} diff --git a/catalog/company-memory.yaml b/catalog/company-memory.yaml new file mode 100644 index 0000000..f310df7 --- /dev/null +++ b/catalog/company-memory.yaml @@ -0,0 +1,18 @@ +{ + "schema": "agentmaurice.module_catalog_entry/v1", + "description": { + "fr": "Mémoire d'entreprise : capturer des sources, proposer et relire des mises à jour, indexer des révisions et les interroger ou les chercher par mots-clés.", + "en": "Company memory: capture sources, propose and review updates, index revisions, then query or keyword-search them." + }, + "capabilities": [ + "memory", + "knowledge-base", + "search", + "review", + "indexing" + ], + "credentials": [], + "price": { + "model": "free" + } +} diff --git a/catalog/content-memory.yaml b/catalog/content-memory.yaml new file mode 100644 index 0000000..0a5601a --- /dev/null +++ b/catalog/content-memory.yaml @@ -0,0 +1,17 @@ +{ + "schema": "agentmaurice.module_catalog_entry/v1", + "description": { + "fr": "Contenu et mémoire : proposer un extrait à la mémoire d'entreprise, consulter ou chercher une révision, et rédiger un brouillon depuis une révision validée.", + "en": "Content and memory: contribute an excerpt to company memory, read or search a revision, and draft from a validated revision." + }, + "capabilities": [ + "content", + "memory", + "search", + "drafts" + ], + "credentials": [], + "price": { + "model": "free" + } +} diff --git a/catalog/content.yaml b/catalog/content.yaml new file mode 100644 index 0000000..d0c3503 --- /dev/null +++ b/catalog/content.yaml @@ -0,0 +1,17 @@ +{ + "schema": "agentmaurice.module_catalog_entry/v1", + "description": { + "fr": "Contenu : dossiers de contenu manuels (enregistrer, lister, lire, partager), avec contrôle de fin de relecture.", + "en": "Content: manual content files (save, list, read, share), with a review-completion check." + }, + "capabilities": [ + "content", + "drafts", + "review", + "sharing" + ], + "credentials": [], + "price": { + "model": "free" + } +} diff --git a/catalog/daily-routine.yaml b/catalog/daily-routine.yaml new file mode 100644 index 0000000..628f99b --- /dev/null +++ b/catalog/daily-routine.yaml @@ -0,0 +1,16 @@ +{ + "schema": "agentmaurice.module_catalog_entry/v1", + "description": { + "fr": "Routine quotidienne : journal du temps, briefing et bilan, et contexte du jour tiré des dossiers et de la mémoire.", + "en": "Daily routine: time journal, briefing and report, and the day's context drawn from case files and memory." + }, + "capabilities": [ + "time-tracking", + "daily-report", + "context" + ], + "credentials": [], + "price": { + "model": "free" + } +} diff --git a/catalog/enterprise-admin.yaml b/catalog/enterprise-admin.yaml new file mode 100644 index 0000000..0d5a6ca --- /dev/null +++ b/catalog/enterprise-admin.yaml @@ -0,0 +1,17 @@ +{ + "schema": "agentmaurice.module_catalog_entry/v1", + "description": { + "fr": "Administration de l'entreprise : vue d'ensemble, gestion, reprise et partage de fiches historiques, contrôle d'approbation.", + "en": "Enterprise administration: overview, management, import and sharing of historical records, approval check." + }, + "capabilities": [ + "administration", + "records", + "sharing", + "approval" + ], + "credentials": [], + "price": { + "model": "free" + } +} diff --git a/catalog/image-studio.yaml b/catalog/image-studio.yaml new file mode 100644 index 0000000..0a5389a --- /dev/null +++ b/catalog/image-studio.yaml @@ -0,0 +1,18 @@ +{ + "schema": "agentmaurice.module_catalog_entry/v1", + "description": { + "fr": "Studio d'images : planifier, produire, relire, publier et exporter des lots d'images, avec feuille de style et profils de sortie.", + "en": "Image studio: plan, produce, review, publish and export image packs, with a style sheet and output profiles." + }, + "capabilities": [ + "images", + "generation", + "review", + "export", + "storage" + ], + "credentials": [], + "price": { + "model": "free" + } +} diff --git a/catalog/marketing-launch.yaml b/catalog/marketing-launch.yaml new file mode 100644 index 0000000..c5141b7 --- /dev/null +++ b/catalog/marketing-launch.yaml @@ -0,0 +1,17 @@ +{ + "schema": "agentmaurice.module_catalog_entry/v1", + "description": { + "fr": "Marketing de lancement : campagne, preuves et contenu liés, demandes d'essai, progression, partage et vue Direction.", + "en": "Launch marketing: campaign, linked proofs and content, trial requests, progress, sharing and a management view." + }, + "capabilities": [ + "marketing", + "campaigns", + "trials", + "direction" + ], + "credentials": [], + "price": { + "model": "free" + } +} diff --git a/catalog/support-memory.yaml b/catalog/support-memory.yaml new file mode 100644 index 0000000..80e465f --- /dev/null +++ b/catalog/support-memory.yaml @@ -0,0 +1,17 @@ +{ + "schema": "agentmaurice.module_catalog_entry/v1", + "description": { + "fr": "Accompagnement et mémoire : proposer un extrait à la mémoire d'entreprise, consulter une révision et chercher dans la mémoire.", + "en": "Support and memory: contribute an excerpt to company memory, read a revision and search the memory." + }, + "capabilities": [ + "support", + "memory", + "search", + "contribution" + ], + "credentials": [], + "price": { + "model": "free" + } +} diff --git a/catalog/support.yaml b/catalog/support.yaml new file mode 100644 index 0000000..18fbc8e --- /dev/null +++ b/catalog/support.yaml @@ -0,0 +1,16 @@ +{ + "schema": "agentmaurice.module_catalog_entry/v1", + "description": { + "fr": "Accompagnement : dossiers d'accompagnement manuels (enregistrer, lister, lire, partager), avec garde sur les actions.", + "en": "Support: manual support files (save, list, read, share), with a guard on actions." + }, + "capabilities": [ + "support", + "case-files", + "sharing" + ], + "credentials": [], + "price": { + "model": "free" + } +} diff --git a/catalog/watch-memory.yaml b/catalog/watch-memory.yaml new file mode 100644 index 0000000..df4980e --- /dev/null +++ b/catalog/watch-memory.yaml @@ -0,0 +1,17 @@ +{ + "schema": "agentmaurice.module_catalog_entry/v1", + "description": { + "fr": "Veille et mémoire : proposer un extrait de veille à la mémoire d'entreprise, consulter une révision et chercher dans la mémoire.", + "en": "Watch and memory: contribute a monitoring excerpt to company memory, read a revision and search the memory." + }, + "capabilities": [ + "watch", + "memory", + "search", + "contribution" + ], + "credentials": [], + "price": { + "model": "free" + } +} diff --git a/catalog/watch.yaml b/catalog/watch.yaml new file mode 100644 index 0000000..537e186 --- /dev/null +++ b/catalog/watch.yaml @@ -0,0 +1,17 @@ +{ + "schema": "agentmaurice.module_catalog_entry/v1", + "description": { + "fr": "Veille : dossiers de veille manuels (enregistrer, lister, lire, partager), avec routage d'un travail de recherche et contrôle de ses résultats.", + "en": "Watch: manual monitoring files (save, list, read, share), with research work routing and result checks." + }, + "capabilities": [ + "watch", + "research", + "case-files", + "sharing" + ], + "credentials": [], + "price": { + "model": "free" + } +} diff --git a/catalog/work-cases.yaml b/catalog/work-cases.yaml new file mode 100644 index 0000000..c9827a9 --- /dev/null +++ b/catalog/work-cases.yaml @@ -0,0 +1,16 @@ +{ + "schema": "agentmaurice.module_catalog_entry/v1", + "description": { + "fr": "Dossiers communs : enregistrer, lister, lire et partager des dossiers, avec un briefing pour la Direction.", + "en": "Shared case files: save, list, read and share files, with a briefing for management." + }, + "capabilities": [ + "case-files", + "sharing", + "direction-briefing" + ], + "credentials": [], + "price": { + "model": "free" + } +} diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index b556eb5..b9c87af 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -2,7 +2,7 @@ ## Préparer le consommateur -Cloner le dépôt privé avec un compte autorisé : +Cloner le dépôt (public depuis le 2026-11-02) : ```sh git clone https://github.com/agentmaurice/modules.git diff --git a/docs/REPOSITORY_MIGRATION.md b/docs/REPOSITORY_MIGRATION.md index 0ad4e06..b395482 100644 --- a/docs/REPOSITORY_MIGRATION.md +++ b/docs/REPOSITORY_MIGRATION.md @@ -1,6 +1,6 @@ # Repository migration to agentmaurice/modules -The existing private `agentmaurice/company-in-a-box` repository is reused as +The existing `agentmaurice/company-in-a-box` repository (private at the time of the migration, public since 2026-11-02) is reused as `agentmaurice/modules`. The migration preserves its Git history, repository identity, historical resource IDs and versions. Repository visibility and runtime deployments are separate from this layout change. diff --git a/scripts/catalog.py b/scripts/catalog.py new file mode 100644 index 0000000..ef1bb62 --- /dev/null +++ b/scripts/catalog.py @@ -0,0 +1,212 @@ +#!/usr/bin/env python3 +"""Generate the public module catalog (catalog.json) from the modules and their catalog entries. + +catalog.json is the enriched index of this repository: for each module listed by modules.json it carries what a +person, an agent or a One needs to find and install it (descriptions, capabilities, requirements, price) together +with the fingerprints the One checks at import. It is generated, never edited by hand: + + python3 scripts/catalog.py # write catalog.json + python3 scripts/catalog.py --check # compare without writing; also validate every field + +Inputs: modules.json (the list), /module.yaml (key, name, version, provides, requires; JSON despite its +name) and catalog/.yaml (descriptions, capabilities, extra credentials, price; JSON as well). +Everything derivable is derived: runtimes and language-model use come from the workflows, MCP connectors from the +manifest, module dependencies from scripts/inventory.py, and both fingerprints from the files themselves. + +The catalog is public: texts are checked for URLs, e-mail addresses, IP addresses, internal host names, secrets +and the internal identifier forbidden in public content. +""" +import argparse +import hashlib +import json +import re +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +SCHEMA = 'agentmaurice.module_catalog/v1' +ENTRY_SCHEMA = 'agentmaurice.module_catalog_entry/v1' +CAPABILITY = re.compile(r'^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$') +PRICE_MODELS = ('free',) +TEXT_MAX = 400 +LANGUAGES = ('fr', 'en') +# Content that must never reach a public file. The first list is the secret shapes check.py already refuses. +FORBIDDEN = { + 'url': r'(?i)\b(?:https?|ftp|ssh|git)://', + 'bare-host': r'(?i)\b[a-z0-9-]+\.(?:com|net|org|io|app|ai|dev|local|internal|lan)\b', + 'e-mail': r'[\w.+-]+@[\w-]+\.[\w.-]+', + 'ip-address': r'\b\d{1,3}(?:\.\d{1,3}){3}\b', + # Spelled in two parts so that this file does not hold the identifier it forbids elsewhere. + 'internal-identifier': r'(?i)' + 'kraf' + 'tek', + 'private-key': r'-----BEGIN [A-Z ]*PRIVATE' + r' KEY-----', + 'github-token': r'\b(?:gh[pousr]_[A-Za-z0-9]{30,}|github_pat_[A-Za-z0-9_]{30,})', + 'provider-key': r'\bsk-(?:ant-[A-Za-z0-9_-]{20,}|[A-Za-z0-9_-]{24,})', + 'jwt': r'\beyJ[A-Za-z0-9_-]{15,}\.[A-Za-z0-9_-]{15,}\.[A-Za-z0-9_-]{15,}', + 'private-home-path': r'/(?:Us' + r'ers|home)/[a-zA-Z][^\s/]+/', +} + + +def tree_sha256(root): + """Fingerprint of a module directory, as the One computes it at import (ComputeModuleDirectoryHash). + + Every regular file under root except .git, ordered by its slash-separated relative path (bytewise); the hash + takes, for each file, the path, a zero byte, the raw SHA-256 of the content and a zero byte.""" + root = Path(root) + entries = [] + for path in root.rglob('*'): + relative = path.relative_to(root) + if '.git' in relative.parts: + continue + if path.is_symlink(): + raise ValueError(f'module symlinks are forbidden: {relative}') + if path.is_dir(): + continue + if not path.is_file(): + raise ValueError(f'module contains a non-regular file: {relative}') + entries.append(relative.as_posix()) + digest = hashlib.sha256() + for relative in sorted(entries, key=lambda name: name.encode('utf-8')): + digest.update(relative.encode('utf-8') + b'\0') + digest.update(hashlib.sha256((root / relative).read_bytes()).digest() + b'\0') + return digest.hexdigest() + + +def load_json(path): + return json.loads(Path(path).read_text(encoding='utf-8')) + + +def walk(value): + if isinstance(value, dict): + yield value + for child in value.values(): + yield from walk(child) + elif isinstance(value, list): + for child in value: + yield from walk(child) + + +def workflow_facts(directory): + """Runtimes used by code_execution actions and whether any step calls a language model.""" + runtimes, llm = set(), False + for path in sorted((directory / 'agents/main/workflows').glob('*.json')): + for node in walk(load_json(path)): + if node.get('type') == 'code_execution': + runtimes.add(node.get('runtime', 'deno')) + if node.get('type') == 'llm_call': + llm = True + return sorted(runtimes), llm + + +def text_problems(label, value): + problems = [] + if not isinstance(value, str) or not value.strip(): + return [f'{label}: texte vide ou absent'] + if len(value) > TEXT_MAX: + problems.append(f'{label}: {len(value)} caractères, {TEXT_MAX} au plus') + for name, pattern in FORBIDDEN.items(): + if re.search(pattern, value): + problems.append(f'{label}: motif interdit dans un contenu public ({name})') + return problems + + +def entry_problems(directory, entry): + problems = [] + if entry.get('schema') != ENTRY_SCHEMA: + problems.append(f'catalog/{directory}.yaml: schema attendu {ENTRY_SCHEMA}') + unknown = set(entry) - {'schema', 'description', 'capabilities', 'credentials', 'price'} + if unknown: + problems.append(f'catalog/{directory}.yaml: champs inconnus {sorted(unknown)}') + description = entry.get('description') + if not isinstance(description, dict) or set(description) != set(LANGUAGES): + problems.append(f'catalog/{directory}.yaml: description fr et en exigées') + else: + for language in LANGUAGES: + problems += text_problems(f'catalog/{directory}.yaml description.{language}', description[language]) + capabilities = entry.get('capabilities') + if not isinstance(capabilities, list) or not 1 <= len(capabilities) <= 12 or len(set(capabilities)) != len(capabilities): + problems.append(f'catalog/{directory}.yaml: 1 à 12 capacités distinctes') + else: + for capability in capabilities: + if not isinstance(capability, str) or not CAPABILITY.match(capability) or len(capability) > 40: + problems.append(f'catalog/{directory}.yaml: capacité invalide {capability!r}') + credentials = entry.get('credentials') + if not isinstance(credentials, list) or len(set(credentials)) != len(credentials): + problems.append(f'catalog/{directory}.yaml: credentials doit être une liste sans doublon') + else: + for credential in credentials: + if not isinstance(credential, str) or not CAPABILITY.match(credential): + problems.append(f'catalog/{directory}.yaml: identifiant de credential invalide {credential!r}') + price = entry.get('price') + if not isinstance(price, dict) or price.get('model') not in PRICE_MODELS or set(price) != {'model'}: + problems.append(f'catalog/{directory}.yaml: price.model parmi {PRICE_MODELS} seulement') + return problems + + +def render(): + sys.path.insert(0, str(Path(__file__).resolve().parent)) + import inventory # composition dependencies are declared once, there + index = load_json(ROOT / 'modules.json')['modules'] + keys_by_directory = {Path(item['manifest']).parent.name: item['key'] for item in index} + problems, modules = [], [] + sidecars = {path.stem for path in (ROOT / 'catalog').glob('*.yaml')} + for extra in sorted(sidecars - set(keys_by_directory)): + problems.append(f'catalog/{extra}.yaml: aucun module de ce dossier dans modules.json') + for item in index: + directory = Path(item['manifest']).parent + name = directory.name + manifest = ROOT / item['manifest'] + module = load_json(manifest) + sidecar = ROOT / 'catalog' / f'{name}.yaml' + if not sidecar.exists(): + problems.append(f'catalog/{name}.yaml: fiche de catalogue absente pour le module {module["key"]}') + continue + entry = load_json(sidecar) + problems += entry_problems(name, entry) + provides = module.get('provides', {}) + runtimes, llm = workflow_facts(ROOT / directory) + connectors = [{'name': mcp['name'], 'tools': sorted(mcp.get('required_tools', []))} + for mcp in module.get('requires', {}).get('mcp', [])] + modules.append({ + 'key': module['key'], 'name': module['name'], 'version': module['version'], + 'subpath': name, 'manifest': item['manifest'], + 'manifest_sha256': hashlib.sha256(manifest.read_bytes()).hexdigest(), + 'tree_sha256': tree_sha256(ROOT / directory), + 'description': entry.get('description'), 'capabilities': entry.get('capabilities'), + 'actions': [{'key': action['key'], 'name': action.get('name', action['key'])} for action in provides.get('actions', [])], + 'queries': [query['key'] for query in provides.get('queries', [])], + 'requires': { + 'runtimes': runtimes, 'language_model': llm, 'connectors': connectors, + 'credentials': entry.get('credentials'), + 'modules': sorted(keys_by_directory[d] for d in inventory.CONSUMERS.get(name, []) if d in keys_by_directory), + }, + 'price': entry.get('price'), + 'maturity': 'preview', + 'workflows': item['workflows'], 'miniapps': item['miniapps'], + }) + modules.sort(key=lambda module: module['key']) + return {'schema': SCHEMA, 'schema_version': 1, 'modules': modules}, problems + + +def main(): + parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument('--check', action='store_true') + args = parser.parse_args() + catalog, problems = render() + if problems: + print('\n'.join(problems), file=sys.stderr) + return 1 + data = json.dumps(catalog, ensure_ascii=False, indent=2) + '\n' + path = ROOT / 'catalog.json' + if args.check: + if not path.exists() or path.read_text(encoding='utf-8') != data: + print('catalog.json differs: run python3 scripts/catalog.py', file=sys.stderr) + return 1 + print('Catalog consistent') + return 0 + path.write_text(data, encoding='utf-8') + print('Catalog generated') + return 0 + + +if __name__ == '__main__': + raise SystemExit(main()) diff --git a/scripts/test.py b/scripts/test.py index da58575..a5641c8 100644 --- a/scripts/test.py +++ b/scripts/test.py @@ -3,13 +3,13 @@ import os, shutil, subprocess, sys, tempfile from pathlib import Path ROOT = Path(__file__).resolve().parents[1] -PYTHON_SUITES = ['templates/company-in-a-box/tests'] + [f'tooling/{name}/tests' for name in ('company-memory', 'memory-integration', 'daily-routine', 'work-cases', 'enterprise-admin', 'marketing-launch', 'image-studio')] +PYTHON_SUITES = ['templates/company-in-a-box/tests'] + [f'tooling/{name}/tests' for name in ('company-memory', 'memory-integration', 'daily-routine', 'work-cases', 'enterprise-admin', 'marketing-launch', 'image-studio', 'catalog')] NODE_TESTS = [f'tooling/{path}' for path in ('memory-integration/tests/test_publication.mjs', 'daily-routine/tests/metrics.test.mjs', 'work-cases/tests/domain.test.mjs', 'marketing-launch/tests/test_domain.cjs', 'marketing-launch/tests/test_generated_runtime.cjs')] def main(): env = {**os.environ, 'PYTHONDONTWRITEBYTECODE': '1'} with tempfile.TemporaryDirectory(prefix='modules-offline-') as temp: work = Path(temp) - for name in ('templates', 'tooling'): + for name in ('templates', 'tooling', 'scripts'): shutil.copytree(ROOT / name, work / name) for manifest in ROOT.glob('*/module.yaml'): shutil.copytree(manifest.parent, work / manifest.parent.name) @@ -28,5 +28,5 @@ def main(): if before != after or any(p.read_bytes() != data for p, data in extra_before.items()): raise SystemExit(f'{name}: le générateur ne reproduit pas les ressources publiées') - print('PASS: 8 suites unittest, contrat ACL Python et 5 contrôles Node et 5 reconstructions à octets identiques, sans réseau ni runtime.') + print('PASS: 9 suites unittest, contrat ACL Python et 5 contrôles Node et 5 reconstructions à octets identiques, sans réseau ni runtime.') if __name__ == '__main__': main() diff --git a/tooling/catalog/tests/test_catalog.py b/tooling/catalog/tests/test_catalog.py new file mode 100644 index 0000000..bd7f7c8 --- /dev/null +++ b/tooling/catalog/tests/test_catalog.py @@ -0,0 +1,159 @@ +"""Offline tests of scripts/catalog.py: the fingerprint shared with the One, the public-content filter, the entry +rules and the derived facts, on small synthetic repositories (nothing here reads the published modules).""" +import hashlib +import importlib.util +import json +import os +import tempfile +import unittest +from pathlib import Path +from unittest import mock + +SCRIPT = Path(__file__).resolve().parents[3] / 'scripts' / 'catalog.py' +spec = importlib.util.spec_from_file_location('module_catalog_script', SCRIPT) +catalog = importlib.util.module_from_spec(spec) +spec.loader.exec_module(catalog) + +# Digest of the fixture below as computed by ComputeModuleDirectoryHash of chatserver +# (internal/business/apps/module_manifest.go), run on the same files on 2026-11-02. +ONE_VECTOR = 'f86081e73b1ef490b9f0545d3b954db73f1025c37ec9d920672a7cd813777062' + + +def write(root, relative, content): + path = Path(root) / relative + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(content if isinstance(content, bytes) else content.encode('utf-8')) + + +def fixture(root): + write(root, 'a/one.txt', 'hello\n') + write(root, 'empty.txt', '') + write(root, 'a/b/z.json', '{"k":1}\n') + write(root, 'é.txt', 'é\n') + write(root, '.git/config', 'ignored\n') + + +class TreeHashTest(unittest.TestCase): + def test_matches_the_digest_the_one_computes(self): + with tempfile.TemporaryDirectory() as root: + fixture(root) + self.assertEqual(ONE_VECTOR, catalog.tree_sha256(root)) + + def test_ignores_git_and_depends_on_every_other_byte_and_path(self): + with tempfile.TemporaryDirectory() as root: + fixture(root) + write(root, '.git/HEAD', 'other') + self.assertEqual(ONE_VECTOR, catalog.tree_sha256(root)) + write(root, 'a/one.txt', 'hello!\n') + self.assertNotEqual(ONE_VECTOR, catalog.tree_sha256(root)) + write(root, 'a/one.txt', 'hello\n') + os.rename(Path(root) / 'empty.txt', Path(root) / 'vide.txt') + self.assertNotEqual(ONE_VECTOR, catalog.tree_sha256(root)) + + def test_refuses_symlinks_like_the_one(self): + with tempfile.TemporaryDirectory() as root: + fixture(root) + os.symlink(Path(root) / 'empty.txt', Path(root) / 'link') + with self.assertRaisesRegex(ValueError, 'symlinks are forbidden'): + catalog.tree_sha256(root) + + +class PublicTextTest(unittest.TestCase): + def test_clean_text_passes(self): + self.assertEqual([], catalog.text_problems('t', "Mémoire d'entreprise : capturer, proposer, relire.")) + + def test_each_forbidden_shape_is_refused(self): + internal = 'kraf' + 'tek' + for text in ('voir https://exemple.org/x', 'écrire à nom@exemple.org', 'hôte 100.64.1.2', 'poste machine.ts.net', + 'chez ' + internal.capitalize(), 'chez ' + internal.upper(), 'sur gitlab.com', 'clé sk-ant-' + 'a' * 30, 'jeton ghp_' + 'A' * 36, + '-----BEGIN RSA PRIVATE' + ' KEY-----', '/Us' + 'ers/jean/code', 'eyJ' + 'a' * 20 + '.' + 'b' * 20 + '.' + 'c' * 20): + self.assertTrue(catalog.text_problems('t', text), text) + + def test_empty_and_long_texts_are_refused(self): + self.assertTrue(catalog.text_problems('t', '')) + self.assertTrue(catalog.text_problems('t', None)) + self.assertTrue(catalog.text_problems('t', 'x' * (catalog.TEXT_MAX + 1))) + + +def entry(**changes): + value = {'schema': catalog.ENTRY_SCHEMA, 'description': {'fr': 'Un module.', 'en': 'A module.'}, + 'capabilities': ['memory', 'search'], 'credentials': [], 'price': {'model': 'free'}} + value.update(changes) + return value + + +class EntryRulesTest(unittest.TestCase): + def test_valid_entry(self): + self.assertEqual([], catalog.entry_problems('m', entry())) + + def test_invalid_entries(self): + for change in ({'schema': 'x'}, {'extra': 1}, {'description': {'fr': 'seul'}}, {'description': {'fr': 'a', 'en': 'b', 'de': 'c'}}, + {'capabilities': []}, {'capabilities': ['a'] * 2}, {'capabilities': ['Bad Cap']}, {'capabilities': [str(i) + 'x' for i in range(13)]}, + {'credentials': ['dup', 'dup']}, {'credentials': ['Bad']}, {'price': {'model': 'paid'}}, {'price': {'model': 'free', 'amount': 1}}, + {'price': 'free'}): + self.assertTrue(catalog.entry_problems('m', entry(**change)), change) + + +def module_repo(root, with_sidecar=True, extra_sidecar=False): + write(root, 'modules.json', json.dumps({'schema_version': 1, 'modules': [ + {'key': 'cib-demo-memory', 'version': '1.0.0', 'manifest': 'demo-memory/module.yaml', 'workflows': 1, 'miniapps': 0}, + {'key': 'cib-demo', 'version': '2.1.0', 'manifest': 'demo/module.yaml', 'workflows': 1, 'miniapps': 0}]})) + write(root, 'demo/module.yaml', json.dumps({'key': 'cib-demo', 'name': 'Demo', 'version': '2.1.0', 'schema_version': 2, + 'provides': {'actions': [{'key': 'save', 'name': 'Save it'}, {'key': 'share'}], 'queries': [{'key': 'list'}]}, + 'requires': {'mcp': [{'name': 'brain', 'required_tools': ['b.two', 'b.one']}]}})) + write(root, 'demo/agents/main/workflows/w.json', json.dumps({'workflow_id': 'w', 'actions': [ + {'id': 'a', 'type': 'code_execution'}, {'id': 'b', 'type': 'code_execution', 'runtime': 'wasm'}, {'id': 'c', 'type': 'llm_call'}]})) + write(root, 'demo-memory/module.yaml', json.dumps({'key': 'cib-demo-memory', 'name': 'Demo memory', 'version': '1.0.0', 'schema_version': 2, 'provides': {}})) + write(root, 'demo-memory/agents/main/workflows/w.json', json.dumps({'workflow_id': 'w2', 'actions': []})) + if with_sidecar: + write(root, 'catalog/demo.yaml', json.dumps(entry(credentials=['demo-key']))) + write(root, 'catalog/demo-memory.yaml', json.dumps(entry())) + if extra_sidecar: + write(root, 'catalog/ghost.yaml', json.dumps(entry())) + + +class RenderTest(unittest.TestCase): + def render(self, **options): + root = tempfile.TemporaryDirectory() + self.addCleanup(root.cleanup) + module_repo(root.name, **options) + with mock.patch.object(catalog, 'ROOT', Path(root.name)): + result = catalog.render() + return Path(root.name), result + + def test_derives_runtimes_model_use_connectors_and_dependencies(self): + root, (value, problems) = self.render() + self.assertEqual([], problems) + self.assertEqual(['cib-demo', 'cib-demo-memory'], [m['key'] for m in value['modules']]) + demo = value['modules'][0] + self.assertEqual(['deno', 'wasm'], demo['requires']['runtimes']) + self.assertTrue(demo['requires']['language_model']) + self.assertEqual([{'name': 'brain', 'tools': ['b.one', 'b.two']}], demo['requires']['connectors']) + self.assertEqual(['demo-key'], demo['requires']['credentials']) + self.assertEqual([{'key': 'save', 'name': 'Save it'}, {'key': 'share', 'name': 'share'}], demo['actions']) + self.assertEqual(['list'], demo['queries']) + self.assertEqual(hashlib.sha256((root / 'demo/module.yaml').read_bytes()).hexdigest(), demo['manifest_sha256']) + self.assertEqual(catalog.tree_sha256(root / 'demo'), demo['tree_sha256']) + self.assertEqual('preview', demo['maturity']) + + def test_a_missing_or_stray_catalog_entry_is_a_problem(self): + _, (_, problems) = self.render(with_sidecar=False) + self.assertEqual(2, len(problems)) + _, (_, problems) = self.render(extra_sidecar=True) + self.assertTrue(any('ghost' in problem for problem in problems)) + + def test_check_flags_a_stale_catalog_and_accepts_a_fresh_one(self): + root = tempfile.TemporaryDirectory() + self.addCleanup(root.cleanup) + module_repo(root.name) + with mock.patch.object(catalog, 'ROOT', Path(root.name)): + with mock.patch('sys.argv', ['catalog.py']): + self.assertEqual(0, catalog.main()) + with mock.patch('sys.argv', ['catalog.py', '--check']): + self.assertEqual(0, catalog.main()) + write(root.name, 'demo/agents/main/workflows/w.json', json.dumps({'workflow_id': 'w', 'actions': []})) + self.assertEqual(1, catalog.main()) + + +if __name__ == '__main__': + unittest.main() From 8dac62e708535b4a63ea529a3898dcc47c976d3a Mon Sep 17 00:00:00 2001 From: "Claude Code (agent)" Date: Mon, 2 Nov 2026 10:43:54 +0100 Subject: [PATCH 2/5] catalog: require the canonical form of the hand-written entries (AGENT-1642) A change of whitespace or key order in catalog/.yaml left catalog.json identical, so --check did not see it. The entries now have one text form; --check refuses any other spelling and plain catalog.py rewrites them, which can change their form but never their content. Co-Authored-By: Claude Sonnet 5.5 --- scripts/catalog.py | 16 +++++++++++++++- tooling/catalog/tests/test_catalog.py | 23 ++++++++++++++++++++--- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/scripts/catalog.py b/scripts/catalog.py index ef1bb62..e479cc6 100644 --- a/scripts/catalog.py +++ b/scripts/catalog.py @@ -75,6 +75,11 @@ def load_json(path): return json.loads(Path(path).read_text(encoding='utf-8')) +def canonical(value): + """The one text form of a catalog entry: any other spelling of the same entry (whitespace, key order) is a diff.""" + return json.dumps(value, ensure_ascii=False, indent=2) + '\n' + + def walk(value): if isinstance(value, dict): yield value @@ -147,7 +152,7 @@ def render(): import inventory # composition dependencies are declared once, there index = load_json(ROOT / 'modules.json')['modules'] keys_by_directory = {Path(item['manifest']).parent.name: item['key'] for item in index} - problems, modules = [], [] + problems, modules, noncanonical = [], [], [] sidecars = {path.stem for path in (ROOT / 'catalog').glob('*.yaml')} for extra in sorted(sidecars - set(keys_by_directory)): problems.append(f'catalog/{extra}.yaml: aucun module de ce dossier dans modules.json') @@ -162,6 +167,9 @@ def render(): continue entry = load_json(sidecar) problems += entry_problems(name, entry) + if sidecar.read_text(encoding='utf-8') != canonical(entry): + noncanonical.append(sidecar) + problems.append(f'catalog/{name}.yaml: forme non canonique (espaces, ordre des clés) : python3 scripts/catalog.py la réécrit') provides = module.get('provides', {}) runtimes, llm = workflow_facts(ROOT / directory) connectors = [{'name': mcp['name'], 'tools': sorted(mcp.get('required_tools', []))} @@ -184,6 +192,7 @@ def render(): 'workflows': item['workflows'], 'miniapps': item['miniapps'], }) modules.sort(key=lambda module: module['key']) + render.noncanonical = noncanonical return {'schema': SCHEMA, 'schema_version': 1, 'modules': modules}, problems @@ -192,6 +201,11 @@ def main(): parser.add_argument('--check', action='store_true') args = parser.parse_args() catalog, problems = render() + if not args.check and render.noncanonical: + # Writing normalises the hand-written entries; only their form can change, never their content. + for sidecar in render.noncanonical: + sidecar.write_text(canonical(load_json(sidecar)), encoding='utf-8') + catalog, problems = render() if problems: print('\n'.join(problems), file=sys.stderr) return 1 diff --git a/tooling/catalog/tests/test_catalog.py b/tooling/catalog/tests/test_catalog.py index bd7f7c8..dd51675 100644 --- a/tooling/catalog/tests/test_catalog.py +++ b/tooling/catalog/tests/test_catalog.py @@ -106,10 +106,10 @@ def module_repo(root, with_sidecar=True, extra_sidecar=False): write(root, 'demo-memory/module.yaml', json.dumps({'key': 'cib-demo-memory', 'name': 'Demo memory', 'version': '1.0.0', 'schema_version': 2, 'provides': {}})) write(root, 'demo-memory/agents/main/workflows/w.json', json.dumps({'workflow_id': 'w2', 'actions': []})) if with_sidecar: - write(root, 'catalog/demo.yaml', json.dumps(entry(credentials=['demo-key']))) - write(root, 'catalog/demo-memory.yaml', json.dumps(entry())) + write(root, 'catalog/demo.yaml', catalog.canonical(entry(credentials=['demo-key']))) + write(root, 'catalog/demo-memory.yaml', catalog.canonical(entry())) if extra_sidecar: - write(root, 'catalog/ghost.yaml', json.dumps(entry())) + write(root, 'catalog/ghost.yaml', catalog.canonical(entry())) class RenderTest(unittest.TestCase): @@ -142,6 +142,23 @@ def test_a_missing_or_stray_catalog_entry_is_a_problem(self): _, (_, problems) = self.render(extra_sidecar=True) self.assertTrue(any('ghost' in problem for problem in problems)) + def test_a_hand_written_entry_must_be_in_canonical_form(self): + root = tempfile.TemporaryDirectory() + self.addCleanup(root.cleanup) + module_repo(root.name) + sidecar = Path(root.name) / 'catalog/demo.yaml' + with mock.patch.object(catalog, 'ROOT', Path(root.name)): + with mock.patch('sys.argv', ['catalog.py']): + self.assertEqual(0, catalog.main()) + for spelling in (sidecar.read_text() + '\n', json.dumps(json.loads(sidecar.read_text())), json.dumps(json.loads(sidecar.read_text()), indent=2, sort_keys=True) + '\n'): + sidecar.write_text(spelling) + with mock.patch('sys.argv', ['catalog.py', '--check']): + self.assertEqual(1, catalog.main(), spelling[:30]) + with mock.patch('sys.argv', ['catalog.py']): + self.assertEqual(0, catalog.main()) + with mock.patch('sys.argv', ['catalog.py', '--check']): + self.assertEqual(0, catalog.main()) + def test_check_flags_a_stale_catalog_and_accepts_a_fresh_one(self): root = tempfile.TemporaryDirectory() self.addCleanup(root.cleanup) From 666d3ae817bfa481d95e5b18c947de9b5d22421f Mon Sep 17 00:00:00 2001 From: "Claude Code (agent)" Date: Mon, 2 Nov 2026 10:45:03 +0100 Subject: [PATCH 3/5] catalog: sort the keys of the hand-written entries (AGENT-1642) Moving a field in an entry kept the file valid and catalog.json identical. The canonical form now sorts keys, so --check sees any reordering and catalog.py rewrites the entries into that form. Co-Authored-By: Claude Sonnet 5.5 --- catalog.json | 48 +++++++++++++-------------- catalog/company-memory.yaml | 12 +++---- catalog/content-memory.yaml | 12 +++---- catalog/content.yaml | 12 +++---- catalog/daily-routine.yaml | 12 +++---- catalog/enterprise-admin.yaml | 12 +++---- catalog/image-studio.yaml | 12 +++---- catalog/marketing-launch.yaml | 12 +++---- catalog/support-memory.yaml | 12 +++---- catalog/support.yaml | 12 +++---- catalog/watch-memory.yaml | 12 +++---- catalog/watch.yaml | 12 +++---- catalog/work-cases.yaml | 12 +++---- scripts/catalog.py | 4 +-- tooling/catalog/tests/test_catalog.py | 2 +- 15 files changed, 99 insertions(+), 99 deletions(-) diff --git a/catalog.json b/catalog.json index 5d4406d..f1825fb 100644 --- a/catalog.json +++ b/catalog.json @@ -11,8 +11,8 @@ "manifest_sha256": "26527b3975fa92c8fbf9ea85f9b0531f431037946c101f5413cc01a4db71265c", "tree_sha256": "461afc86087a8436ee3c1c38773f28d4304c7bbb08ae50ef7081397c847317af", "description": { - "fr": "Accompagnement : dossiers d'accompagnement manuels (enregistrer, lister, lire, partager), avec garde sur les actions.", - "en": "Support: manual support files (save, list, read, share), with a guard on actions." + "en": "Support: manual support files (save, list, read, share), with a guard on actions.", + "fr": "Accompagnement : dossiers d'accompagnement manuels (enregistrer, lister, lire, partager), avec garde sur les actions." }, "capabilities": [ "support", @@ -63,8 +63,8 @@ "manifest_sha256": "9ed65127ed0709ba3a58060c90a3dcd3a9ddbd0c9b34abb12d3c4576394079d3", "tree_sha256": "7479fa6e70af460c22e1443a83d1aba2654f8680bfc3663ab1cd9b4f0aa5d045", "description": { - "fr": "Accompagnement et mémoire : proposer un extrait à la mémoire d'entreprise, consulter une révision et chercher dans la mémoire.", - "en": "Support and memory: contribute an excerpt to company memory, read a revision and search the memory." + "en": "Support and memory: contribute an excerpt to company memory, read a revision and search the memory.", + "fr": "Accompagnement et mémoire : proposer un extrait à la mémoire d'entreprise, consulter une révision et chercher dans la mémoire." }, "capabilities": [ "support", @@ -110,8 +110,8 @@ "manifest_sha256": "0089a7cb29ce5c2e332a1f7436d4c60febbb9fda11b0515b8128fd8e6c0d4181", "tree_sha256": "1af55c7df9103155604b40f03313307e5e8c2128cb99f394267343263086d593", "description": { - "fr": "Contenu : dossiers de contenu manuels (enregistrer, lister, lire, partager), avec contrôle de fin de relecture.", - "en": "Content: manual content files (save, list, read, share), with a review-completion check." + "en": "Content: manual content files (save, list, read, share), with a review-completion check.", + "fr": "Contenu : dossiers de contenu manuels (enregistrer, lister, lire, partager), avec contrôle de fin de relecture." }, "capabilities": [ "content", @@ -163,8 +163,8 @@ "manifest_sha256": "249e56e9533bece539d2ac0c1d2bfefb0dc65b6d42a7e93cc40022bdc240e2fb", "tree_sha256": "dede4e31151069c2863666a3497d2ff6889f02efed432289e8a3a5abbcb844cc", "description": { - "fr": "Contenu et mémoire : proposer un extrait à la mémoire d'entreprise, consulter ou chercher une révision, et rédiger un brouillon depuis une révision validée.", - "en": "Content and memory: contribute an excerpt to company memory, read or search a revision, and draft from a validated revision." + "en": "Content and memory: contribute an excerpt to company memory, read or search a revision, and draft from a validated revision.", + "fr": "Contenu et mémoire : proposer un extrait à la mémoire d'entreprise, consulter ou chercher une révision, et rédiger un brouillon depuis une révision validée." }, "capabilities": [ "content", @@ -214,8 +214,8 @@ "manifest_sha256": "8cd81a40c20c0f44a037055785a1e276f64c90082b670df546e0291b1ae4c6bb", "tree_sha256": "e34b14d8344e039a282202838d05e0881930df749305b2b5dc0ab45b4423f5b5", "description": { - "fr": "Routine quotidienne : journal du temps, briefing et bilan, et contexte du jour tiré des dossiers et de la mémoire.", - "en": "Daily routine: time journal, briefing and report, and the day's context drawn from case files and memory." + "en": "Daily routine: time journal, briefing and report, and the day's context drawn from case files and memory.", + "fr": "Routine quotidienne : journal du temps, briefing et bilan, et contexte du jour tiré des dossiers et de la mémoire." }, "capabilities": [ "time-tracking", @@ -263,8 +263,8 @@ "manifest_sha256": "b70c51ca0d95f494a49b349a9997ce328f8cd0f73ae9b2db92af57839e49f543", "tree_sha256": "56e6d0b9675ecf4e515e3de3ab2703c36a2cbf0bf6113d357be89926b23f6f8e", "description": { - "fr": "Administration de l'entreprise : vue d'ensemble, gestion, reprise et partage de fiches historiques, contrôle d'approbation.", - "en": "Enterprise administration: overview, management, import and sharing of historical records, approval check." + "en": "Enterprise administration: overview, management, import and sharing of historical records, approval check.", + "fr": "Administration de l'entreprise : vue d'ensemble, gestion, reprise et partage de fiches historiques, contrôle d'approbation." }, "capabilities": [ "administration", @@ -317,8 +317,8 @@ "manifest_sha256": "d6e2d73144a40d2d4695ec77593949434aa841f9fe9343dc9bdff28a3d22f16f", "tree_sha256": "7d46b90ad8bcb4ebaa49d6c09f51390c17c952e2c9c424ffdca827000110afce", "description": { - "fr": "Marketing de lancement : campagne, preuves et contenu liés, demandes d'essai, progression, partage et vue Direction.", - "en": "Launch marketing: campaign, linked proofs and content, trial requests, progress, sharing and a management view." + "en": "Launch marketing: campaign, linked proofs and content, trial requests, progress, sharing and a management view.", + "fr": "Marketing de lancement : campagne, preuves et contenu liés, demandes d'essai, progression, partage et vue Direction." }, "capabilities": [ "marketing", @@ -379,8 +379,8 @@ "manifest_sha256": "f32db870687d26e4763a3d8eb615ad307bd98b8815963b70eb1cbc191f66fc4c", "tree_sha256": "09609ae3d3fe36f66815c60f1d456fb3c527c63341654ecfe459f67c3ae6705e", "description": { - "fr": "Veille : dossiers de veille manuels (enregistrer, lister, lire, partager), avec routage d'un travail de recherche et contrôle de ses résultats.", - "en": "Watch: manual monitoring files (save, list, read, share), with research work routing and result checks." + "en": "Watch: manual monitoring files (save, list, read, share), with research work routing and result checks.", + "fr": "Veille : dossiers de veille manuels (enregistrer, lister, lire, partager), avec routage d'un travail de recherche et contrôle de ses résultats." }, "capabilities": [ "watch", @@ -436,8 +436,8 @@ "manifest_sha256": "bf295664b5b9410516edf1c91280d2d4a3199d0b13ecac20c63705a020d9ba59", "tree_sha256": "853222eabafa65e06f9a29f9da7585466292d81413e4fd97de24d284fc82455b", "description": { - "fr": "Veille et mémoire : proposer un extrait de veille à la mémoire d'entreprise, consulter une révision et chercher dans la mémoire.", - "en": "Watch and memory: contribute a monitoring excerpt to company memory, read a revision and search the memory." + "en": "Watch and memory: contribute a monitoring excerpt to company memory, read a revision and search the memory.", + "fr": "Veille et mémoire : proposer un extrait de veille à la mémoire d'entreprise, consulter une révision et chercher dans la mémoire." }, "capabilities": [ "watch", @@ -483,8 +483,8 @@ "manifest_sha256": "65ef645f3e093cfa5bc68df154e8b762da1e48df14ae5ab94131bf23af4566cf", "tree_sha256": "996bb140c42b1847feec99baab2177006d91d2069bb18c49ae8bc72e0e668395", "description": { - "fr": "Dossiers communs : enregistrer, lister, lire et partager des dossiers, avec un briefing pour la Direction.", - "en": "Shared case files: save, list, read and share files, with a briefing for management." + "en": "Shared case files: save, list, read and share files, with a briefing for management.", + "fr": "Dossiers communs : enregistrer, lister, lire et partager des dossiers, avec un briefing pour la Direction." }, "capabilities": [ "case-files", @@ -532,8 +532,8 @@ "manifest_sha256": "a26d8495505180a3d75be3ef6b6ea017aaf2467e87e0da0f2e653a4da719314e", "tree_sha256": "647a0524f2d1e6745ff58dbead425fbff935b86876862d909e337b535774725e", "description": { - "fr": "Mémoire d'entreprise : capturer des sources, proposer et relire des mises à jour, indexer des révisions et les interroger ou les chercher par mots-clés.", - "en": "Company memory: capture sources, propose and review updates, index revisions, then query or keyword-search them." + "en": "Company memory: capture sources, propose and review updates, index revisions, then query or keyword-search them.", + "fr": "Mémoire d'entreprise : capturer des sources, proposer et relire des mises à jour, indexer des révisions et les interroger ou les chercher par mots-clés." }, "capabilities": [ "memory", @@ -606,8 +606,8 @@ "manifest_sha256": "b29f62142e391df84b705394d87392d7f790a575c294ecce3e6451c2a4714122", "tree_sha256": "ff67c21cdf4c87dcc4e192e315f280af1ea763441cdc16ad26af550c396fee82", "description": { - "fr": "Studio d'images : planifier, produire, relire, publier et exporter des lots d'images, avec feuille de style et profils de sortie.", - "en": "Image studio: plan, produce, review, publish and export image packs, with a style sheet and output profiles." + "en": "Image studio: plan, produce, review, publish and export image packs, with a style sheet and output profiles.", + "fr": "Studio d'images : planifier, produire, relire, publier et exporter des lots d'images, avec feuille de style et profils de sortie." }, "capabilities": [ "images", diff --git a/catalog/company-memory.yaml b/catalog/company-memory.yaml index f310df7..3bd927a 100644 --- a/catalog/company-memory.yaml +++ b/catalog/company-memory.yaml @@ -1,9 +1,4 @@ { - "schema": "agentmaurice.module_catalog_entry/v1", - "description": { - "fr": "Mémoire d'entreprise : capturer des sources, proposer et relire des mises à jour, indexer des révisions et les interroger ou les chercher par mots-clés.", - "en": "Company memory: capture sources, propose and review updates, index revisions, then query or keyword-search them." - }, "capabilities": [ "memory", "knowledge-base", @@ -12,7 +7,12 @@ "indexing" ], "credentials": [], + "description": { + "en": "Company memory: capture sources, propose and review updates, index revisions, then query or keyword-search them.", + "fr": "Mémoire d'entreprise : capturer des sources, proposer et relire des mises à jour, indexer des révisions et les interroger ou les chercher par mots-clés." + }, "price": { "model": "free" - } + }, + "schema": "agentmaurice.module_catalog_entry/v1" } diff --git a/catalog/content-memory.yaml b/catalog/content-memory.yaml index 0a5601a..c69a0ad 100644 --- a/catalog/content-memory.yaml +++ b/catalog/content-memory.yaml @@ -1,9 +1,4 @@ { - "schema": "agentmaurice.module_catalog_entry/v1", - "description": { - "fr": "Contenu et mémoire : proposer un extrait à la mémoire d'entreprise, consulter ou chercher une révision, et rédiger un brouillon depuis une révision validée.", - "en": "Content and memory: contribute an excerpt to company memory, read or search a revision, and draft from a validated revision." - }, "capabilities": [ "content", "memory", @@ -11,7 +6,12 @@ "drafts" ], "credentials": [], + "description": { + "en": "Content and memory: contribute an excerpt to company memory, read or search a revision, and draft from a validated revision.", + "fr": "Contenu et mémoire : proposer un extrait à la mémoire d'entreprise, consulter ou chercher une révision, et rédiger un brouillon depuis une révision validée." + }, "price": { "model": "free" - } + }, + "schema": "agentmaurice.module_catalog_entry/v1" } diff --git a/catalog/content.yaml b/catalog/content.yaml index d0c3503..ea5686e 100644 --- a/catalog/content.yaml +++ b/catalog/content.yaml @@ -1,9 +1,4 @@ { - "schema": "agentmaurice.module_catalog_entry/v1", - "description": { - "fr": "Contenu : dossiers de contenu manuels (enregistrer, lister, lire, partager), avec contrôle de fin de relecture.", - "en": "Content: manual content files (save, list, read, share), with a review-completion check." - }, "capabilities": [ "content", "drafts", @@ -11,7 +6,12 @@ "sharing" ], "credentials": [], + "description": { + "en": "Content: manual content files (save, list, read, share), with a review-completion check.", + "fr": "Contenu : dossiers de contenu manuels (enregistrer, lister, lire, partager), avec contrôle de fin de relecture." + }, "price": { "model": "free" - } + }, + "schema": "agentmaurice.module_catalog_entry/v1" } diff --git a/catalog/daily-routine.yaml b/catalog/daily-routine.yaml index 628f99b..fddc3ef 100644 --- a/catalog/daily-routine.yaml +++ b/catalog/daily-routine.yaml @@ -1,16 +1,16 @@ { - "schema": "agentmaurice.module_catalog_entry/v1", - "description": { - "fr": "Routine quotidienne : journal du temps, briefing et bilan, et contexte du jour tiré des dossiers et de la mémoire.", - "en": "Daily routine: time journal, briefing and report, and the day's context drawn from case files and memory." - }, "capabilities": [ "time-tracking", "daily-report", "context" ], "credentials": [], + "description": { + "en": "Daily routine: time journal, briefing and report, and the day's context drawn from case files and memory.", + "fr": "Routine quotidienne : journal du temps, briefing et bilan, et contexte du jour tiré des dossiers et de la mémoire." + }, "price": { "model": "free" - } + }, + "schema": "agentmaurice.module_catalog_entry/v1" } diff --git a/catalog/enterprise-admin.yaml b/catalog/enterprise-admin.yaml index 0d5a6ca..083e022 100644 --- a/catalog/enterprise-admin.yaml +++ b/catalog/enterprise-admin.yaml @@ -1,9 +1,4 @@ { - "schema": "agentmaurice.module_catalog_entry/v1", - "description": { - "fr": "Administration de l'entreprise : vue d'ensemble, gestion, reprise et partage de fiches historiques, contrôle d'approbation.", - "en": "Enterprise administration: overview, management, import and sharing of historical records, approval check." - }, "capabilities": [ "administration", "records", @@ -11,7 +6,12 @@ "approval" ], "credentials": [], + "description": { + "en": "Enterprise administration: overview, management, import and sharing of historical records, approval check.", + "fr": "Administration de l'entreprise : vue d'ensemble, gestion, reprise et partage de fiches historiques, contrôle d'approbation." + }, "price": { "model": "free" - } + }, + "schema": "agentmaurice.module_catalog_entry/v1" } diff --git a/catalog/image-studio.yaml b/catalog/image-studio.yaml index 0a5389a..adeb557 100644 --- a/catalog/image-studio.yaml +++ b/catalog/image-studio.yaml @@ -1,9 +1,4 @@ { - "schema": "agentmaurice.module_catalog_entry/v1", - "description": { - "fr": "Studio d'images : planifier, produire, relire, publier et exporter des lots d'images, avec feuille de style et profils de sortie.", - "en": "Image studio: plan, produce, review, publish and export image packs, with a style sheet and output profiles." - }, "capabilities": [ "images", "generation", @@ -12,7 +7,12 @@ "storage" ], "credentials": [], + "description": { + "en": "Image studio: plan, produce, review, publish and export image packs, with a style sheet and output profiles.", + "fr": "Studio d'images : planifier, produire, relire, publier et exporter des lots d'images, avec feuille de style et profils de sortie." + }, "price": { "model": "free" - } + }, + "schema": "agentmaurice.module_catalog_entry/v1" } diff --git a/catalog/marketing-launch.yaml b/catalog/marketing-launch.yaml index c5141b7..8d86464 100644 --- a/catalog/marketing-launch.yaml +++ b/catalog/marketing-launch.yaml @@ -1,9 +1,4 @@ { - "schema": "agentmaurice.module_catalog_entry/v1", - "description": { - "fr": "Marketing de lancement : campagne, preuves et contenu liés, demandes d'essai, progression, partage et vue Direction.", - "en": "Launch marketing: campaign, linked proofs and content, trial requests, progress, sharing and a management view." - }, "capabilities": [ "marketing", "campaigns", @@ -11,7 +6,12 @@ "direction" ], "credentials": [], + "description": { + "en": "Launch marketing: campaign, linked proofs and content, trial requests, progress, sharing and a management view.", + "fr": "Marketing de lancement : campagne, preuves et contenu liés, demandes d'essai, progression, partage et vue Direction." + }, "price": { "model": "free" - } + }, + "schema": "agentmaurice.module_catalog_entry/v1" } diff --git a/catalog/support-memory.yaml b/catalog/support-memory.yaml index 80e465f..192f5bb 100644 --- a/catalog/support-memory.yaml +++ b/catalog/support-memory.yaml @@ -1,9 +1,4 @@ { - "schema": "agentmaurice.module_catalog_entry/v1", - "description": { - "fr": "Accompagnement et mémoire : proposer un extrait à la mémoire d'entreprise, consulter une révision et chercher dans la mémoire.", - "en": "Support and memory: contribute an excerpt to company memory, read a revision and search the memory." - }, "capabilities": [ "support", "memory", @@ -11,7 +6,12 @@ "contribution" ], "credentials": [], + "description": { + "en": "Support and memory: contribute an excerpt to company memory, read a revision and search the memory.", + "fr": "Accompagnement et mémoire : proposer un extrait à la mémoire d'entreprise, consulter une révision et chercher dans la mémoire." + }, "price": { "model": "free" - } + }, + "schema": "agentmaurice.module_catalog_entry/v1" } diff --git a/catalog/support.yaml b/catalog/support.yaml index 18fbc8e..2ffdacb 100644 --- a/catalog/support.yaml +++ b/catalog/support.yaml @@ -1,16 +1,16 @@ { - "schema": "agentmaurice.module_catalog_entry/v1", - "description": { - "fr": "Accompagnement : dossiers d'accompagnement manuels (enregistrer, lister, lire, partager), avec garde sur les actions.", - "en": "Support: manual support files (save, list, read, share), with a guard on actions." - }, "capabilities": [ "support", "case-files", "sharing" ], "credentials": [], + "description": { + "en": "Support: manual support files (save, list, read, share), with a guard on actions.", + "fr": "Accompagnement : dossiers d'accompagnement manuels (enregistrer, lister, lire, partager), avec garde sur les actions." + }, "price": { "model": "free" - } + }, + "schema": "agentmaurice.module_catalog_entry/v1" } diff --git a/catalog/watch-memory.yaml b/catalog/watch-memory.yaml index df4980e..ffdf019 100644 --- a/catalog/watch-memory.yaml +++ b/catalog/watch-memory.yaml @@ -1,9 +1,4 @@ { - "schema": "agentmaurice.module_catalog_entry/v1", - "description": { - "fr": "Veille et mémoire : proposer un extrait de veille à la mémoire d'entreprise, consulter une révision et chercher dans la mémoire.", - "en": "Watch and memory: contribute a monitoring excerpt to company memory, read a revision and search the memory." - }, "capabilities": [ "watch", "memory", @@ -11,7 +6,12 @@ "contribution" ], "credentials": [], + "description": { + "en": "Watch and memory: contribute a monitoring excerpt to company memory, read a revision and search the memory.", + "fr": "Veille et mémoire : proposer un extrait de veille à la mémoire d'entreprise, consulter une révision et chercher dans la mémoire." + }, "price": { "model": "free" - } + }, + "schema": "agentmaurice.module_catalog_entry/v1" } diff --git a/catalog/watch.yaml b/catalog/watch.yaml index 537e186..bc9df4d 100644 --- a/catalog/watch.yaml +++ b/catalog/watch.yaml @@ -1,9 +1,4 @@ { - "schema": "agentmaurice.module_catalog_entry/v1", - "description": { - "fr": "Veille : dossiers de veille manuels (enregistrer, lister, lire, partager), avec routage d'un travail de recherche et contrôle de ses résultats.", - "en": "Watch: manual monitoring files (save, list, read, share), with research work routing and result checks." - }, "capabilities": [ "watch", "research", @@ -11,7 +6,12 @@ "sharing" ], "credentials": [], + "description": { + "en": "Watch: manual monitoring files (save, list, read, share), with research work routing and result checks.", + "fr": "Veille : dossiers de veille manuels (enregistrer, lister, lire, partager), avec routage d'un travail de recherche et contrôle de ses résultats." + }, "price": { "model": "free" - } + }, + "schema": "agentmaurice.module_catalog_entry/v1" } diff --git a/catalog/work-cases.yaml b/catalog/work-cases.yaml index c9827a9..2546677 100644 --- a/catalog/work-cases.yaml +++ b/catalog/work-cases.yaml @@ -1,16 +1,16 @@ { - "schema": "agentmaurice.module_catalog_entry/v1", - "description": { - "fr": "Dossiers communs : enregistrer, lister, lire et partager des dossiers, avec un briefing pour la Direction.", - "en": "Shared case files: save, list, read and share files, with a briefing for management." - }, "capabilities": [ "case-files", "sharing", "direction-briefing" ], "credentials": [], + "description": { + "en": "Shared case files: save, list, read and share files, with a briefing for management.", + "fr": "Dossiers communs : enregistrer, lister, lire et partager des dossiers, avec un briefing pour la Direction." + }, "price": { "model": "free" - } + }, + "schema": "agentmaurice.module_catalog_entry/v1" } diff --git a/scripts/catalog.py b/scripts/catalog.py index e479cc6..cf07fff 100644 --- a/scripts/catalog.py +++ b/scripts/catalog.py @@ -76,8 +76,8 @@ def load_json(path): def canonical(value): - """The one text form of a catalog entry: any other spelling of the same entry (whitespace, key order) is a diff.""" - return json.dumps(value, ensure_ascii=False, indent=2) + '\n' + """The one text form of a catalog entry: any other spelling of the same entry (whitespace, key order: keys are sorted) is a diff.""" + return json.dumps(value, ensure_ascii=False, indent=2, sort_keys=True) + '\n' def walk(value): diff --git a/tooling/catalog/tests/test_catalog.py b/tooling/catalog/tests/test_catalog.py index dd51675..2ae4579 100644 --- a/tooling/catalog/tests/test_catalog.py +++ b/tooling/catalog/tests/test_catalog.py @@ -150,7 +150,7 @@ def test_a_hand_written_entry_must_be_in_canonical_form(self): with mock.patch.object(catalog, 'ROOT', Path(root.name)): with mock.patch('sys.argv', ['catalog.py']): self.assertEqual(0, catalog.main()) - for spelling in (sidecar.read_text() + '\n', json.dumps(json.loads(sidecar.read_text())), json.dumps(json.loads(sidecar.read_text()), indent=2, sort_keys=True) + '\n'): + for spelling in (sidecar.read_text() + '\n', json.dumps(json.loads(sidecar.read_text())), json.dumps(dict(reversed(list(json.loads(sidecar.read_text()).items()))), indent=2) + '\n'): sidecar.write_text(spelling) with mock.patch('sys.argv', ['catalog.py', '--check']): self.assertEqual(1, catalog.main(), spelling[:30]) From 47d2d5af2331b997ec37129fe44c38ba49e4b9dc Mon Sep 17 00:00:00 2001 From: "Claude Code (agent)" Date: Mon, 2 Nov 2026 10:48:52 +0100 Subject: [PATCH 4/5] catalog: leave no bytecode behind when --check imports the inventory (AGENT-1642) The CI runs catalog.py --check right before check.py. Importing scripts/inventory.py wrote scripts/__pycache__, which check.py refuses as a non-distributable file, so the job failed on the first pull request. The import now disables bytecode, and a test runs both commands without PYTHONDONTWRITEBYTECODE and looks for any .pyc. Co-Authored-By: Claude Sonnet 5.5 --- scripts/catalog.py | 2 ++ tooling/catalog/tests/test_catalog.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/scripts/catalog.py b/scripts/catalog.py index cf07fff..7875429 100644 --- a/scripts/catalog.py +++ b/scripts/catalog.py @@ -148,6 +148,8 @@ def entry_problems(directory, entry): def render(): + # Importing inventory must not leave a scripts/__pycache__ behind: check.py refuses any bytecode file. + sys.dont_write_bytecode = True sys.path.insert(0, str(Path(__file__).resolve().parent)) import inventory # composition dependencies are declared once, there index = load_json(ROOT / 'modules.json')['modules'] diff --git a/tooling/catalog/tests/test_catalog.py b/tooling/catalog/tests/test_catalog.py index 2ae4579..a46bd87 100644 --- a/tooling/catalog/tests/test_catalog.py +++ b/tooling/catalog/tests/test_catalog.py @@ -112,6 +112,24 @@ def module_repo(root, with_sidecar=True, extra_sidecar=False): write(root, 'catalog/ghost.yaml', catalog.canonical(entry())) +class BytecodeTest(unittest.TestCase): + def test_a_check_run_leaves_no_bytecode_in_the_repository(self): + # The CI runs catalog.py --check right before check.py, which refuses any bytecode file (AGENT-1642, PR 7). + import shutil + import subprocess + import sys + root = tempfile.TemporaryDirectory() + self.addCleanup(root.cleanup) + module_repo(root.name) + (Path(root.name) / 'scripts').mkdir() + for name in ('catalog.py', 'inventory.py'): + shutil.copy(SCRIPT.parent / name, Path(root.name) / 'scripts' / name) + env = {key: value for key, value in os.environ.items() if key != 'PYTHONDONTWRITEBYTECODE'} + subprocess.run([sys.executable, str(Path(root.name) / 'scripts/catalog.py')], env=env, check=True, capture_output=True) + subprocess.run([sys.executable, str(Path(root.name) / 'scripts/catalog.py'), '--check'], env=env, check=True, capture_output=True) + self.assertEqual([], [str(p) for p in Path(root.name).rglob('*.pyc')]) + + class RenderTest(unittest.TestCase): def render(self, **options): root = tempfile.TemporaryDirectory() From 2e460a2e297b34b89d77115a6e5b4b313a54e43f Mon Sep 17 00:00:00 2001 From: "Claude Code (agent)" Date: Mon, 2 Nov 2026 10:50:09 +0100 Subject: [PATCH 5/5] catalog: compare and write bytes so a line-ending change is a difference (AGENT-1642) Reading the entries and catalog.json as text turned CRLF into LF before the comparison, so --check accepted them. They are now compared and written as bytes. Co-Authored-By: Claude Sonnet 5.5 --- scripts/catalog.py | 8 ++++---- tooling/catalog/tests/test_catalog.py | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/scripts/catalog.py b/scripts/catalog.py index 7875429..3aa8a50 100644 --- a/scripts/catalog.py +++ b/scripts/catalog.py @@ -169,7 +169,7 @@ def render(): continue entry = load_json(sidecar) problems += entry_problems(name, entry) - if sidecar.read_text(encoding='utf-8') != canonical(entry): + if sidecar.read_bytes() != canonical(entry).encode('utf-8'): # bytes: a CRLF is a difference too noncanonical.append(sidecar) problems.append(f'catalog/{name}.yaml: forme non canonique (espaces, ordre des clés) : python3 scripts/catalog.py la réécrit') provides = module.get('provides', {}) @@ -206,7 +206,7 @@ def main(): if not args.check and render.noncanonical: # Writing normalises the hand-written entries; only their form can change, never their content. for sidecar in render.noncanonical: - sidecar.write_text(canonical(load_json(sidecar)), encoding='utf-8') + sidecar.write_bytes(canonical(load_json(sidecar)).encode('utf-8')) catalog, problems = render() if problems: print('\n'.join(problems), file=sys.stderr) @@ -214,12 +214,12 @@ def main(): data = json.dumps(catalog, ensure_ascii=False, indent=2) + '\n' path = ROOT / 'catalog.json' if args.check: - if not path.exists() or path.read_text(encoding='utf-8') != data: + if not path.exists() or path.read_bytes() != data.encode('utf-8'): print('catalog.json differs: run python3 scripts/catalog.py', file=sys.stderr) return 1 print('Catalog consistent') return 0 - path.write_text(data, encoding='utf-8') + path.write_bytes(data.encode('utf-8')) print('Catalog generated') return 0 diff --git a/tooling/catalog/tests/test_catalog.py b/tooling/catalog/tests/test_catalog.py index a46bd87..50e69a1 100644 --- a/tooling/catalog/tests/test_catalog.py +++ b/tooling/catalog/tests/test_catalog.py @@ -168,6 +168,13 @@ def test_a_hand_written_entry_must_be_in_canonical_form(self): with mock.patch.object(catalog, 'ROOT', Path(root.name)): with mock.patch('sys.argv', ['catalog.py']): self.assertEqual(0, catalog.main()) + crlf = sidecar.read_bytes().replace(b'\n', b'\r\n') + sidecar.write_bytes(crlf) + with mock.patch('sys.argv', ['catalog.py', '--check']): + self.assertEqual(1, catalog.main(), 'CRLF') + with mock.patch('sys.argv', ['catalog.py']): + self.assertEqual(0, catalog.main()) + self.assertNotIn(b'\r', sidecar.read_bytes()) for spelling in (sidecar.read_text() + '\n', json.dumps(json.loads(sidecar.read_text())), json.dumps(dict(reversed(list(json.loads(sidecar.read_text()).items()))), indent=2) + '\n'): sidecar.write_text(spelling) with mock.patch('sys.argv', ['catalog.py', '--check']): @@ -188,6 +195,13 @@ def test_check_flags_a_stale_catalog_and_accepts_a_fresh_one(self): self.assertEqual(0, catalog.main()) write(root.name, 'demo/agents/main/workflows/w.json', json.dumps({'workflow_id': 'w', 'actions': []})) self.assertEqual(1, catalog.main()) + write(root.name, 'demo/agents/main/workflows/w.json', json.dumps({'workflow_id': 'w', 'actions': [ + {'id': 'a', 'type': 'code_execution'}, {'id': 'b', 'type': 'code_execution', 'runtime': 'wasm'}, {'id': 'c', 'type': 'llm_call'}]})) + with mock.patch('sys.argv', ['catalog.py', '--check']): + self.assertEqual(0, catalog.main()) + published = Path(root.name) / 'catalog.json' + published.write_bytes(published.read_bytes().replace(b'\n', b'\r\n')) + self.assertEqual(1, catalog.main(), 'CRLF in catalog.json') if __name__ == '__main__':