Skip to content

Settle how cead is built: spec, skeleton, fill - #10

Merged
1zeroone0 merged 1 commit into
mainfrom
build-method
Sep 28, 2026
Merged

1zeroone0 merged 1 commit into
mainfrom
build-method

Conversation

@1zeroone0

Copy link
Copy Markdown
Owner

What this PR does

Settles how cead is built before the first code, from scoping the first PR (the old loop PR, whose intent is now a Horizon comment on #7).

  • One method. CODE.md is reorganized as method, vocabulary, languages. TLA+ specifies the system, Lean a core function, Rust is the system: one pipeline of spec → slice → core → skeleton → fill. The system spec (spec/cead.tla) comes first and is revisable: when code disagrees, the spec changes in that PR. A moved signature is learning, stated in the commit comment; a new capability is drift.
  • Spec, not model. The artifact before the skeleton is a spec; "model" collided with the LLM.
  • Frontier and claim. Placeholders (todo!, unimplemented!, unwrap, expect, #[ignore]) are the frontier, zero at merge. unreachable!() and #[expect(lint, reason)] are claims review reads. #[allow] is denied. Frontier lints warn, so a draft compiles and cargo clippy --all-targets -- -D warnings fails until filled. Tests unwrap through clippy.toml, not attributes. The toolchain pins clippy.
  • Types as schema. The five language-enforced invariants and the "does it still compile?" test for what is a choice, written down as priors.
  • Probe, then wrap. Dependencies are probed while scoping, findings in a PR comment, probe never committed. A dependency's types stay inside its boundary module.
  • Vocabulary as a table. Every noun has one home in code (type, module or crate, binary); a noun may precede its home; no home without a noun.
  • AGENTS.md. End-to-end tests first, ending in a checkable, re-runnable artifact. Branches name the change, not the thing changed. Only Horizon and PRs in progress are open. The squash trade is stated; gh land now keeps each PR's comment thread as a git note in refs/notes/pr (backfilled for Refresh cead's assets: Irish accents, feathered Ogham mark, SVG lockups #3, Name cead's userspace and its three ways to fan out #4, Make PR comments state their next step and feed the description #6). The one-measurement-per-milestone line is removed: "a system that can disagree with us" already says it.
  • done → finish. done is a POSIX shell keyword (bash -c 'done x' is a syntax error), so the call could never run. finish is process-shaped: like gdb's, it returns a frame's value to its caller.

What this PR does not do

  • Write any spec or code; initial-spec is next (Horizon).
  • Re-cut the rest of Horizon; that is a merge requirement of initial-spec.
  • Change gh land itself in the repo; it lives outside it.

Merge requirements

  • cargo clippy --all-targets -- -D warnings green on the empty crate with the new lints.
  • Roone has read CODE.md end to end and it reads as one document.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@1zeroone0

Copy link
Copy Markdown
Owner Author

d86898f

  1. Built — CODE.md reorganized as Method (sequence, frontier/claim, boundaries) → Vocabulary (table with a Home column) → Rust / TLA+ / Lean (environment and idioms only). AGENTS.md: five line edits, one deletion. Cargo.toml lints, clippy.toml, clippy in the toolchain; README done → finish.
  2. Why — Languages were parallel sections; they are one pipeline, so method comes first and languages say only how they express it. clippy.toml over cfg_attr(test, allow(...)), because allow_attributes rejects the attribute form.
  3. Bloat — CODE.md is 24 bytes smaller despite adding the invariants, the method sequence and the table: the lint block that duplicated Cargo.toml is gone (Cargo.toml is the rule), and "every noun is a struct or enum" is absorbed by the Home rule.
  4. Drift — Moved out, to Horizon, not deleted: TLA+ candidates (fork–exec gap, log/snapshot/fork, budget tree) and Lean candidates (Budget::split, eviction, export round-trip, pinned-prompt renderer) go to the initial-spec comment; "first Lean spec is Budget" goes to the rlm-and-budget comment. The Lean project moves from model/ to spec/.
  5. Trust surface — Checked on 1.98 in a scratch crate: todo!() warns; bare #[allow] and a reason-less #[expect] are errors; #[expect(clippy::unreachable, reason)] passes; unwrap in #[cfg(test)] passes with clippy.toml. Not checked: allow-expect-in-tests, by symmetry only.
  6. How it breaks — A lake project and TLA+ modules sharing spec/ may collide once both exist. #[ignore] is still counted as frontier but no lint counts it; that is grep, not a checker.
  7. Not confident — The Home column's form (one column, free text) before any home exists. Whether "a fill commit names the action it implements" is practical when one body serves two actions.
  8. Verify yourself — CODE.md Method section as a whole; the frontier/claim lists in Rust › Idioms; AGENTS.md line on Horizon.
  9. Next steps — Finished pending your read; Horizon updates and initial-spec scoping continue on Horizon #7.

@1zeroone0 1zeroone0 mentioned this pull request Sep 28, 2026
5 tasks
@1zeroone0
1zeroone0 marked this pull request as ready for review September 28, 2026 02:12
@1zeroone0
1zeroone0 merged commit 75756ee into main Sep 28, 2026
@1zeroone0
1zeroone0 deleted the build-method branch September 28, 2026 02:17
@1zeroone0 1zeroone0 mentioned this pull request Sep 29, 2026
5 tasks done
1zeroone0 added a commit that referenced this pull request Sep 29, 2026
Specify cead as a system in TLA+, confidential-first. The first practice
of the method settled in #10.

## What this PR does
- `spec/cead.tla`: the whole system, coarse, in three layers. One
protocol, two modes that differ only in who guarantees its assumptions:
**attested**, where the processor proves them, and **trusted-host**,
where they are asserted. The modes are also a measured comparison of
what attestation costs, not a claim that it is safer.
- **Layer 1: a boot, its records and the log.** A boot's first record is
its report, binding its key to the manifest's measurement; nothing runs
until the log holds it. Each call is an intent, acknowledged by the log
before policy decides, then a decision and, if allowed, a witness. The
boot ends with a signed exit record. The log keeps a record only if the
processor or a vouched key signed it, first-wins per place in the boot's
hash chain. The host is a Dolev–Yao network: it can lose, delay, replay
and forge, and sign only as itself.
- **Layer 2: snapshot, fork and recovery.** A snapshot is taken between
calls, once the log holds every record. A boot from one makes a new key;
its report names the snapshot. A fork starts a new job; a recovery
continues one whose boot is unknown, at most once, and **fences** it:
the log keeps none of that boot's records after.
- **Layer 3: sub-agents, processors and meters,** inside one boot.
`agent` spawns a child process with rights ⊆ its parent's, depth − 1 and
a capped meter; every call charges each meter up to the root (KeyKOS). A
process ends when the model replies without a command; its live
descendants are killed. Revocation is `kill`, reaching only descendants
(a PID namespace per spawn). The model's processors are virtual:
`Dispatch` gives a ready process one.
- Assumptions in the header, each with its guarantor per mode:
`KeySecret`, `KeyBound`, `SnapshotSealed`, `Descendants`; availability
is the host's and the scheduler's.
- README rewritten as a whiteboard of what cead is and how it works:
scannable, no status or placeholders to drift; uses, evaluations and
unproven ideas live in Horizon.
- Vocabulary re-levelled around the spec: **boot**, **report**,
**record** (Linux audit's unit: report, intent, decision, witness,
exit), fork and recovery and fencing inside **snapshot**; one call,
**`agent`**, since agent delegation's in-distribution form is a
semantics shell job control already carries.
- Order of work after this PR: the harness in a confidential Cloud
Hypervisor machine (the loop, unattested first); then, concurrently, the
confidential research questions and trusted-host mode on Firecracker and
Virtualization.framework (Horizon #7).
- Horizon #7 re-cut: every comment names its slice of the spec.

## What this PR does not do
- Rust or Lean.
- Inference as evidence, which is phase two (Horizon: one memory
hierarchy): the engine's chain, and a record of inference outside the
machine joined to the log by call id. The spec includes the model's
processor, not its evidence.
- Prove what the engine produced: the log proves what the machine
received. Hosted APIs cannot honor job-scoped tokens, so a gateway on
the host holds the real key and ends TLS; the model's words there are as
trustworthy as that gateway.
- Answer the research questions. The spec states what attested snapshot
and fork must guarantee; hardware says whether they can.
- Liveness beyond "every boot ends": no fairness on `Dispatch`, so
starvation is the scheduler's (trusted for availability only).
- Policy that depends on state; `Policy` is a constant (Horizon:
policy).

## Merge requirements
- [x] TLC green; each commit line records the tools version and bounds.
- [x] Every property has a mutation that TLC catches.
- [x] Assumptions named in the spec's header, each with its guarantor
per mode.
- [x] Names come from CODE.md's vocabulary.
- [x] Horizon re-cut against the spec.

## Record
- TLC 2.19. Committed: `cead.cfg` (2 commands, 1 denied, 1 call, 2
boots) 437,752 distinct states, 30 s; `tree.cfg` (2 processes, depth 1,
2 calls) 783,076, 44 s. 26 mutations, all caught, two needing 3 boots or
3 processes.
- Receipt runs: the full spec at 2 calls, 2 boots (meter not binding),
19,188,532 states, 40m48s, green; layer 2 at 1 call, 3 boots, one
command, 19,482,379 states, 46m43s, green; the tree at 3 processes,
depth 2, stopped past 11M states, no violation.
- Findings the model produced: fencing (a late exit record would give a
job two outcomes); records stay in transit once sent (loss as removal
made TLC enumerate every subset; deleting `Lose` and `Resend` cut the
smallest bound from 10+ min to 5 s); Linux cannot revoke a running
child's rights (revocation is `kill`, no membrane).
- Unmeasured commitments: a round trip to the log before the first call
and per call, a signature and hash per record, re-keying per fork, boots
lost to fencing. Each is a measurement in the loop or stats (Horizon).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant