Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
12ed8e9
In-tab kernel: the bench in Firefox and WebKit
humuhumu33 Nov 14, 2026
f6a8b5c
In-tab kernel: probe restoring a memory image in place of reading the…
humuhumu33 Nov 14, 2026
1ecbedf
In-tab kernel: work done once per address
humuhumu33 Nov 14, 2026
a30fcad
In-tab kernel: measure which arithmetic theorems Lean accepts without…
humuhumu33 Nov 14, 2026
768a015
In-tab kernel: prove an app's guarantees with no server and no elabor…
humuhumu33 Nov 14, 2026
87d71eb
In-tab kernel: one proof per guarantee
humuhumu33 Nov 14, 2026
51bf89a
In-tab kernel: measure what an address removes from a large app's proof
humuhumu33 Nov 14, 2026
428e01d
In-tab kernel: a guarantee proved from named obligations
humuhumu33 Nov 14, 2026
c377e4b
In-tab kernel: keep facts by address, assemble guarantees from them
humuhumu33 Nov 14, 2026
f1f40c1
In-tab kernel: prove an app in the browser worker
humuhumu33 Nov 14, 2026
555312e
Merge remote-tracking branch 'origin/main' into feat/in-tab-kernel-ph…
humuhumu33 Nov 14, 2026
ca8770f
FA-87: prove a rules app in the tab, behind a switch
humuhumu33 Nov 14, 2026
e6cd327
FA-88: prove every rule a spec can state in the tab
humuhumu33 Nov 14, 2026
1655b6d
FA-89: approve and publish a rules app with no hosted verifier
humuhumu33 Nov 14, 2026
b283d8b
Say a first proof judged all its facts, and record the studio run
humuhumu33 Nov 14, 2026
7a11a0e
Give the generation-patch browser check the tab prover
humuhumu33 Nov 14, 2026
cc00dbe
Merge remote-tracking branch 'origin/main' into feat/in-tab-kernel-ph…
humuhumu33 Nov 14, 2026
5629b11
Merge main; renumber this branch's capabilities FA-88 to FA-90
humuhumu33 Nov 14, 2026
b5755c5
Merge main; renumber this branch's capabilities FA-89 to FA-91
humuhumu33 Nov 15, 2026
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
18 changes: 18 additions & 0 deletions CONFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,24 @@ model does not sanction.
| --- | --- | --- |
| `FA-83` | `build` | Stateful preview parsing and checking transmit source only under disclosed source-bound or turn-scoped revocable hosted permission |

## in-tab-every-rule

| ID | Level | Statement |
| --- | --- | --- |
| `FA-90` | `build` | The tab proves a rules app whatever its conditions say: is not, a comparison of two fields, and a number with no maximum, up to the largest number a request can carry |

## in-tab-kernel-verdict

| ID | Level | Statement |
| --- | --- | --- |
| `FA-86` | `build` | A proof verdict is decided by the Prism guest from addresses the tab derived and the result of a kernel run in the tab, never from a server reply |

## in-tab-rules-proof

| ID | Level | Statement |
| --- | --- | --- |
| `FA-89` | `build` | A rules app is proved in the tab: Lean's kernel judges proofs written there from the spec, and only the Prism guest's word proved marks it proved |

## initial-project-theme

| ID | Level | Statement |
Expand Down Expand Up @@ -471,6 +483,12 @@ model does not sanction.
| --- | --- | --- |
| `FA-09` | `build` | Rule status and asynchronous proof or publication completion remain bound to the current rule source |

## rules-without-hosted-verifier

| ID | Level | Statement |
| --- | --- | --- |
| `FA-91` | `build` | Approving or publishing a rules app asks no hosted verifier: approval proves only in the tab, and publish builds with no attestation, the published repository's own CI proving the model with the locked SDK |

## semantic-application-discovery

| ID | Level | Statement |
Expand Down
3 changes: 3 additions & 0 deletions app/product.json
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,9 @@
"ids": [
"FA-85",
"FA-86",
"FA-89",
"FA-90",
"FA-91",
"LL-01",
"LL-02"
],
Expand Down
23 changes: 22 additions & 1 deletion app/src/Features.lex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,27 @@
body: "crates/conformance/tests/in_tab_kernel_verdict.rs::in_tab_kernel_verdict_fa_86"
}

definition{
name: testFA89,
parameters: [],
result: String,
body: "crates/conformance/tests/in_tab_rules_proof.rs::in_tab_rules_proof_fa_89"
}

definition{
name: testFA90,
parameters: [],
result: String,
body: "crates/conformance/tests/in_tab_every_rule.rs::in_tab_every_rule_fa_90"
}

definition{
name: testFA91,
parameters: [],
result: String,
body: "crates/conformance/tests/rules_without_hosted_verifier.rs::rules_without_hosted_verifier_fa_91"
}

definition{
name: testLL01,
parameters: [],
Expand Down Expand Up @@ -1621,7 +1642,7 @@
name: featureProof,
parameters: [],
result: Foundation.Arch::Feature,
body: (record Foundation.Arch::Feature {statement := "Proof (FA-85, FA-86, LL-01, LL-02): A verdict is decided by the guest from what the tab derived, a theorem proved on the same declarations is reused, and local obligations hold on every request.", calls := (cons "InTabKernel::verdictCode" (cons "InTabKernelProtocol::dispatchVerdict" (cons "FoundrySpecification::proofReuseBoundary" (nil String)))), acceptance := (cons "Features::testFA85" (cons "Features::testFA86" (cons "Features::testLL01" (cons "Features::testLL02" (nil String)))))})
body: (record Foundation.Arch::Feature {statement := "Proof (FA-85, FA-86, FA-89, FA-90, FA-91, LL-01, LL-02): A verdict is decided by the guest from what the tab derived, a theorem proved on the same declarations is reused, and local obligations hold on every request.", calls := (cons "InTabKernel::verdictCode" (cons "InTabKernelProtocol::dispatchVerdict" (cons "FoundrySpecification::proofReuseBoundary" (nil String)))), acceptance := (cons "Features::testFA85" (cons "Features::testFA86" (cons "Features::testFA89" (cons "Features::testFA90" (cons "Features::testFA91" (cons "Features::testLL01" (cons "Features::testLL02" (nil String))))))))})
}

definition{
Expand Down
39 changes: 39 additions & 0 deletions crates/conformance/tests/in_tab_every_rule.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//! The `in-tab-every-rule` suite: one test per scenario in `features/suites/in-tab-every-rule.feature`.
use std::path::PathBuf;
use std::process::Command;

/// `FA-90`: The tab proves a rules app whatever its conditions say: is not, a comparison of two fields, and a number with no maximum, up to the largest number a request can carry
#[test]
fn in_tab_every_rule_fa_90() {
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.ancestors()
.nth(2)
.expect("repository root")
.to_path_buf();
// The suite runs the fixtures' own specs through the shell's Lean kernel and the pinned Forge kernel guest.
let output = Command::new("node")
.args(["--test", "--test-reporter=tap", "--test-timeout=200000"])
.arg(root.join("studio/tools/in_tab_every_rule.test.mjs"))
.output()
.expect("the locked SDK supplies Node");
let report = String::from_utf8_lossy(&output.stdout);
assert!(
output.status.success(),
"{report}\n{}",
String::from_utf8_lossy(&output.stderr)
);
// A run that skipped, filtered or lost a test is not the oracle.
for required in [
"# tests 4",
"# pass 4",
"# fail 0",
"# cancelled 0",
"# skipped 0",
"# todo 0",
] {
assert!(
report.lines().any(|line| line == required),
"incomplete oracle: {report}"
);
}
}
39 changes: 39 additions & 0 deletions crates/conformance/tests/in_tab_rules_proof.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//! The `in-tab-rules-proof` suite: one test per scenario in `features/suites/in-tab-rules-proof.feature`.
use std::path::PathBuf;
use std::process::Command;

/// `FA-89`: A rules app is proved in the tab: Lean's kernel judges proofs written there from the spec, and only the Prism guest's word proved marks it proved
#[test]
fn in_tab_rules_proof_fa_89() {
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.ancestors()
.nth(2)
.expect("repository root")
.to_path_buf();
// The suite runs the shell's own Lean kernel and the pinned Forge kernel guest; nothing stands in for either.
let output = Command::new("node")
.args(["--test", "--test-reporter=tap", "--test-timeout=120000"])
.arg(root.join("studio/tools/in_tab_prove.test.mjs"))
.output()
.expect("the locked SDK supplies Node");
let report = String::from_utf8_lossy(&output.stdout);
assert!(
output.status.success(),
"{report}\n{}",
String::from_utf8_lossy(&output.stderr)
);
// A run that skipped, filtered or lost a test is not the oracle.
for required in [
"# tests 4",
"# pass 4",
"# fail 0",
"# cancelled 0",
"# skipped 0",
"# todo 0",
] {
assert!(
report.lines().any(|line| line == required),
"incomplete oracle: {report}"
);
}
}
39 changes: 39 additions & 0 deletions crates/conformance/tests/rules_without_hosted_verifier.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//! The `rules-without-hosted-verifier` suite: one test per scenario in `features/suites/rules-without-hosted-verifier.feature`.
use std::path::PathBuf;
use std::process::Command;

/// `FA-91`: Approving or publishing a rules app asks no hosted verifier: approval proves only in the tab, and publish builds with no attestation, the published repository's own CI proving the model with the locked SDK
#[test]
fn rules_without_hosted_verifier_fa_91() {
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.ancestors()
.nth(2)
.expect("repository root")
.to_path_buf();
// The suite runs the host's own functions, with the hosted prover replaced by one that fails if it is called.
let output = Command::new("node")
.args(["--test", "--test-reporter=tap"])
.arg(root.join("studio/tools/rules_without_hosted_verifier.test.mjs"))
.output()
.expect("the locked SDK supplies Node");
let report = String::from_utf8_lossy(&output.stdout);
assert!(
output.status.success(),
"{report}\n{}",
String::from_utf8_lossy(&output.stderr)
);
// A run that skipped, filtered or lost a test is not the oracle.
for required in [
"# tests 3",
"# pass 3",
"# fail 0",
"# cancelled 0",
"# skipped 0",
"# todo 0",
] {
assert!(
report.lines().any(|line| line == required),
"incomplete oracle: {report}"
);
}
}
10 changes: 10 additions & 0 deletions features/suites/in-tab-every-rule.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Feature: in-tab-every-rule

@FA-90 @build
Scenario: The tab proves a rules app whatever its conditions say: is not, a comparison of two fields, and a number with no maximum, up to the largest number a request can carry
Given the fixture specs RSVP, which compares two fields, the parking fee, which says is not, and the library fee
When each is proved in the tab through tab_sound, with the shell's own Lean kernel and the pinned guest
Then each is proved, on propext and Quot.sound, and so is RSVP with no maximum on seats and a spec comparing fields by = and !=
And the data the tab proves answers every sampled request as the spec's rules answer it
And RSVP without its waitlist rule, and the parking fee with its is not guarantee turned around, are refused, the broken guarantee named
And an edit judges only the facts it changed
9 changes: 9 additions & 0 deletions features/suites/in-tab-rules-proof.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Feature: in-tab-rules-proof

@FA-89 @build
Scenario: A rules app is proved in the tab: Lean's kernel judges proofs written there from the spec, and only the Prism guest's word proved marks it proved
Given the studio's own Lean kernel and checker library, each named by its SHA-256 in the shell's manifest, and the pinned Forge kernel guest
When a rules app is approved
Then Lean's kernel in the tab judges a proof of each guarantee written there from the spec, and the guest compares what the tab derived
And the app is proved only on the guest's word proved, with no attestation
And a guarantee the rules break, another statement, kernel or library, an axiom outside the two declared, or a guest with no verdict leave it unproved
11 changes: 11 additions & 0 deletions features/suites/rules-without-hosted-verifier.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Feature: rules-without-hosted-verifier

@FA-91 @build
Scenario: Approving or publishing a rules app asks no hosted verifier: approval proves only in the tab, and publish builds with no attestation, the published repository's own CI proving the model with the locked SDK
Given the host's own approval, proof and publish functions, with the hosted prover replaced by one that fails if it is called
When a rules app is approved, proved and published
Then the tab is the only prover asked, and its refusal leaves the rules checked, with its reason and no proof
And a proof is committed only when its answer is in, so an approval cancelled while the tab proves is rolled back
And publish hands the build the attestation the rules carry, none for a proof made in the tab, and the published app says its proof ran in the SDK image
And rules over the SDK's rule limit are proved and not published
And no message about a rules app names the hosted verifier
18 changes: 18 additions & 0 deletions model/ids.toml
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,24 @@ level = "build"
suite = "product-model"
statement = "Foundry is one Prism model whose architecture, design, features, security, quality and compliance facets are projected from app/product.json and the kernel, and whose quality thresholds are the kernel's own terms"

[[id]]
id = "FA-89"
level = "build"
suite = "in-tab-rules-proof"
statement = "A rules app is proved in the tab: Lean's kernel judges proofs written there from the spec, and only the Prism guest's word proved marks it proved"

[[id]]
id = "FA-90"
level = "build"
suite = "in-tab-every-rule"
statement = "The tab proves a rules app whatever its conditions say: is not, a comparison of two fields, and a number with no maximum, up to the largest number a request can carry"

[[id]]
id = "FA-91"
level = "build"
suite = "rules-without-hosted-verifier"
statement = "Approving or publishing a rules app asks no hosted verifier: approval proves only in the tab, and publish builds with no attestation, the published repository's own CI proving the model with the locked SDK"

[[id]]
id = "PM-02"
level = "build"
Expand Down
23 changes: 14 additions & 9 deletions studio/shell/host.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import { r4Decide, r4Refusal, r4Request, r4Spec } from "./r4.mjs";
import { viewReady, lookup, routeOf, refusalWord, seal as sealAnswer, gpuReady, gpuIds, heldFor, rulesModel, gpuAvailable, rememberSession, withEngine, engine, readWho, MODEL_ID, idOf } from "./inference.js";
import { install, installed, encodeView, b64, unb64, sha256 } from "./holo.js";
import * as prism from "./prism.js";
import * as inTab from "./in-tab/client.mjs";
import * as live from "./live/project.mjs";
import * as lexlean from "./live/lexlean.mjs";
import { canonicalEditPath, planCanonicalEdit } from "./canonical-edits.mjs";
Expand Down Expand Up @@ -1386,22 +1387,25 @@ async function rulesAfterTurn(appId, text, written = [], options = {}) {
async function rewordPhase(phase) {
try { return await nextPhase(phase, "reword"); } catch (e) { return null; }
}
// Lean proves the rules on the hosted verifier; the kernel moves the phase on its attestation or its
// refusal. A proof whose logic changed meanwhile is dropped: it is about other rules. A reword meanwhile
// keeps it, since the logic kappa is the same. Resolves the prover's result, or null when the logic
// changed under it.
// Lean's kernel proves the rules in this tab (in-tab/client.mjs), and the kernel moves the phase on the Prism
// guest's verdict: proved, or anything else. No server is asked. A proof whose logic changed meanwhile is
// dropped: it is about other rules. A reword meanwhile keeps it, since the logic kappa is the same. Resolves the
// prover's result, or null when the logic changed under it.
async function proveRules(appId, logicKey, onWait, options = {}) {
const state = await rulesOf(appId);
const reservation = options.expectedState || state;
if (!sameRuleReservation(state, reservation) || (state.logicKappa || state.specKappa) !== logicKey) return null;
// Nothing leaves the tab, so a proof is committed to only when its result is in (`commit`): an approval cancelled
// while it ran is rolled back, and its result is dropped.
let submitted = false;
// Proof records live under their theorem address in "refs"; prism/proof-reuse.mjs decides whether one
// may stand for a proof.
const proofStore = { get: (key) => get("refs", key), put: (key, value) => put("refs", key, value) };
const result = await prism.prove(reservation.spec, { onWait, store: proofStore, beforeSubmit: () => { options.beforeSubmit?.(); submitted = true; } }).catch((e) => {
const commit = () => { options.beforeSubmit?.(); submitted = true; };
const tab = await inTab.proveInTab(reservation.spec, { guest: kernelReady, commit }).catch((e) => {
if (options.beforeSubmit && !submitted) throw e;
return { ok: false, error: String((e && e.message) || e) };
return { ok: false, why: String((e && e.message) || e) };
});
// The axiom sets of the model the build writes are the renderer's own: the published repository's CI proves that
// model with the locked SDK, and refuses a set Lean does not observe.
const result = tab.ok ? { ok: true, seconds: tab.seconds, record: tab.record, axioms: {} } : { ok: false, error: tab.why };
const phase = await nextPhase("proving", result.ok ? "attest" : "fail");
let attempted;
for (;;) {
Expand Down Expand Up @@ -1678,6 +1682,7 @@ async function publishTurn(chatId, appId, messages, userId, ref, intentId) {
const refusal = !rules || !rules.spec ? "This app has no rules to build yet. Tell me what it decides, approve the rules, then say publish."
: rules.phase !== "proved" && rules.phase !== "published" ? (rules.phase === "checked" ? "Reply approve first: Lean proves the rules, then the Prism SDK builds them." : `The rules are ${rules.phase === "proving" ? "being proved by Lean; say publish when it is done" : "not checked yet; ask me to fix them"}.`)
: rules.facets && !rules.facets.ok ? `Publishing writes the whole model, and its facets are not projected yet: ${rules.facets.issue} Ask me to fix the app's prompt, then say publish.`
: rules.spec.rules.length > prism.PROVE_RULES_MAX ? prism.publishTooLarge(rules.spec)
: !token ? "Publishing builds the app with the Prism SDK on GitHub Actions, in a public repository in your account. Connect GitHub in Settings, under Integrations, then say publish."
: null;
if (refusal) { await show(refusal); return finish(); }
Expand Down
Loading
Loading