truthmark 1.6.1 → 2.1.0

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,12 +1,12 @@
1
1
  # Truthmark
2
2
 
3
- **Your agents write code. Truthmark makes their context reviewable in Git.**
3
+ **Your agents write code. Truthmark maintains human-facing, Git-reviewable documentation.**
4
4
 
5
5
  English | [Deutsch](README.de.md) | [中文](README.zh.md) | [Español](README.es.md) | [Русский](README.ru.md)
6
6
 
7
7
  ![Truthmark banner](docs/assets/truthmark-banner.png)
8
8
 
9
- AI coding agents can change a repository faster than humans can keep its context aligned.
9
+ AI coding agents can change a repository faster than humans can keep its documentation aligned.
10
10
 
11
11
  Truthmark fixes the part that usually breaks after the code is written: the repository truth.
12
12
 
@@ -33,9 +33,9 @@ The implementation changes, but the repository story drifts:
33
33
  - product decisions disappear after handoff
34
34
  - reviewers see code diffs without the related truth diffs
35
35
  - branches quietly develop different versions of “what is true”
36
- - each agent session has to rediscover context from scratch
36
+ - each agent session has to rediscover repository truth from scratch
37
37
 
38
- Truthmark turns that fragile context into committed repository infrastructure.
38
+ Truthmark turns that fragile repository truth into committed repository infrastructure.
39
39
 
40
40
  Instead of relying on every human and every agent to remember the right documentation habit, Truthmark installs the habit into the repository.
41
41
 
@@ -66,7 +66,7 @@ It has two distinct surfaces, and the distinction matters.
66
66
 
67
67
  The CLI is for maintainers, reviewers, and automation.
68
68
 
69
- Use it to configure a repository, install or refresh workflow files, validate truth artifacts, and generate optional review context.
69
+ Use it to configure a repository, install or refresh workflow files, validate truth artifacts, and generate optional review material.
70
70
 
71
71
  ```bash
72
72
  truthmark config
@@ -179,6 +179,14 @@ Ask your agent to split the broad route into actual product, service, domain, or
179
179
  /truthmark-structure split the broad repository area into auth, billing, and notifications
180
180
  ```
181
181
 
182
+ If the project already has implemented features but missing or weak truth docs, ask the installed Truth Document workflow to document a focused scope:
183
+
184
+ ```text
185
+ /truthmark-document document the implemented payment retry behavior in src/billing/retry.ts and related tests
186
+ ```
187
+
188
+ Truth Document is the common first workflow for existing projects. It inspects implementation, tests, routes, and existing docs, then creates or repairs truth docs and routing without changing functional code.
189
+
182
190
  After that, use your AI coding agent normally.
183
191
 
184
192
  When the agent changes functional code, Truth Sync acts as the finish-time guard that checks whether mapped truth docs need to change before handoff.
@@ -188,7 +196,7 @@ When the agent changes functional code, Truth Sync acts as the finish-time guard
188
196
  | Capability | What it does |
189
197
  | --- | --- |
190
198
  | Git-native truth | Keeps repository truth in committed Markdown and config. |
191
- | Branch-scoped context | Truth moves with the branch instead of living in a private session. |
199
+ | Branch-scoped documentation | Truth moves with the branch instead of living in a private session. |
192
200
  | Human CLI | Gives maintainers setup, refresh, validation, and inspection commands. |
193
201
  | AI-facing workflows | Gives agents host-native workflows for sync, documentation, structure, preview, realization, and audit. |
194
202
  | Explicit routing | Maps code areas to canonical truth docs. |
@@ -229,10 +237,10 @@ It is useful when you need:
229
237
  - less documentation drift
230
238
  - better handoffs
231
239
  - branch-specific product truth
232
- - durable architecture and API context
240
+ - durable architecture and API documentation
233
241
  - explicit ownership between docs and code
234
242
  - safer agent write boundaries
235
- - reviewable context instead of hidden memory
243
+ - reviewable documentation instead of hidden memory
236
244
  - AI workflows that still work from committed repo files
237
245
 
238
246
  ## Where Truthmark fits
@@ -248,7 +256,7 @@ It gives those workflows a durable place to land in Git.
248
256
  | Plan-first feature work | Spec workflow |
249
257
  | Branch-scoped truth that travels with code | Truthmark |
250
258
  | Validating behavior correctness | Tests and review |
251
- | Reviewing AI-assisted context changes | Truthmark plus Git review |
259
+ | Reviewing AI-assisted documentation changes | Truthmark plus Git review |
252
260
 
253
261
  Truthmark’s lane is narrow by design:
254
262
 
@@ -329,7 +337,7 @@ They are used by agents or agent hosts during repository work. They are not top-
329
337
  | Truth Preview | read-only | The agent needs to preview likely routing before edits. | Reads only. Does not authorize writes. |
330
338
  | Truth Realize | doc-first | Product or architecture truth docs lead and code should be updated to match. | Updates code only. The agent must not edit the truth docs it is realizing. |
331
339
  | Truth Check | audit-first | A reviewer or agent needs to audit repository truth health. | Audits and reports. |
332
- | Truthmark Portal | presentation-only | A human explicitly asks for a browsable static HTML Portal over repository truth docs. | Writes generated non-canonical static files only under the configured Portal output directory. |
340
+ | Truthmark Portal | presentation-only | A human explicitly asks for a browsable static HTML Portal over repository truth docs. | Writes generated non-canonical static files only under the fixed Portal output directory. |
333
341
 
334
342
  ### Important distinction
335
343
 
@@ -365,12 +373,16 @@ Direct invocation is still useful for troubleshooting, forcing an early sync, or
365
373
 
366
374
  ## Existing behavior without docs
367
375
 
368
- Use Truth Document when the implementation already exists but the repository truth is incomplete.
376
+ Use Truth Document when the implementation already exists but the repository truth is incomplete. This is the normal path for established repositories adopting Truthmark after the codebase already exists.
369
377
 
370
378
  ```text
371
- /truthmark-document document the implemented session timeout behavior under docs/truth/authentication
379
+ /truthmark-document document the implemented session timeout behavior across src/auth/session.ts, src/auth/middleware.ts, and tests/auth/session.test.ts
372
380
  ```
373
381
 
382
+ Give it the feature name, code paths, test paths, or desired truth-doc area. On OpenCode-style hosts, call the same workflow as `/skill truthmark-document ...`; on Gemini CLI, use `/truthmark:document ...`.
383
+
384
+ For a large repo that still has one broad placeholder route, run Truth Structure first, then invoke Truth Document for one bounded feature or area at a time.
385
+
374
386
  Truth Document inspects implementation, tests, route files, and existing docs as evidence.
375
387
 
376
388
  It writes truth docs and routing only.
@@ -382,7 +394,7 @@ It must not change functional code.
382
394
  Use Truth Realize when a product or architecture decision starts in docs and code should be updated to match.
383
395
 
384
396
  ```text
385
- /truthmark-realize realize docs/truth/authentication/session-timeout.md into code
397
+ /truthmark-realize realize docs/truthmark/truth/authentication/session-timeout.md into code
386
398
  ```
387
399
 
388
400
  Truth Realize is doc-first.
@@ -429,7 +441,7 @@ Most maintainers start with three commands.
429
441
  | `truthmark init` | Install or refresh configured workflow surfaces from the reviewed config. |
430
442
  | `truthmark check` | Validate configuration, authority, routing, decision-bearing docs, frontmatter, internal links, branch scope, generated surfaces, freshness, and coverage diagnostics. |
431
443
 
432
- Optional repository-intelligence helpers generate derived review context for the active checkout. Generated workflow skill packages may also expose helper manifests and helper policies that call installed `truthmark validate ... --json` CLI validators; those helpers are accelerators, not bundled repo-local scripts or sources of truth. Standalone Copilot prompts and Gemini commands use the same CLI validator contract when the installed runner is available, and otherwise report a visible skipped helper status with manual validation.
444
+ Optional repository-intelligence helpers generate derived review material for the active checkout, such as RepoIndex, RouteMap, ImpactSet, and bounded ContextPack artifacts. Generated workflow skill packages may also expose helper manifests and helper policies that call installed `truthmark validate ... --json` CLI validators; those helpers are accelerators, not bundled repo-local scripts or sources of truth. Standalone Copilot prompts and Gemini commands use the same CLI validator contract when the installed runner is available, and otherwise report a visible skipped helper status with manual validation.
433
445
 
434
446
  They are not sources of truth.
435
447
 
@@ -450,16 +462,16 @@ It is deliberately separate from the core truth workflow:
450
462
  - Markdown truth docs remain canonical.
451
463
  - Generated Portal HTML is presentation only.
452
464
  - Portal is manual-only; it does not run as a completion gate, Truth Sync step, `truthmark check` step, or automatic post-change hook.
453
- - Portal writes stay inside the configured output directory unless the user explicitly changes scope.
465
+ - Portal writes stay inside the fixed Truthmark-derived output directory.
454
466
  - Generated pages should use local assets, source provenance, and a visible Markdown-canonical disclaimer.
455
467
 
456
468
  Enable it with the namespaced config block:
457
469
 
458
470
  ```yaml
459
- truthmark-portal:
460
- enabled: true
461
- output: docs/truthmark-portal
462
- template: default
471
+ truthmark:
472
+ generated:
473
+ portal:
474
+ enabled: true
463
475
  ```
464
476
 
465
477
  Then rerun:
@@ -498,14 +510,14 @@ Important config areas include:
498
510
  | --- | --- |
499
511
  | `version` | Config contract version. |
500
512
  | `platforms` | Agent hosts that should receive platform-specific generated surfaces. |
501
- | `docs.layout` | Current docs layout mode. |
502
- | `docs.roots` | Named canonical documentation roots. |
503
- | `docs.routing.root_index` | Root route index path. |
504
- | `docs.routing.area_files_root` | Directory for delegated child route files. |
505
- | `docs.routing.default_area` | Initial scaffolded child route basename. |
506
- | `docs.routing.max_delegation_depth` | Current maximum route delegation depth. |
507
- | `truthmark-portal` | Optional manual presentation workflow settings: `enabled`, `output`, and `template`. |
508
- | `authority` | Ordered canonical docs and globs used as repository truth authority. |
513
+ | `truthmark.workspace` | Truthmark-owned workspace for routes, truth docs, templates, and generated presentation output. |
514
+ | `truthmark.routes.index` | Root route index path relative to `truthmark.workspace`. |
515
+ | `truthmark.routes.areas` | Directory for delegated child route files relative to `truthmark.workspace`. |
516
+ | `truthmark.routes.default_area` | Initial scaffolded child route basename. |
517
+ | `truthmark.routes.max_delegation_depth` | Current maximum route delegation depth. |
518
+ | `truthmark.truth.root` | Truth doc root relative to `truthmark.workspace`. |
519
+ | `truthmark.templates.root` | Truth-doc template root relative to `truthmark.workspace`. |
520
+ | `truthmark.generated.portal` | Optional manual presentation workflow enablement: `enabled`. |
509
521
  | `instruction_targets` | Files that receive shared managed instruction blocks, such as `AGENTS.md`. |
510
522
  | `frontmatter.required` | Metadata fields that produce error diagnostics when missing. |
511
523
  | `frontmatter.recommended` | Metadata fields that produce review diagnostics when missing. |
@@ -518,8 +530,8 @@ Truthmark maps code surfaces to truth docs.
518
530
  The main routing files are:
519
531
 
520
532
  ```text
521
- docs/truthmark/areas.md
522
- docs/truthmark/areas/**/*.md
533
+ docs/truthmark/routes/areas.md
534
+ docs/truthmark/routes/areas/**/*.md
523
535
  ```
524
536
 
525
537
  A route tells the agent:
@@ -549,7 +561,7 @@ It does this in four layers:
549
561
 
550
562
  - configuration and routing for ownership boundaries
551
563
  - canonical truth docs and starter templates
552
- - compact managed instruction blocks for repository-wide agent context
564
+ - compact managed instruction blocks for repository-wide agent instructions
553
565
  - host-native workflow packages, commands, prompts, and verifier agents for the platforms enabled in config
554
566
 
555
567
  Truthmark preserves manual content outside managed instruction blocks.
@@ -633,7 +645,7 @@ truthmark check
633
645
  ### Document implemented behavior
634
646
 
635
647
  ```text
636
- /truthmark-document document the implemented password reset flow under docs/truth/authentication
648
+ /truthmark-document document the implemented password reset flow under docs/truthmark/truth/authentication
637
649
  ```
638
650
 
639
651
  ### Sync after code changes
@@ -645,7 +657,7 @@ truthmark check
645
657
  ### Realize a doc-first decision
646
658
 
647
659
  ```text
648
- /truthmark-realize realize docs/truth/billing/invoice-retry-policy.md into code
660
+ /truthmark-realize realize docs/truthmark/truth/billing/invoice-retry-policy.md into code
649
661
  ```
650
662
 
651
663
  ### Audit truth health from the terminal
@@ -654,13 +666,13 @@ truthmark check
654
666
  truthmark check
655
667
  ```
656
668
 
657
- ### Generate branch-impact context
669
+ ### Generate branch-impact summary
658
670
 
659
671
  ```bash
660
672
  truthmark impact --base main
661
673
  ```
662
674
 
663
- ### Generate workflow context
675
+ ### Generate a workflow ContextPack
664
676
 
665
677
  ```bash
666
678
  truthmark context --workflow truth-sync --base main --format markdown
@@ -669,10 +681,10 @@ truthmark context --workflow truth-sync --base main --format markdown
669
681
  ### Enable the optional Portal workflow
670
682
 
671
683
  ```yaml
672
- truthmark-portal:
673
- enabled: true
674
- output: docs/truthmark-portal
675
- template: default
684
+ truthmark:
685
+ generated:
686
+ portal:
687
+ enabled: true
676
688
  ```
677
689
 
678
690
  ```bash
@@ -746,11 +758,11 @@ The README is the fast path for evaluation and setup.
746
758
  Detailed current behavior lives under `docs/`:
747
759
 
748
760
  - [Docs index](docs/README.md)
749
- - [Architecture overview](docs/architecture/overview.md)
750
- - [API and CLI contracts](docs/truth/contracts.md)
751
- - [Init and scaffold behavior](docs/truth/init-and-scaffold.md)
752
- - [Check diagnostics](docs/truth/check-diagnostics.md)
753
- - [Installed workflows](docs/truth/workflows/overview.md)
761
+ - [Architecture overview](docs/truthmark/truth/architecture/overview.md)
762
+ - [API and CLI contracts](docs/truthmark/truth/contracts.md)
763
+ - [Init and scaffold behavior](docs/truthmark/truth/init-and-scaffold.md)
764
+ - [Check diagnostics](docs/truthmark/truth/check-diagnostics.md)
765
+ - [Installed workflows](docs/truthmark/truth/workflows/overview.md)
754
766
  - [Repository truth maintenance guide](docs/standards/maintaining-repository-truth.md)
755
767
 
756
768
  ## Design boundaries
@@ -787,7 +799,7 @@ Teams should still:
787
799
  - review generated workflow-surface diffs after upgrades
788
800
  - keep human ownership over product and architecture decisions
789
801
 
790
- Truthmark makes agent context visible. It does not replace human judgment.
802
+ Truthmark makes agent-facing repository truth visible. It does not replace human judgment.
791
803
 
792
804
  ## Roadmap direction
793
805
 
@@ -807,7 +819,7 @@ The center of gravity stays the same:
807
819
  repository truth
808
820
  agent-native workflows
809
821
  Git review
810
- branch-scoped context
822
+ branch-scoped documentation
811
823
  ```
812
824
 
813
825
  ## License