refactor: simplify Truthmark workflow surfaces (#20)

* refactor: simplify Truthmark workflow surfaces

* fix: limit Preview workflow surfaces to supported hosts

* docs(truthmark): sync diff-friendly truth docs

* fix: prune retired generated surfaces

* fix: prune retired generated workflow surfaces

* docs: update truthmark architecture and runtime behavior notes

* chore: bump version to 2.2.3

---------

Co-authored-by: MerlinH <merlinh221@gmail.com>
This commit is contained in:
Merlin's Cat
2026-06-20 20:14:07 +10:00
committed by GitHub
co-authored by MerlinH
parent fb2c469005
commit 452f5eeafc
129 changed files with 1205 additions and 2614 deletions
@@ -24,5 +24,3 @@ Progressive disclosure:
- support/procedure.md — read before edits or detailed auditing; contains core review questions
- support/report-template.md — read before the final report
- support/subagents-and-leases.md — read only when using subagents, leases, or accepting worker output
- helper-manifest.yml — read only when invoking helper validators or validating helper registration
- support/helper-policy.md — read only when invoking helper validators or reporting helper status
@@ -1,34 +0,0 @@
# Truthmark-managed generated file. Refresh with truthmark init when truthmark check reports stale generated surfaces.
helpers:
validate-document-report:
optional: true
runner: truthmark
command:
argv:
- truthmark
- validate
- document-report
- <report-file>
- --json
inputs:
- document report file
output: json
writes: false
fallback: manually validate support/report-template.md required sections and structured Evidence checked entries
validate-write-lease:
optional: true
runner: truthmark
command:
argv:
- truthmark
- validate
- write-lease
- <lease-or-report-file>
- <changed-files-file>
- --json
inputs:
- lease or worker report yaml
- changed file list
output: json
writes: false
fallback: manually compare declared allowedWrites and forbiddenWrites with the actual changed files
@@ -1,23 +0,0 @@
# Optional Helper CLI Policy
Truthmark-managed generated file. Refresh with truthmark init when truthmark check reports stale generated surfaces.
Optional helper CLI commands may collect deterministic checkout facts or validate artifacts. If the Truthmark CLI is unavailable or cannot return the declared helper output, continue manually using this procedure and report which helper was skipped. Helper output is derived evidence; it does not override direct checkout inspection, workflow write boundaries, or parent acceptance.
Runner detection:
- Check that the declared Truthmark CLI runner is available before invoking a helper.
- Invoke helpers through the installed `truthmark validate ... --json` CLI command using argv-style arguments from helper-manifest.yml.
- If unavailable, failing, or returning incompatible output, treat the helper as skipped and use the manual fallback.
- Do not fail the workflow solely because a helper cannot run.
Available helpers:
- validate-document-report: optional truthmark; manual fallback: manually validate support/report-template.md required sections and structured Evidence checked entries
- validate-write-lease: optional truthmark; manual fallback: manually compare declared allowedWrites and forbiddenWrites with the actual changed files
Final reports should include helper status when helpers are declared for this workflow:
```md
Helper scripts:
- validate-document-report: ran, passed
- validate-write-lease: skipped, no write lease used
```
@@ -61,6 +61,7 @@ Treat the HTML comments under each template section as normative authoring guida
Align existing docs to that template and write or repair section content so it satisfies the comment guidance while preserving accurate authored content.
If the template is missing, use lane-specific sections: product truth says what must be true and why; engineering truth says how the repository currently realizes it.
Teams may edit template files under the configured Truthmark templates root to define their local truth-doc standards.
Prefer diff-friendly Markdown: one durable claim per bullet or line, paragraphs no longer than one or two short sentences, and bullets or tables for rules, criteria, fields, files, and lists.
Truth-doc shape repair review:
- Truth Document may restructure only truth docs for the implemented behavior being documented.
- repair shape in place only after the ownership review confirms the doc is the right bounded owner
@@ -79,12 +80,7 @@ Truthmark hierarchy hints:
Decision truth lives in the canonical doc it governs; date active decisions inline when added or changed.
Do not create separate active-decision ADR/planning logs; replace the active decision and let Git history carry the audit trail.
Product decisions belong in product truth; engineering, architecture, contract, workflow, and operational decisions belong in engineering truth.
Helper status reporting:
- Validate the report body before adding this validator's own success status; the body may omit `validate-document-report` while validation is pending.
- After `truthmark validate document-report <report-file> --json` returns `data.validation.ok: true`, append or update `validate-document-report: ran, passed` in the final report.
- If the installed Truthmark CLI is unavailable or the helper is skipped, record `validate-document-report: skipped, <reason>` and manually validate the report shape.
- Record `validate-write-lease: ran, passed` only after validating a concrete write lease; otherwise use a truthful skipped status such as `skipped, no write lease used`.
- Helper output is derived evidence and never replaces direct checkout inspection, evidence review, or parent acceptance.
Optional validation: when local tooling is available, you may validate the final report with `truthmark validate document-report <report-file> --json`; direct checkout inspection and evidence review remain authoritative.
Parent post-document verification:
- verify only truth docs and leased truth routing files changed during document work
- stop on functional code, generated host surfaces, or unrelated diffs caused by document work
@@ -29,9 +29,6 @@ Evidence checked:
Evidence: src/routing/area-resolver.ts:14 / docs/truthmark/routes/areas.md:9
Result: supported
Helper scripts:
- validate-write-lease: skipped, no write lease used
Notes:
- Documented routing and behavior from route handlers and tests.
```
@@ -1,25 +0,0 @@
---
name: truthmark-preview
description: Use when the user explicitly asks to preview likely workflow routing, target files, writes, or subagent use before edits. Not for validation, automatic gates, final correctness, or replacing Truth Check.
argument-hint: Optional requested outcome, code area, doc path, or routing question
user-invocable: true
---
# Truthmark Preview
Use this skill only when the user explicitly asks to preview Truthmark routing or workflow choice before edits.
Invocations: OpenCode /skill truthmark-preview; Codex /truthmark-preview or $truthmark-preview; Claude Code /truthmark-preview; GitHub Copilot /truthmark-preview; Gemini CLI /truthmark:preview.
Quick procedure:
- Follow repository instruction files that exist in this checkout; do not assume any optional policy path exists.
- Inspect .truthmark/config.yml and the root route index (docs/truthmark/routes/areas.md) first when present; then inspect only child route files under docs/truthmark/routes/areas/ that are relevant to the selected scope or changed paths, plus the truth docs or implementation files needed to preview ownership.
- Truth Preview is read-only; this report is intended, not authorized.
- must not edit files and must not issue write leases; do not run Truth Sync automatically, replace Truth Check, claim final correctness, or mutate code.
- Use optional read-only route-auditor evidence only when it reduces context or clarifies ownership.
- Hand off to the selected workflow after user approval.
Progressive disclosure:
- support/procedure.md — read before edits or detailed auditing; contains core review questions
- support/report-template.md — read before the final report
- support/subagents-and-leases.md — read only when using subagents, leases, or accepting worker output
@@ -1,53 +0,0 @@
# Truthmark Preview Procedure
Truthmark-managed generated file. Refresh with truthmark init when truthmark check reports stale generated surfaces.
Use this skill only when the user explicitly asks to preview Truthmark routing or workflow choice before edits.
Invocations: OpenCode /skill truthmark-preview; Codex /truthmark-preview or $truthmark-preview; Claude Code /truthmark-preview; GitHub Copilot /truthmark-preview; Gemini CLI /truthmark:preview.
Truth Preview is read-only. Its report is intended, not authorized.
Purpose:
- preview the likely Truthmark workflow, route owner, target files, expected write classes, suggested subagent use, and manual handoff questions before edits happen
- report likely product lane impact, engineering lane impact, target docs, and ambiguity before edits
- hand off to the selected workflow after user approval
- keep the selector thin so agents can avoid loading or acting through heavier workflows prematurely
Read:
- .truthmark/config.yml, only when present
- docs/truthmark/routes/areas.md, first, only when present
- relevant child route files under docs/truthmark/routes/areas/ for the selected scope or changed paths, only when present
- relevant truth docs and implementation files needed to preview ownership
- Evidence authority:
- Repository instruction files and explicitly configured policy docs remain instruction authority when present; do not assume a repository uses any particular policy path.
- Implementation code and canonical truth docs are inspected evidence for current behavior; they do not silently override workflow write boundaries.
- Lane classification:
- classify the request or changed surface as product-lane, engineering-lane, both-lane, or ambiguous for reporting only
- product-lane ownership belongs under docs/truthmark/product and describes product promises, boundaries, rationale, decisions, and success criteria
- engineering-lane ownership belongs under docs/truthmark/engineering and describes source-backed current realization, contracts, architecture, workflows, operations, or tests
- both-lane ownership uses separate product and engineering docs cross-linked in route YAML with realized_by and realizes, not in doc frontmatter
- ambiguous lane ownership should be reported for manual handoff or routed to Truth Structure
- Do not make product docs a summary of engineering docs. Do not make engineering docs a detailed version of product docs. Product truth says what must be true and why. Engineering truth says how the repository currently realizes it.
Do not:
- must not edit files
- must not create truth docs
- must not update routing
- must not run Truth Sync automatically
- must not replace Truth Check
- must not claim final correctness
- must not issue write leases
- must not mutate code
Suggested subagent use:
- optional read-only verifier: truth_route_auditor
- write workers: none
- leases needed: none
Truthmark hierarchy hints:
- Config, when present: .truthmark/config.yml
- Root route index, when present: docs/truthmark/routes/areas.md
- Area route files, when present: docs/truthmark/routes/areas/**/*.md
- Product truth docs, when present: docs/truthmark/product/**/*.md
- Engineering truth docs, when present: docs/truthmark/engineering/**/*.md
@@ -1,43 +0,0 @@
# Truthmark Preview Report Template
Truthmark-managed generated file. Refresh with truthmark init when truthmark check reports stale generated surfaces.
Report completion in this shape:
```md
Truth Preview: completed
Requested outcome:
- preview likely Truthmark workflow routing before edits
Likely workflow:
- truthmark-document
Why this workflow:
- positive trigger: document existing implemented behavior
- negative triggers considered: functional-code change, doc-first implementation, topology repair, truth audit
- forbidden adjacency considered: must not edit functional code
Likely route owner:
- route file: docs/truthmark/routes/areas.md
- likely lane impact: engineering-lane
- product target docs: none identified
- engineering target docs: docs/truthmark/engineering/behaviors/example.md
- confidence: medium
Expected write classes:
- truth docs
Expected target files:
- docs/truthmark/engineering/behaviors/example.md
Suggested subagent use:
- read-only verifiers: truth_route_auditor
- write workers: none in Preview
- leases needed: none in Preview
Manual handoff questions:
- none identified in preview
Handoff:
- Run the selected Truthmark workflow after user approval.
```
@@ -1,10 +0,0 @@
# Truthmark Preview Subagents And Leases
Truthmark-managed generated file. Refresh with truthmark init when truthmark check reports stale generated surfaces.
OpenCode subagent mode:
- use automatically when this workflow runs in OpenCode and the parent agent chooses bounded subagent fan-out
- dispatch read-only project subagents only: @truth-route-auditor
- workers inspect checkout evidence directly, return structured findings, and must not edit files
- parent supplies bounded evidence shards; workers must not preload host instruction files or repo-wide policy docs unless assigned as evidence
- Parent agent owns the final Truth Preview report
@@ -19,20 +19,15 @@ Truth Structure is agent-native:
- inspect the configured root route index at docs/truthmark/routes/areas.md and relevant child route files under docs/truthmark/routes/areas/ when they exist
- define areas by product or behavior ownership, not by mechanical directory mirroring
- create or repair docs/truthmark/routes/areas.md
- create starter truth docs when useful and when they belong in the canonical current-truth surface
- create skeletal starter truth docs only when missing ownership would otherwise block future workflows
- Starter truth docs must use closed YAML frontmatter bounded by opening and closing --- lines; include status, truth_kind, and last_reviewed inside that frontmatter. Put source references in the final ## Source References section, not in frontmatter.
- Starter truth docs must use lane-specific templates and keep product and engineering truth in separate files.
- Starter truth docs are ownership anchors, not behavior writeups: include only the title, bounded area/scope, and Source References needed to make routing explicit.
- Starter truth docs must keep product and engineering truth in separate files; leave substantive behavior, contract, architecture, workflow, operations, or test prose to Truth Document.
When creating or updating a truth doc, inspect the routed truth kind and use the matching template under the configured Truthmark templates root.
Supported kinds: product-capability, engineering-behavior, engineering-contract, engineering-architecture, engineering-workflow, engineering-operations, and engineering-test-behavior.
Treat the HTML comments under each template section as normative authoring guidance for that section.
Align existing docs to that template and write or repair section content so it satisfies the comment guidance while preserving accurate authored content.
If the template is missing, use lane-specific sections: product truth says what must be true and why; engineering truth says how the repository currently realizes it.
Teams may edit template files under the configured Truthmark templates root to define their local truth-doc standards.
- use docs/truthmark/product/** for product truth destinations
- use docs/truthmark/engineering/** for engineering truth destinations
- use only canonical current-truth destinations for starter truth docs
- keep active Product Decisions in product truth and Engineering Decisions in engineering truth
- keep Product Decisions in product truth and Engineering Decisions in engineering truth when selecting destinations; report any relocation need instead of rewriting decision prose during topology review
- preserve unrelated authored content
## New area setup
Use when a user asks to onboard a new code area into Truthmark, a new package, controller, domain, or product area lacks bounded truth ownership, or a new product area needs routing and starter truth docs.
@@ -52,18 +47,12 @@ Do not:
## Topology Governance
Truth Structure owns documentation topology, lane splits, decision relocation, and relationship repair. Do not depend on humans to manually organize docs/truthmark/product or docs/truthmark/engineering. Treat both configured lane roots as managed semantic roots.
Inspect controllers, routes, handlers, services, packages, tests, existing truth docs, and route files; infer product and domain ownership from behavior boundaries, not from mechanical directory mirroring.
When topology pressure exists, repair structure before creating or extending truth docs.
When topology pressure exists, repair route structure before creating or extending truth ownership anchors.
Truth-doc ownership review:
- before editing or relying on candidate route owners and current truth docs, verify each target/source truth doc is a bounded owner for the behavior
- if a target/source doc mixes independent owners, spans unrelated behaviors, acts as an index, or needs cross-owner edits, do not patch or in-place repair it
- if a truth doc mixes independent owners, route ownership is broad, or a split is required for bounded ownership, split and reroute into bounded truth docs when safe; otherwise stop with manual-review files
- if a truth doc mixes independent owners, route ownership is broad, or a split is required for bounded ownership, split or reroute only the ownership topology when safe; otherwise stop with manual-review files
- report Ownership reviewed, Structure required, Truth docs split, Truth docs restructured, or Manual handoff reason as applicable
Decision/Rationale preservation review:
- before any truth-doc split, restructure, or shape repair, inventory existing Product Decisions, Engineering Decisions, and Rationale sections in every source or touched truth doc
- preserve each current decision and rationale in the correct product or engineering lane owner; when splitting, move it to the new owner doc rather than deleting it or leaving it in an index
- remove or narrow a decision or rationale only when checkout evidence shows it is stale or unsupported, and report the exact claim, evidence, and result
- if ownership of a decision or rationale is unclear, stop with manual-review files instead of deleting it or guessing
- after the edit, verify every touched truth doc keeps lane-appropriate decision/rationale sections and every pre-existing entry is preserved, moved, narrowed, removed with evidence, or blocked
Topology pressure signals:
- one area maps broad code such as src/**, app/**, server/**, services/**, or packages/**
- one area maps multiple unrelated controllers, route groups, services, or bounded contexts
@@ -79,10 +68,10 @@ Use these review thresholds as guidance:
- more than 5 controllers mapped through one catch-all area
Repair rules:
- split broad, overloaded, or catch-all areas into behavior-owned child route files
- split mixed-owner truth docs into bounded owner docs before adding new behavior claims
- split or flag mixed-owner truth docs for bounded owners before any workflow adds new behavior claims
- create route files under docs/truthmark/routes/areas/ when a product/domain boundary is clear
- create engineering behavior truth docs under docs/truthmark/engineering only when behavior lacks a current doc
- create product truth docs under docs/truthmark/product only when product promise, boundary, rationale, or user-visible capability truth is in scope
- create skeletal engineering ownership anchors under docs/truthmark/engineering only when behavior lacks a current owner
- create skeletal product ownership anchors under docs/truthmark/product only when product promise, boundary, rationale, or user-visible capability ownership is in scope
- README.md files are indexes, not Truth Sync targets
- prefer bounded product docs under product/capabilities or product/decisions and engineering docs under engineering/<kind>/<surface>.md
- keep behavior truth docs behavior-oriented, not endpoint-oriented
@@ -90,21 +79,12 @@ Repair rules:
- update routing so future Truth Sync can target small docs
- preserve existing authored docs; move or rewrite only when needed to remove ambiguity
- report Truth docs split when one broad or mixed-owner truth doc becomes multiple bounded docs
Truth-doc shape repair review:
- Truth Structure may restructure broader routed docs when topology, ownership, or doc-shape repair is already in scope.
- repair shape in place only after the ownership review confirms the doc is the right bounded owner
- use Truth Structure for ownership splits; do not treat broad or mixed-owner docs as in-place repair work
- repair shape when a narrow edit would make truth worse: missing template sections, stale evidence conflicts, cross-section updates within one owner, or wrong frontmatter/source/headings
- preserve supported claims; remove, narrow, or record unsupported or stale claims for manual handoff
- report docs restructured and why a narrow edit was not sufficient
Evidence checklist:
- apply the evidence checklist before finishing when Truth Structure writes routed docs, ownership claims, lane-specific decisions, or rationale
- support ownership/behavior claims with topology or primary checkout evidence from layout, implementation boundaries, docs, config, route files, tests, templates, schemas, or contracts
- tests/examples/canonical docs corroborate; remove, narrow, or record unsupported claims for manual handoff
Maintain architecture docs only for structure-level changes: system structure, module boundaries, runtime topology, persistence boundaries, cross-cutting contracts, or generated-surface ownership.
Keep ordinary behavior, endpoints, UI copy, validation rules, and bug fixes in behavior or contract docs unless they change those boundaries.
- Do not finish topology repair with mixed product/engineering authority in a single canonical truth doc.
- If an existing canonical doc has wrong-lane sections, split or move them into the correct product or engineering lane.
- If an existing canonical doc has wrong-lane sections, report the lane repair needed and only move content when the topology split explicitly requires it.
Portable fallback:
- If this skill surface is unavailable, perform the same workflow directly from committed repository files.
- Do not require the truthmark CLI.
-2
View File
@@ -25,5 +25,3 @@ Progressive disclosure:
- support/procedure.md — read before edits or detailed auditing; contains core review questions
- support/report-template.md — read before the final report
- support/subagents-and-leases.md — read only when using subagents, leases, or accepting worker output
- helper-manifest.yml — read only when invoking helper validators or validating helper registration
- support/helper-policy.md — read only when invoking helper validators or reporting helper status
@@ -1,34 +0,0 @@
# Truthmark-managed generated file. Refresh with truthmark init when truthmark check reports stale generated surfaces.
helpers:
validate-sync-report:
optional: true
runner: truthmark
command:
argv:
- truthmark
- validate
- sync-report
- <report-file>
- --json
inputs:
- sync report file
output: json
writes: false
fallback: "manually validate support/report-template.md and check Evidence checked entries match Claim, indented Evidence, and Result: supported | narrowed | removed | blocked"
validate-write-lease:
optional: true
runner: truthmark
command:
argv:
- truthmark
- validate
- write-lease
- <lease-or-report-file>
- <changed-files-file>
- --json
inputs:
- lease or worker report yaml
- changed file list
output: json
writes: false
fallback: manually compare declared allowedWrites and forbiddenWrites with the actual changed files
@@ -1,23 +0,0 @@
# Optional Helper CLI Policy
Truthmark-managed generated file. Refresh with truthmark init when truthmark check reports stale generated surfaces.
Optional helper CLI commands may collect deterministic checkout facts or validate artifacts. If the Truthmark CLI is unavailable or cannot return the declared helper output, continue manually using this procedure and report which helper was skipped. Helper output is derived evidence; it does not override direct checkout inspection, workflow write boundaries, or parent acceptance.
Runner detection:
- Check that the declared Truthmark CLI runner is available before invoking a helper.
- Invoke helpers through the installed `truthmark validate ... --json` CLI command using argv-style arguments from helper-manifest.yml.
- If unavailable, failing, or returning incompatible output, treat the helper as skipped and use the manual fallback.
- Do not fail the workflow solely because a helper cannot run.
Available helpers:
- validate-sync-report: optional truthmark; manual fallback: manually validate support/report-template.md and check Evidence checked entries match Claim, indented Evidence, and Result: supported | narrowed | removed | blocked
- validate-write-lease: optional truthmark; manual fallback: manually compare declared allowedWrites and forbiddenWrites with the actual changed files
Final reports should include helper status when helpers are declared for this workflow:
```md
Helper scripts:
- validate-sync-report: ran, passed
- validate-write-lease: skipped, no write lease used
```
@@ -32,78 +32,33 @@ Parent workflow:
- User-provided decisions/rationale: decisions, rationale, constraints, tradeoffs, rejection reasons, or scope boundaries from the current task conversation, or "none provided"
- No-update-needed rationale: why mapped truth is already current when no truth doc should change
- Blockers: missing routing, ambiguous ownership, failed verification, unavailable evidence, or off-boundary write needs
11. Only edit allowed truth docs/routes after Sync Intent is clear; if ownership is ambiguous, stop and recommend Truth Structure instead of guessing.
Topology review:
11. Only edit allowed truth docs/routes after Sync Intent is clear; if ownership is ambiguous, repair topology first when the repair is safe and in scope, otherwise stop and recommend Truth Structure instead of guessing.
Topology review and repair:
- before updating truth docs, verify the changed code resolves to a specific behavior-owned area and bounded truth owner
- if routing is missing, stale, broad, overloaded, catch-all route only, or cannot map changed code to a bounded truth owner, do not create another generic truth doc
- run Truth Structure before syncing when topology repair is safe and in scope
- stop and recommend Truth Structure when topology repair is unsafe, ambiguous, or outside the current task boundary
- report the route files and changed code paths that require structure repair
- if routing is missing, stale, broad, overloaded, catch-all route only, or cannot map changed code to a bounded truth owner, run Truth Structure before syncing when topology repair is safe and in scope
- safe in-scope topology repair may update truth routing files and create or update bounded leaf truth docs needed to map the changed functional code; keep the repair limited to the affected route owner
- stop and recommend Truth Structure only when topology repair is unsafe, ambiguous, or outside the current task boundary
- report the route files and changed code paths that required structure repair
- do not create another generic truth doc
- README.md files are indexes, not Truth Sync targets
- must not append behavior details to a README.md index
- create or update a bounded leaf truth doc when behavior changes do not fit an existing leaf doc
- write engineering truth under docs/truthmark/engineering; product truth updates under docs/truthmark/product are allowed only for explicit current product behavior changes
Truth-doc ownership review:
- before editing or relying on changed functional files and impacted truth docs, verify each target/source truth doc is a bounded owner for the behavior
- if a target/source doc mixes independent owners, spans unrelated behaviors, acts as an index, or needs cross-owner edits, do not patch or in-place repair it
- if an impacted doc is broad, mixed-owner, index-like, or the update spans independent behavior owners, run Truth Structure before syncing when safe and in scope; otherwise stop and recommend Truth Structure
- report Ownership reviewed, Structure required, Truth docs split, Truth docs restructured, or Manual handoff reason as applicable
Decision/Rationale preservation review:
- before any truth-doc split, restructure, or shape repair, inventory existing Product Decisions, Engineering Decisions, and Rationale sections in every source or touched truth doc
- preserve each current decision and rationale in the correct product or engineering lane owner; when splitting, move it to the new owner doc rather than deleting it or leaving it in an index
- remove or narrow a decision or rationale only when checkout evidence shows it is stale or unsupported, and report the exact claim, evidence, and result
- if ownership of a decision or rationale is unclear, stop with manual-review files instead of deleting it or guessing
- after the edit, verify every touched truth doc keeps lane-appropriate decision/rationale sections and every pre-existing entry is preserved, moved, narrowed, removed with evidence, or blocked
When creating or updating a truth doc, inspect the routed truth kind and use the matching template under the configured Truthmark templates root.
Supported kinds: product-capability, engineering-behavior, engineering-contract, engineering-architecture, engineering-workflow, engineering-operations, and engineering-test-behavior.
Treat the HTML comments under each template section as normative authoring guidance for that section.
Align existing docs to that template and write or repair section content so it satisfies the comment guidance while preserving accurate authored content.
If the template is missing, use lane-specific sections: product truth says what must be true and why; engineering truth says how the repository currently realizes it.
Teams may edit template files under the configured Truthmark templates root to define their local truth-doc standards.
Truth-doc shape repair review:
- Truth Sync may restructure leased canonical truth docs when the current sync evidence shows repository truth is stale, even when the doc is outside the initially affected route focus.
- repair shape in place only after the ownership review confirms the doc is the right bounded owner
- use Truth Structure for ownership splits; do not treat broad or mixed-owner docs as in-place repair work
- repair shape when a narrow edit would make truth worse: missing template sections, stale evidence conflicts, cross-section updates within one owner, or wrong frontmatter/source/headings
- preserve supported claims; remove, narrow, or record unsupported or stale claims for manual handoff
- report docs restructured and why a narrow edit was not sufficient
Maintain architecture docs only for structure-level changes: system structure, module boundaries, runtime topology, persistence boundaries, cross-cutting contracts, or generated-surface ownership.
Keep ordinary behavior, endpoints, UI copy, validation rules, and bug fixes in behavior or contract docs unless they change those boundaries.
Evidence checklist:
- route-first: map changed functional files to bounded route owners and primary canonical docs
- review new or changed behavior-bearing claims only in touched docs, route ownership, lane-specific decisions, and rationale
- support claims with primary checkout evidence: implementation, config, routing, generated templates, schemas, or contract definitions
- tests/examples/canonical docs corroborate; they are not sole proof when implementation conflicts
- remove, narrow, or record unsupported claims for manual handoff
- if no impacted doc changed, report why truth was already current or why sync was skipped
Repository intelligence artifacts are optional derived context: RepoIndex, RouteMap, ImpactSet, and WorkflowState/action context may guide routing, write boundaries, and verification planning when available.
They do not override checkout evidence, canonical truth docs, route files, or workflow write boundaries.
If unavailable, inspect any present Truthmark config, route files, source files, truth docs, and tests directly, then report that repository-intelligence artifacts were not generated.
Optional validation tooling:
- you may run truthmark check when local tooling is available
- you may validate the final report with `truthmark validate sync-report <report-file> --json` when available
- do not require the truthmark binary; direct checkout inspection is the canonical path
- optional validation must not replace agent judgment about docs and routing
- update Product Decisions only in product truth and Engineering Decisions only in engineering truth when evidence supports the lane-specific decision change
Helper status reporting:
- Validate the report body before adding this validator's own success status; the body may omit `validate-sync-report` while validation is pending.
- After `truthmark validate sync-report <report-file> --json` returns `data.validation.ok: true`, append or update `validate-sync-report: ran, passed` in the final report.
- If the installed Truthmark CLI is unavailable or the helper is skipped, record `validate-sync-report: skipped, <reason>` and manually validate the report shape.
- Record `validate-write-lease: ran, passed` only after validating a concrete write lease; otherwise use a truthful skipped status such as `skipped, no write lease used`.
- Helper output is derived evidence and never replaces direct checkout inspection, evidence review, or parent acceptance.
Truthmark hierarchy hints:
- Config, when present: .truthmark/config.yml
- Root route index, when present: docs/truthmark/routes/areas.md
- Area route files, when present: docs/truthmark/routes/areas/**/*.md
- Product truth docs, when present: docs/truthmark/product/**/*.md
- Engineering truth docs, when present: docs/truthmark/engineering/**/*.md
Decision truth lives in the canonical doc it governs; date active decisions inline when added or changed.
Do not create separate active-decision ADR/planning logs; replace the active decision and let Git history carry the audit trail.
Product decisions belong in product truth; engineering, architecture, contract, workflow, and operational decisions belong in engineering truth.
Parent post-sync verification:
- verify only truth docs and leased truth routing files changed during sync
- stop on any unrelated diff caused by the sync step
- stop if functional code changed during sync
- for each write lease, validate the worker report against the actual worker diff, allowedWrites, forbiddenWrites, identity fields, filesChanged, offLeaseChanges, blockers, and expected report fields before accepting it
- validate the final report against the structured Truth Sync report contract, including Claim, indented Evidence, and Result values supported, narrowed, removed, or blocked under Evidence checked
- verify the updated docs correspond to reviewed checkout evidence, changed-code impact, or a recorded stale-truth correction made within the sync write lease
- verify the final report records ownership review, structure requirement, split, restructure, or manual handoff reason when the ownership review applies
@@ -33,9 +33,6 @@ Evidence checked:
Evidence: src/auth/session.ts:12 / docs/truthmark/routes/areas.md:11
Result: supported
Helper scripts:
- validate-write-lease: skipped, no write lease used
Notes:
- Updated session timeout behavior.
```