From 3438b1f123f1c26149e134faa1f334354231402c Mon Sep 17 00:00:00 2001 From: MerlinH Date: Sat, 9 May 2026 19:39:39 +1000 Subject: [PATCH] chore: vrification flow fix and translation rule --- README.de.md | 14 ++++++++-- README.es.md | 14 ++++++++-- README.md | 12 +++++++- README.ru.md | 14 ++++++++-- README.zh.md | 14 ++++++++-- docs/ai/repo-rules.md | 1 + docs/standards/documentation-governance.md | 1 + tests/package-files.test.ts | 32 +++++++++++++++++++--- 8 files changed, 85 insertions(+), 17 deletions(-) diff --git a/README.de.md b/README.de.md index 8765d7c..3ba9241 100644 --- a/README.de.md +++ b/README.de.md @@ -66,7 +66,17 @@ Das ist das Kernversprechen: Agentenkontext wird zu festgeschriebenem Repository ## Erste Schritte -Wenn du Truthmark zunächst gegen ein anderes lokales Repository ausprobieren willst, bevor das Paket anderswo veröffentlicht ist: +Installiere Truthmark in dem Repository, das du initialisieren möchtest: + +```bash +cd /path/to/your-repo +npm install -D truthmark +npx truthmark config +npx truthmark init +npx truthmark check +``` + +Wenn du stattdessen unveröffentlichte Änderungen aus einem Source-Checkout ausprobieren möchtest: ```bash cd /path/to/truthmark @@ -194,8 +204,6 @@ V1 bietet derzeit: - Branch-Scope-Metadaten - Diagnostik für Konfiguration, Autorität, Routing, Entscheidungsstruktur, Frontmatter, Links und polyglotte Abdeckung -Es wird nicht angenommen, dass das ungescopte Paket `truthmark` bereits veröffentlicht ist. - ## Dokumentation Die Root-README ist für Menschen gedacht, die das Paket evaluieren und ausprobieren. Detaillierte funktionale und geschäftliche Spezifikationen liegen unter `docs/`: diff --git a/README.es.md b/README.es.md index 590ed66..d3a1a44 100644 --- a/README.es.md +++ b/README.es.md @@ -66,7 +66,17 @@ Esta es la promesa central: el contexto del agente pasa a ser estado confirmado ## Primeros pasos -Para probar Truthmark contra otro repositorio local antes de que el paquete se publique en otro lugar: +Instala Truthmark en el repositorio que quieras inicializar: + +```bash +cd /path/to/your-repo +npm install -D truthmark +npx truthmark config +npx truthmark init +npx truthmark check +``` + +Si quieres probar cambios aún no publicados desde un checkout del código fuente: ```bash cd /path/to/truthmark @@ -194,8 +204,6 @@ V1 actualmente ofrece: - metadatos de alcance de rama - diagnósticos de configuración, autoridad, enrutamiento, estructura de decisiones, frontmatter, enlaces y cobertura políglota -No se debe asumir que el paquete sin scope `truthmark` ya está publicado. - ## Documentación El README raíz es para personas que evalúan y prueban el paquete. Las especificaciones funcionales y de negocio detalladas viven en `docs/`: diff --git a/README.md b/README.md index c04dff3..d101658 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,17 @@ This is the core promise: agent context becomes committed repository state inste ## Get started -To try Truthmark from a source checkout instead of the published npm package: +Install Truthmark in the repository you want to initialize: + +```bash +cd /path/to/your-repo +npm install -D truthmark +npx truthmark config +npx truthmark init +npx truthmark check +``` + +If you want to try unreleased changes from a source checkout instead: ```bash cd /path/to/truthmark diff --git a/README.ru.md b/README.ru.md index 6a33eda..10a5eb0 100644 --- a/README.ru.md +++ b/README.ru.md @@ -66,7 +66,17 @@ Truthmark превращает истину репозитория в явную ## Начало работы -Чтобы попробовать Truthmark на другом локальном репозитории до публикации пакета где-либо еще: +Установите Truthmark в репозитории, который хотите инициализировать: + +```bash +cd /path/to/your-repo +npm install -D truthmark +npx truthmark config +npx truthmark init +npx truthmark check +``` + +Если вы хотите попробовать еще не выпущенные изменения из исходного checkout: ```bash cd /path/to/truthmark @@ -194,8 +204,6 @@ V1 сейчас предоставляет: - метаданные области ветки - диагностика конфигурации, полномочий, маршрутизации, структуры решений, frontmatter, ссылок и полиглотного покрытия -Не следует считать, что пакет `truthmark` без scope уже опубликован. - ## Документация Корневой README предназначен для людей, которые оценивают и пробуют пакет. Подробные функциональные и бизнес-спецификации находятся в `docs/`: diff --git a/README.zh.md b/README.zh.md index 6888dcf..e5526d2 100644 --- a/README.zh.md +++ b/README.zh.md @@ -66,7 +66,17 @@ Truthmark 把仓库事实变成代理可见的显式工作流载体: ## 快速开始 -如果想在包发布到其他地方之前,先在另一个本地仓库试用 Truthmark: +在你想初始化的仓库中安装 Truthmark: + +```bash +cd /path/to/your-repo +npm install -D truthmark +npx truthmark config +npx truthmark init +npx truthmark check +``` + +如果你想从源码检出中试用尚未发布的变更: ```bash cd /path/to/truthmark @@ -194,8 +204,6 @@ V1 目前提供: - 分支范围元数据 - 配置、权限边界、路由、决策结构、frontmatter、链接和多语言覆盖率诊断 -不要假定未带 scope 的 `truthmark` 包已经发布。 - ## 文档 根 README 面向评估和试用这个包的人。详细的功能和业务规范位于 `docs/` 下: diff --git a/docs/ai/repo-rules.md b/docs/ai/repo-rules.md index b564b67..84437b6 100644 --- a/docs/ai/repo-rules.md +++ b/docs/ai/repo-rules.md @@ -97,6 +97,7 @@ Current product boundaries: 7. **Docs change with behavior** - If a behavior, contract, workflow, or completion rule changes, update the nearest canonical doc in the same working change. - For major product, onboarding, install, command, positioning, or workflow changes, review the root [README.md](../../README.md) in the same working change and update stale user-facing claims, examples, or command sequences. + - When the root README changes materially, update the localized README variants in the same working change or explicitly confirm why they remain intentionally different. 8. **Keep onboarding honest** - The root README is not the canonical behavior spec, but it is the human entry point. It must not lag behind major product changes that affect how people understand, install, or use Truthmark. diff --git a/docs/standards/documentation-governance.md b/docs/standards/documentation-governance.md index b966390..47b1221 100644 --- a/docs/standards/documentation-governance.md +++ b/docs/standards/documentation-governance.md @@ -78,6 +78,7 @@ Do not create separate timestamped ADR folders, planning tickets, or historical - Behavior changes and truth-doc updates should land in the same working change when possible. - Major product, onboarding, install, command, positioning, or workflow changes should include a root README review in the same working change. Update the README when its human-facing claims, examples, or command sequences are stale. +- When the root README has localized variants, keep them aligned with the English README for materially changed install, command, positioning, and workflow guidance in the same working change, or explicitly document why a variant intentionally differs. - When routing changes, update `docs/truthmark/areas.md` and any affected canonical docs together. - When routing is broad, overloaded, or catch-all, run Truth Structure before adding more generic feature docs. - When a document stops being canonical, supersede or demote it explicitly. diff --git a/tests/package-files.test.ts b/tests/package-files.test.ts index ec8ea41..a43fb71 100644 --- a/tests/package-files.test.ts +++ b/tests/package-files.test.ts @@ -26,6 +26,22 @@ type PackFile = { mode: number; }; +const parsePackOutput = ( + stdout: string, +): Array<{ + files: PackFile[]; +}> => { + const jsonStartIndex = stdout.search(/^\s*\[\s*\{\s*$/m); + + if (jsonStartIndex === -1) { + throw new SyntaxError("npm pack output did not include a JSON array"); + } + + return JSON.parse(stdout.slice(jsonStartIndex)) as Array<{ + files: PackFile[]; + }>; +}; + const readPackageJson = async (): Promise<{ scripts?: Record; }> => { @@ -46,10 +62,7 @@ const readPackFiles = async (): Promise => { cwd: repoRoot, }, ); - const jsonStartIndex = stdout.indexOf("["); - const packOutput = JSON.parse(stdout.slice(jsonStartIndex)) as Array<{ - files: PackFile[]; - }>; + const packOutput = parsePackOutput(stdout); return packOutput[0]?.files ?? []; }; @@ -96,4 +109,15 @@ describe("package and release integrity", () => { "release:check": expect.any(String), }); }); + + it("parses npm pack JSON after bracketed build output", () => { + const packOutput = parsePackOutput(`build [1/2] +[ + { + "files": [] + } +]`); + + expect(packOutput).toEqual([{ files: [] }]); + }); });