Skip to content

rename LightMeter → hdr::Cascade (SESSION_B_HDR_RENAME) - #10

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/setup-adaworld-repos-4kPEX
Mar 14, 2026
Merged

rename LightMeter → hdr::Cascade (SESSION_B_HDR_RENAME)#10
AdaWorldAPI merged 1 commit into
mainfrom
claude/setup-adaworld-repos-4kPEX

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner
  • git mv light_meter.rs → hdr.rs
  • mod.rs: pub mod light_meter → pub mod hdr
  • LightMeter → Cascade (all 21 occurrences)
  • cascade_query() → query()
  • Add expose() and test_distance() thin wrappers
  • Update hdr_proof.rs references
  • Fix clippy: add is_empty(), use is_multiple_of()

435 tests pass, clippy clean.

https://claude.ai/code/session_01Mcj8GxEtzmVba6RmuT7AjD

- git mv light_meter.rs → hdr.rs
- mod.rs: pub mod light_meter → pub mod hdr
- LightMeter → Cascade (all 21 occurrences)
- cascade_query() → query()
- Add expose() and test_distance() thin wrappers
- Update hdr_proof.rs references
- Fix clippy: add is_empty(), use is_multiple_of()

435 tests pass, clippy clean.

https://claude.ai/code/session_01Mcj8GxEtzmVba6RmuT7AjD
@AdaWorldAPI
AdaWorldAPI merged commit d674570 into main Mar 14, 2026
AdaWorldAPI pushed a commit that referenced this pull request Apr 21, 2026
… construction)

Applies the CODING_PRACTICES "builder is the only path" principle at
the type-system level. Ten key Wire DTOs now forbid raw struct-literal
construction from external crates:

  WireCalibrateRequest       WireSweepGrid
  WireCalibrateResponse      WireSweepRequest
  WireCodecParams            WireSweepResult
  WireTensorView             WireSweepResponse
  WireTokenAgreement         WireTokenAgreementResult

External callers (hypothetical downstream consumer crates) are now
forced through one of these paths to construct these types:

  1. serde deserialize — JSON/YAML at REST/gRPC ingress (the intended
     path per Rule F "serialise once at edges only")
  2. TryFrom<WireCodecParams> for CodecParams — the shipped validated
     conversion that runs precision-ladder + overfit guard
  3. Future Builder::build() if one is added for a specific DTO

Internal construction (tests in wire.rs, grpc.rs conversion code,
serve.rs handler body) is UNAFFECTED — #[non_exhaustive] only
gates external-crate callers. Same-crate code retains struct-literal
access.

Why this matters in practice:

  - `WireCodecParams { subspaces: 6, centroids: 0, ... }` compiled
    today (skipping the ZeroDimension guard). External users can now
    only get a CodecParams through the TryFrom conversion, which
    runs the full validation chain at ingress.

  - Future new fields on these DTOs won't break external callers
    (they were already non-exhaustive-forbidden from raw struct
    literals), so downstream rebuilds don't need coordinated updates.

  - The "object does the work" principle now has teeth — the type
    system enforces what the docs say.

Test Plan:
  - cargo test --features lab --lib:   118/118 pass (unchanged)
  - cargo clippy --features lab -- -D warnings:   CLEAN
  - No internal construction path broken (tests + grpc.rs +
    serve.rs handler all inside the crate)

Also in this commit (cherry-picked from orphan branch state that was
not in the #239 merge):

  - scripts/codec_sweep.sh: Codex P2 fix — stub honesty check now
    exits 3 on missing/false flag instead of just logging. Script
    actually enforces the anti-#219 safeguard it documents.

  - CODING_PRACTICES.md: polyfill chain diagram + mandatory cargo
    clippy + feature-matrix discipline section (~131 LOC).

Cross-ref: CODING_PRACTICES.md anti-pattern #10 "Raw struct literals
bypassing builders"; session epiphany "the object does the work";
Codex P2 review 2026-04-21 on the stub honesty script.

https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh
AdaWorldAPI added a commit that referenced this pull request May 6, 2026
…ITICAL fixes required)

Meta-1 review surfaces 10 findings; 2 CRITICAL fixes block Round 2 opening:

CRITICAL #1: Doctor.Anamnese Full predicate-write violates BMV-Ä §57 append-only
  → fix: empty writable_predicates, keep only "append" action
CRITICAL #2: Receptionist clinical-blind fails safety (no Identity-read for
  allergy/triage lookup before scheduling)
  → fix: merge Patient permission to Detail-depth + 3 demographic writes,
    add Identity-read on Diagnosis + LabResult

HIGH #3-#4 (defer to Round 3 gate.rs): Diagnosis finalize/retract Escalate +
  Patient anonymize/merge/delete Escalate (GDPR Art.17 + §35 BDSG)
MEDIUM #5-#8 (backlog): Missing entities (Termin, Recall, ePA) + audit trail hook
LOW #9-#10 (backlog): PKV/GKV modulation + dynamic reason strings

Round 2 implications surfaced for W5/W8.
Round 3 implications surfaced for W9/W12 (Escalate wrapping + §73 SGB V test).

Concrete diff for W3-revision-2 included at end of file.
Next commit: W3-revision-2 applies the two CRITICAL fixes.
AdaWorldAPI pushed a commit that referenced this pull request Jul 21, 2026
…d, not extrapolated)

Ran the tractable falsifier on the actual public-domain KJV Bible (Gutenberg #10,
792,180 word tokens):
- 12,555 distinct word types = 0.19 of a 64k tile (one tile holds it 5.2x over)
- 3,523 proper-noun types (names/places = S/O entity nodes) = ~1/18 of a tile
- ~66k propositions at the measured ~12 words/SPO grain ≈ exactly one tile
- footprint: 64k × 512 B/NodeRow = 32 MB resident for the whole work

A graph node is an entity/lemma, so the Bible's distinct-node count is bounded
above by 12,555 << 64k; at proposition grain it lands at ~one tile. Confirmed on
real text.

Honest boundary recorded: the full DeepNSM awareness run (standing-wave escalation
rate, deductions/contradictions) was NOT run — text_stream_to_soa needs protoc
(absent here) and DeepNSM's 4096-COCA vocab ceilings whole-Bible entity counting.
The lexical bound is the real tractable falsifier; the awareness run is deferred.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3RyLEbuNSHxxB3NTTrGki
AdaWorldAPI pushed a commit that referenced this pull request Jul 27, 2026
…'s entity_type, NOT the V3 GUID classid

Operator: "ClassId must be a hallucinated zombie from a session not following
due diligence — look up classid of the one and only V3 GUID substrate classid."
Verified against the types, not the names.

WHAT WAS WRONG. `lance-graph-contract` exported TWO different types under one
word, in one crate:

  class_view.rs:54   pub type ClassId = u16    <- the zombie
  rbac.rs:103        pub type ClassId = u32    <- the real one

The u16 one is NOT a narrower classid. Traced to its source, its value comes
from `OntologyRegistry::entity_type_of(NiblePath) -> Option<u16>`, minted as
`(rows.len() + 1) as u16` with id 0 as the "unknown" sentinel — a REGISTRY ROW
NUMBER. Its doc-comment nevertheless called it "the Cognitive-RISC `class_id` /
`shape_id`", asserting an identity it does not have. That is what made it a
zombie: a name that manufactures a false correspondence to the substrate
classid.

The one and only substrate classid is the u32 in the V3 GUID key (classid(4) at
bytes 0..4, canon-high per D-CLASSID-CANON-HIGH-FLIP). Everything canonical
already takes it bare as u32 — action::actions_for, unicharset_adapter,
canonical_node — and rbac aliases it correctly, its own doc saying "the codebook
ClassId (the NodeGuid.classid)".

THE FIX. `class_view::ClassId` -> `EntityTypeId`, so the name states what the
value is. The u16 width is CORRECT for an entity type (it indexes registry rows)
and must NOT be widened to "match" the GUID — they are not the same quantity;
that would be the same conflation in the other direction. The old name stays as
a #[deprecated] alias with a migration pointer (I-LEGACY-API-FEATURE-GATED), but
is deliberately NOT re-exported at the crate root, so a fresh
`use lance_graph_contract::ClassId` cannot silently pick up the wrong quantity.

SAFETY CHECK, since a mixed width in an authorization path would be serious:
lance-graph-rbac imports `contract::rbac::{ActorId, ClassId, ...}` — the u32.
No crate mixes the two. The rename script asserted this per-file before
touching anything.

Renamed in: contract (class_view, selection), ontology (class_resolver,
registry, wikidata_hhtl), ogar (docs), arm-discovery (test). 278 ontology + 18
contract tests pass; clippy clean on the touched crates.

ALSO FIXES audit item #10 (CODE-READY): the deprecated `oxrdf::Subject` ->
`NamedOrBlankNode`, 5 sites in ttl_parse.rs + hydrators/owl.rs.

STILL OPEN, NOT FIXED HERE — a functional gap this audit surfaced. The wiring
`class_id_for_guid` uses the v1 fold `NiblePath::from_guid_prefix`, which
REFUSES (returns None) when both classid halves are nonzero. The crate's own
test proves the consequence: OSINT-V3 `0x0701_1000` (canon 0x0701 high + marker
0x1000 low) folds to None, so a V3-marked GUID resolves to NO class through
that path. `from_guid_prefix_v3` exists and ignores the classid entirely.
Which fold `class_id_for_guid` should use is a design call, not a rename —
left for a ruling rather than decided here.

Board correction owed: E-EVENT-IDENTITY-IS-NOT-SOURCE-IDENTITY-AND-WE-HAVE-
NEITHER-1 leg 2 cites "ClassId is u16 while the GUID's classid is a u32
composite (two types, one word)" as evidence. That is right, but the sharper
statement is now available: it is not a narrower classid at all, it is a
different object that was misnamed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RbXniqYUYgwUsRrEnRRiid
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.

2 participants