truthmark 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,231 +1,193 @@
1
1
  # Truthmark
2
2
 
3
- **Your agents write code. Truthmark maintains human-facing, Git-reviewable documentation.**
3
+ **Your agents write code. Truthmark maintains the human-facing, Git-reviewable documentation.**
4
+
5
+ Truthmark installs Git-native workflows that let AI coding agents create new product and engineering documentation from existing code and tests, keep it current after every code change, and hand you ordinary Markdown diffs for review.
4
6
 
5
7
  [![npm version](https://img.shields.io/npm/v/truthmark?color=cb3837&label=npm)](https://www.npmjs.com/package/truthmark)
6
8
  [![CI](https://github.com/merlinhu1/truthmark/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/merlinhu1/truthmark/actions/workflows/ci.yml)
7
9
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
8
10
  [![Node.js >=24](https://img.shields.io/badge/node-%3E%3D24-339933?logo=node.js&logoColor=white)](package.json)
9
11
 
10
- [Website](https://merlinhu1.github.io/truthmark/) | [GitHub](https://github.com/merlinhu1/truthmark) | [User Guide](docs/user-guide.md)
12
+ [Get started](#quick-start-create-your-first-truth-document) · [Website](https://merlinhu1.github.io/truthmark/) · [User Guide](https://github.com/merlinhu1/truthmark/blob/main/docs/user-guide.md) · [GitHub](https://github.com/merlinhu1/truthmark)
13
+
14
+ <details>
15
+ <summary>Read this README in 16 languages</summary>
11
16
 
12
17
  [🇺🇸 English](README.md) | [🇨🇳 简体中文](docs/readmes/README.zh.md) | [🇯🇵 日本語](docs/readmes/README.ja.md) | [🇰🇷 한국어](docs/readmes/README.ko.md) | [🇩🇪 Deutsch](docs/readmes/README.de.md) | [🇫🇷 Français](docs/readmes/README.fr.md) | [🇪🇸 Español](docs/readmes/README.es.md) | [🇧🇷 Português](docs/readmes/README.pt.md) | [🇷🇺 Русский](docs/readmes/README.ru.md) | [🇸🇦 العربية](docs/readmes/README.ar.md) | [🇮🇹 Italiano](docs/readmes/README.it.md) | [🇵🇱 Polski](docs/readmes/README.pl.md) | [🇹🇷 Türkçe](docs/readmes/README.tr.md) | [🇻🇳 Tiếng Việt](docs/readmes/README.vi.md) | [🇮🇩 Bahasa Indonesia](docs/readmes/README.id.md) | [🇬🇷 Ελληνικά](docs/readmes/README.el.md)
13
18
 
14
- ![Truthmark banner](docs/assets/truthmark-banner.png)
19
+ </details>
15
20
 
16
- ## 🚀 Quick Start: running locally in five minutes
21
+ ## Create the first docs. Keep them true.
17
22
 
18
- Run this inside the Git repository you want Truthmark to manage:
23
+ Most documentation tools stop after generation. Truthmark gives agents a complete documentation lifecycle inside your repository:
19
24
 
20
- ```bash
21
- cd /path/to/your-repo
22
- npm install -g truthmark
23
- truthmark init
24
- truthmark check
25
- git diff
26
- ```
25
+ - **Create new docs from working software.** Truth Document reads code and tests, then creates bounded product or engineering documentation.
26
+ - **Keep docs aligned automatically.** Truth Sync runs at agent handoff after functional code changes and updates repository truth before the work is finished.
27
+ - **Turn docs back into code.** Truth Realize implements approved truth docs while preserving a clean doc-first workflow.
28
+ - **Repair ownership as the codebase grows.** Truth Structure creates bounded routes and starter docs for new or overloaded areas.
29
+ - **Review everything in Git.** Code, decisions, contracts, architecture, operations, and behavior travel together with the branch.
30
+
31
+ No hosted knowledge base. No private agent memory. No documentation trapped in chat history.
27
32
 
28
- In an interactive terminal, `truthmark init` shows a numbered multi-select for Codex, Claude Code, GitHub Copilot, OpenCode, Antigravity, and Cursor. Select zero or more hosts; choose `none` for a host-neutral, CLI-only repository.
33
+ ## Quick Start: create your first truth document
29
34
 
30
- For scripts and CI, repeat `--platform` to replace the selected host set without prompting:
35
+ **Requirements:** Node.js 24 or newer, a Git repository, and a supported AI coding host for agent workflows.
36
+
37
+ Run this inside the repository you want Truthmark to manage:
31
38
 
32
39
  ```bash
33
- truthmark init --platform codex --platform cursor
34
- truthmark init --json
40
+ cd /path/to/your-repo
41
+ npm install -g truthmark
42
+ truthmark init
35
43
  ```
36
44
 
37
- `--json` never prompts. On a first noninteractive run with no `--platform`, initialization stays host-neutral; later reruns retain the platforms already saved in `.truthmark/config.yml`.
45
+ `truthmark init` lets you select Codex, Claude Code, GitHub Copilot, OpenCode, Antigravity, Cursor, or a host-neutral command-line interface setup.
38
46
 
39
- Now try the most common adoption path: document one existing behavior from code and tests. In your AI coding host, ask the installed workflow:
47
+ Now ask your configured agent to document one real behavior:
40
48
 
41
49
  ```text
42
50
  /truthmark-document document the implemented session timeout behavior across src/auth/session.ts and tests/auth/session.test.ts
43
51
  ```
44
52
 
45
- After that, users should not normally invoke Truth Sync directly. Keep coding through your AI host; the installed repository instructions tell the agent to run relevant tests and perform the Truth Sync review before handoff when functional code changes. You review the resulting code diff plus truth-doc diff.
46
-
47
- If you only want CLI validation and do not want host-specific AI workflows yet, select `none` and continue with `truthmark check`; you can rerun `truthmark init` later to select platforms.
48
-
49
- ## 💡 The Problem: The AI Documentation Gap
50
-
51
- AI coding agents are incredible at writing code fast. But this speed creates a dangerous new failure mode: **the repository's story drifts from reality.**
53
+ Truth Document creates a new bounded truth doc when one does not exist, updates an existing owner when it does, and updates routing when needed. It does not change functional code.
52
54
 
53
- * Behavior is lost in ephemeral chat histories.
54
- * Architecture documents quickly fall behind.
55
- * Product decisions vanish after handoff.
56
- * Code reviewers are left examining raw code diffs without understanding the "why."
57
- * Every new AI session is forced to rediscover your repository's truth from scratch.
55
+ Review the result:
58
56
 
59
- ## 🎯 The Solution: Truthmark
60
-
61
- **Truthmark** installs a Git-native workflow layer into your repository. It fixes the part of AI development that usually breaks: keeping documentation aligned with code after the first draft.
62
-
63
- Instead of hoping humans and AI agents remember to update docs, Truthmark makes documentation a systematic, reviewable habit right inside your repo.
64
-
65
- Truthmark is not a one-shot docs generator. It is an ongoing truth-doc curation loop that keeps human-facing docs small, owned, evidence-backed, and reviewable as agents keep changing code.
66
-
67
- ### ✨ Why Truthmark is Unique
57
+ ```bash
58
+ truthmark check
59
+ git status --short --untracked-files=all
60
+ git diff
61
+ ```
68
62
 
69
- Truthmark isn't just another documentation tool. It is deeply integrated into the AI workflow:
63
+ You should now have:
70
64
 
71
- * **🚫 Zero Vendor Lock-in:** No hosted services, no hidden databases, no extra servers to operate.
72
- * **🌳 100% Git-Native:** Everything lives in your repository. The truth moves with your branch.
73
- * **🤝 Human-owned, agent-followed contract:** Maintainers own the repo contract; agents follow the installed instructions while coding.
74
- * **🧭 Ongoing truth curation:** Broad or messy docs are routed toward Structure instead of becoming giant catch-all files.
75
- * **✅ Trust Through Verification:** AI work becomes easier to trust because behavior-changing work includes a human-reviewable truth-doc decision or diff.
65
+ ```text
66
+ docs/truthmark/engineering/behaviors/session-timeout.md
67
+ docs/truthmark/routes/areas/authentication.md
68
+ ```
76
69
 
77
- ## 🔄 How It Works
70
+ The exact paths follow your repository’s ownership structure. New files appear in `git status`; changes to tracked files appear in `git diff`.
78
71
 
79
- When an AI agent modifies your code, the job isn't finished. Truthmark installs a finish-time workflow guard that agents follow before handoff:
72
+ Invocation varies by host. OpenCode uses `/skill truthmark-document`, Antigravity uses `@truthmark-document`, and other supported hosts use their native skill or slash-command surface. See the [platform table](https://github.com/merlinhu1/truthmark/blob/main/docs/user-guide.md#supported-agent-platforms) for exact commands.
80
73
 
81
- 1. 💻 **Code:** Agent modifies functional code.
82
- 2. 🧪 **Test:** Relevant tests are executed.
83
- 3. 🔍 **Check:** Truthmark checks mapped documentation as part of the installed finish-time review.
84
- 4. 📝 **Document:** Docs are updated by the agent when repository truth has changed.
85
- 5. 👀 **Review:** A human reviews the *code diff* + the *truth diff*.
74
+ For scripts and continuous integration, pass the selected platforms explicitly:
86
75
 
87
- ## 🛠 How you interact with Truthmark
76
+ ```bash
77
+ truthmark init --platform codex --platform cursor
78
+ truthmark init --json
79
+ ```
88
80
 
89
- Truthmark has one repo-local contract with two ways to use it.
81
+ Choose `none` interactively or run `truthmark init --clear-platforms` for a host-neutral repository. You can add agent platforms later by rerunning `truthmark init`.
90
82
 
91
- ### Humans install and validate the contract
83
+ For branch-relative freshness diagnostics, pass a Git base:
92
84
 
93
- Maintainers and CI use the CLI:
85
+ ```bash
86
+ truthmark check --base <base-ref>
87
+ ```
94
88
 
95
- * `truthmark init` - create or refresh configuration, select zero or more platforms, and install routing, truth-doc scaffolds, and selected AI-host instructions.
96
- * `truthmark check` - validate the repository truth from the terminal.
97
- * `truthmark uninstall --dry-run|--apply` - preview or remove generated host surfaces while preserving authored truth and configuration.
89
+ ## How Truthmark works
98
90
 
99
- ### Agents follow the contract while coding
91
+ <picture>
92
+ <source media="(max-width: 700px)" srcset="docs/assets/truthmark-workflow-mobile.svg">
93
+ <img src="docs/assets/truthmark-workflow.svg" alt="How Truthmark works" width="1440">
94
+ </picture>
100
95
 
101
- Truthmark installs repo-local instructions for supported AI coding hosts such as Codex, Claude Code, GitHub Copilot, OpenCode, Antigravity, and Cursor.
96
+ The Truthmark command-line interface installs and validates the repository contract. Your coding agent performs the evidence review and documentation work through the installed host-native workflows.
102
97
 
103
- The normal loop is simple:
98
+ A normal code change follows one simple loop:
104
99
 
105
- 1. Ask your agent for a code change, or ask it to document existing behavior.
106
- 2. The installed instructions tell the agent when to test, when to update truth docs, and when to stop for human review.
107
- 3. You review ordinary Git diffs: code plus any truth-doc changes.
100
+ 1. The agent changes functional code.
101
+ 2. Relevant tests run.
102
+ 3. Truth Sync checks the mapped documentation.
103
+ 4. The agent creates or updates docs and routing when repository truth changed.
104
+ 5. You review the code diff and truth diff together.
108
105
 
109
- The user-started agent requests are intentionally few:
106
+ ## Workflows
110
107
 
111
- * `/truthmark-document` - document existing implemented behavior from code and tests.
112
- * `/truthmark-realize` - implement code from existing truth docs.
113
- * `/truthmark-check` - audit repository truth.
108
+ | Workflow | Use it when | Result |
109
+ | -------------------- | --------------------------------------------------------- | ----------------------------------------------------------------------- |
110
+ | **Truth Document** | Existing code needs documentation | Creates or updates evidence-backed product and engineering docs |
111
+ | **Truth Sync** | Functional code changed | Keeps mapped docs and routing aligned before handoff |
112
+ | **Truth Structure** | A new area needs ownership or existing docs are too broad | Creates bounded routes and skeletal starter docs |
113
+ | **Truth Realize** | An approved truth doc should become working software | Updates functional code from documentation |
114
+ | **Truth Check** | Repository truth needs an audit | Reports routing, ownership, evidence, and documentation issues |
115
+ | **Truthmark Portal** | The team wants a browsable documentation site | Generates a committed static HTML presentation from Markdown truth docs |
114
116
 
115
- Truth Sync is not the usual way to start work; it is the finish-time review after functional code changes.
116
- Truth Structure is not a day-to-day command; it repairs routing or ownership only when that blocks the work.
117
+ Truthmark installs these workflows as native repository surfaces for Codex, Claude Code, GitHub Copilot, OpenCode, Antigravity, and Cursor.
117
118
 
118
119
  ## What you get
119
120
 
120
- | Capability | What it does |
121
- | --- | --- |
122
- | Git-native truth | Keeps repository truth in committed Markdown and config. |
123
- | Branch-scoped documentation | Truth moves with the branch instead of living in a private session. |
124
- | Human CLI | Gives maintainers setup, refresh, validation, and inspection commands. |
125
- | Installed agent guidance | Tells coding agents when to document, test, sync truth, audit, or stop for review. |
126
- | Explicit routing | Maps code areas to canonical truth docs. |
127
- | Durable truth curation | Keeps docs bounded, evidence-backed, and reviewable instead of letting them grow into catch-all files. |
128
- | Reviewable handoffs | Produces ordinary Git diffs for both code and truth docs. |
129
- | Local-first operation | Requires no hosted service, daemon, database, or MCP server. |
130
- | Safer write boundaries | Separates code-first, doc-first, read-only, and doc-only workflows. |
131
- | Validation | Reports routing, authority, frontmatter, link, generated-surface, branch-scope, freshness, and coverage issues. |
132
- | Optional Portal | Generates a committed static HTML presentation site from Markdown truth docs when explicitly enabled and requested. |
133
-
134
- ## Visual overview
135
-
136
- ![Truthmark features](docs/assets/truthmark-features.png)
137
-
138
- **Features:** what Truthmark installs and how agents use repo-local instructions.
121
+ ### Documentation that starts from reality
139
122
 
140
- ![Truthmark position](docs/assets/truthmark-position.png)
123
+ Truthmark can create documentation for product capabilities, implementation behavior, application programming interfaces, architecture, workflows, operations, and tests. Code and tests provide the evidence; bounded Markdown docs preserve the result.
141
124
 
142
- **Position:** where Truthmark fits relative to prompts, memory, and spec workflows.
125
+ ### Documentation that survives the next change
143
126
 
144
- ![Truthmark sync flow](docs/assets/truthmark-syncflow.png)
127
+ Routes connect code areas to canonical docs. When agents change behavior, Truth Sync knows where the corresponding truth belongs and keeps the handoff reviewable.
145
128
 
146
- **Sync flow:** how Truth Sync closes out normal code changes before handoff.
129
+ ### Product and engineering truth in separate lanes
147
130
 
148
- ## Why teams adopt it
131
+ Product truth captures user-facing promises, boundaries, decisions, and acceptance criteria. Engineering truth captures current behavior, contracts, architecture, workflows, operations, and test behavior.
149
132
 
150
- Truthmark is for teams that already know AI agents can generate code.
133
+ ### Git-native collaboration
151
134
 
152
- The next problem is governance.
135
+ Everything important lives in committed repository files. Truth follows the branch, works with ordinary pull requests, and remains visible to every maintainer and coding agent.
153
136
 
154
- Not governance as ceremony. Governance as a simple question:
137
+ ### Local-first operation
155
138
 
156
- > After this AI-assisted change, does the repository still tell the truth?
157
-
158
- Truthmark helps teams answer that with committed files, explicit routing, and reviewable diffs.
159
-
160
- Most AI tools can draft documentation. Truthmark keeps repository truth curated after the draft, after the next code change, and after the doc starts getting too broad.
161
-
162
- It is useful when you need:
163
-
164
- - less documentation drift
165
- - better handoffs
166
- - branch-specific product truth
167
- - durable architecture and API documentation
168
- - explicit ownership between docs and code
169
- - safer agent write boundaries
170
- - reviewable documentation instead of hidden memory
171
- - agent guidance that still works from committed repo files
139
+ Truthmark needs no hosted service, daemon, database, vector store, or Model Context Protocol server. The repository carries its own documentation workflow.
172
140
 
173
141
  ## Where Truthmark fits
174
142
 
175
- Truthmark does not replace prompts, memory, specs, tests, or code review.
176
-
177
- It gives those workflows a durable place to land in Git.
178
-
179
- | Need | Better fit |
180
- | --- | --- |
181
- | Better output from one agent session | Better prompt |
182
- | Personal or session-level continuity | Memory tool |
183
- | Plan-first feature work | Spec workflow |
184
- | Branch-scoped truth that travels with code | Truthmark |
185
- | Validating behavior correctness | Tests and review |
186
- | Reviewing AI-assisted documentation changes | Truthmark plus Git review |
187
-
188
- Truthmark’s lane is narrow by design:
189
-
190
- ```text
191
- make repository truth explicit
192
- route it to code
193
- install agent guidance around it
194
- keep the result reviewable in Git
195
- ```
196
-
197
- ## Go deeper
198
-
199
- The README is the storefront: fast context, quick start, and the core mental model.
143
+ | Need | Best fit |
144
+ | -------------------------------------------------- | -------------------------- |
145
+ | Better output from one agent session | Better prompt |
146
+ | Personal or session-level continuity | Memory tool |
147
+ | Plan-first feature work | Specification workflow |
148
+ | Branch-scoped documentation that travels with code | **Truthmark** |
149
+ | Behavior correctness | Tests and code review |
150
+ | Reviewable AI-assisted documentation | **Truthmark + Git review** |
200
151
 
201
- The [static website](https://merlinhu1.github.io/truthmark/) is the concise public introduction for GitHub Pages.
152
+ Truthmark is built for maintainers and engineering teams that already use AI coding agents and want the repository to keep telling the truth as fast as the code changes.
202
153
 
203
- For command-by-command usage, surface comparisons, supported platform details, configuration, routing, Portal, and examples, read the [Truthmark User Guide](docs/user-guide.md).
154
+ ## Supported hosts and command line
204
155
 
205
- ## Project status
156
+ Supported agent hosts:
206
157
 
207
- Truthmark 2.3 provides:
158
+ - Codex
159
+ - Claude Code
160
+ - GitHub Copilot
161
+ - OpenCode
162
+ - Antigravity
163
+ - Cursor
208
164
 
209
- - local CLI commands for init, uninstall, check, index, impact, workflow status, and validate
210
- - generated repo-local agent instructions for Codex, Claude Code, GitHub Copilot, OpenCode, Antigravity, and Cursor
211
- - route, authority, frontmatter, link, freshness, generated-surface, branch-scope, and coverage diagnostics
212
- - branch-scoped truth docs and derived repository-intelligence artifacts
165
+ <details>
166
+ <summary>Command-line reference</summary>
213
167
 
214
- ## Documentation
168
+ | Command | Purpose |
169
+ | ----------------------------------------------------------------- | -------------------------------------------------------------------------------- |
170
+ | `truthmark init` | Create or refresh configuration, routing, templates, and selected host workflows |
171
+ | `truthmark check [--base <ref>]` | Validate repository truth and optionally run branch-freshness diagnostics |
172
+ | `truthmark index --json` | Inspect derived repository and routing metadata |
173
+ | `truthmark impact --base <ref> --json` | Map changed files to docs, owners, and nearby tests |
174
+ | `truthmark workflow status --workflow <id> [--base <ref>] --json` | Inspect workflow applicability and targets |
175
+ | `truthmark validate ...` | Validate workflow reports and write leases |
176
+ | `truthmark uninstall --dry-run` / `truthmark uninstall --apply` | Preview or remove generated host surfaces while preserving authored truth |
215
177
 
216
- - [User guide](docs/user-guide.md)
217
- - [Docs index](docs/README.md)
218
- - [Architecture overview](docs/truthmark/engineering/architecture/overview.md)
219
- - [API and CLI contracts](docs/truthmark/engineering/contracts/config-route-and-check-contracts.md)
220
- - [Repository truth maintenance guide](docs/standards/maintaining-repository-truth.md)
178
+ Structured JSON output is available throughout the command-line interface for scripts and continuous integration.
221
179
 
222
- For local development and contribution commands, see [CONTRIBUTING.md](CONTRIBUTING.md).
180
+ </details>
223
181
 
224
- ## Design boundaries
182
+ ## Learn more
225
183
 
226
- Truthmark is intentionally small: local, committed, branch-scoped, and reviewable.
184
+ - [Truthmark User Guide](https://github.com/merlinhu1/truthmark/blob/main/docs/user-guide.md)
185
+ - [Documentation index](https://github.com/merlinhu1/truthmark/blob/main/docs/README.md)
186
+ - [Architecture overview](https://github.com/merlinhu1/truthmark/blob/main/docs/truthmark/engineering/architecture/overview.md)
187
+ - [Configuration, routing, and command contracts](https://github.com/merlinhu1/truthmark/blob/main/docs/truthmark/engineering/contracts/config-route-and-check-contracts.md)
188
+ - [Contributing](https://github.com/merlinhu1/truthmark/blob/main/CONTRIBUTING.md)
227
189
 
228
- It is not a hosted service, MCP server, vector database, hidden memory layer, CI enforcement product, or autonomous code rewrite engine. It helps repository truth stay visible; it does not replace tests, code review, or human judgment.
190
+ **Install Truthmark, select your coding host, and turn one real behavior into documentation today.**
229
191
 
230
192
  ## License
231
193