Skip to content

pv contradicted itself about metadata:, and entity.properties was read by nothing — both apex-measured defects fixed (Refs PMAT-3529) - #3530

Merged
noahgift merged 6 commits into
mainfrom
PMAT-3529-sigma-metadata-entity-properties
Sep 19, 2026
Merged

noahgift merged 6 commits into
mainfrom
PMAT-3529-sigma-metadata-entity-properties

Conversation

@noahgift

Copy link
Copy Markdown
Member

ont-delta: type study (the first entity type whose OWN properties are focus predicates)

Closes #3529. Both defects were measured and reported by the apex session (paiml/apex, APEX-001 EV-19/EV-21) against pv 0.68.1, with file and stderr; both blocked a real corpus. Spec: paiml/infra docs/specifications/paiml-ontology.md §3.6, §3.7, §4.1, §4.2.

1. One binary, two subcommands, opposite verdicts on the same bytes. pv validate REQUIRES metadata.{version, description} on a contract. contracts/ontology.yaml IS a contract. The Σ schema is deny_unknown_fields, so it refused the block: apex measured pv validate rc 0 and pv lint --gate sigma exit 3 over the same file (unknown field `metadata` … at line 26), and a corpus that keeps ONE Σ for both readers (EV-19 decision A) could not satisfy them at once.

Σ now carries metadata as opaque YAML: no Σ rule reads a field of it, and it joins READABLE_KEYS so readers: must still claim it. The anti-decoration rule is answered, not weakened — "the contract schema reads it, not Σ" — and a test drops the readers entry to show the exit 3 comes back naming the key.

2. A shape over entity.properties had no predicate to constrain. extract:pv-contract emitted ont:entityType / ont:entityRef and nothing else, so a contract carrying the properties of the thing it is a contract for — apex's nine researcher degrees of freedom, which live in the contract because the contract IS the pre-registration and EV-6 hashes it — had every minCount: 1 fire for the wrong reason: a shape failing because the extractor was silent, the vacuity R-2 exists to end.

entity.properties.<k>: <scalar> now becomes <entityType>:<k> on the contract node (study:scale "linear"). Three rules, each with a test:

  • the namespace is the entity type, never ont: — two types may both carry a scale, and one predicate for both would let a shape over one constrain the other;
  • no entity.type → no property triples: there is no namespace, and inventing one is an inference;
  • nested mappings and sequences are not emitted at v1alpha1: the subset has no path expressions, so a predicate no shape could reach is decoration.

The fixtures are apex's own falsifiers (EV-21 FALSIFY-ONT-021/021b), run through the CLI, with the shape header apex will write (targetClass: ont:Contract, closed: true, ignoredProperties: for the contract's own keys):

fixture verdict
entity-props-ok Pass — a build that emits no property triples fails it on minCount
entity-props-bad-value Fail (in): ont:study/scale: quadratic is not one of ["linear", …]
entity-props-undeclared-key Fail (closed): carries ont:study/subgroup, which the closed shape does not declare

Also: a lexical violation now names its path in the message, not only in the result's path field — in, pattern, minLength, maxLength. A shape with nine properties used to produce nine lines a reader could not tell apart.

Measured on this tree: pv lint contracts --gate sigma Pass, --gate shapes Pass (1731 focus nodes), pv extract contracts --check 0, aprender-contracts lib 1614/1614, ont_entity_properties 6/6, ont2b_sigma_gate 11/11, ont4_relations_gate 11/11, ont4b_shapes_gate 8/8, clippy -D warnings clean, cargo fmt clean.

R-23:

aprender: cmd="pv lint contracts --gate shapes --format json" pv=<this head> exit=0 verdict="Pass — 1 armed shape, 1731 focus nodes, 0 violations, plant 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 — Σ and the first shape are on rmedia#559"

Independent of #3516 / #3526 / #3528: it touches ontology/sigma.rs, ontology/extract/pv_contract.rs and the lexical messages only.

🤖 Generated with Claude Code

@noahgift

Copy link
Copy Markdown
Member Author

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

{
 "ticket": "PMAT-3529",
 "head": "7a77ff147eac8ac670bc5efd3917d6d099af132a",
 "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": 2
  },
  {
   "lane": 2,
   "verdict": "PASS",
   "findings": 3
  },
  {
   "lane": 3,
   "verdict": "PASS",
   "findings": 0
  }
 ]
}

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

§13.11 rung 1 — quorum shadow verdict

S13-SHADOW pr=3530 head=f69f7514f1b9c1133b2e73db4fefd4c3e6e887f3 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.

@noahgift

Copy link
Copy Markdown
Member Author

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

{
 "ticket": "PMAT-3529",
 "head": "ce899dddcd894cfd1fdf76cb6b6d7d2d88e59b6b",
 "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": 2
  },
  {
   "lane": 2,
   "verdict": "PASS",
   "findings": 0
  },
  {
   "lane": 3,
   "verdict": "PASS",
   "findings": 0
  }
 ]
}

@noahgift

Copy link
Copy Markdown
Member Author

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

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

@noahgift

Copy link
Copy Markdown
Member Author

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

{
 "ticket": "PMAT-3529",
 "head": "0b24cf2ba825b305b5db2893c49ed4d80c41c8a9",
 "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": 5
  },
  {
   "lane": 2,
   "verdict": "PASS",
   "findings": 0
  },
  {
   "lane": 3,
   "verdict": "PASS",
   "findings": 0
  }
 ]
}

@noahgift
noahgift enabled auto-merge September 19, 2026 12:57
Noah Gift and others added 5 commits September 19, 2026 14:57
….properties becomes <entityType>:<key> — the two defects apex measured on pv 0.68.1

Both were reported with file and stderr by the apex session (APEX-001 EV-19/EV-21) and both blocked a real corpus.

1. ONE BINARY, TWO SUBCOMMANDS, OPPOSITE VERDICTS ON THE SAME BYTES. `pv validate` REQUIRES metadata.{version, description} on a contract; contracts/ontology.yaml IS a contract; the Σ schema is deny_unknown_fields and refused the block — measured on apex: `pv validate` rc 0 and `pv lint --gate sigma` exit 3 over the same file, "unknown field `metadata` … at line 26". Σ now carries `metadata` as OPAQUE YAML: no Σ rule reads a field of it, it joins READABLE_KEYS so `readers` must still claim it, and the anti-decoration rule is answered rather than weakened ("the contract schema reads it, not Σ"). Two unit rows and a CLI row where the same fixture file passes `pv validate` AND `pv lint --gate sigma`; a third asserts that dropping the `readers` entry brings the exit 3 back, naming the key.

2. A SHAPE OVER entity.properties HAD NO PREDICATE TO CONSTRAIN. extract:pv-contract emitted ont:entityType and ont:entityRef from `entity:` and nothing else, so a contract carrying the properties of the thing it is a contract FOR — apex's nine researcher degrees of freedom, which live in the contract because the contract IS the pre-registration and EV-6 hashes it — had every `minCount: 1` fire for the wrong reason: a shape failing because the extractor was silent, the vacuity R-2 exists to end. `entity.properties.<k>: <scalar>` now becomes `<entityType>:<k>` on the contract node (`study:scale "linear"`).

The namespace is the ENTITY TYPE, never ont:, because two entity types may both carry a `scale` and one predicate for both would let a shape over one constrain the other. A contract with no `entity.type` gets no property triples — there is no namespace, and inventing one would be an inference. Nested mappings and sequences are not emitted at v1alpha1: the subset has no path expressions, so a predicate no shape could reach is decoration. All three rules have a test.

Fixtures are apex's own falsifiers (EV-21 FALSIFY-ONT-021/021b), run through the CLI: entity-props-ok PASSES (a build that emits no property triples fails it on minCount), entity-props-bad-value FAILS naming `ont:study/scale` and the value, entity-props-undeclared-key FAILS on `closed` naming `ont:study/subgroup`. The shape in them is the header apex will write: targetClass ont:Contract, closed: true, ignoredProperties for the contract's own keys.

Also: a lexical violation now names its PATH in the message (`ont:study/scale: quadratic is not one of […]`), not only in the result's path field — a shape with nine properties used to produce nine lines a reader could not tell apart. `in`, `pattern`, `minLength`, `maxLength`.

Measured on this tree: `pv lint contracts --gate sigma` Pass, `--gate shapes` Pass (1731 focus nodes), `pv extract contracts --check` 0, aprender-contracts lib 1614/1614, ont_entity_properties 6/6, ont2b_sigma_gate 11/11, ont4_relations_gate 11/11, ont4b_shapes_gate 8/8, clippy -D warnings clean.

Pmat-Ticket: PMAT-3529
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…e criteria are written from the diff (Refs PMAT-3529)

Quorum round 1 was NOT AGREED: lane 1 (gemini-3.1-pro-high) raised two findings and one of them is right.

RIGHT, and fixed here: the diff changed the shape gate's violation messages (the path now travels IN the message for in/pattern/minLength/maxLength) and the ticket did not say so, so the lane read a change nobody asked for. It is not a drive-by: without the path in the message apex's two EV-21 falsifiers cannot "FAIL naming study:<k>", which is the whole point of the row, and a shape with nine properties emits nine lines a reader cannot tell apart. The ticket title now names it and the acceptance criteria say what each part must do — written from the diff, as they should have been before the first round.

WRONG, and measured: the lane asserted (grounding "asserted", not "measured") that the CLI legs assert `ont:study/scale` while the extractor emits `study:scale`, "which will cause the test to fail". Both are the same IRI. `expand("study:scale")` is ONT_BASE + "study/scale" and `short()` renders any ONT_BASE IRI with the `ont:` prefix, so the message reads `ont:study/scale` — the repo-wide convention (`ont:model/parityReceipt`, `ont:tool/surprise`). The legs pass: `cargo test -p aprender-contracts-cli --test ont_entity_properties` 6/6, and the message on the fixture is, verbatim:

  ont:contract/study-shape-v1 violates shape `study-shape-v1` (in): ont:study/scale: quadratic is not one of ["linear", "log10", "log2", "sqrt", "logit"]

No code change for that one; a claim that a green test will fail is refuted by running it.

Pmat-Ticket: PMAT-3529
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…— the sentence the lane read twice was mine (Refs PMAT-3529)

Round 2 was NOT AGREED and lane 1 (gemini-3.1-pro-high) raised the same objection as round 1, this time grounded in my own acceptance criterion: AC3 said "the namespace is the entity TYPE, never ont:", the CLI legs assert the message contains `ont:study/scale`, and the lane concluded that either the code violates the AC or the test must fail.

The code is right and the sentence was wrong. Two different things were being called "namespace":
- the PREDICATE IRI, which is ONT_BASE + "study/scale" — what `study:scale` expands to — and never ONT_BASE + "scale", so a shape over one entity type cannot constrain another type's `scale`. That is the rule, and the unit test asserts both directions.
- the RENDERING, which is `short()`'s job and repo-wide: every ONT_BASE IRI prints with the `ont:` prefix, so the message reads `ont:study/scale` exactly as the model receipts already read `ont:model/parityReceipt` and the json row reads `ont:tool/surprise`.

AC2 and AC3 now say the IRI in full and note that the rendering is separate and unchanged. No code change: a lane reading a criterion the way it is written is the criterion's defect, and changing `short()` to invert `expand()` would re-render every vocabulary predicate and focus node across the corpus and three other repos' expectations — a rendering change that large is its own row with its own case table, not a footnote to this one.

Measured again at this head: ont_entity_properties 6/6, and the fixture's message verbatim —
  ont:contract/study-shape-v1 violates shape `study-shape-v1` (in): ont:study/scale: quadratic is not one of ["linear", "log10", "log2", "sqrt", "logit"]

Pmat-Ticket: PMAT-3529
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…t to the prefixed form with a test (Refs PMAT-3529)

Round 3: lane 1 PASS, lane 3 PASS, lane 2 FAIL — and lane 2's finding is the same misreading lane 1 made in round 2, from the other side: it claimed `expand("study:scale")` returns the literal `"study:scale"` because `study:` is "not a registered prefix", so the graph would hold `<study:scale>` and the tests would fail.

Measurably false — §3.6's prefix rule is that any UNREGISTERED `p:name` maps into `<ONT_BASE>p/name`, which is exactly the fall-through arm of `expand`, and the tests pass with the N-Triples holding `…/v1alpha1/study/scale>`. But two independent readers taking the same line for a literal IRI is not two mistakes, it is one ambiguity: the shape writes `path: study:scale`, the extractor wrote `expand(&format!("{ty}:{key}"))`, and a reader had to know `expand`'s arms to see they are the same predicate.

So the code now says it. `entity_predicate(ty, key)` spells `<ONT_BASE><ty>/<key>` directly, and a unit test asserts it equals `expand("study:scale")` AND equals the full IRI AND is not `ont("scale")` — the equivalence is pinned by a failing test rather than by knowledge of the prefix rule. No behaviour changes: same triples, same messages, ont_entity_properties 6/6, pv_contract unit tests 5/5, clippy clean.

Pmat-Ticket: PMAT-3529
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rounds 1-3 were NOT AGREED and each finding is answered in the commit that followed it: the message change now named by the ticket and its acceptance criteria (r1), the acceptance criterion saying which IRI rather than which prefix (r2), and the predicate spelled in one function with a test pinning it to the prefixed form (r3). Two of the four findings were false and were refuted by running the tests; both false ones pointed at the same ambiguity, which is now gone.

Pmat-Ticket: PMAT-3529
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@noahgift
noahgift force-pushed the PMAT-3529-sigma-metadata-entity-properties branch from f7754a5 to e1b93b8 Compare September 19, 2026 12:58
@noahgift
noahgift disabled auto-merge September 19, 2026 12:59
@noahgift

Copy link
Copy Markdown
Member Author

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

{
 "ticket": "PMAT-3529",
 "head": "e1b93b8c2bf42ea5fe3a800fed7ca3b943bf09da",
 "width": 3,
 "executor": "agy",
 "agreed": true,
 "auto_merge": {
  "checked": true,
  "was_armed": true,
  "disarmed": true,
  "note": "auto-merge was armed from an earlier round; disarmed before lanes launched"
 },
 "lanes": [
  {
   "lane": 1,
   "verdict": "PASS",
   "findings": 5
  },
  {
   "lane": 2,
   "verdict": "PASS",
   "findings": 5
  },
  {
   "lane": 3,
   "verdict": "PASS",
   "findings": 0
  }
 ]
}

…(Refs PMAT-3529)

Pmat-Ticket: PMAT-3529
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@noahgift
noahgift enabled auto-merge September 19, 2026 13:32
noahgift pushed a commit that referenced this pull request Sep 19, 2026
…, and the facades lock learns the sha2 edge (Refs PMAT-3508)

Four reds on dc717bb from run 35444437778, three defects, none in the code:

1. `REFUSE ordinal 339 is shared by 339-…-ont-extract-json.cmd and
   339-…-ont4c1-model-receipts.cmd` on workspace-test shards 2/3 and 3/3.
   #3516 (extract:json) landed on 339 while this branch was rebased over it;
   ordinals are picked by hand per branch and nothing checks them until the
   docker step after a 2-minute build. 340 is apr-cli-pixel-regression on main
   and 341 is #3530's, so this one takes 342.

2. `FAIL R5 crates/facades/Cargo.lock is stale` on guard-cargo AND guard-tree.
   ONT-4c1 added `sha2 = { workspace = true }` to aprender-contracts for the
   receipt hashes; the facades resolve aprender-contracts by PATH under their
   own lock, so the lock needed sha2 and its eight transitive edges. Every
   version the facades resolved matches the root Cargo.lock where the root has
   one. Nothing in the facades' API changed: `27 vendored 0.3.1 examples +
   probes compile against the facades` was ok on the same run.

3. `FAIL: non-closing ref(s) with no keep-open reason: #3477` — the PR body,
   not the tree; fixed in the body with a `keep-open:` line.

Pmat-Ticket: PMAT-3508
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@noahgift
noahgift added this pull request to the merge queue Sep 19, 2026
Merged via the queue into main with commit 860b028 Sep 19, 2026
25 of 26 checks passed
@noahgift
noahgift deleted the PMAT-3529-sigma-metadata-entity-properties branch September 19, 2026 14:40
noahgift pushed a commit that referenced this pull request Sep 19, 2026
…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 pushed a commit that referenced this pull request Sep 19, 2026
…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 added a commit that referenced this pull request Sep 19, 2026
…ow 0)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
guyernest pushed a commit to guyernest/aprender that referenced this pull request Sep 29, 2026
…xtract:apr-model, the ladder rungs as model:Model, resolves: receipt over the tracked ladder receipts by measured sha256, and arming per shape: ladder-measured armed, ladder-green reported until the bump arms it (paiml#3526)

* PMAT-3508 / ONT-4c1: model receipts as focus nodes — extract:gguf + extract:apr-model, the ladder rungs as model:Model, resolves: receipt over the tracked ladder receipts, per-shape arming (ladder-measured armed, ladder-green reported)

Pmat-Ticket: PMAT-3508
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* PMAT-3508: the hosts test discriminates (rung listed on lambda only), the roadmap acceptance from the diff, the receipt

Pmat-Ticket: PMAT-3508
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* PMAT-3508: rebased onto main with extract:json (paiml#3516) — one walk, extract::all, and the ladder receipts of paiml#3523 as witnesses

The reconciliation this branch carried on a scratch branch is now the rebase: extract::all is the ONE walk the shapes gate and pv extract share (pv_contract -> json per document -> gguf -> apr_model -> receipts::read_all -> resolve), ExtractFailure carries both a json declaration fault and a receipt schema fault, and ShapesOutcome::ExtractFailed maps both to exit 3.

Measured on this head, with paiml#3523 receipts on main: pv lint contracts --gate shapes Pass, shapes_n 3, focus_nodes_n 1741, violations 0, WITNESSES 16, armed [ladder-measured, ont-shapes-v1], reported [ladder-green], by_entity_type.gguf 8, pc_extract gguf+apr-model fired; pv extract contracts 9582 triples; aprender-contracts lib 1645/1645; ont4c1_model_receipts 12/12; ont_extract_json 7/7; ont4b_shapes_gate 11/11; check_ont_ratchet.sh PASS; clippy -D warnings clean.

Pmat-Ticket: PMAT-3508
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* PMAT-3508: README states the censused count with ont-model-receipts-v1 in the corpus (1798)

Pmat-Ticket: PMAT-3508
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* audit: quorum-PMAT-3508 AGREED 3/3 on the head rebased over paiml#3516 and paiml#3523 (Refs PMAT-3508)

Pmat-Ticket: PMAT-3508
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* ci: ONT-4c1's explicit-test ordinal moves 339 -> 342 (339 is paiml#3516's), and the facades lock learns the sha2 edge (Refs PMAT-3508)

Four reds on dc717bb from run 35444437778, three defects, none in the code:

1. `REFUSE ordinal 339 is shared by 339-…-ont-extract-json.cmd and
   339-…-ont4c1-model-receipts.cmd` on workspace-test shards 2/3 and 3/3.
   paiml#3516 (extract:json) landed on 339 while this branch was rebased over it;
   ordinals are picked by hand per branch and nothing checks them until the
   docker step after a 2-minute build. 340 is apr-cli-pixel-regression on main
   and 341 is paiml#3530's, so this one takes 342.

2. `FAIL R5 crates/facades/Cargo.lock is stale` on guard-cargo AND guard-tree.
   ONT-4c1 added `sha2 = { workspace = true }` to aprender-contracts for the
   receipt hashes; the facades resolve aprender-contracts by PATH under their
   own lock, so the lock needed sha2 and its eight transitive edges. Every
   version the facades resolved matches the root Cargo.lock where the root has
   one. Nothing in the facades' API changed: `27 vendored 0.3.1 examples +
   probes compile against the facades` was ok on the same run.

3. `FAIL: non-closing ref(s) with no keep-open reason: paiml#3477` — the PR body,
   not the tree; fixed in the body with a `keep-open:` line.

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

---------

Co-authored-by: Noah Gift <noah@paiml.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
guyernest pushed a commit to guyernest/aprender that referenced this pull request Sep 29, 2026
…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) (paiml#3528)

* PMAT-3509: file ONT-4b2 (extract:code + extract:lean, the W3C cases, the oracle differential) against paiml#3509

Pmat-Ticket: PMAT-3509
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* PMAT-3509 / ONT-4b2: extract:code + extract:lean into contracts.nt (symbol/ 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 paiml#3523 are on main (paiml#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>

* ONT-4b2: rebased onto 45decaf (ONT-4c1 + paiml#3530 + paiml#3523 + paiml#3516 on main) — 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: paiml#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>]` — paiml#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>

* ont4c1 corpus test: ladder-green is one of the reported shapes, not the 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>

* lint.rs: decide_named_gate's arms are expressions, not returns; drop 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>

* ont4c1 corpus test: ladder-green is reported and known (armed ∪ not_armed), never pinned to one side of the arming line (Refs PMAT-3509)

aprender-ba, on paiml#3528: the 0.68.2 bump (paiml#3498, head 5b22fb2) arms ladder-green, so a test asserting ladder-green ∈ not_armed_shapes goes red on the release branch the moment paiml#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>

* ONT-4b2: make oracle without cd (.ONESHELL); the facades lock learns 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:
   paiml#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>

* audit: quorum-PMAT-3509 round 3 AGREED 3/3 on f5dd5d7 (Refs PMAT-3509)

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>

* README: the CONTRACT_COUNT block states 1799 — ONT-4b2 adds contracts/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>

* audit: quorum-PMAT-3509 round 4 AGREED 3/3 on a692709 (Refs PMAT-3509)

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>

* audit: quorum-PMAT-3509 round 6 AGREED 3/3 on 3329c7c (Refs PMAT-3509)

Round 4's 3/3 lapsed to the merge of main ebda31d (paiml#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>

---------

Co-authored-by: Noah Gift <noah@paiml.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
guyernest pushed a commit to guyernest/aprender that referenced this pull request Sep 29, 2026
* release: 0.68.2

bump-version.sh 0.68.2 (every workspace, facades included; --check green) and the CHANGELOG [0.68.2] section,
per docs/specifications/06x-release-schedule.md §4.2. After this merges, rel-0682-autopilot runs APR-RELEASE-001 §4 T-1..T-4 + close:
deep (T-1, local), pre-publish dogfood, tag + release, clean-room.yml dispatched on the tag (T-3, run id recorded), assets by command, preflight, cascade (T-4, automated), install, host + installer receipts, close.

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

* release: 0.68.2 CHANGELOG — Qwen3.5 on CUDA up to 27B (paiml#3517, paiml#3527) and every PR merged since v0.68.1

Pmat-Ticket: PMAT-3477

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* evidence(ladder): 0.68.2 receipts measured from the bump tree on lambda (sm_89) and gx10 (sm_121) — every required rung green on both hosts; qwen3-8b optional red on lambda (paiml#3532)

Pmat-Ticket: PMAT-3477

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* contracts: arm ladder-measured + ladder-green shapes for 0.68.2; contracts.nt regenerated with the two 0.68.2 ladder receipts as focus nodes (ONT-4c1, paiml#3508)

Pmat-Ticket: PMAT-3477

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* CHANGELOG 0.68.2: rows for paiml#3533, paiml#3534 (merged since the cut)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* CHANGELOG 0.68.2: row for paiml#3528

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* CHANGELOG 0.68.2: rows for paiml#3526, paiml#3530 (merged-since-tag predicate now 0)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* CHANGELOG 0.68.2: row for paiml#3536

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Alfredo Deza <alfredo@deza.pe>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pv contradicts itself about metadata:, and entity.properties is read by nothing — two defects apex measured on 0.68.1

1 participant