Skip to content

Commit ff8eced

Browse files
neurophone: proofs (2.1 TLC / 2.3 typestate) + estate Trustfile (#158)
## Summary Continues the neurophone hardening (follow-up to the merged #154, #156). Two chunks: ### Proofs — honest staged path (#84) - **2.1 lifecycle: TLC-model-checked.** Added `proofs/tla/Lifecycle.cfg` + a `WorkBound` constraint; TLC now reports **"No error has been found"** (13 states) — `TypeOK`, `NoUseBeforeInit`, and the `NoUseAfterShutdown` property all hold. - **2.1 (type level) + 2.3 release-once: compile-fail verified.** Three `compile_fail` doc-tests on `NeuroSymbolicSystem` prove the typestate rejects use-before-init, use-after-shutdown, and double-shutdown — `cargo test` fails if any starts compiling. - **0.1 panic-freedom + 0.2 numeric containment** on the core operational paths: `neurophone-core/tests/proptest_core.rs`. - `proofs/README.adoc` rewritten to reflect reality (property/checked/open), and corrected: the `spectral_radius` misnomer is **already fixed** in `esn` (power iteration), so 1.1's precondition holds — only the formal contraction proof remains. - `Justfile`: `proof-tla` (fetches `tla2tools.jar`, self-skips without java), `proof`, and the RSR `quality` gate. ### Estate Trustfile (owner's explicit ask) - `.machine_readable/contractiles/trust/Trustfile.a2ml` upgraded from 23 lines to the full **A2ML Trustfile v2026.2.5-final** baseline, specialised for neurophone: threat model for an on-device app, real seams, the honest 0.1–3.2 `PROOF_ARTIFACTS` map with explicit `non_claims`, capability gateway, crypto-agility. Owner-only crypto (Ed448+Dilithium5 / SPHINCS+, hashes, transparency entries) left as `{{PLACEHOLDER}}`. - New SHA-pinned `.github/workflows/trustfile.yml` gate: structural lint + placeholder policy (WARN on branches / ERROR on main) + integrity-hash drift report + runnable checks. Ground truth: `cargo test` **160 pass**, `cargo clippy --all-targets -- -D warnings` clean, `cargo fmt --check` clean; TLC verified locally. ## FLAGS — external / owner-plane (unchanged) - `gossamer` + `conative-gating` clones remain **403-blocked** → #83 epic and #103 staged. - OPEN obligations 1.1 / 1.2 (formal) / 2.2 / 3.1 residual — honest, with completion paths. - Owner fills the Trustfile `{{PLACEHOLDER}}` crypto at signing time. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0172RBMz3qYjb1ttzD2i7RNh --- _Generated by [Claude Code](https://claude.ai/code/session_0172RBMz3qYjb1ttzD2i7RNh)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 672636f commit ff8eced

10 files changed

Lines changed: 670 additions & 39 deletions

File tree

.github/workflows/trustfile.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Validates the canonical Trustfile (estate baseline v2026.2.5-final) and runs
3+
# its fast integrity checks. Placeholder crypto tokens ({{...}}) are owner-supplied
4+
# at signing time, so they only hard-fail on `main` — on branches/PRs they warn.
5+
name: Trustfile Validation
6+
7+
on:
8+
push:
9+
branches: [main]
10+
pull_request:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
validate:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
env:
25+
TRUSTFILE: .machine_readable/contractiles/trust/Trustfile.a2ml
26+
steps:
27+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
persist-credentials: false
30+
31+
- name: Trustfile present and structurally complete
32+
run: |
33+
set -euo pipefail
34+
test -f "$TRUSTFILE" || { echo "::error::$TRUSTFILE is missing"; exit 1; }
35+
missing=""
36+
for section in META THREAT_MODEL TRUSTFILE ESTATE_STANDARD \
37+
REPOSITORY_SPECIFIC PROOF_ARTIFACTS CAPABILITY_GATEWAY \
38+
CRYPTO_AGILITY SIGNATURE_BLOCK DEPLOYMENT; do
39+
grep -qE "^### \[$section\]" "$TRUSTFILE" || missing="$missing $section"
40+
done
41+
if [ -n "$missing" ]; then
42+
echo "::error::Trustfile missing required section(s):$missing"
43+
exit 1
44+
fi
45+
echo "All required Trustfile sections present."
46+
47+
- name: Placeholder policy (WARN on branches, ERROR on main)
48+
run: |
49+
set -euo pipefail
50+
count=$(grep -cE '\{\{[A-Za-z0-9_]+\}\}' "$TRUSTFILE" || true)
51+
if [ "$count" -eq 0 ]; then
52+
echo "No unresolved placeholders."
53+
exit 0
54+
fi
55+
if [ "${GITHUB_REF:-}" = "refs/heads/main" ]; then
56+
echo "::error::$count unresolved {{PLACEHOLDER}} token(s) on main — owner must fill crypto/provenance before release."
57+
grep -nE '\{\{[A-Za-z0-9_]+\}\}' "$TRUSTFILE" | head -20
58+
exit 1
59+
else
60+
echo "::warning::$count unresolved {{PLACEHOLDER}} token(s) (owner-supplied at signing time; allowed on branches)."
61+
fi
62+
63+
- name: Integrity-hash drift report (informational)
64+
run: |
65+
set -euo pipefail
66+
# Report the current digests so drift is visible; never auto-commit on a
67+
# protected branch (that is a signing-time, owner-side step).
68+
if command -v b3sum >/dev/null 2>&1; then echo "blake3: $(b3sum "$TRUSTFILE" | awk '{print $1}')"; fi
69+
echo "sha3-512: $(openssl dgst -sha3-512 "$TRUSTFILE" | awk '{print $2}')"
70+
71+
- name: Runnable integrity checks
72+
run: |
73+
set -euo pipefail
74+
# license-content: sole-owner repo must be MPL-2.0
75+
grep -q 'Mozilla Public License\|MPL-2.0' LICENSE \
76+
|| { echo "::error::LICENSE is not MPL-2.0"; exit 1; }
77+
# no secrets committed
78+
if [ -f .env ] || [ -f credentials.json ] || [ -f .env.local ]; then
79+
echo "::error::secret/credential file committed"; exit 1
80+
fi
81+
echo "Runnable integrity checks passed."

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,6 @@ deps/
8484
.cache/
8585
build/
8686
dist/
87+
88+
# TLA+ model-checker jar cache (fetched by `just proof-tla`)
89+
.tlacache/

0 commit comments

Comments
 (0)