Skip to content

Commit f676ff8

Browse files
docs: max-out vs estate standards + fill INTENT.contractile + reconcile drift counts (#53)
Closes #44. Mirrors the verisimdb#81 Gold-tier docs sweep: Fill placeholders * .machine_readable/INTENT.contractile — all 5 placeholder slots filled: purpose (verified-shell + MAA framework), anti-purpose (verification-first not POSIX-first, NOT a bash/zsh replacement, NOT a research vehicle for shell language design), STANDALONE, 11 documented deps, explicit "no known downstream consumers at v0.9.0" rather than fabricated names. Adds 9-item architectural-invariants + 8-item ask-before-touching. * .machine_readable/agent_instructions/methodology.a2ml — PROJECT_UNIQUE_STRENGTH filled with the polyglot-6 cross-foundation argument and the divergence contrast vs echidna/proven/ephapax; 9-rule divergent-invariants; 9-item known-constraints. Bumps last-updated 2026-03-24 -> 2026-06-01. Reconcile drift counts (authoritative: counted from actual repo state) * Tests: README "602"/"555" -> 736 (matches CLAUDE.md + cargo-test reality) * Theorems: README "200+"/"~250+" -> ~478 candidates (per issue #42 inventory) * Source files: CLAUDE.md "33"/"30" internal contradiction -> 32 (find ... | wc -l) * LoC: CLAUDE.md "21,000"/"15,720" -> 21,331 (wc -l aggregate) * Proof holes: CLAUDE.md "10 across 8 files (4 gaps, 4 axioms, 2 structural)" -> 3 (1 real gap + 1 justified axiom + 1 structural axiom, matches docs/PROOF_HOLES_AUDIT.md) * Fuzz targets: README "4" -> 7 (parser, arith, job-spec, signal-parse, path-ops, glob-expansion, state-machine) * Citation BibTeX: v0.14.0/2025 -> v0.9.0/2026 * FAQ "production-ready?" para: v0.14.0/82%/177 tests -> v0.9.0/~78%/736 * README license badge: malformed URL fixed; PMPL-1.0 -> MPL-2.0 (project migrated in commit 990b147) Dual-source consolidation * Delete CHANGELOG.md (keep .adoc — estate-asciidoc convention) * Delete MAINTAINERS.md (keep .adoc — also more current with proper maintainer entry vs "[To be added]" placeholder) * Update 10+ outbound references in GOVERNANCE.adoc, RSR_COMPLIANCE.md, CONTRIBUTING.md, CODE_OF_CONDUCT.md, CHANGELOG.adoc Add * FAQ.adoc — 12 Q&A pairs (what is vsh, why prove, why 6 systems, how to trust proofs, production-readiness, count drift, RMR vs RMO, algorithmic vs thermodynamic reversibility, licence, Absolute Zero/CNO, FFI/ABI surface, MAA framework) * docs/audits/2026-06-01-deep-audit.adoc — captures the seed inventory from issues #41-#46/#49/#51, before/after drift table, plus 9 newly surfaced drift items found during execution (not in #44's list) Machine-readable surface * 0-AI-MANIFEST.a2ml — rewrote from stale rsr-template-repo template stub to point at actual .machine_readable/ + contractile family + current counts table * .well-known/ai.txt — references corrected (was pointing at non-existent AI.a2ml; now points at 0-AI-MANIFEST.a2ml + INTENT + methodology + audits) Wiki audit * gh api confirms has_wiki=true, but clone yields only Home.md stub (35 bytes, "Welcome to the valence-shell wiki!"). Surfaced as follow-up in docs/audits/2026-06-01-deep-audit.adoc; no wiki content written (wikis are user-facing artefacts needing owner direction). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9c81564 commit f676ff8

15 files changed

Lines changed: 804 additions & 400 deletions

.machine_readable/INTENT.contractile

Lines changed: 77 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,47 @@
3030
; ── End Definitions ──────────────────────────────────────────────
3131

3232
(intent-contractile
33-
(version "1.0.0")
33+
(version "1.1.0")
3434
(repo "valence-shell")
3535

3636
; === Purpose (what this repo IS) ===
3737
(purpose
38-
"{{ONE_PARAGRAPH_PURPOSE}}"
38+
"valence-shell (vsh) is a formally verified Unix-style shell whose every \
39+
filesystem-touching operation is backed by a machine-checkable proof of \
40+
reversibility. It implements the MAA (Mutually Assured Accountability) \
41+
framework: the model-layer operations (mkdir/rmdir, create/delete/write, \
42+
cp/mv/ln -s, chmod/chown) are proven reversible across 6 independent \
43+
proof systems (Coq, Lean 4, Agda, Isabelle/HOL, Mizar, Z3) so that \
44+
cross-validation catches errors a single foundation would miss. The \
45+
primary deliverable is a working interactive Rust CLI (impl/rust-cli/) \
46+
that mirrors those proven operations and provides undo/redo, named \
47+
checkpoints, transaction grouping, and proof-annotated dry-runs — \
48+
plus enough POSIX shell surface (pipelines, redirections, here-docs, \
49+
job control, variables, control structures, glob, quoting) to be \
50+
actually usable. The long-term motivation is GDPR-grade auditable \
51+
deletion: every act on the filesystem should be either reversible \
52+
(RMR) or attestably irreversible (RMO), with the choice and the proof \
53+
observable to a third party."
3954
)
4055

4156
; === Anti-Purpose (what this repo is NOT — prevents scope creep) ===
4257
(anti-purpose
43-
"{{ONE_PARAGRAPH_ANTI_PURPOSE}}"
58+
"valence-shell is NOT a drop-in bash/zsh replacement: it is \
59+
verification-first, not POSIX-first. POSIX compliance is a means to \
60+
the end of running real shell scripts against proven operations, not \
61+
the goal itself — features that cannot be modelled and proven \
62+
reversible (or attestably irreversible) are out of scope for the \
63+
core. It is NOT a research vehicle for shell language design: \
64+
syntactic innovation goes to other shells. It is NOT a production \
65+
shell as of v0.9.0 — the extraction gap (Lean → Rust → POSIX \
66+
syscalls) is not formally closed; the Rust CLI matches the proven \
67+
model via property tests at roughly 85% confidence, not via a \
68+
mechanised correspondence theorem. It is NOT a general-purpose \
69+
filesystem library: external consumers should not depend on \
70+
impl/rust-cli/ internals; the stable surface is the proofs and \
71+
(eventually) an extracted, verified runtime. It is NOT a place for \
72+
unverified 'convenience features' — every command must have a \
73+
proof story or an explicit, documented gap."
4474
; Examples:
4575
; "This is NOT a general-purpose database — it solves one specific problem."
4676
; "This is NOT a framework — it is a library with a focused API."
@@ -49,24 +79,57 @@
4979

5080
; === Key Architectural Decisions That Must Not Be Reversed ===
5181
(architectural-invariants
52-
; *REMINDER: List the foundational decisions*
53-
; ("Idris2 for ABI definitions — dependent types prove interface correctness")
54-
; ("Zig for FFI — zero-cost C ABI compatibility")
55-
; ("Elixir for supervision — OTP fault tolerance")
82+
("Polyglot verification — 6 proof systems (Coq, Lean 4, Agda, Isabelle/HOL, Mizar, Z3) prove the SAME core theorems across DIFFERENT logical foundations; do not collapse to a single prover")
83+
("Lean 4 is the primary spec — when proofs disagree, Lean is the canonical statement; other systems cross-validate")
84+
("Coq is the extraction path — proofs in coq/ must remain extractable to OCaml/Rust; do not introduce non-computational axioms beyond the documented set (funext, well-formedness, decidability of is_empty_dir)")
85+
("Rust is the primary runtime — impl/rust-cli/ is the only production-tracked implementation; OCaml/Elixir/Zig live in impl/ but are reference/FFI artefacts only")
86+
("MAA framework split — RMR (Remove-Match-Reverse) operations MUST be proven reversible; RMO (Remove-Match-Obliterate) operations MUST be proven non-injective (information-loss) — never collapse the two")
87+
("Honest-status discipline — every claim in README/CLAUDE.md/contractiles must have a counterpart caveat; the EXPLAINME.adoc per-claim caveat pattern is load-bearing")
88+
("Reversibility predicate is conditional — theorems are of the form `precondition p fs -> reverse(op(p, fs)) = fs`; never weaken to unconditional reversibility")
89+
("Proof-hole audit is authoritative — `docs/PROOF_HOLES_AUDIT.md` is the single source of truth for remaining gaps; CLAUDE.md and README MUST be kept in sync with it")
90+
("Six-tool boundary policy is in force — Zig for APIs/FFIs, Idris2 for ABIs, SNIFs for BEAM↔native, typed-wasm for compile targets, Groove Protocol for cross-system service discovery; bash/POSIX is the user surface, not an internal interop layer")
5691
)
5792

5893
; === Sensitive Areas (if in doubt, ask) ===
5994
(ask-before-touching
60-
; *REMINDER: List areas where LLMs should check before modifying*
61-
; "src/abi/ — formal proofs, changes require re-verification"
62-
; "ffi/zig/ — C ABI boundary, changes affect all language bindings"
63-
; ".machine_readable/ — checkpoint files, format is specified"
95+
"proofs/coq/ proofs/lean4/ proofs/agda/ proofs/isabelle/ proofs/mizar/ proofs/z3/ — every change requires re-verification across affected systems"
96+
"proofs/idris2/ — ABI carriers; changes here ripple to FFI surface"
97+
"docs/PROOF_HOLES_AUDIT.md — single-source-of-truth for proof debt; any change must be reflected in CLAUDE.md and README counts the same commit"
98+
".machine_readable/ — contractile family (MUST/TRUST/DUST/INTENT/ADJUST) + a2ml agent state; format is specified by the agentic-a2ml ADRs"
99+
"impl/rust-cli/src/state.rs — operation history, undo/redo, checkpoints; this is the runtime correspondence to the proven model"
100+
"impl/rust-cli/src/commands/secure_deletion.rs and proofs/idris2/RMO.idr — RMO/GDPR claims; the entire compliance story rides on these"
101+
"EXPLAINME.adoc — the per-claim-caveat scaffold; do not delete or 'simplify' without owner sign-off"
102+
"LICENSE + LICENSES/ — REUSE-format SPDX; the project migrated PMPL-1.0 → MPL-2.0 in commit 990b147 and must not regress"
64103
)
65104

66105
; === Ecosystem Position ===
67106
(ecosystem
68-
(belongs-to "{{MONOREPO_OR_STANDALONE}}")
69-
(depends-on ("{{DEP1}}" "{{DEP2}}"))
70-
(depended-on-by ("{{CONSUMER1}}" "{{CONSUMER2}}"))
107+
(belongs-to "STANDALONE")
108+
; The proof systems, the Rust CLI, the ABI carriers, and the supporting
109+
; reference implementations (OCaml/Elixir/Zig) all live in this single repo.
110+
; valence-shell is NOT a sub-project of a larger monorepo.
111+
112+
(depends-on
113+
"Coq 8.18+ — Calculus of Inductive Constructions, extraction to OCaml"
114+
"Lean 4.3+ — primary specification language (dependent type theory)"
115+
"Agda 2.6.4+ — intensional type theory, cross-validation"
116+
"Isabelle/HOL 2024 — higher-order logic, cross-validation"
117+
"Mizar — Tarski-Grothendieck set theory, cross-validation"
118+
"Z3 4.12+ — SMT solver, automated decision procedures"
119+
"Rust toolchain (stable, edition 2021) — impl/rust-cli/ primary implementation"
120+
"cargo-fuzz — fuzz harness (7 targets in impl/rust-cli/fuzz/fuzz_targets/)"
121+
"reedline — interactive REPL backend"
122+
"Just (command runner) — top-level build orchestration"
123+
"Nix (recommended) — pinned multi-prover toolchain via flake.nix"
124+
)
125+
126+
(depended-on-by
127+
; valence-shell has no known production downstream consumers at v0.9.0.
128+
; It is a standalone research prototype. Treat any future consumer
129+
; relationship as a hard architectural decision requiring INTENT update.
130+
"NONE_AT_V0_9_0 — no known downstream consumers; this is a standalone research prototype"
131+
; Conceptual / aspirational relationships (NOT current code dependencies):
132+
"absolute-zero (conceptual ancestor) — CNO composition theory predates this project; vsh implements it for filesystem ops"
133+
)
71134
)
72135
)

.machine_readable/agent_instructions/methodology.a2ml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
# Reference: ADR-002 in standards/agentic-a2ml/docs/
99

1010
[metadata]
11-
version = "1.0.0"
12-
last-updated = "2026-03-24"
11+
version = "1.1.0"
12+
last-updated = "2026-06-01"
1313
spec = "https://github.com/hyperpolymath/standards/blob/main/agentic-a2ml/docs/ADR-002-methodology-layer.adoc"
1414

1515
# ============================================================================
@@ -55,7 +55,7 @@ perfective = 10 # % for SPDX headers, doc updates, formatting, style
5555
# Customise this per project — the template default is generic.
5656

5757
[methodology.unique-strength]
58-
description = "{{PROJECT_UNIQUE_STRENGTH}}"
58+
description = "Proof-backed MAA (Mutually Assured Accountability) framework with polyglot verification: the SAME core reversibility theorems proven across 6 independent proof systems (Coq, Lean 4, Agda, Isabelle/HOL, Mizar, Z3) on top of DIFFERENT logical foundations (CIC, dependent TT, intensional TT, HOL, Tarski-Grothendieck set theory, SMT). Cross-validation between foundations catches modelling errors that any single prover would miss, and the Idris2 ABI layer carries the proof story across the FFI boundary into the Rust CLI runtime. Sibling projects diverge: echidna is dyadic-Coq-only, proven is single-Idris2, ephapax is four-layer-Coq for typed-wasm — none of them carry cross-foundation cross-validation. Divergent-mode work in valence-shell must DEEPEN the polyglot story (close a hole in System X by porting the proof from System Y, tighten the cross-system correspondence, extend Idris2 ABI coverage of newly-proven operations) rather than introduce a 7th system or substitute a stronger single-prover stack."
5959
deepen-not-broaden = true
6060

6161
# ============================================================================
@@ -71,15 +71,21 @@ deepen-not-broaden = true
7171

7272
[methodology.divergent-invariants]
7373
rules = [
74-
# Customise per project. Examples:
75-
# "Idris2 only for formal verification — no Lean4, Coq, Agda",
76-
# "believe_me count must remain zero",
77-
# "FFI architecture: Idris2 → RefC → Zig → C ABI (no shortcuts)",
74+
"Polyglot stays at exactly 6 verification systems (Coq, Lean 4, Agda, Isabelle/HOL, Mizar, Z3) — do not add a 7th and do not drop one to simplify",
75+
"Lean 4 is the canonical specification — when foundations disagree, Lean is the source of truth and the others cross-validate",
76+
"Coq proofs in proofs/coq/ MUST remain extractable to OCaml — no introduction of non-computational axioms beyond the documented set (funext, well-formedness, decidability of is_empty_dir)",
77+
"Proof-hole count is monotone non-increasing — never trade a closed hole for a new one without an explicit ADR; PROOF_HOLES_AUDIT.md is the bookkeeping",
78+
"RMR (Remove-Match-Reverse) theorems are reversibility statements; RMO (Remove-Match-Obliterate) theorems are NON-injectivity statements — never collapse the two; the historical mis-statement obliterate_not_reversible was already caught and replaced 2026-04-03",
79+
"Idris2 ABI layer is the only sanctioned proof-to-FFI carrier — do not bypass it with raw C bindings or unverified Rust FFI",
80+
"Rust is the single production runtime — divergent work goes into impl/rust-cli/, not into impl/ocaml/ (extraction target, design only) or impl/elixir/ (reference, stale)",
81+
"POSIX coverage is a means, not an end — do not add shell syntax that has no path to a proof story",
82+
"Honest-status discipline — every claim must have a counterpart caveat (EXPLAINME.adoc pattern); README/CLAUDE.md numbers MUST match docs/PROOF_HOLES_AUDIT.md and reality",
7883
]
7984

80-
# Optional: language invariant for the core strength
81-
# If set, divergent mode will not introduce other languages for this purpose
82-
# language-invariant = "idris2"
85+
# Language invariant for the core strength: there is no SINGLE language —
86+
# the polyglot itself is the invariant. The set of 6 verification systems is
87+
# the riverbank; do not introduce a 7th and do not drop one.
88+
# language-invariant = "polyglot-6"
8389

8490
# ============================================================================
8591
# CONSTRAINT HINTS
@@ -89,9 +95,15 @@ rules = [
8995

9096
[methodology.known-constraints]
9197
constraints = [
92-
# Customise per project. Examples:
93-
# "End-to-end build has never been verified",
94-
# "libproject.so does not exist yet — all bindings call stubs",
98+
"Lean -> Rust correspondence is property-tested only (~85% confidence), NOT mechanised — closing this is the critical-path blocker to v1.0.0",
99+
"Elixir NIF build is broken — impl/elixir/ is reference-only; do not block work on it",
100+
"BEAM daemon is designed but not implemented — no current SNIF carrier",
101+
"Coq has 1 remaining real proof gap: obliterate_overwrites_all_blocks (mechanical induction over overwrite passes) — see docs/PROOF_HOLES_AUDIT.md",
102+
"Agda has 1 structural axiom (funext) — provable in cubical Agda, intentional in intensional TT",
103+
"Coq has 1 justified decidability axiom (is_empty_dir_dec) — infinite-domain Filesystem = Path -> option FSNode; switching to FMaps.t FSNode is the documented migration",
104+
"RMO (GDPR / secure deletion) primitives are stubs in impl/rust-cli/src/commands/secure_deletion.rs — proofs exist for the model, runtime does not yet bind to them",
105+
"OCaml extraction path exists in proofs/coq/extraction.v but the extracted code is not wired into a build target",
106+
"Idris2 ABI carrier has 2 holes + 10 partial markers per the 2026-06-01 deep audit (issue #42) — these are the FFI boundary obligations",
95107
]
96108

97109
# ============================================================================

.well-known/ai.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ Disallow-Generation: yes
1313
# AI agents must preserve Emotional Lineage per PMPL Section 3.
1414
#
1515
# For AI agent integration instructions, see:
16-
# AI.a2ml (AI entry point)
17-
# .machine_readable/ (structured project state)
16+
# 0-AI-MANIFEST.a2ml (lexicographic-first AI entry point)
17+
# .machine_readable/INTENT.contractile (purpose + ecosystem)
18+
# .machine_readable/agent_instructions/methodology.a2ml (mode/budget/invariants)
19+
# docs/audits/ (drift-reconciliation audit log)

0-AI-MANIFEST.a2ml

Lines changed: 71 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,75 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# 0-AI-MANIFEST.a2ml — AI agent entry point for valence-shell
3+
#
4+
# Lexicographic-first machine-readable file so any agent that does a
5+
# default-sorted directory walk discovers this first. Points at the
6+
# canonical contractile family and the agent_instructions/ tree.
17

2-
# AI Assistant Instructions
8+
[manifest]
9+
project = "valence-shell"
10+
version = "0.9.0"
11+
status = "Advanced research prototype — NOT production-ready"
12+
license = "MPL-2.0"
13+
last-updated = "2026-06-01"
314

4-
## Repository Focus
5-
- `rsr-template-repo` is treated as a Rhodium Standard Repository; obey the Rhodium policies, maintain `.bot_directives`, and keep `.machines_readable/6scm/` authoritative.
6-
- Prefer to keep generated files out of source control, and regenerate them with the documented commands before committing.
15+
# What this project IS — one-line summary; for the full statement read
16+
# .machine_readable/INTENT.contractile (the load-bearing artefact).
17+
description = "Formally verified Unix-style shell with proven reversibility across 6 proof systems (Coq, Lean 4, Agda, Isabelle/HOL, Mizar, Z3). Implements the MAA (Mutually Assured Accountability) framework."
718

8-
## Workflow
9-
1. Inspect `.machines_readable/6scm/STATE.scm` for blockers and next actions.
10-
2. Respect any constraints listed inside `.machines_readable/6scm/AGENTIC.scm` when tooling changes are requested.
11-
3. After finishing edits, update STATE with your outcomes and commit with a concise, imperative message.
19+
[entry-points]
20+
# Read these in order at session start.
21+
contractile-purpose = ".machine_readable/INTENT.contractile"
22+
contractile-must = ".machine_readable/MUST.contractile"
23+
contractile-trust = ".machine_readable/TRUST.contractile"
24+
contractile-adjust = ".machine_readable/ADJUST.contractile"
25+
methodology = ".machine_readable/agent_instructions/methodology.a2ml"
26+
coverage = ".machine_readable/agent_instructions/coverage.a2ml"
27+
debt = ".machine_readable/agent_instructions/debt.a2ml"
28+
human-claude-handbook = "CLAUDE.md"
29+
human-readme = "README.adoc"
30+
human-explainme = "EXPLAINME.adoc"
31+
human-faq = "FAQ.adoc"
1232

13-
## Delivery Promises
14-
- Mention in summaries whether STATE, `contractiles/`, or `.bot_directives/` changed.
15-
- Keep this file in sync with the repository’s status; update it if the governance changes.
33+
[honest-status]
34+
# The single source of truth for proof debt is docs/PROOF_HOLES_AUDIT.md.
35+
# If you see different numbers anywhere, file an issue.
36+
proof-holes-doc = "docs/PROOF_HOLES_AUDIT.md"
37+
deep-audit-log-dir = "docs/audits/"
38+
latest-deep-audit = "docs/audits/2026-06-01-deep-audit.adoc"
39+
40+
[counts-as-of-last-audit]
41+
# Per docs/audits/2026-06-01-deep-audit.adoc + issue #42.
42+
theorem-candidates = 478
43+
proof-systems = 6
44+
proof-holes-remaining = 3 # 1 real gap + 1 justified axiom + 1 structural axiom
45+
rust-source-files = 32
46+
rust-loc = 21331
47+
tests-passing = 736
48+
tests-ignored = 14
49+
tests-failing = 0
50+
fuzz-targets = 7
51+
52+
[boundary-convention]
53+
# Per estate-standard feedback_estate_boundary_conventions:
54+
in-process-ffi = "Zig (impl/zig/)"
55+
formal-abi = "Idris2 (proofs/idris2/)"
56+
beam-native = "SNIFs — not currently wired"
57+
compile-target = "typed-wasm — not currently a target"
58+
service-discovery = "Groove Protocol — not currently wired"
59+
60+
[delivery-promises]
61+
# Every agent session must:
62+
# 1. Read INTENT before changing scope.
63+
# 2. Update docs/PROOF_HOLES_AUDIT.md the same commit that changes any proof.
64+
# 3. Keep README/CLAUDE.md numbers in sync with reality (see docs/audits/).
65+
# 4. Never collapse the 6-system polyglot stack (divergent invariant).
66+
update-on-touch = [
67+
".machine_readable/INTENT.contractile",
68+
".machine_readable/MUST.contractile",
69+
".machine_readable/TRUST.contractile",
70+
".machine_readable/ADJUST.contractile",
71+
"docs/PROOF_HOLES_AUDIT.md",
72+
"docs/audits/",
73+
"CLAUDE.md",
74+
"README.adoc",
75+
]

CHANGELOG.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,5 +398,5 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for how to contribute to future releases.
398398

399399
---
400400

401-
**Maintained by**: See [MAINTAINERS.md](MAINTAINERS.md)
401+
**Maintained by**: See [MAINTAINERS.adoc](MAINTAINERS.adoc)
402402
**License**: Palimpsest-MPL 1.0 or later (see link:LICENSE[LICENSE])

0 commit comments

Comments
 (0)