Skip to content

Commit d2d2436

Browse files
committed
Add runtime evidence index and retention
1 parent c5890f3 commit d2d2436

9 files changed

Lines changed: 516 additions & 1 deletion
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<!--
2+
Copyright (C) 2026 Marco Fortina
3+
SPDX-License-Identifier: AGPL-3.0-or-later
4+
-->
5+
6+
# Runtime evidence index and retention
7+
8+
`scripts/runtime-evidence-index.sh` builds a stable JSON index across runtime
9+
validation pack evidence and SSH runtime evidence.
10+
11+
Build or refresh the index:
12+
13+
```bash
14+
scripts/runtime-evidence-index.sh
15+
```
16+
17+
The default index path is:
18+
19+
```text
20+
dist/runtime-evidence-index.json
21+
```
22+
23+
## Verification
24+
25+
Use `--verify` to validate every discovered `SHA256SUMS` file before the index is
26+
written:
27+
28+
```bash
29+
scripts/runtime-evidence-index.sh --verify
30+
```
31+
32+
Verification covers runtime validation pack directories under `dist/runtime-packs`
33+
and SSH runtime evidence files under `dist/runtime-evidence`.
34+
35+
## Retention
36+
37+
Use `--retain N` to keep only the latest N runtime validation pack runs per pack
38+
and the latest N SSH runtime evidence runs:
39+
40+
```bash
41+
scripts/runtime-evidence-index.sh --verify --retain 10
42+
```
43+
44+
Retention rewrites the runtime evidence checksum file after pruning SSH evidence
45+
files.
46+
47+
## Automatic index updates
48+
49+
`scripts/runtime-validation-packs.sh` and `scripts/runtime-evidence.sh` update the
50+
index automatically after producing evidence. Disable this only while debugging a
51+
narrow failure:
52+
53+
```bash
54+
AUTOMAX_RUNTIME_EVIDENCE_INDEX_UPDATE=0 scripts/runtime-validation-packs.sh --pack package-only
55+
```
56+
57+
Useful controls:
58+
59+
```bash
60+
AUTOMAX_RUNTIME_EVIDENCE_INDEX=dist/runtime-evidence-index.json
61+
AUTOMAX_RUNTIME_EVIDENCE_RETAIN=10
62+
```
63+
64+
## Index schema
65+
66+
The index has a stable top-level shape:
67+
68+
```json
69+
{
70+
"schema_version": 1,
71+
"generated_at": "2026-01-01T00:00:00Z",
72+
"entry_count": 1,
73+
"entries": []
74+
}
75+
```
76+
77+
Entries use `type: runtime-pack` or `type: runtime-evidence` and include relative
78+
paths to manifests, summaries, checksums and evidence files.

docs/guides/runtime-evidence.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,19 @@ AUTOMAX_RUNTIME_EVIDENCE_PACKAGE=1 scripts/runtime-evidence.sh
7676
The package smoke log is stored in the evidence directory and included in
7777
`SHA256SUMS`.
7878

79+
## Index and retention
80+
81+
The runtime evidence script updates `dist/runtime-evidence-index.json`
82+
automatically after producing evidence. Set `AUTOMAX_RUNTIME_EVIDENCE_RETAIN` to
83+
keep only the latest N SSH evidence runs while refreshing the index:
84+
85+
```bash
86+
AUTOMAX_RUNTIME_EVIDENCE_RETAIN=10 scripts/runtime-evidence.sh
87+
```
88+
89+
Use `scripts/runtime-evidence-index.sh --verify` to validate existing checksums
90+
and rebuild the index without running a new SSH smoke.
91+
7992
## CI behavior
8093

8194
The script exits with code `77` when `AUTOMAX_SSH_HOST` or `AUTOMAX_SSH_USER` is

docs/guides/runtime-validation-packs.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,16 @@ logs/<step>.log
6868
Steps that require unavailable runtime inputs return `skipped` with `rc=77` in
6969
the manifest. Failed steps stop the pack by default. Use `--keep-going` to collect
7070
all step outcomes before returning a failing summary.
71+
72+
## Index and retention
73+
74+
Runtime validation packs update `dist/runtime-evidence-index.json` automatically
75+
after each run. Set `AUTOMAX_RUNTIME_EVIDENCE_RETAIN` to prune older evidence
76+
runs while updating the index:
77+
78+
```bash
79+
AUTOMAX_RUNTIME_EVIDENCE_RETAIN=10 scripts/runtime-validation-packs.sh --pack package-only
80+
```
81+
82+
Use `scripts/runtime-evidence-index.sh --verify` to rebuild the index and verify
83+
all discovered checksums without running a new pack.

docs/reference/release.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Keep the following with the release record:
7575
- `scripts/release-check.sh` output;
7676
- runtime evidence from disposable hosts when the release changes runtime
7777
behavior;
78+
- `dist/runtime-evidence-index.json` generated with checksum verification;
7879
- runtime validation pack output from `scripts/runtime-validation-packs.sh`;
7980
- `automax plugins coverage --strict` output for builtin and release-loaded
8081
plugins;

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ nav:
7070
- Extended SSH Smoke: guides/ssh-smoke.md
7171
- Runtime Evidence Suite: guides/runtime-evidence.md
7272
- Runtime Validation Packs: guides/runtime-validation-packs.md
73+
- Runtime Evidence Index: guides/runtime-evidence-index.md
7374
- Publishing Documentation: guides/publishing-docs.md
7475
- Reference:
7576
- CLI: reference/cli.md

0 commit comments

Comments
 (0)