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
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": "99bfdc208dce94d81e4c4cbb4f24e4f56daaa006175b7d96799e2f79ff24b98e",
"pdf_sha256": "cb0ad414329ba221d54ea3e2d0a2860529e3ff3109558a346b94c828aad059a1",
"tex_sha256": "a7cd1807077baa1d1ca34015faf500a24477991859427f4db646e5f230fe54e2"
},
"Observations": {
"pdf_sha256": "946c0151ff19b9bea418524c9184fd2614ed1d0d8786be167e69be79fadd53c5",
"pdf_sha256": "4c0c6ceb328610bd2850f85ac19d719409a3973b61f6eb437202423be0a88cee",
"tex_sha256": "056820f37ac40133e341f46ad6c81125e35981150a1cc86f2063faad3f26fbd4"
},
"Paper": {
"pdf_sha256": "29083b380af1b4ba59d478e8f8b1defaa41df051d44a49bc6f1f487a403e774e",
"pdf_sha256": "c51fda82f4a4394a1e4099e35fc3a548f8d9aed95504e23fa77f43789cf145c0",
"tex_sha256": "000f988561d9621f9ba2f9a99aba971670864367ebd336e6fbad0e1f71da01cb"
}
},
"generated_at_utc": "2026-11-14T22:17:42.029985+00:00",
"source_digest": "fc66c209c514b0c616f3dea01ec778f54dd19356d13c2c780d455710262fe4b9"
"generated_at_utc": "2026-11-15T17:22:33.909324+00:00",
"source_digest": "4134e80e708ff079732e3e5bd32fd3ed1db3c70d9edb5f6d9b362106ba79fbed"
}
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 = "59f64efe727898bcf6a337630c38eb4ea7ffc08cd83a49a0ea669c61c3b23587"
project_config_sha256 = "a3a5a5708da7bc4dfaacf3cd2a52e3d8558e7937d1cc876bc6973558b31acb29"
project_config_sha256 = "220287baabbf37bc6f9b6aab45fc02ed8942400deadf953c80cdd71bb66e0768"
lean_toolchain = "leanprover/lean4:v4.32.2"

[[workspace_file]]
Expand Down
2 changes: 1 addition & 1 deletion 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/CandidateSource.lex.tex", "src/CandidateSourceChecks0.lex.tex", "src/CandidateSourceChecks1.lex.tex", "src/CandidateSourceChecks2.lex.tex", "src/CandidateSourceChecks3.lex.tex", "src/CandidateSourceTraces.lex.tex", "src/ClosedBindingFixture.lex.tex", "src/ClosedGoalChecks0.lex.tex", "src/ClosedGoalChecks1.lex.tex", "src/ClosedGoalChecks2.lex.tex", "src/ClosedGoalChecks3.lex.tex", "src/ClosedGoalChecks4.lex.tex", "src/ClosedGoalChecks5.lex.tex", "src/ClosedGoalTraces.lex.tex", "src/CompilerSnapshot.lex.tex", "src/CompilerSnapshotTraces.lex.tex", "src/Convert.lex.tex", "src/CoreBinding.lex.tex", "src/CoreBindingTraces.lex.tex", "src/CoreNotation.lex.tex", "src/CoreNotationTraces.lex.tex", "src/Discovery.lex.tex", "src/Engine.lex.tex", "src/EnvironmentAcquisition.lex.tex", "src/EnvironmentMemory.lex.tex", "src/EnvironmentMemoryCommand.lex.tex", "src/EnvironmentMemoryTraces.lex.tex", "src/EnvironmentPlan.lex.tex", "src/EnvironmentPlanCommand.lex.tex", "src/EnvironmentPlanTraces.lex.tex", "src/EnvironmentPlanWireTraces0.lex.tex", "src/EnvironmentPlanWireTraces1.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/ResearchArchitecture.lex.tex", "src/ResearchCandidate.lex.tex", "src/ResearchCandidateTraces.lex.tex", "src/ResearchCatalog.lex.tex", "src/ResearchCohort.lex.tex", "src/ResearchCohortChecks0.lex.tex", "src/ResearchCohortChecks1.lex.tex", "src/ResearchCohortChecks2.lex.tex", "src/ResearchCohortCommand.lex.tex", "src/ResearchCohortInput.lex.tex", "src/ResearchCohortTraces.lex.tex", "src/ResearchCommand.lex.tex", "src/ResearchCommandTraces.lex.tex", "src/ResearchEvidence.lex.tex", "src/ResearchEvidenceTraces.lex.tex", "src/ResearchExecution.lex.tex", "src/ResearchExecutionTraces.lex.tex", "src/ResearchFactory.lex.tex", "src/ResearchFactoryTraces.lex.tex", "src/ResearchInput.lex.tex", "src/ResearchInputTraces.lex.tex", "src/ResearchJournal.lex.tex", "src/ResearchJournalTraces.lex.tex", "src/ResearchProject.lex.tex", "src/ResearchProjectTraces.lex.tex", "src/ResearchProof.lex.tex", "src/ResearchProofTraces.lex.tex", "src/ResearchRecord.lex.tex", "src/ResearchRunner.lex.tex", "src/ResearchRunnerTraces.lex.tex", "src/ResearchSession.lex.tex", "src/ResearchSessionTraces.lex.tex", "src/ResearchTraces.lex.tex", "src/ResearchVerification.lex.tex", "src/ResearchVerificationChecks0.lex.tex", "src/ResearchVerificationChecks1.lex.tex", "src/ResearchVerificationChecks2.lex.tex", "src/ResearchVerificationChecks3.lex.tex", "src/ResearchVerificationChecks4.lex.tex", "src/ResearchVerificationChecks5.lex.tex", "src/ResearchVerificationChecks6.lex.tex", "src/ResearchVerificationTraces.lex.tex", "src/ResearchWorkspace.lex.tex", "src/ResearchWorkspaceTraces.lex.tex", "src/Rule30Core.lex.tex", "src/Sequences.lex.tex", "src/Standards.lex.tex", "src/Toml.lex.tex", "src/VerificationCommandFixtures.lex.tex", "src/VerificationHashData.lex.tex", "src/VerificationHashFixtures.lex.tex", "src/VerificationHashSteps0.lex.tex", "src/VerificationHashSteps1.lex.tex", "src/VerificationHashSteps2.lex.tex", "src/VerificationHashSteps3.lex.tex", "src/VerificationHashSteps4.lex.tex", "src/VerificationHashSteps5.lex.tex", "src/VerificationIdentityTraces.lex.tex", "src/VerificationJsonData.lex.tex", "src/VerificationJsonFixtures.lex.tex", "src/VerificationJsonSteps0.lex.tex", "src/VerificationJsonSteps1.lex.tex", "src/VerificationJsonSteps10.lex.tex", "src/VerificationJsonSteps11.lex.tex", "src/VerificationJsonSteps2.lex.tex", "src/VerificationJsonSteps3.lex.tex", "src/VerificationJsonSteps4.lex.tex", "src/VerificationJsonSteps5.lex.tex", "src/VerificationJsonSteps6.lex.tex", "src/VerificationJsonSteps7.lex.tex", "src/VerificationJsonSteps8.lex.tex", "src/VerificationJsonSteps9.lex.tex", "src/VerificationMetadataChecks0.lex.tex", "src/VerificationMetadataChecks1.lex.tex", "src/VerificationMetadataTraces.lex.tex", "src/VerificationPolicyChecks0.lex.tex", "src/VerificationPolicyTraces.lex.tex", "src/VerificationProcessChecks0.lex.tex", "src/VerificationProcessTraces.lex.tex", "src/VerificationReport.lex.tex", "src/VerificationReportTraces.lex.tex", "src/VerificationUtf8Fixtures.lex.tex", "src/VerificationUtf8Steps0.lex.tex", "src/VerificationUtf8Steps1.lex.tex", "src/VerificationUtf8Steps2.lex.tex", "src/VerificationUtf8Steps3.lex.tex", "src/VerificationUtf8Steps4.lex.tex", "src/VerificationUtf8Steps5.lex.tex", "src/VerificationUtf8Steps6.lex.tex", "src/VerificationUtf8Steps7.lex.tex", "src/VerificationUtf8Steps8.lex.tex", "src/VerificationUtf8Steps9.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/CandidateSource.lex.tex", "src/CandidateSourceChecks0.lex.tex", "src/CandidateSourceChecks1.lex.tex", "src/CandidateSourceChecks2.lex.tex", "src/CandidateSourceChecks3.lex.tex", "src/CandidateSourceTraces.lex.tex", "src/ClosedBindingFixture.lex.tex", "src/ClosedGoalChecks0.lex.tex", "src/ClosedGoalChecks1.lex.tex", "src/ClosedGoalChecks2.lex.tex", "src/ClosedGoalChecks3.lex.tex", "src/ClosedGoalChecks4.lex.tex", "src/ClosedGoalChecks5.lex.tex", "src/ClosedGoalTraces.lex.tex", "src/CompilerSnapshot.lex.tex", "src/CompilerSnapshotTraces.lex.tex", "src/Convert.lex.tex", "src/CoreBinding.lex.tex", "src/CoreBindingTraces.lex.tex", "src/CoreNotation.lex.tex", "src/CoreNotationTraces.lex.tex", "src/Discovery.lex.tex", "src/Engine.lex.tex", "src/EnvironmentAcquisition.lex.tex", "src/EnvironmentMemory.lex.tex", "src/EnvironmentMemoryCommand.lex.tex", "src/EnvironmentMemoryTraces.lex.tex", "src/EnvironmentPlan.lex.tex", "src/EnvironmentPlanCommand.lex.tex", "src/EnvironmentPlanTraces.lex.tex", "src/EnvironmentPlanWireTraces0.lex.tex", "src/EnvironmentPlanWireTraces1.lex.tex", "src/EnvironmentResearchCommand.lex.tex", "src/EnvironmentResearchInput.lex.tex", "src/EnvironmentResearchSelection.lex.tex", "src/EnvironmentResearchTraces.lex.tex", "src/EnvironmentResearchWireTraces.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/ResearchArchitecture.lex.tex", "src/ResearchCandidate.lex.tex", "src/ResearchCandidateTraces.lex.tex", "src/ResearchCatalog.lex.tex", "src/ResearchCohort.lex.tex", "src/ResearchCohortChecks0.lex.tex", "src/ResearchCohortChecks1.lex.tex", "src/ResearchCohortChecks2.lex.tex", "src/ResearchCohortCommand.lex.tex", "src/ResearchCohortInput.lex.tex", "src/ResearchCohortTraces.lex.tex", "src/ResearchCommand.lex.tex", "src/ResearchCommandTraces.lex.tex", "src/ResearchEvidence.lex.tex", "src/ResearchEvidenceTraces.lex.tex", "src/ResearchExecution.lex.tex", "src/ResearchExecutionTraces.lex.tex", "src/ResearchFactory.lex.tex", "src/ResearchFactoryTraces.lex.tex", "src/ResearchInput.lex.tex", "src/ResearchInputTraces.lex.tex", "src/ResearchJournal.lex.tex", "src/ResearchJournalTraces.lex.tex", "src/ResearchProject.lex.tex", "src/ResearchProjectTraces.lex.tex", "src/ResearchProof.lex.tex", "src/ResearchProofTraces.lex.tex", "src/ResearchRecord.lex.tex", "src/ResearchRunner.lex.tex", "src/ResearchRunnerTraces.lex.tex", "src/ResearchSession.lex.tex", "src/ResearchSessionTraces.lex.tex", "src/ResearchTraces.lex.tex", "src/ResearchVerification.lex.tex", "src/ResearchVerificationChecks0.lex.tex", "src/ResearchVerificationChecks1.lex.tex", "src/ResearchVerificationChecks2.lex.tex", "src/ResearchVerificationChecks3.lex.tex", "src/ResearchVerificationChecks4.lex.tex", "src/ResearchVerificationChecks5.lex.tex", "src/ResearchVerificationChecks6.lex.tex", "src/ResearchVerificationTraces.lex.tex", "src/ResearchWorkspace.lex.tex", "src/ResearchWorkspaceTraces.lex.tex", "src/Rule30Core.lex.tex", "src/Sequences.lex.tex", "src/Standards.lex.tex", "src/Toml.lex.tex", "src/VerificationCommandFixtures.lex.tex", "src/VerificationHashData.lex.tex", "src/VerificationHashFixtures.lex.tex", "src/VerificationHashSteps0.lex.tex", "src/VerificationHashSteps1.lex.tex", "src/VerificationHashSteps2.lex.tex", "src/VerificationHashSteps3.lex.tex", "src/VerificationHashSteps4.lex.tex", "src/VerificationHashSteps5.lex.tex", "src/VerificationIdentityTraces.lex.tex", "src/VerificationJsonData.lex.tex", "src/VerificationJsonFixtures.lex.tex", "src/VerificationJsonSteps0.lex.tex", "src/VerificationJsonSteps1.lex.tex", "src/VerificationJsonSteps10.lex.tex", "src/VerificationJsonSteps11.lex.tex", "src/VerificationJsonSteps2.lex.tex", "src/VerificationJsonSteps3.lex.tex", "src/VerificationJsonSteps4.lex.tex", "src/VerificationJsonSteps5.lex.tex", "src/VerificationJsonSteps6.lex.tex", "src/VerificationJsonSteps7.lex.tex", "src/VerificationJsonSteps8.lex.tex", "src/VerificationJsonSteps9.lex.tex", "src/VerificationMetadataChecks0.lex.tex", "src/VerificationMetadataChecks1.lex.tex", "src/VerificationMetadataTraces.lex.tex", "src/VerificationPolicyChecks0.lex.tex", "src/VerificationPolicyTraces.lex.tex", "src/VerificationProcessChecks0.lex.tex", "src/VerificationProcessTraces.lex.tex", "src/VerificationReport.lex.tex", "src/VerificationReportTraces.lex.tex", "src/VerificationUtf8Fixtures.lex.tex", "src/VerificationUtf8Steps0.lex.tex", "src/VerificationUtf8Steps1.lex.tex", "src/VerificationUtf8Steps2.lex.tex", "src/VerificationUtf8Steps3.lex.tex", "src/VerificationUtf8Steps4.lex.tex", "src/VerificationUtf8Steps5.lex.tex", "src/VerificationUtf8Steps6.lex.tex", "src/VerificationUtf8Steps7.lex.tex", "src/VerificationUtf8Steps8.lex.tex", "src/VerificationUtf8Steps9.lex.tex"]
build_root = ".lexlean"
lockfile = "lexlean.lock"
lean_workspace = "."
Expand Down
106 changes: 106 additions & 0 deletions rule30-api/production/ENVIRONMENT-RESEARCH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Supplied context for one research attempt

`EnvironmentResearchCommand.step` is a native Host entry. Export it with
`environment-research-request.json`, then call the generated executable with
one request filename. `environment-research-example.json` is a complete wire
example with illustrative identities, NOT evidence of a verified attempt.
Replace its library tree, revision, tool digests and paths with actual inputs.
No source or proof is acquired or synthesized by this command.

## Admission

The request is `r30/environment-research/1`, with exactly `spec`, `plan`,
`context`, and `candidates`. The plan is an existing QUERY
`r30/environment-plan/1` object; it carries the entire task, nonempty query
and 1–8 explicit source triples. The context is the unchanged
`r30/environment-context/1` envelope, including its exact
`observed-sources-not-proof` trust label. It need not contain every planned
source: observations must form a unique ordered subsequence of the plan.
Every observed content must match the query. The existing observation validator
checks claimed repository/path/commit/blob formats, acquisition label, nonempty
whole content of at most 4 KiB, and its SHA-256 digest. None of these checks
authenticates a GitHub origin or a supplied Git object.

The whole original request is at most 8 MiB with the existing depth-96 JSON
parser. Duplicate keys, including escaped duplicates, are refused recursively.
Embedded object budgets are measured on canonical JSON, not original whitespace:
plan at most 64 KiB with its existing depth-16 parser; context at most 1 MiB
with depth 16. This is a stricter overall depth limit for nested candidate
requests than parsing each candidate at depth 96 independently. Work limits
also apply; a request inside byte limits may still be refused.

There are 1–16 candidates, each exactly `{cue, attempt}`. A cue contains
1–128 UTF-8 bytes. Each attempt is a full supplied `r30/research-attempt/1`;
synthesis and premise goals are refused. `CandidateBinding.selectedClosed`
requires the named constant, origin equal to theorem, zero premise, empty
telescope, origin membership in sources and exact goal binding. The serialized
target is parsed under the candidate bounds, requires exactly nodes/root, and
passes the existing pure core renderer over every node, including unreachable
nodes and nested fields. Rendered validation bytes are discarded; the supplied
config and target bytes remain unchanged. Valid unused nodes and nonzero roots
are supported. Large well-shaped unused nodes can exhaust the existing work or
output budget; no validation limit is enlarged. Every candidate,
including every unselected candidate, passes `ResearchFactory.candidateReady`:
workspace/tool bounds and pure source construction across the complete arena.
This checks shape and applicability, never proof success. A well-formed invalid
proof must still fail in the owned verifier.

Task comparison explicitly compares every field, reusing the existing purpose,
ordered-source and sequent comparisons: id, purpose,
intent, status, component, ordered sources, schema, all six sequent fields,
age and weight. Every candidate request has the same full task, serial and
snapshot. `ResearchProject.sameWorkspace` and `ResearchFactory.sameTools`,
plus full request equality and maxBytes/maxDepth/maxSteps equality, preserve
all workspace, environment, tool and execution bounds. Candidate arena, proof,
imports, levels and allowed constructive axioms may differ; the winner is
passed unchanged. The same process environment is supplied to every parser.
The snapshot's `library` is a Git TREE identity; workspace and observation
`revision` fields are COMMIT identities. They are not equated.

## Selection and lifecycle

Each candidate scores one hit per admitted observation containing its cue,
from zero to eight. The highest score wins; earlier input order breaks ties.
No observations or all-zero scores picks index zero and reports fallback.
Source text and cue bytes are only substring data. They never supply commands,
imports, tools, proof terms or goals. Candidate proof data comes solely from
the explicit attempts, under the existing construction and verification checks.

Only after the entire input and pool pass admission does the command call
`ResearchSession.begin` once. It retains the selected session and selection
metadata, with no alternative pool for retries. There is no memory-store
access or lock acquisition. Acquisition and query must finish in another
process before supplying the envelope; the inherited Host has no unlock call.

Output is `r30/environment-research-result/1`: `selection` contains policy
`r30/context-cue-count/1`, context authority
`supplied/self-consistent/not-authenticated`, SHA-256 of the ORIGINAL request
bytes (an audit binding, not authority), chosen zero-based index, score,
matched zero-based observation indices and fallback. `result` preserves the
existing `r30/research-result/1` request/status/detail/evidence fields; blocked
results include the existing recovery workspace. Admission failure has empty
selection metadata. Only an owned session completion can produce a checked
outcome, after verification and evidence retention. A failed selected proof
never starts a second attempt and does not refute or exhaust the task.

The Host driver is synchronous. `ResearchSession.Event.cancel` is an internal
pure event, not a native external cancellation channel. This command forwards
native replies as host events; it does not invent a cancellation input.
Incompatible events are refused by the owning lifecycle; arbitrary forged or
replayed same-variant events are not authenticated by the pure model.

The caller must enforce a whole-run deadline. Timeout, OS termination or crash
does not establish descendant termination or completed cleanup. Inspect retained
workspace, processes and evidence before retrying. A crash after evidence
archival but before output remains uncertain; there is no automatic retry,
durable scheduler, exactly-once, restart or power-loss guarantee. Use the
existing owned-workspace safety assumptions and do not reuse an uncertain
workspace. Context is never proof authority, source inspection or autonomous
learning. This increment does not incorporate the separate inspector work.

## Qualification boundary

Source/frontend checks and focused diagnostics precede independent review.
Full-profile production, exact generated executable acceptance, the normal
commit gate and exact-head CI remain required. The compiler is the existing
fixed-kernel native candidate, not an assertion of upstream acceptance.
Loading
Loading