Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/lexlean-revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2aced32e0f9c1ca0cf160f150a04819dedb4fc04
b0e40add3b573a7040d27a6dd67858db89838199
8 changes: 7 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ command/attestation reads. Its accepted outcome is validated report data;
`ResearchProof` promotes it only after `CandidateBinding` recomputes the candidate
semantic identity and compares the audited declaration's actual type with the
requested contextual goal. `ResearchRunner.Event.reviewed` refuses checked
answers; submit proof jobs through `Event.proof`. The binding schema encodes the
answers; submit constructed candidates through `Event.candidate`.
`ResearchCandidate` owns the local `lexlean snapshot` process and output read,
reconstructs the full compiler IR with `CompilerSnapshot`, derives verification
pins and preflights the exact goal before entering `ResearchProof`. Snapshot
metadata is not a proof. Its caller still owns candidate construction, the
isolated project and imported library snapshot. `Event.proof` remains the
internal typed entry for already-owned candidate data. The binding schema encodes the
inspected source type and closed target as core arenas in the sequent; source
inspection must establish their origin and snapshot before dispatch.
Maintenance reports have a separate result kind. Cancellation consumes the
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,12 @@ step roots can export a generated executable with explicit file/process effects
and child cleanup; pure roots remain libraries.
The API imports `LexLeanStd.Host` from the pinned source package; its local
`Host` module contains only the application harness. The attention catalog
covers all 60 application and library modules. `ResearchRunner` connects the
covers all 64 application and library modules. `ResearchRunner` connects the
controller to the local-tool supervisor in `ResearchExecution`: it binds each
job to the outstanding request, drains cancelled host requests, preserves child
ownership on cleanup failure, and requires report review after a successful
process exit. External checked answers are refused: proof jobs use the owned
`ResearchCandidate` lifecycle, which obtains an owned local compiler snapshot before starting the
`ResearchProof` verifier. Maintenance reports must cover the requested sources. Dependency changes invalidate both
active work and remembered evidence.

Expand All @@ -311,7 +312,14 @@ resource limits, exact tool identities, declaration axiom checks and module
kernel-replay records. The decoder recomputes the attestation content identity;
`ResearchVerification` owns the fixed local verify job, reads its command output
before the matching attestation, and returns a receipt only after decoding it.
Cancellation drains pending reads; failed process cleanup retains ownership.
Cancellation drains pending reads; unexpected replies halt dispatch with ownership
retained, as do failed process cleanups.
`CompilerSnapshot` reconstructs the full linked IR and exact lexicon closure from
`lexlean snapshot`, checks the compiler and recomputes its semantic identity.
`ResearchCandidate` owns that command and output read, derives the verification
pins, checks the requested contextual goal, and starts verification in the same
isolated project. A snapshot alone is metadata; only the subsequent verifier can
produce proof evidence. Cancellation cannot cross the handoff into verification.
`ResearchProof` then binds the receipt to the candidate's actual native declaration.
`ArtifactIdentity` recomputes the semantic identity from canonical linked IR and
lexicon closure; `CandidateBinding` selects the unique audited theorem and
Expand All @@ -324,6 +332,9 @@ UTF-8 chunk, parser-state and SHA-256 block facts keep the complete report
acceptance proof compositional; lifecycle traces reuse that checked receipt and verify rejection,
cancellation, ownership and terminal behavior.

`rule30-api/production/research-request.json` exports the research controller,
catalog initializer, and runner `begin`/`step` component libraries.

Native application wiring, source inspection into the binding schema,
strategy candidate construction and durable publication are still required for
the new runner to replace the legacy engine. CI and runtime
Expand Down
Binary file modified Rule30-Core.pdf
Binary file not shown.
Binary file modified Rule30-Observations.pdf
Binary file not shown.
Binary file modified Rule30-Paper.pdf
Binary file not shown.
10 changes: 5 additions & 5 deletions pdf-manifest.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"documents": {
"Core": {
"pdf_sha256": "f479fa1dbee863116bb577217ebbc22429bca7e117d25ae1d47188d6080ff122",
"pdf_sha256": "d9c44a5241f29408df06c5cc3c2c8b3a3f873f1e7408b87d9066b3b63bc9e147",
"tex_sha256": "a7cd1807077baa1d1ca34015faf500a24477991859427f4db646e5f230fe54e2"
},
"Observations": {
"pdf_sha256": "de987d0c3a8eea79bbfe5c95b8254eeb1b65f1b5218ff7f6a54096ac719f3f45",
"pdf_sha256": "ca4906ef5921402090a9530bb4c32048d156ab63a4ab128d774c36d6fa9ccc1f",
"tex_sha256": "056820f37ac40133e341f46ad6c81125e35981150a1cc86f2063faad3f26fbd4"
},
"Paper": {
"pdf_sha256": "dba47573d0d811503185ba2b379a3e6de85e4d403ddae126643c2e408d0e6e28",
"pdf_sha256": "8dac918f7fe4faed24c3a2815097e36c13b37d9ba2b66fcd4ff9b84f902d318c",
"tex_sha256": "000f988561d9621f9ba2f9a99aba971670864367ebd336e6fbad0e1f71da01cb"
}
},
"generated_at_utc": "2026-11-04T20:49:52.508527+00:00",
"source_digest": "499bcf9d5fb81dcc7379fb536b87ae6caf13f9ac89db23f3996934a9bc5ca816"
"generated_at_utc": "2026-11-04T23:37:57.002459+00:00",
"source_digest": "ee78d0baa7a86567d7f9fdfa5ddd2893f4641cfe14bee69bdaaa4e4c6c5f9d47"
}
2 changes: 1 addition & 1 deletion rule30-api/lexlean.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spec = "lexlean/lock/2"
language = "1.2"
compiler_semantics = "b9816b388a3eb1800179f96aa9bc789620a46d7a7132f1b52ee9fa404c2092f7"
project_config_sha256 = "f051b3f72b219df5ee4ee3276311bb8dd0e4211878f6904aa411974333c29226"
project_config_sha256 = "f0d83d368ddcf856d8997e460d5c121390f8118cef37f56e18c5a2e68996beb1"
lean_toolchain = "leanprover/lean4:v4.32.1"

[[workspace_file]]
Expand Down
4 changes: 2 additions & 2 deletions rule30-api/lexlean.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "rule30-api"
language = "1.2"
module_prefix = "Rule30Api"
source_roots = ["src", "stdlib"]
entrypoints = ["src/Api.lex.tex", "src/Application.lex.tex", "src/Architecture.lex.tex", "src/ArtifactIdentity.lex.tex", "src/ArtifactIdentityTraces.lex.tex", "src/Audit.lex.tex", "src/BindingFixture.lex.tex", "src/CandidateBinding.lex.tex", "src/CandidateBindingTraces.lex.tex", "src/Convert.lex.tex", "src/CoreBinding.lex.tex", "src/CoreBindingTraces.lex.tex", "src/Discovery.lex.tex", "src/Engine.lex.tex", "src/Host.lex.tex", "src/Hypotheses.lex.tex", "src/Json.lex.tex", "src/JsonCanonical.lex.tex", "src/JsonCanonicalTraces.lex.tex", "src/JsonTraces.lex.tex", "src/Observer.lex.tex", "src/Presentation.lex.tex", "src/R30.lex.tex", "src/R30Traces.lex.tex", "src/R30TracesClaims.lex.tex", "src/R30TracesForms.lex.tex", "src/R30TracesRegister.lex.tex", "src/Register.lex.tex", "src/Research.lex.tex", "src/ResearchCatalog.lex.tex", "src/ResearchExecution.lex.tex", "src/ResearchExecutionTraces.lex.tex", "src/ResearchProof.lex.tex", "src/ResearchProofTraces.lex.tex", "src/ResearchRunner.lex.tex", "src/ResearchRunnerTraces.lex.tex", "src/ResearchTraces.lex.tex", "src/ResearchVerification.lex.tex", "src/ResearchVerificationTraces.lex.tex", "src/Rule30Core.lex.tex", "src/Sequences.lex.tex", "src/Standards.lex.tex", "src/Toml.lex.tex", "src/VerificationCommandFixtures.lex.tex", "src/VerificationHashFixtures.lex.tex", "src/VerificationJsonData.lex.tex", "src/VerificationJsonFixtures.lex.tex", "src/VerificationJsonSteps0.lex.tex", "src/VerificationJsonSteps1.lex.tex", "src/VerificationJsonSteps2.lex.tex", "src/VerificationJsonSteps3.lex.tex", "src/VerificationReport.lex.tex", "src/VerificationReportTraces.lex.tex", "src/VerificationUtf8Fixtures.lex.tex"]
entrypoints = ["src/Api.lex.tex", "src/Application.lex.tex", "src/Architecture.lex.tex", "src/ArtifactIdentity.lex.tex", "src/ArtifactIdentityTraces.lex.tex", "src/Audit.lex.tex", "src/BindingFixture.lex.tex", "src/CandidateBinding.lex.tex", "src/CandidateBindingTraces.lex.tex", "src/CompilerSnapshot.lex.tex", "src/CompilerSnapshotTraces.lex.tex", "src/Convert.lex.tex", "src/CoreBinding.lex.tex", "src/CoreBindingTraces.lex.tex", "src/Discovery.lex.tex", "src/Engine.lex.tex", "src/Host.lex.tex", "src/Hypotheses.lex.tex", "src/Json.lex.tex", "src/JsonCanonical.lex.tex", "src/JsonCanonicalTraces.lex.tex", "src/JsonTraces.lex.tex", "src/Observer.lex.tex", "src/Presentation.lex.tex", "src/R30.lex.tex", "src/R30Traces.lex.tex", "src/R30TracesClaims.lex.tex", "src/R30TracesForms.lex.tex", "src/R30TracesRegister.lex.tex", "src/Register.lex.tex", "src/Research.lex.tex", "src/ResearchCandidate.lex.tex", "src/ResearchCandidateTraces.lex.tex", "src/ResearchCatalog.lex.tex", "src/ResearchExecution.lex.tex", "src/ResearchExecutionTraces.lex.tex", "src/ResearchProof.lex.tex", "src/ResearchProofTraces.lex.tex", "src/ResearchRunner.lex.tex", "src/ResearchRunnerTraces.lex.tex", "src/ResearchTraces.lex.tex", "src/ResearchVerification.lex.tex", "src/ResearchVerificationTraces.lex.tex", "src/Rule30Core.lex.tex", "src/Sequences.lex.tex", "src/Standards.lex.tex", "src/Toml.lex.tex", "src/VerificationCommandFixtures.lex.tex", "src/VerificationHashFixtures.lex.tex", "src/VerificationJsonData.lex.tex", "src/VerificationJsonFixtures.lex.tex", "src/VerificationJsonSteps0.lex.tex", "src/VerificationJsonSteps1.lex.tex", "src/VerificationJsonSteps2.lex.tex", "src/VerificationJsonSteps3.lex.tex", "src/VerificationReport.lex.tex", "src/VerificationReportTraces.lex.tex", "src/VerificationUtf8Fixtures.lex.tex"]
build_root = ".lexlean"
lockfile = "lexlean.lock"
lean_workspace = "."
Expand Down Expand Up @@ -34,7 +34,7 @@ kind = "path"
path = "lexlean-stdlib"

[limits]
max_file_bytes = 6291456
max_file_bytes = 8388608
max_total_source_bytes = 67108864
max_primitive_atoms = 2000000
max_token_lattice_edges = 4000000
Expand Down
10 changes: 10 additions & 0 deletions rule30-api/production/research-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@
"package": {"name": "rule30_research_initial", "version": "0.1.0"},
"root": "Rule30Api.ResearchCatalog.initial",
"targets": [{"digest": "0f5802ea18121b6a7a0d03e999589ce4e5ae812dc2a358432c1bf024a8e53f9f", "id": "rust-std"}]
},
{
"package": {"name": "rule30_research_runner_begin", "version": "0.1.0"},
"root": "Rule30Api.ResearchRunner.begin",
"targets": [{"digest": "0f5802ea18121b6a7a0d03e999589ce4e5ae812dc2a358432c1bf024a8e53f9f", "id": "rust-std"}]
},
{
"package": {"name": "rule30_research_runner_step", "version": "0.1.0"},
"root": "Rule30Api.ResearchRunner.step",
"targets": [{"digest": "0f5802ea18121b6a7a0d03e999589ce4e5ae812dc2a358432c1bf024a8e53f9f", "id": "rust-std"}]
}
],
"spec": "lexlean/production-request/1"
Expand Down
84 changes: 84 additions & 0 deletions rule30-api/src/CompilerSnapshot.lex.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
\begin{lexlean}{CompilerSnapshot}
\useglossary{lexlean.std.bool@1.2.0}
\useglossary{lexlean.std.nat@1.2.0}
\importmodule{Json}
\importmodule{Toml}
\importmodule{CoreBinding}
\importmodule{ArtifactIdentity}
\importmodule{CandidateBinding}
\importmodule{VerificationReport}
\title{Boolean}
\begin{semanticmodule}

definition{
name: contract,
parameters: [],
result: String,
body: "A local lexlean snapshot exposes the public semantic snapshot, not the linked IR itself. Reconstruct linked IR from each module's full linked_ir value in snapshot order and retain the exact envelope lexicon_closure. Recompute the language 1.2 semantic identity against the expected compiler before deriving verification pins. A decoded snapshot is candidate metadata, never proof evidence. Its authority requires the caller to own the local snapshot invocation and subsequent verification in the same isolated project; the verified report must match the derived source and semantic identities. Imported library ownership remains part of the research snapshot boundary.",
axioms: [],
executable: true
}

structure{
name: Metadata,
type_parameters: [],
parameters: [],
fields: [{name: source, type: Bytes}, {name: semantic, type: Bytes}, {name: binding, type: CandidateBinding::Input}]
}

definition{
name: modules,
parameters: [rows : (List Json::Value), fuel : Nat],
result: (Option (List Json::Value)),
body: (match rows | List.nil => (ctor Option.some [(List Json::Value)] (nil Json::Value)) | List.cons head tail => (match fuel | Nat.zero => (ctor Option.none [(List Json::Value)]) | Nat.succ more => (match (CoreBinding::get head 0x6c696e6b65645f6972) | Json::Value.object entries => (match (modules tail more) | Option.none => (ctor Option.none [(List Json::Value)]) | Option.some rest => (ctor Option.some [(List Json::Value)] (cons (ctor Json::Value.object entries) rest))) | Json::Value.null => (ctor Option.none [(List Json::Value)]) | Json::Value.boolean b => (ctor Option.none [(List Json::Value)]) | Json::Value.number n => (ctor Option.none [(List Json::Value)]) | Json::Value.string s => (ctor Option.none [(List Json::Value)]) | Json::Value.array a => (ctor Option.none [(List Json::Value)])))),
axioms: [],
recursive_argument: rows,
executable: true
}

definition{
name: linked,
parameters: [rows : (List Json::Value)],
result: Json::Value,
body: (ctor Json::Value.object (cons (0x73706563, (ctor Json::Value.string 0x6c65786c65616e2f6c696e6b65642d69722f31)) (cons (0x6d6f64756c6573, (ctor Json::Value.array rows)) (nil (Bytes * Json::Value))))),
axioms: [],
executable: true
}

definition{
name: bind,
parameters: [value : Json::Value, compiler : Bytes, rows : (List Json::Value), maxBytes : Nat, maxSteps : Nat],
result: (Option Metadata),
body: (match (modules rows maxSteps) | Option.none => (ctor Option.none [Metadata]) | Option.some content => (let input : CandidateBinding::Input := (record CandidateBinding::Input {linked := (linked content), lexicon := (CoreBinding::get value 0x6c657869636f6e5f636c6f73757265)}); (match (ArtifactIdentity::semantic compiler (project input linked) (project input lexicon) maxBytes maxSteps) | Option.none => (ctor Option.none [Metadata]) | Option.some meaning => (if (Toml::sameBytes meaning (VerificationReport::bytes (CoreBinding::get value 0x73656d616e7469635f6964))) then (ctor Option.some [Metadata] (record Metadata {source := (VerificationReport::bytes (CoreBinding::get value 0x736f757263655f6964)), semantic := meaning, binding := input})) else (ctor Option.none [Metadata]))))),
axioms: [Quot.sound, propext],
executable: true
}

definition{
name: metadata,
parameters: [value : Json::Value, compiler : Bytes, maxBytes : Nat, maxSteps : Nat],
result: (Option Metadata),
body: (if ((Toml::sameBytes (VerificationReport::bytes (CoreBinding::get value 0x73706563)) 0x6c65786c65616e2f73656d616e7469632d736e617073686f742f32) && ((Toml::sameBytes (VerificationReport::bytes (CoreBinding::get value 0x6c616e6775616765)) 0x312e32) && ((Toml::sameBytes (VerificationReport::bytes (CoreBinding::get value 0x636f6d70696c65725f73656d616e746963735f6964)) compiler) && (VerificationReport::digest (VerificationReport::bytes (CoreBinding::get value 0x736f757263655f6964)))))) then (match (CandidateBinding::array (CoreBinding::get value 0x6d6f64756c6573)) | Option.none => (ctor Option.none [Metadata]) | Option.some rows => (bind value compiler rows maxBytes maxSteps)) else (ctor Option.none [Metadata])),
axioms: [Quot.sound, propext],
executable: true
}

definition{
name: decode,
parameters: [source : Bytes, compiler : Bytes, maxBytes : Nat, maxDepth : Nat, maxSteps : Nat],
result: (Option Metadata),
body: (match (Json::parse source maxBytes maxDepth) | Result.error problem => (ctor Option.none [Metadata]) | Result.ok value => (metadata value compiler maxBytes maxSteps)),
axioms: [Quot.sound, propext],
executable: true
}

definition{
name: features,
parameters: [],
result: (List String),
body: (cons "local-compiler-snapshot-decoding" (cons "full-linked-ir-reconstruction" (cons "exact-lexicon-closure" (cons "compiler-and-semantic-identity" (cons "bounded-module-decoding" (cons "metadata-is-not-proof" (nil String))))))),
axioms: [],
executable: true
}
\end{semanticmodule}
\end{lexlean}
Loading
Loading