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.
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