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
22 changes: 11 additions & 11 deletions .trinity/seals/analog_AnalogMosPsp10350cData.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"built_by": "t27c-bootstrap@0.5.2+ea35d9b72",
"built_by": "t27c-bootstrap@0.5.2+0fba674ef",
"closure": [
{
"spec": "specs/analog/mos_psp103_data.t27",
"spec_hash": "sha256:d5f3244ff1936f2b96e95b06e022d6b42b489ac49e025ec99486d6d36e6c6580"
"spec_hash": "sha256:3936594d2ab220f06b2d636182689811b696e044fc3ce6850ea2604ac74f3ea3"
},
{
"spec": "specs/analog/mos_table.t27",
"spec_hash": "sha256:9c0d1537ed5d8d60c4bdcb67d1e4c73ef80270e8cab224cb089c5b568fe11182"
"spec_hash": "sha256:16d28f10fa8663926dddb4bcced981cdc4cd8f38a6b748e4b7688f2e56bbab6c"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:277bd41ef2e98b05b10cd80d83c632c20ff90f8ff50c5f8b0bd8710b9c2b6ff0",
"gen_hash_rust": "sha256:6fcf9d9f5e5c577b7a8a14ad729ea68108509ba7fed79106187abb1f589fbb39",
"gen_hash_verilog": "sha256:16aaa6a244e03f397b0b6bae08bfe89793319614845c8fba614704078a3d112f",
"gen_hash_zig": "sha256:1ac65693f2030507c79047418c8a74dc4b24656dacbd336dc53c02c55f58a9a1",
"gen_hash_c": "sha256:3fce02e848b9ebef280d56181ab73b8133f7052cad30d8da8bc47c9f81b43502",
"gen_hash_rust": "sha256:44a53bca3eae237e46d3bb78ceeb06cce0750bbb3dd86ce8edf585fad65f2bb3",
"gen_hash_verilog": "sha256:642d3c74b953143fa2aaef5d95f0014948690c6fe47b0c1d2723aeb27469a166",
"gen_hash_zig": "sha256:284284e9712d079e29b10b439f40ec5144b0183d18d990fe592747893f3272fc",
"module": "AnalogMosPsp10350cData",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-19T05:32:08Z",
"sealed_at": "2026-10-19T16:29:36Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:ed4680506d435cdb660ecfdf28ec4f7091fa3c40ce08dc4aeb5bc4570b404976",
"spec_hash": "sha256:9e68629797a29516836ca3e0b5e4881b0e751d847c58fd52b63e8f69746dbbe1",
"spec_path": "specs/analog/mos_psp103_50c_data.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 3,
"total": 3,
"passed": 4,
"total": 4,
"vacuous": 0
},
"toolchain": {
Expand Down
18 changes: 9 additions & 9 deletions .trinity/seals/analog_AnalogMosPsp103Data.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"built_by": "t27c-bootstrap@0.5.2+ea35d9b72",
"built_by": "t27c-bootstrap@0.5.2+0fba674ef",
"closure": [
{
"spec": "specs/analog/linear.t27",
"spec_hash": "sha256:3ddef7be183aba583ed285334ee389b48a65b41335e98914514235db7c4e5d62"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:be16cbf1fbac3021d77530b1e86f19bfacf626eb7cfe834900c984331491c060",
"gen_hash_rust": "sha256:cbd4b0ad5ced378295e73bec1bcc69ff8270b99f4a4e27064a6aa2b0aa02c222",
"gen_hash_verilog": "sha256:f062ed3fc219deec9fa254d48b0a8e3ac8de0d2c525810154d1f25ab20a95162",
"gen_hash_zig": "sha256:03d50a36f22f40daf936ade0b764ae11b4142c3f667bf1ab640007eb4fdbcb45",
"gen_hash_c": "sha256:c1bef3a23c202f04a424fa9647be515f0a73b0570f564b2034dc0f7ced6a3286",
"gen_hash_rust": "sha256:e79aeca5c088b28ba70f75c7db22b193450cb7436f9dc188b24149457d09797d",
"gen_hash_verilog": "sha256:913b5632ebb861ca2f1753a2c062ad6177792cdae769c0c41912b2dc3afe29a1",
"gen_hash_zig": "sha256:37dc8408fe41cf9c5774624a1c0de61ce288b322eb5d777d841a10bd653768a4",
"module": "AnalogMosPsp103Data",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-19T05:33:43Z",
"sealed_at": "2026-10-19T16:29:24Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:be100dec66ee80de6cf520f79038e7668bc1171102db1fefe6a4c74559d029de",
"spec_hash": "sha256:3936594d2ab220f06b2d636182689811b696e044fc3ce6850ea2604ac74f3ea3",
"spec_path": "specs/analog/mos_psp103_data.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 7,
"total": 7,
"passed": 8,
"total": 8,
"vacuous": 0
},
"toolchain": {
Expand Down
12 changes: 6 additions & 6 deletions .trinity/seals/analog_AnalogSarKick.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"built_by": "t27c-bootstrap@0.5.2+ea35d9b72",
"built_by": "t27c-bootstrap@0.5.2+0fba674ef",
"closure": [
{
"spec": "specs/analog/linear.t27",
"spec_hash": "sha256:3ddef7be183aba583ed285334ee389b48a65b41335e98914514235db7c4e5d62"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:eadf7a5711ab26d9ccc62014db5742e9384ce4f4b435056d1491aeaf4401c8eb",
"gen_hash_c": "sha256:516df5bf9f81aa5a2115b870c10eb58b21e5edb76d59da54c6c1fa621a5034d7",
"gen_hash_rust": "sha256:5516883b9db0b8b604aafaa502a79c08d8680e7be9b7a4aa05fcf61666eeea4f",
"gen_hash_verilog": "sha256:4fcae5993b32996b83ceafc7794fcb6ce084b37c79d413c5412ca602c9b8da90",
"gen_hash_zig": "sha256:fb3ac67bc0ab4942a221bf1c76792d28c313975f4e99694563d6ab56192353c9",
"gen_hash_verilog": "sha256:524c966626538ac391a13e03108559b227118c2251dc9c9e12b2b6d0324447e0",
"gen_hash_zig": "sha256:01d83589ceef71018375c7f4630ef68b02bb30212b7d06f4f95455360c256089",
"module": "AnalogSarKick",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-19T08:09:24Z",
"sealed_at": "2026-10-19T16:29:46Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:ccea2477f8ea8f09a40c15a4881c9003111866a176565d60102b6f9550a7d94c",
"spec_hash": "sha256:8c7c3968475c3f62c78f7b0a7739c2f049680eb9911d23be7f4d0ce0a4922dff",
"spec_path": "specs/analog/sar_kick.t27",
"tests": {
"failed": 0,
Expand Down
49 changes: 49 additions & 0 deletions .trinity/seals/coverage_TriCoverage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"built_by": "t27c-bootstrap@0.5.2+0fba674ef",
"closure": [
{
"spec": "specs/lab/text.t27",
"spec_hash": "sha256:5a108e7c6da57c5c4fbd2c3f109092dcf130ca9107b4f559c4bbba750a863c3e"
},
{
"spec": "specs/tri/lab/receipt.t27",
"spec_hash": "sha256:00d9eec8d7be84dde596c9990b3a5574de24aff9f7a94579fc620eb585712441"
},
{
"spec": "specs/tri/lanes/lanes.t27",
"spec_hash": "sha256:aac192b3e3250196262a9b8467d4a9cef8147438c11c0744c66c3f6b175c9342"
},
{
"spec": "specs/tri/remote/remote_job.t27",
"spec_hash": "sha256:84a153bd92bbc94bc57f1d030114507bd99de2f3ac3f800db3fe5880df950479"
},
{
"spec": "specs/tri/test/report.t27",
"spec_hash": "sha256:f648fe411cdcc610536e6268baa64798ceabef7bb8b600991cd4c431236aef5b"
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:c56fb507501afa7e4deb6445cd9a7a0447ec92d96ebc70e7c532e0309628c34f",
"gen_hash_rust": "sha256:9d577d29855400f1ad4ca97c0cbfb1874047aeac067ba9128f61d4bfee29ec9f",
"gen_hash_verilog": "sha256:eb4b293149431c91d441b38117063f267ca17dcef9fa224de0e774aa0e846675",
"gen_hash_zig": "sha256:d0c9be1395f34ae643743317fc83532d238d992dbcbc1dd40bcc787fe02afa10",
"module": "TriCoverage",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-19T17:03:53Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:847d7ab22554616ca37b5cc4461763049be0de588920cf08d762907d135104c4",
"spec_path": "specs/tri/coverage/coverage.t27",
"tests": {
"failed": 0,
"failing": [],
"forced": false,
"passed": 18,
"total": 18,
"vacuous": 0
},
"toolchain": {
"test_runner": "sha256:8512b80da533b79289110fca4a65f3336abd7a059ca4b72ea595d5e33ff8ad10",
"zig": "0.16.0"
}
}
12 changes: 6 additions & 6 deletions .trinity/seals/lab_LabPrune.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"built_by": "t27c-bootstrap@0.5.2+c948f4df7",
"built_by": "t27c-bootstrap@0.5.2+0fba674ef",
"closure": [
{
"spec": "specs/claw/lab_disk.t27",
Expand All @@ -15,16 +15,16 @@
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:536ebcd57367aa5bf729cdd2496b056295a556d06c4f89a54e40fea7abccafc8",
"gen_hash_c": "sha256:b7025c46381b9a35f5f5e685f5d8a21a29beede7eafdc9ee6d61751c37949a48",
"gen_hash_rust": "sha256:f16148ccd9899bc4e8ec8b387677747baec934f0249324d39103577809ba0804",
"gen_hash_verilog": "sha256:b90f6d18cc727397e16e48f95b30170ff7bfae781fade7d16be0ab67f8754208",
"gen_hash_zig": "sha256:b201f8be850be555c2306d224618eed7929eb64a0153174957a562023db591a6",
"gen_hash_verilog": "sha256:b6fd1b4a553dbc5597868ebe34b665d5a5f5f1b586f269ff0f14ad899d4d6392",
"gen_hash_zig": "sha256:7084c58facdfacd56104610157b60f6c775bce4cdaefc747fb16e19deded71fe",
"module": "LabPrune",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-19T13:57:01Z",
"sealed_at": "2026-10-19T16:30:11Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:d837e4b542b5c7b30df5f0daa7ad30ae04a1903443c787b686a1940adde9cd3e",
"spec_hash": "sha256:a747fca983c2ad33d06ccd8598c3ee16dc854510d43d297493d163db5d11cb0d",
"spec_path": "specs/lab/prune.t27",
"tests": {
"failed": 0,
Expand Down
10 changes: 5 additions & 5 deletions .trinity/seals/lab_LabT27bReport.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
}
],
"config": "gen=c,rust,verilog,zig;tests=zig",
"gen_hash_c": "sha256:acf57ccef56bd87c835e62b293bc1798e0c01eb07448e63e806d69b791445606",
"gen_hash_c": "sha256:016cd68e450a8d39717365ee6c77d2999554c2a78f031cb9ed315d7c49fa40cd",
"gen_hash_rust": "sha256:77b35bcf4dfa00dcfc8fc277cc206146e9266a1b0a6b0a768b7990cd676762f7",
"gen_hash_verilog": "sha256:ee0a40c730fef4cce0c67765d0d20fc53791e1b3fb476cca97cb2aaa116aa066",
"gen_hash_zig": "sha256:2418d7ce413caf6e9967672e8132543388f06e5bcf5d022db43d892ce1034252",
"gen_hash_verilog": "sha256:fdfb099d988ddcd2cc24d90fa233591c504f32546d1c2c9a8457732a7729430d",
"gen_hash_zig": "sha256:690b1503db95f1133afd7578cef6bdf20970976df66fa9c7774ee7798850e89a",
"module": "LabT27bReport",
"ring": 12,
"seal_schema": 2,
"sealed_at": "2026-10-19T14:57:00Z",
"sealed_at": "2026-10-19T16:29:57Z",
"sealed_by": "t27c-bootstrap@0.5.2",
"spec_hash": "sha256:281801183bfea16fee870f7b0d7c48b71c8f24e5b53417f8df88b4026ae67008",
"spec_hash": "sha256:90f8457cbe1ac2944a04b18be4c72dbc7ed52b1857a5a2eb0ebc22bdd21e71e6",
"spec_path": "specs/lab/lab_t27b_report.t27",
"tests": {
"failed": 0,
Expand Down
3 changes: 3 additions & 0 deletions cli/tri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ enum Commands {
T27oSweep { paths: Vec<String>, #[arg(long, default_value = t27o_ledger::SWEEP_HERE)] repo: String, #[arg(long, default_value_t = t27o_ledger::SWEEP_MAX_BYTES)] max_bytes: usize, #[arg(long)] cache: Option<String>, #[arg(long, default_value_t = t27o_ledger::SWEEP_TOP)] top: usize },
/// Land a lane branch (default: the current one): merge master, then tests with no vacuous pass, seals, types ratchet, dupe subset, push, pull request, auto-merge; the first failing gate stops it with a named code (CONFLICT, TESTS_NOT_CLEAN, SEAL_NOT_CLEAN, TYPES_NOT_CLEAN, DUPE_NOT_SUBSET, PUSH_NOT_CONFIRMED) and a second run prints ALREADY_LANDED; --plan prints the steps and runs none, --check stops before the commit; T27C names the t27c program (default t27c on PATH) (rules: specs/tri/land/land.t27, #11068).
Land { branch: Option<String>, #[arg(long, default_value_t = 0)] issue: u64, #[arg(long)] plan: bool, #[arg(long)] check: bool },
/// Coverage of a set of specs by five facts each, one row per spec and a total: the tests ran and none failed, no vacuous pass, a test named for a refusal or a planted fault (negative control), the seal verifies, and the header names an issue. PATTERN is a path or a glob (`specs/lab/*.t27`); the last line is `gaps G coverage N/D`, never rounded. Exit 0 once printed, 1 on a gap with --strict, 2 when no spec matched; --t27c names the t27c program (default target/release/t27c, then t27c on PATH) (rules: specs/tri/coverage/coverage.t27, #11061).
Coverage { patterns: Vec<String>, #[arg(long)] strict: bool, #[arg(long)] t27c: Option<String> },
/// Add one lesson to the Traps section of a skill unless the section already says it; `tri learn add --help` has the refusals (rules: specs/tri/loop/lesson.t27, #11060).
Learn { #[command(subcommand)] action: loopclaim::LearnCmd },
}
Expand Down Expand Up @@ -1375,6 +1377,7 @@ fn main() -> Result<()> {
Commands::T27o { file, name, oracle, check, t27c, emit_cell } => std::process::exit(cmd_t27o(file, name.as_deref(), *oracle, *check, t27c.as_deref(), *emit_cell)? as i32),
Commands::T27oSweep { paths, repo, max_bytes, cache, top } => std::process::exit(cmd_t27o_sweep(paths, repo, *max_bytes, cache.as_deref(), *top)? as i32),
Commands::Land { branch, issue, plan, check } => std::process::exit(cmd_land(branch.as_deref(), *issue, *plan, *check)? as i32),
Commands::Coverage { patterns, strict, t27c } => std::process::exit(seals::coverage_run(patterns, *strict, t27c.as_deref())?),
Commands::Learn { action } => loopclaim::learn_run(action)?,
}

Expand Down
33 changes: 33 additions & 0 deletions cli/tri/src/seals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,39 @@ pub fn run(cmd: &SealsCmd) -> Result<()> {
Ok(())
}

// `tri coverage` (#11061): every rule is specs/tri/coverage/coverage.t27; this runs git and t27c (argument vectors, no shell) and prints what the rules write.
#[path = "../../../gen/rust/tri/coverage/coverage.rs"] #[allow(dead_code, unused_parens, unused_mut, unused_variables, non_snake_case, unused_assignments, clippy::all)]
mod cov; // t27c gen-rust of specs/tri/coverage/coverage.t27: the five facts, a spec's row and the total
/// What `t27c test-report` and `t27c seal --verify` say about one spec, and the spec's own text.
fn cov_probe(t27c: &str, path: &str) -> cov::TriCoverageProbe {
let leak = |s: String| -> &'static str { s.leak() };
let (report, test_run) = crate::test_report(t27c, std::path::Path::new(path), false).unwrap_or(("", u8::MAX));
let seal = std::process::Command::new(t27c).args(["seal", path, "--verify"]).output();
cov::TriCoverageProbe { path: leak(path.into()), report, test_run, seal: leak(seal.as_ref().map(|o| String::from_utf8_lossy(&o.stdout).into_owned()).unwrap_or_default()), seal_ok: seal.map_or(false, |o| o.status.success()), source: leak(std::fs::read_to_string(path).unwrap_or_default()) }
}

pub fn coverage_run(patterns: &[String], strict: bool, t27c: Option<&str>) -> Result<i32> {
let t27c = crate::mutate::resolve_t27c(t27c);
let mut specs: Vec<String> = Vec::new();
for p in patterns {
let o = std::process::Command::new("git").args(["ls-files", "--cached", "--others", "--exclude-standard", "--"]).arg(format!(":(glob){p}")).output()?;
specs.extend(String::from_utf8_lossy(&o.stdout).lines().filter(|l| cov::is_spec_path(l.to_string().leak())).map(String::from));
}
specs.sort();
specs.dedup();
let mut probes: Vec<(usize, cov::TriCoverageProbe)> = std::thread::scope(|s| {
let hs: Vec<_> = (0..cov::JOBS).map(|j| { let (t, sp) = (t27c.as_str(), &specs); s.spawn(move || (j..sp.len()).step_by(cov::JOBS).map(|i| (i, cov_probe(t, &sp[i]))).collect::<Vec<_>>()) }).collect();
hs.into_iter().flat_map(|h| h.join().unwrap()).collect()
});
probes.sort_by_key(|p| p.0);
let mut buf = vec![0u8; cov::ROW_MAX.max(cov::TOTAL_MAX)];
let masks: Vec<u8> = probes.iter().map(|(_, p)| { let n = cov::emit_row(&mut buf, 0, *p); print!("{}", String::from_utf8_lossy(&buf[..n])); cov::facts(*p) }).collect();
let ok: Vec<u64> = (0..cov::FACTS).map(|k| masks.iter().filter(|m| cov::holds(**m, k)).count() as u64).collect();
let n = cov::emit_total(&mut buf, 0, masks.len() as u64, ok[0], ok[1], ok[2], ok[3], ok[4]);
print!("{}", String::from_utf8_lossy(&buf[..n]));
Ok(cov::coverage_exit(masks.len() as u64, ok.iter().sum(), strict) as i32)
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
Loading
Loading