Skip to content

Commit fae8361

Browse files
docs(verification): state no-formal-proof stance; add registry data-integrity invariants (#21)
gv-clade-index has no ABI/FFI surface, so there are no formal proofs to maintain here (the template Idris2 ABI proofs were removed earlier; see PROOF-NEEDS.md). Make that stance explicit and promote the registry's checkable invariants to executable "proofs". - verification/README.adoc + proofs/safety_case/traceability READMEs: document that formal proofs are N/A for this JS data/edge project and that correctness is assured by worker/test/ + the worker-ci gate; Idris2 proofs deferred until a native surface exists. - .machine_readable/6a2/STATE.a2ml: add [verification] section recording the stance. - worker/test/data.test.js: add invariants — prefixed == "<clade>-<name>", valid secondary codes, github primary-key uniqueness, uuid present/well-formed/unique (now 37 tests). Claude-Session: https://claude.ai/code/session_01UCnxjXkN6uDj9YSANuGEgR Co-authored-by: Claude <noreply@anthropic.com>
1 parent 66fb176 commit fae8361

6 files changed

Lines changed: 85 additions & 2 deletions

File tree

.machine_readable/6a2/STATE.a2ml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ milestones = [
3131
{ name = "Phase 8: Repo lockdown (visibility management)", completion = 0 },
3232
]
3333

34+
[verification]
35+
formal-proofs = "none — no ABI/FFI surface to verify (see PROOF-NEEDS.md, verification/README.adoc)"
36+
correctness-evidence = "worker/test/ — Worker test suite + data-integrity invariants; gated by worker-ci.yml"
37+
idris2-proofs = "deferred until/unless a native ABI surface is introduced"
38+
3439
[blockers-and-issues]
3540
blockers = [
3641
"Phase 3 deploy: CLOUDFLARE_API_TOKEN repo secret required to enable automated Worker deploys",

verification/README.adoc

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,29 @@
1-
= Verification Pillar
1+
// SPDX-License-Identifier: MPL-2.0
2+
= Verification Pillar — gv-clade-index
3+
4+
== Status: no formal-proof surface
5+
6+
gv-clade-index is a `gv`/`db` project — a JavaScript Cloudflare Worker over a
7+
VeriSimDB/KV registry. It has *no native ABI/FFI surface*, so there are no Idris2 /
8+
Lean / Coq / Agda proofs to maintain here, and none are outstanding. The template
9+
ABI proofs that once implied otherwise were removed; see `PROOF-NEEDS.md`.
10+
11+
== What stands in for "proofs" here
12+
13+
Correctness is assured by executable evidence appropriate to a data/edge service:
14+
15+
* *Worker test suite* — `worker/test/worker.test.js`: routing, input validation,
16+
security headers, CORS, error paths, and a fuzz sweep (no uncontrolled 5xx).
17+
* *Data-integrity invariants* — `worker/test/data.test.js` asserts the registry's
18+
"theorems": the 12-clade invariant; count consistency
19+
(`total_repos == |by_name| == Σ member_count`); every clade member resolves;
20+
`prefixed == "<clade>-<name>"`; valid secondary codes; and forge primary-key
21+
(`github`) + `uuid` uniqueness.
22+
* *CI gate* — `.github/workflows/worker-ci.yml` runs these on every PR.
23+
24+
== When real proofs would apply
25+
26+
Only if a native/compiled ABI surface is introduced. At that point, add
27+
domain-specific Idris2 proofs per the pattern referenced in `PROOF-NEEDS.md`
28+
(e.g. `proven`, `typed-wasm`, `echidna`). The `proofs/`, `safety_case/`, and
29+
`traceability/` units are retained for RSR structure until then.

verification/proofs/README.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
// SPDX-License-Identifier: MPL-2.0
12
= Proofs Unit
3+
4+
No formal proofs: gv-clade-index has no ABI/FFI surface to verify (see
5+
`../README.adoc` and the repo-root `PROOF-NEEDS.md`). Correctness evidence for this
6+
data/edge service lives in the Worker test suite and the data-integrity invariants
7+
under `worker/test/`. Add Idris2 proofs here only if a native surface is introduced.
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
= Safety case Unit
1+
// SPDX-License-Identifier: MPL-2.0
2+
= Safety Case Unit
3+
4+
Not applicable as a high-assurance safety case: this is a read-only governance
5+
registry (JavaScript Worker + VeriSimDB), not safety-critical software. Operational
6+
assurance is provided by the test suite, the CI gate, structured logging, and the
7+
`/v1/health` + `/v1/ready` probes. See `../README.adoc`.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
// SPDX-License-Identifier: MPL-2.0
12
= Traceability Unit
3+
4+
No requirements-to-proof traceability matrix: there are no formal proofs to trace
5+
(see `../README.adoc`). Phase/requirement tracking lives in
6+
`.machine_readable/6a2/STATE.a2ml` and `ROADMAP.adoc`; the registry's data invariants
7+
are traced by `worker/test/data.test.js`.

worker/test/data.test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,35 @@ describe('index.json consistency', () => {
5656
}
5757
});
5858
});
59+
60+
// Registry data-integrity invariants — the "proofs" a governance/registry repo can
61+
// actually guarantee (this project has no formal ABI/FFI surface; see
62+
// verification/README.adoc and PROOF-NEEDS.md).
63+
describe('registry invariants', () => {
64+
it('every repo prefixed name is "<clade>-<name>"', () => {
65+
for (const r of repos) {
66+
expect(r.prefixed).toBe(`${r.clade}-${r.name}`);
67+
}
68+
});
69+
70+
it('secondary clade codes are valid and exclude the primary', () => {
71+
for (const r of repos) {
72+
for (const code of r.secondary || []) {
73+
expect(VALID_CLADES).toContain(code);
74+
expect(code).not.toBe(r.clade);
75+
}
76+
}
77+
});
78+
79+
it('forge primary keys (github slugs) are unique', () => {
80+
const slugs = repos.map((r) => r.github);
81+
expect(new Set(slugs).size).toBe(slugs.length);
82+
});
83+
84+
it('uuids are present, well-formed and unique', () => {
85+
const uuidRe = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
86+
const uuids = repos.map((r) => r.uuid);
87+
for (const u of uuids) expect(u).toMatch(uuidRe);
88+
expect(new Set(uuids).size).toBe(uuids.length);
89+
});
90+
});

0 commit comments

Comments
 (0)