feat: add Truthmark health scorecard and bounded workflow contracts (#13)

* feat: add OpenSpec-driven workflow state

* docs: plan generated playbooks workflow contract

* feat: add truth health scorecard

Release Truthmark 2.1.0 with check JSON scorecard output.

Archive the completed OpenSpec pass 4 scorecard change and update generated truth surfaces.

* fix: unblock truthmark scorecard review

- restore and update coverage for scorecard/evidence/workflow behavior
- make truthmark-sync select a cheap local base when --base is omitted
- report malformed evidence YAML blocks as diagnostics instead of throwing

* fix: tighten workflow boundaries

* fix: fail closed when sync has no comparison base

* fix: tighten truth health review coverage

- only parse fenced YAML evidence blocks with top-level evidence markers
- convert coverage fixtures to valid v2 config and assert non-vacuous diagnostics
- update Truthmark truth docs for source traceability and workflow-state tests

* docs: clarify source traceability diagnostics

* docs: harden optional CLI workflow boundary

* docs: clarify product boundary is repo-local

* fix: bound truthmark workflow fallback behavior

- make live workflow preflight use the one-call instructions contract
- keep missing-CLI fallback bounded for Sync, Document, Structure, and Realize
- add routing and generated-surface coverage plus refreshed host surfaces

* test: cover no-cli workflow fallback bounds

- assert route-first fallback wording in generated workflow surfaces
- clarify progressive-disclosure support files are conditional
- align overview docs with bounded no-CLI behavior

* docs: route workflow eval coverage

* fix: remove workflow instructions preflight

* fix: remove stale workflow preflight wording

* fix: remove generic workflow validation blocks

* fix: avoid duplicated markdown context JSON

* fix: keep workflow status manifest-only

* docs: align truth docs with v2 hierarchy

---------

Co-authored-by: MerlinH <merlinh221@gmail.com>
This commit is contained in:
Merlin's Cat
2026-06-13 04:09:45 +10:00
committed by GitHub
co-authored by MerlinH
parent aa6442bba9
commit a083b703fa
335 changed files with 7232 additions and 3616 deletions
+23
View File
@@ -0,0 +1,23 @@
# Truthmark v2 workspace refactor
Previous version: 1.6.1
New version: 2.0.0
Diff basis: release/1.6.1..HEAD plus working tree
Version action: major
SemVer rationale: The pending payload intentionally rejects legacy `docs.roots` and top-level `authority` config shapes and changes shipped default workspace, routing, scaffold, and generated workflow behavior.
Release payload:
- Replace the old repo-doc hierarchy defaults with a `version: 2` `truthmark.workspace` config model.
- Move Truthmark-owned routes, truth docs, templates, and generated Portal output under `docs/truthmark/` while leaving project-owned `docs/ai`, `docs/architecture`, and `docs/standards` outside the Truthmark workspace.
- Refresh generated host-native workflow surfaces, managed instruction blocks, routing tests, and README examples for the clean v2 workspace.
User-facing release text:
- Truthmark 2.0.0 introduces the clean workspace-scoped config model and removes compatibility loading for legacy `docs.roots` / top-level `authority` configs. Re-run `truthmark config` / `truthmark init` and update existing repositories to the `truthmark.workspace` layout before relying on generated workflows.
Verification:
- `npx tsx src/cli/main.ts init --json`
- `npx vitest run tests/git/repository.test.ts tests/evidence/validate.test.ts tests/fs/paths.test.ts tests/evals/workflow-routing.test.ts`
- `npm run release:check`
- `npx tsx src/cli/main.ts check --json`
- `npx tsx src/cli/main.ts index --json`
- README stale-path sweep and heading-depth parity check across localized READMEs.
+24
View File
@@ -0,0 +1,24 @@
# Truth Health Scorecard
Previous version: 2.0.0
New version: 2.1.0
Diff basis: release/1.6.1..HEAD plus working tree
Version action: minor
SemVer rationale: Pass 4 adds the backward-compatible `data.scorecard` JSON contract to `truthmark check --json` while preserving raw diagnostics and existing check payload fields.
Release payload:
- Add `truthmark-scorecard/v0` as a compact Truth Health Scorecard in `truthmark check --json` under `data.scorecard`.
- Summarize raw check diagnostics into routing coverage, ownership clarity, source traceability, branch freshness, generated-surface freshness, truth doc structure, and decision/rationale preservation dimensions.
- Preserve raw diagnostics, branch scope, truth visibility, and optional impact set output while marking branch freshness as `not-run` when no `--base` is supplied.
User-facing release text:
- `truthmark check --json` now includes `data.scorecard`, a compact `truthmark-scorecard/v0` health summary that points back to the raw diagnostics array for detail. Existing diagnostics and JSON fields remain available.
Verification:
- `npx vitest run tests/checks/scorecard.test.ts tests/checks/check.test.ts tests/cli/help.test.ts`
- `npm run release:check`
- `npx tsx src/cli/main.ts check --json`
- `npx tsx src/cli/main.ts index --json`
- `node dist/main.js check --json`
- `node dist/main.js index --json`
- `git diff --check -- src/checks tests docs/truthmark package.json package-lock.json changes`