Skip to content

feat(rdlc): instantiate the RDLC regulator's interior blocks (NDCVB=M), honest-dark#66

Merged
ryanklee merged 1 commit into
mainfrom
alpha/rdlc-instantiation
Jun 15, 2026
Merged

feat(rdlc): instantiate the RDLC regulator's interior blocks (NDCVB=M), honest-dark#66
ryanklee merged 1 commit into
mainfrom
alpha/rdlc-instantiation

Conversation

@ryanklee

@ryanklee ryanklee commented Jun 15, 2026

Copy link
Copy Markdown
Owner

RDLC instantiation — interior blocks Φ/Ξ/ψ/M/β (NDCVB=M), honest-dark

Instantiates RDLC (Research Development Life Cycle) as a sibling lifecycle of SDLC over the
claim-assertion plant, per the reorientation framework's "instantiate, not build": supply the
four-tuple ⟨Φ ResearchCase, Ξ RStage, ψ validity_gates, β admission⟩ and bind M = NDCVB,
inheriting a new tier-0 commons/. Rendered honest-dark — only blocks that exist are lit.

Designed by a multi-agent workflow (3 designs → synthesis → adversarial fidelity review =
GO-WITH-FIXES; all five framework rules pass, every prior cross-fault avoided). Both must-fixes
applied.

What's here

  • commons/ (tier-0, pure): BaseGovernanceCase spine + ordinal_stage helper.
  • rdlc/ (the sibling):
    • ResearchCase (Φ) — claim-plant fields only; no SDLC code-mutation no-go fields by inheritance (the category error is type-impossible).
    • RStage (Ξ) — R0…R5, disposition-first (no allows_source_mutation/allows_release).
    • gate_status / gate_result — the {∗} terminal-stalk theorem as a constructor invariant: a DARK/PARTIAL gate carrying a verdict is unconstructable.
    • m_binding (M) — the sole ndcvb importer, lazy/optional → instrument absent = honest dark, not an import crash.
    • validity_gates (ψ) — 1 LIT (ψ1 = construct-validity via M), 3 PARTIAL, 2 DARK (freeze-lock never fired; reflexive-dogfood is vapor — both render dark, claim no protection).
    • admission (β) — fail-closed allow-list; research_ledger; validator CLI.

Scope discipline (why additive-only)

Built with zero sdlc/ edits: beta is mid-flight on sdlc/authority_case.py, so the
commons-extraction + AuthorityCase reparent are a deferred, governance-authorized follow-up.
This PR introduces no governance-kernel change.

Must-fixes applied

  • R-A: ψ1/M is LIT as a capability; a given ResearchCase is per-case-dark until a real Measurement binds (construct_validity_gate(None) → DARK).
  • R-C: an import-graph lint pins commons tier-0 purity, the sole-ndcvb-importer invariant, and sibling-disjointness (sdlc ⟂ rdlc).

Evidence

  • 149 tests pass, ruff clean. The existing sdlc/ suite stays green — proving the additive build introduces zero regression.

Merge is a separate S7 step: this PR's authorization packet keeps release_authorized: false. For this governance-spec change the merge decision is the operator's.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a research case validation system with support for YAML file parsing and structured metadata.
    • Added a validity gate framework to authorize research claims based on configurable requirement sets.
    • Implemented a research case ledger for tracking lifecycle transitions and state changes.
  • Testing

    • Added comprehensive validation tests for case parsing, admission logic, and validity gate operations.
    • Introduced automated import discipline verification to maintain system architecture integrity.

…), honest-dark

Instantiate RDLC (Research Development Life Cycle) as a SIBLING lifecycle of SDLC over
the claim-assertion plant, per the reorientation framework's "instantiate, not build":
supply the four-tuple <Phi ResearchCase, Xi RStage, psi validity_gates, beta admission>
and bind M=NDCVB, inheriting the tier-0 commons. Rendered honest-dark — only blocks
that exist are lit.

commons/ (tier-0): BaseGovernanceCase spine + the ordinal_stage helper (pure: imports no
  lifecycle or model). AuthorityCase reparent + RiskTier/ledger extraction are DEFERRED to
  a governance-authorized follow-up — beta is mid-flight on sdlc/authority_case.py, so this
  lands ADDITIVE-ONLY with zero sdlc/ edits (no collision, no kernel change).

rdlc/ (the sibling): RStage (R0..R5, disposition-first — no SDLC code-mutation verbs),
  ResearchCase (claim-plant fields only, fail-closed; no SDLC no-go fields by inheritance),
  gate_status/gate_result (the {*} terminal-stalk theorem as a constructor invariant — a
  DARK/PARTIAL gate carrying a verdict is UNCONSTRUCTABLE), m_binding (the sole ndcvb
  importer; lazy/optional, so M absent => honest dark, not an import crash), validity_gates
  (psi1 LIT / psi2-4 PARTIAL / psi5 freeze-lock DARK / psi6 dogfood DARK), admission (beta,
  fail-closed allow-list), research_ledger (2nd ledger, same mechanism), validator CLI.

Designed + ground-truth-verified by a workflow; GO-WITH-FIXES from an adversarial fidelity
review (all 5 framework rules pass; every prior cross-fault avoided). Must-fixes applied:
psi1 is LIT-as-capability / per-case-dark until a run binds (R-A); the import-graph lint
pins commons tier-0 purity + the sole-ndcvb-importer + sibling-disjointness (R-C).

149 passed, ruff clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Introduces a new commons tier-0 package exposing BaseGovernanceCase (Pydantic model with YAML frontmatter parsing) and stage_from_label (ordinal enum helper). Builds a new rdlc package on top with GateStatus/GateResult primitives, RStage ladder, six ψ validity gates (with lazy ndcvb M-binding), ResearchCase, fail-closed assertion_admitted, a research ledger, and a CLI validator. Updates pyproject.toml for packaging and tooling. Adds unit, integration, and static import-graph tests.

Changes

commons tier-0 base and rdlc research lifecycle

Layer / File(s) Summary
commons tier-0: ordinal stage helper and BaseGovernanceCase model
commons/ordinal_stage.py, commons/governance_case.py, commons/__init__.py, tests/commons/test_commons.py
stage_from_label normalizes and resolves label strings to IntEnum members; BaseGovernanceCase is a Pydantic model with YAML frontmatter parsing and abstract parsed_stage/no_go_violations; both re-exported via __all__; tests cover label resolution, YAML parsing, and abstract method contracts.
rdlc gate status, result, and RStage ladder
rdlc/gate_status.py, rdlc/gate_result.py, rdlc/r_stage.py, tests/rdlc/test_gate_result.py, tests/rdlc/test_r_stage.py
GateStatus enum (LIT/PARTIAL/DARK); GateResult frozen dataclass enforcing that only LIT carries a verdict and non-LIT forbids one; RStage IntEnum R0–R5 with predicate methods and from_label(); construction invariants and predicate behavior tested.
ndcvb M-binding and ψ validity gates
rdlc/m_binding.py, rdlc/validity_gates.py, tests/rdlc/test_m_binding.py, tests/rdlc/test_validity_gates.py
construct_validity_gate lazily imports ndcvb and maps all failure/missing cases to DARK, success to LIT with verdict; validity_gates.py defines psi1–psi6 (psi1 delegates to M-binding, psi2–4 PARTIAL, psi5–6 DARK); gate-status and M-binding outcomes tested.
ResearchCase model, admission logic, and research ledger
rdlc/research_case.py, rdlc/admission.py, rdlc/research_ledger.py, tests/rdlc/test_research_case.py, tests/rdlc/test_admission.py, tests/rdlc/test_research_ledger.py
ResearchCase subclasses BaseGovernanceCase with freeze/preregistration/ratification fields and no_go_violations() implementing pre-R4, phantom-freeze, and public-claim guards; assertion_admitted performs fail-closed corroborated-only gate check; research_ledger.py re-exports sdlc ledger primitives with a distinct default path; all behaviors tested.
rdlc validator CLI, package __init__, and build config
rdlc/validator.py, rdlc/__init__.py, pyproject.toml, tests/rdlc/test_validator.py
validate_file and main implement a CLI YAML validator with optional strict mode; rdlc/__init__.py assembles the public export surface; pyproject.toml adds commons and rdlc packages, expands include globs, Ruff first-party list, ndcvb dev dependency, and uv source override; validator behavior tested.
Import-graph enforcement and lifecycle integration tests
tests/rdlc/test_import_graph.py, tests/rdlc/test_lifecycle.py
AST-based static tests enforce tier purity (commons imports nothing from sdlc/rdlc/ndcvb; rdlc runtime sdlc imports limited to two sanctioned modules; ndcvb only in m_binding.py; sdlc never imports rdlc); integration tests exercise ResearchCase + validity gates + assertion_admitted end-to-end.

Sequence Diagram(s)

sequenceDiagram
  participant CLI as validator CLI (main)
  participant validate_file
  participant ResearchCase
  participant no_go_violations
  participant assertion_admitted
  participant construct_validity_gate
  participant ndcvb

  CLI->>validate_file: path, strict=True/False
  validate_file->>ResearchCase: from_yaml(file_text)
  ResearchCase-->>validate_file: ResearchCase instance
  validate_file->>no_go_violations: no_go_violations()
  no_go_violations-->>validate_file: list[str] violations
  validate_file-->>CLI: issues list (PASS / FAIL)

  Note over assertion_admitted,ndcvb: Separate admission flow
  assertion_admitted->>construct_validity_gate: measurement
  construct_validity_gate->>ndcvb: score(measurement)
  ndcvb-->>construct_validity_gate: Verdict or error
  construct_validity_gate-->>assertion_admitted: GateResult (LIT/DARK)
  assertion_admitted-->>CLI: True (admitted) or False (blocked)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • ryanklee/hapax-constitution#60: The new rdlc/research_ledger.py directly re-exports EvidenceEntry, append_entry, read_entries, and record_transition from sdlc.evidence_ledger, which was introduced in this PR.

Poem

🐇 Hoppity-hop through the governance maze,
A commons base sets the stage ablaze,
ψ-gates go LIT when the verdict rings true,
No phantom freeze sneaks a claim right through.
The rabbit stamps PASS on each well-guarded case,
And DARK stays DARK — no shortcuts in this race! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: instantiating RDLC as a sibling lifecycle with interior blocks (NDCVB=M) rendered as honest-dark.
Description check ✅ Passed The description is comprehensive and detailed, covering objectives, architectural components, scope discipline, must-fixes, and evidence, but does not follow the simple two-section template (Summary + Test plan).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch alpha/rdlc-instantiation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ryanklee ryanklee merged commit d2aa3f8 into main Jun 15, 2026
2 of 3 checks passed
@ryanklee ryanklee deleted the alpha/rdlc-instantiation branch June 15, 2026 13:39
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.

1 participant