Skip to content

Commit 603ee56

Browse files
committed
feat(ci): dashboard-check — fail the build when dashboards diverge from STATE
Structural defence against the estate's #1 recurring defect ("dashboards that lie": a human-facing status surface claiming more than the machine-readable STATE, e.g. the historical TOPOLOGY "100% Production Ready" vs STATE 60%/Grade-D). New Rust workspace crate `crates/dashboard-check` (Rust = the policy- preferred CLI language) parses `.machine_readable/6a2/STATE.a2ml` — a2ml is TOML, so it uses the `toml` crate, not a bespoke reader — extracts completion-percentage / crg-grade / last-updated (tolerating januskey's quoted "60"/"D" and other repos' bare integers), and asserts they match TOPOLOGY.md (`OVERALL: …%`, `Grade X`) and READINESS.md (`CRG Grade: X`), plus that the dashboard's `Last updated` is not older than STATE's. Exits non-zero with a precise diff on divergence. - 8 unit tests over pure extract/reconcile fns (quoted + bare parsing, each drift class, the aligned pass case, and a prose-shadowing regression where a note mentioning "OVERALL" must not shadow the real dashboard line). - Verified end-to-end: passes on this repo (reconciled); catches an injected 100%-vs-60% drift with the exact "completion mismatch" message. - Wired as `just check-dashboard` and CI workflow `Dashboard Check` (SPDX header, contents:read perms, SHA-pinned actions). - TOPOLOGY.md's "source of truth" note now records that agreement is machine-enforced. Prototyped in januskey; designed to be vendored estate-wide (every repo has the same STATE.a2ml + dashboard shape). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015qwVESTcbfanY2iJPQNoSz
1 parent 65e1376 commit 603ee56

7 files changed

Lines changed: 491 additions & 6 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+
#
4+
# dashboard-check.yml — fail the build when a hand-maintained status dashboard
5+
# (TOPOLOGY.md / READINESS.md) diverges from the machine-readable STATE.a2ml.
6+
# Structural defence against the "dashboards that lie" failure mode.
7+
name: Dashboard Check
8+
9+
on:
10+
pull_request:
11+
branches: ['**']
12+
push:
13+
branches: [main, master]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
dashboard-check:
20+
name: STATE vs dashboard reconciliation
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 15
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
26+
27+
- uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
28+
29+
- name: Reconcile dashboards against STATE.a2ml
30+
run: cargo run -q -p dashboard-check -- --check .

Cargo.lock

Lines changed: 93 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell
33

44
[workspace]
5-
members = ["crates/reversible-core", "crates/januskey-cli"]
5+
members = ["crates/reversible-core", "crates/januskey-cli", "crates/dashboard-check"]
66
resolver = "2"
77

88
[workspace.package]

Justfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ fmt:
3131
lint:
3232
cargo clippy --workspace -- -D warnings
3333

34+
# Fail if a hand-maintained dashboard diverges from STATE.a2ml (source of truth)
35+
check-dashboard:
36+
cargo run -q -p dashboard-check -- --check .
37+
3438
# Run benchmarks
3539
bench:
3640
cargo bench --workspace

TOPOLOGY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
5757
> CRG grade **D**) and `READINESS.md` (Grade **D — Alpha, Unstable**). This
5858
> dashboard is a human-readable summary of those files; if they disagree,
5959
> they win. Percentages below are qualitative, not measured coverage.
60+
> This agreement is now **machine-enforced**: `just check-dashboard`
61+
> (crate `crates/dashboard-check`, CI job `Dashboard Check`) fails the build
62+
> if the `OVERALL` percentage or grade here drifts from STATE.a2ml.
6063
6164
```
6265
COMPONENT STATUS NOTES

crates/dashboard-check/Cargo.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell
3+
4+
[package]
5+
name = "dashboard-check"
6+
version = "0.1.0"
7+
edition.workspace = true
8+
license.workspace = true
9+
repository.workspace = true
10+
authors.workspace = true
11+
description = "Fails CI when a hand-maintained status dashboard diverges from the machine-readable STATE.a2ml (the source of truth). Kills the 'dashboards that lie' failure mode at the root."
12+
13+
[[bin]]
14+
name = "dashboard-check"
15+
path = "src/main.rs"
16+
17+
[dependencies]
18+
toml = "0.8"

0 commit comments

Comments
 (0)