Skip to content

ONT-4b2: extract:code + extract:lean as focus nodes; 16 of the ONT-0 table's 32 W3C SHACL-Core cases vendored in the gate, 16 accounted for by excluding form; the pinned oracle differential out of it (Refs PMAT-3509) - #3528

Merged
noahgift merged 12 commits into
mainfrom
PMAT-3509-ont-4b2-oracle-w3c
Sep 19, 2026

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

ont-delta: type code

Closes #3509 (0.68.2 requirement, §0.4 second ruling relayed via the release session). Spec: paiml/infra docs/specifications/paiml-ontology.md §5 ONT-4b2, §3.6, §3.7, R-13, R-15, R-18.

DRAFT while it is stacked. This branch is built on the reconciled #3526 (ONT-4c1) + #3516 (extract:json) tree, because all three touch extract::all and shapes_gate.rs. It rebases onto main after #3516 → #3523 → #3526 land, and the three known-red tests below go green with #3523's receipts. Quorum and seam review can run now; nothing here waits on them.

extract:code — the focus objects are the bound symbols: every module_path + function a binding.yaml declares, resolved by a syn module-tree walk (inline modules, x.rs / x/mod.rs / #[path], one pub use … as hop, impl methods, both [package] name and [lib] name, a facade and the crate it re-exports tried in order). Not every fn in 3.9 M lines: no contract constrains a symbol nothing binds, and ONT-3a already owns the per-binding claim. Fail-closed in the graph: a symbol the walk cannot find is still an ont:Symbol, with sym:resolved false and sym:unresolvedReason naming the file and the segment — so a ghost binding is a violation naming the symbol, not a quietly smaller graph. Measured here: 270 bound symbols, 169 resolved, 101 genuinely absent (chat_session, encrypt, dispatch modules that do not exist; data::run where only run_audit/run_split do).

extract:lean — the in-tree theorems as ont:Statement under world/, read by ONT-2a's own scan and rule (a file carrying sorry grounds nothing), joined to the contracts that cite them by ONT-2a's name forms, with references that name nothing counted (lean_refs_unresolved), never guessed. 410 statements.

The W3C arm, both sides. 16 of ONT-0's 32-case table are translated into the contract dialect and run by the gate every time (ontology::w3c); the other 16 are listed by name with the form that puts them outside the subset (sh:class on a node shape, sh:or, sh:flags, blank-node kinds), so w3c_cases_passed is a count over the cases the subset claims and a case refused by design is never scored as a failure. A failing case declines Unknown{Differential} naming it — never a corpus verdict.

The oracle, out of the gate (R-13). tests/oracle/ is a scratch crate detached from the workspace ([workspace] in its own manifest) with shacl pinned =0.3.21 — ONT-0's measured verdict ORACLE. make oracle runs the pinned processor over the original case files and over the real corpus and writes the tracked tests/oracle/differential.json: 17 cases, 0 disagreements. A planted sh:minCount change in shapes.ttl makes it disagree (measured: 1756 vs 15). A test asserts no shacl/rudof_rdf/oxigraph is in the workspace lock (F-20).

Four conformance fixes the cases and the oracle found in the in-house validator, each with the case that fires on it:

fix case
sh:class / targetClass use the rdfs:subClassOf closure (SHACL §2.1.1) property/class-001
sh:datatype checks the lexical form is well formed ("300"^^xsd:byte is a violation) property/datatype-ill-formed
sh:node reports ONE result per failing value on the outer path property/node-001, -002
sh:in is term equality, and the export writes the entries typed the corpus arm: in: ["true"] was accepting "true"^^xsd:boolean, 490 results of difference

The closure is built once per validate() rather than scanned per node: the corpus gate went 27.2 s → 6.9 s in the same commit.

Arming. bound-symbols-resolve and lean-statements-grounded ship computed and reported, in not_armed_shapes (§3.9) — 101 ghosts and three admitted theorem files exist on main today, and a gate red on its own target the day it merges trains bypass. Arming is one string in contracts/lint-baseline.json for the release that cleans them. The fixture pair proves both directions: code-bound/ (unarmed → Pass, unarmed_violations 1) and code-ghost/ (armed → Fail naming the symbol).

Two check_ont_ratchet.sh defects fixed, each with a self-test row that goes red without the fix (17 → 23 rows): entity_types_registered and extractors_implemented grepped the Rust for EntityType:: and impl Extractor — forms this codebase has never used — so both measured 0 while the baseline carried 1 and 1 from an older tree; and --write deleted formal_prose and legacy_unresolved_depends_on, two shrink-only ratchets the sigma and relations gates read from that same file, so updating one ratchet disarmed two others.

Known red, all three the same inherited assertion, none of it this row's: lint_passes_on_real_contracts, ont4b_shapes_gate::the_repo_corpus_passes_…, ont4c1_model_receipts::the_repo_corpus_reports_… assert the real corpus PASSES, and the armed ladder-measured finds 0 witnesses until #3523's re-measured receipts are on main. Proven by measurement: with ladder-measured unarmed for one run the same corpus is Pass, 0 violations, 113 reported.

Green here: aprender-contracts lib 1659/1660 (the one above), ontology:: 82/82, ont4b2_code_lean_w3c 8/8, ont_extract_json 7/7, ont4b_shapes_gate 10/11, ont4c1_model_receipts 11/12, pv extract --check 0, check_ont_ratchet.sh --self-test 23/23, clippy -D warnings clean, cargo fmt clean, make oracle 0 disagreements.

R-23 (this head, pv built from it):

aprender: cmd="pv lint contracts --gate shapes --format json" pv=<this head> exit=1 verdict="Fail — 5 shapes, 2318 focus nodes, 8 armed violations (ladder-measured, 0 witnesses until #3523), 105 reported from the two unarmed ONT-4b2 shapes, w3c_cases_passed 16/16, pc_extract code+lean fired"
rmedia:   cmd="pv lint crates/rmedia-core/contracts --gate shapes --format json" pv=<this head> exit=2 verdict="decline: NoShapes on origin/main 9e90468 — the Σ and the first shape are on rmedia#559, measured Pass there (131 focus nodes)"

🤖 Generated with Claude Code

Noah Gift and others added 3 commits September 19, 2026 17:05
…the oracle differential) against #3509

Pmat-Ticket: PMAT-3509
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ymbol/ and world/ roots), 16 vendored W3C SHACL-Core cases run by the gate, the pinned oracle differential out of gate

extract:code walks the BOUND symbols only — every module_path + function a binding.yaml declares — through a syn module-tree walk (inline mods, file mods, #[path], one re-export hop, impl methods, both [package] and [lib] crate names, a facade and the crate it re-exports tried in order). Fail-closed IN THE GRAPH: a symbol the walk cannot find is still an ont:Symbol with sym:resolved false and sym:unresolvedReason naming the file and the segment, so a ghost binding is a violation naming the symbol instead of a smaller graph. Measured on this tree: 270 bound symbols, 169 resolved, 101 genuinely absent.

extract:lean reads the in-tree theorems through ONT-2a's own scan and rule (a file carrying `sorry` grounds nothing), joins them to the contracts that cite them by ONT-2a's name forms, and counts references that name nothing (lean_refs_unresolved) rather than guessing. 410 statements on this tree.

The W3C arm is two-sided. 16 of ONT-0's 32-case table are translated into the contract dialect and RUN BY THE GATE every time (ontology::w3c); the other 16 are listed by name with the form that puts them outside the subset, so the count is over the cases the subset claims and a case refused by design is never scored as a failure. A failing case declines Unknown{Differential} — never a corpus verdict. tests/oracle/ is a scratch crate DETACHED from the workspace with shacl pinned =0.3.21 (ONT-0's verdict ORACLE, R-13 release gate only); `make oracle` validates the ORIGINAL case files and the real corpus through it and writes the tracked tests/oracle/differential.json (17 cases, 0 disagreements). A planted sh:minCount change in shapes.ttl makes it disagree — measured.

Four conformance fixes the cases and the oracle found in the in-house validator:
- sh:class and targetClass use the rdfs:subClassOf closure (SHACL 2.1.1; W3C class-001), through one index per validate() instead of a scan per node — the corpus gate went 27.2s -> 6.9s in the same commit.
- sh:datatype checks the lexical form is WELL FORMED for the type ("300"^^xsd:byte is a violation; W3C datatype-ill-formed).
- sh:node reports ONE result per failing value on the outer path, with the nested findings as its detail (W3C node-001/-002).
- sh:in is TERM equality: an entry carries the datatype its YAML scalar gives it and the export writes it typed. Before, `in: ["true"]` accepted "true"^^xsd:boolean, which the oracle refuses — 490 results of difference on the real corpus, which is how it was found.

Sigma: code and lean implemented: true, concepts Symbol and Statement. The shapes bound-symbols-resolve and lean-statements-grounded ship COMPUTED AND REPORTED, not armed (§3.9): 101 ghosts and three admitted theorem files exist on main today, and a gate red on its own target the day it merges trains bypass. Arming is one string in lint-baseline.json for the release that cleans them.

check_ont_ratchet.sh, two defects fixed with rows that go red without the fix: entity_types_registered and extractors_implemented grepped the Rust for `EntityType::` and `impl Extractor`, two forms this codebase has never used, so both measured 0 while the baseline carried 1 and 1 from an older tree — they now read Sigma; and `--write` DELETED formal_prose and legacy_unresolved_depends_on, two shrink-only ratchets the sigma and relations gates read from that same file, so updating one ratchet disarmed two others. Self-test 17 -> 23 rows.

Known red, all three the same inherited assertion and none of them this row's: lint_passes_on_real_contracts, ont4b_shapes_gate::the_repo_corpus_passes_..., ont4c1_model_receipts::the_repo_corpus_reports_... assert the real corpus PASSES, and the armed ladder-measured finds 0 witnesses until the re-measured receipts of #3523 are on main (#3526's waiting note). Proven by measurement: with ladder-measured unarmed for one run the same corpus is Pass, 0 violations, 113 reported.

Pmat-Ticket: PMAT-3509
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…n) — ordinal 343, the sh:in message carries the path AND the terms, regenerated census / contracts.nt / tree-reader registry (Refs PMAT-3509)

The branch was built on the reconciled 4c1 scratch base; only its two own
commits were replayed (`git rebase --onto origin/main bd89c88`). One real
conflict, shapes.rs check_lexical: #3530 put the property path at the front
of the `in` message (`ont:study/scale: quadratic is not one of …`) and 4b2
renders the value and the list as TERMS (`sh:in` is term equality). Merged:
`<path>: <term> is not one of [<terms>]` — #3530's CLI legs
(contains path ∧ value ∧ "is not one of") and 4b2's still hold. The four
generated files took main's copy and were regenerated with this tree's pv:
`pv extract contracts --check` 0; sigma Pass, relations Pass, shapes Pass
(shapes_n=5, focus_nodes_n=2318, symbols 169 resolved / 101 unresolved
reported, W3C 16/16). Ordinal 340 was apr-cli-pixel-regression on main;
4b2 takes 343 (342 is 4c1's).

Pmat-Ticket: PMAT-3509
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@noahgift
noahgift force-pushed the PMAT-3509-ont-4b2-oracle-w3c branch from 81ef9d7 to b7bb485 Compare September 19, 2026 15:16
Noah Gift and others added 2 commits September 19, 2026 17:21
…he only one — ONT-4b2 reports two more unarmed (Refs PMAT-3509)

On the 4b2 tree not_armed_shapes is [ladder-green, bound-symbols-resolve, lean-statements-grounded]; the corpus test pinned the list to one entry, a fact about ONT-4c1's tree rather than about ONT-4c1. Membership is what the row promises (§3.9 reported-first); the fixture test keeps its exact-list form.

Pmat-Ticket: PMAT-3509
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…the unused ShapesOutcome import (clippy 1.93 -D warnings) (Refs PMAT-3509)

Pmat-Ticket: PMAT-3509
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@noahgift
noahgift marked this pull request as ready for review September 19, 2026 15:26
…rmed), never pinned to one side of the arming line (Refs PMAT-3509)

aprender-ba, on #3528: the 0.68.2 bump (#3498, head 5b22fb2) arms ladder-green, so a test asserting ladder-green ∈ not_armed_shapes goes red on the release branch the moment #3528 lands under it. The row's fact is that the gate computes and reports the shape (a by_shape entry) and lists it on one side or the other; which side is the bump's, not the row's.

Pmat-Ticket: PMAT-3509
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@noahgift

Copy link
Copy Markdown
Contributor Author

quorum-review (AD-04): NOT agreed (auto_merge: checked=true was_armed=false disarmed=false)

{
 "ticket": "PMAT-3509",
 "head": "bb738faab1635af346fe24902d81cd5e574c24ae",
 "width": 3,
 "executor": "agy",
 "agreed": false,
 "auto_merge": {
  "checked": true,
  "was_armed": false,
  "disarmed": false,
  "note": "auto-merge not armed"
 },
 "lanes": [
  {
   "lane": 1,
   "verdict": "FAIL",
   "findings": 1
  },
  {
   "lane": 2,
   "verdict": "FAIL",
   "findings": 1
  },
  {
   "lane": 3,
   "verdict": "FAIL",
   "findings": 1
  }
 ]
}

…the syn edge; the ticket says 16 vendored + 16 accounted for, not 32; the differential re-run on the rebased tree (Refs PMAT-3509)

Quorum round 2 on bb738fa, three lanes, three findings, all real:

1. (flash, measured) `make oracle` under this Makefile's .ONESHELL: line 1376
   `cd tests/oracle && cargo build` moved the shell for line 1377, whose
   `$(cd tests/oracle …)` then failed with "No such file" and tried to run
   `/release/ont-oracle`. Both lines now use --manifest-path and no cd.
   Proven by running `make oracle-check` after the change: the oracle built,
   ran, and diffed — which is the second finding.

2. tests/oracle/differential.json was the pre-rebase tree's. Fresh on
   45decaf+4b2: cases=17, disagreements=0, corpus agree=true with 103
   violations on BOTH sides (was 113/113 — the corpus moved under the rebase:
   #3530's entity-property fixes and main's contracts). The oracle and pv
   still agree on every case and on the corpus; the file is the run's output.

3. (pro-high, pro-low) the ticket title said "32 vendored W3C SHACL-Core
   cases"; the diff vendors 16 and accounts for the other 16 by excluding
   form (a constraint on the node shape itself, outside the subset), which
   `the_table_of_ont_0_is_accounted_for_case_by_case` asserts as 16 + 16 =
   32 with no id twice. The title now says that, and six acceptance criteria
   are written from the diff (not the plan) — the CLI leg's `n >= 16` is
   what is vendored. Roadmap re-aggregated.

Also: crates/facades/Cargo.lock regenerated for the `syn` edge
aprender-contracts gained (guard-tree R5 on bb738fa: "Cargo.lock is
stale"); `cargo metadata --locked` rc 0 in crates/facades.

Pmat-Ticket: PMAT-3509
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@noahgift noahgift changed the title ONT-4b2: extract:code + extract:lean as focus nodes; the W3C SHACL-Core cases in the gate; the pinned oracle differential out of it (Refs PMAT-3509) ONT-4b2: extract:code + extract:lean as focus nodes; 16 of the ONT-0 table's 32 W3C SHACL-Core cases vendored in the gate, 16 accounted for by excluding form; the pinned oracle differential out of it (Refs PMAT-3509) Sep 19, 2026
@noahgift

Copy link
Copy Markdown
Contributor Author

quorum-review (AD-04): three PASS — agreed (auto_merge: checked=true was_armed=false disarmed=false)

{
 "ticket": "PMAT-3509",
 "head": "f5dd5d7f6f6cd7b0ea5a045db9b505ae9c088928",
 "width": 3,
 "executor": "agy",
 "agreed": true,
 "auto_merge": {
  "checked": true,
  "was_armed": false,
  "disarmed": false,
  "note": "auto-merge not armed"
 },
 "lanes": [
  {
   "lane": 1,
   "verdict": "PASS",
   "findings": 0
  },
  {
   "lane": 2,
   "verdict": "PASS",
   "findings": 1
  },
  {
   "lane": 3,
   "verdict": "PASS",
   "findings": 0
  }
 ]
}

Round 1 lapsed to the arming-neutral ladder-green assertion (aprender-ba's finding); round 2's three findings — the .ONESHELL cd in make oracle, the stale differential, the 32-vs-16 title — were each answered in the diff.

Pmat-Ticket: PMAT-3509
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@noahgift
noahgift enabled auto-merge September 19, 2026 15:46
@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

§13.11 rung 1 — quorum shadow verdict

S13-SHADOW pr=3528 head=60c460827baf5e44e9d20a3d1a8b195fb0441e98 verdict=REFUSE class=Q1 arm_rc=1

Shadow mode: this records a verdict and merges nothing. A refusal
to arm is not a block (§13 adds zero rows to §7) — the pull request is
exactly as green as it was.

…/ont-code-symbols-v1.yaml (make readme-sync) (Refs PMAT-3509)

guard-cargo on the merge tree: FALSIFY-README-002 (the block is generated, an equality, not a ratchet). Regenerated with the generator the guard names; readme-sync-check and check_readme_claims.sh pass.

Pmat-Ticket: PMAT-3509
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@noahgift
noahgift disabled auto-merge September 19, 2026 16:44
@noahgift

Copy link
Copy Markdown
Contributor Author

quorum-review (AD-04): three PASS — agreed (auto_merge: checked=true was_armed=false disarmed=false)

{
 "ticket": "PMAT-3509",
 "head": "a6927091a2e29fdaa0de49757d88eed7298795cd",
 "width": 3,
 "executor": "agy",
 "agreed": true,
 "auto_merge": {
  "checked": true,
  "was_armed": false,
  "disarmed": false,
  "note": "auto-merge not armed"
 },
 "lanes": [
  {
   "lane": 1,
   "verdict": "PASS",
   "findings": 0
  },
  {
   "lane": 2,
   "verdict": "PASS",
   "findings": 3
  },
  {
   "lane": 3,
   "verdict": "PASS",
   "findings": 0
  }
 ]
}

Round 3's 3/3 lapsed to the README CONTRACT_COUNT regeneration (guard-cargo FALSIFY-README-002 on the merge tree).

Pmat-Ticket: PMAT-3509
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@noahgift
noahgift enabled auto-merge September 19, 2026 16:53
@noahgift
noahgift added this pull request to the merge queue Sep 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Sep 19, 2026
…cle-w3c

# Conflicts:
#	crates/aprender-contracts-cli/src/commands/lint.rs
@noahgift

Copy link
Copy Markdown
Contributor Author

quorum-review (AD-04): NOT agreed (auto_merge: checked=true was_armed=false disarmed=false)

{
 "ticket": "PMAT-3509",
 "head": "3329c7cde4f704673d06df5bb50ba2b4e5cf7271",
 "width": 3,
 "executor": "agy",
 "agreed": false,
 "auto_merge": {
  "checked": true,
  "was_armed": false,
  "disarmed": false,
  "note": "auto-merge not armed"
 },
 "lanes": [
  {
   "lane": 1,
   "verdict": "NO-VERDICT",
   "findings": 0
  },
  {
   "lane": 2,
   "verdict": "PASS",
   "findings": 3
  },
  {
   "lane": 3,
   "verdict": "PASS",
   "findings": 0
  }
 ]
}

@noahgift

Copy link
Copy Markdown
Contributor Author

quorum-review (AD-04): three PASS — agreed (auto_merge: checked=true was_armed=false disarmed=false)

{
 "ticket": "PMAT-3509",
 "head": "3329c7cde4f704673d06df5bb50ba2b4e5cf7271",
 "width": 3,
 "executor": "agy",
 "agreed": true,
 "auto_merge": {
  "checked": true,
  "was_armed": false,
  "disarmed": false,
  "note": "auto-merge not armed"
 },
 "lanes": [
  {
   "lane": 1,
   "verdict": "PASS",
   "findings": 3
  },
  {
   "lane": 2,
   "verdict": "PASS",
   "findings": 4
  },
  {
   "lane": 3,
   "verdict": "PASS",
   "findings": 4
  }
 ]
}

Round 4's 3/3 lapsed to the merge of main ebda31d (#3533 lifted the same function 4b2 had already split; resolution: keep decide_named_gate/decide_shapes_gate, drop single_gate_outcome). Round 5 was two PASS and one lane timed out at 25 min (no verdict, not a finding); round 6 agreed.

Pmat-Ticket: PMAT-3509
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@noahgift
noahgift enabled auto-merge September 19, 2026 18:38
@noahgift
noahgift added this pull request to the merge queue Sep 19, 2026
Merged via the queue into main with commit daad9f7 Sep 19, 2026
25 of 26 checks passed
@noahgift
noahgift deleted the PMAT-3509-ont-4b2-oracle-w3c branch September 19, 2026 19:45
noahgift added a commit that referenced this pull request Sep 19, 2026
Co-Authored-By: Claude Fable 5.1 <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

1 participant