Skip to content

docs: Phase 3b 4-stage staged resolution plan (#235 → #239 / #240 / #241 / #242)#237

Merged
hyperpolymath merged 2 commits into
mainfrom
proof-debt/phase-3b-design-gap-finding
May 30, 2026
Merged

docs: Phase 3b 4-stage staged resolution plan (#235 → #239 / #240 / #241 / #242)#237
hyperpolymath merged 2 commits into
mainfrom
proof-debt/phase-3b-design-gap-finding

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

@hyperpolymath hyperpolymath commented May 30, 2026

Summary

Phase D slice 4 Phase 3b — design-gap finding (#235) + 4-stage staged resolution plan owner-approved 2026-05-30 PM. Stages tracked at #239 / #240 / #241 / #242.

No formal/*.v changes. No CI changes (the parallel-session PR #236 owns the Coq EACCES fix).

4-stage staged resolution plan

The original three-option framing in #235 is superseded by a staged plan that captures all three "Interesting" values without committing to any single option's downsides.

Stage Issue Scope Captures value of
Stage 1 — IMMEDIATE #239 Leaf-only Phase 3b via tfuneff_lambda_free + Counterexample_L2_nested.v + 2-condition preservation_l2. Option (3) — principled deferral, honest 2-condition statement.
Stage 2 — parallel L4 track #240 ELam T_param R_in R_out body annotation extension. AST + typing rule + cascading. Option (1) — L4 "type-level → program-level commitments".
Stage 3 — post-Stage-2 #241 Relaxed Phase 3b via declared_lambda_r_ins ⊆ R_in_v + CPS v-typing argument. Nested-condition collapses. Option (2) — higher-order proof style enters codebase.
Stage 4 — Phase 5 #242 Compound non-linear + region-substitution machinery + unconditional preservation_l2. The final destination.

Why staging beats single-option commitments

  • (1) alone: forces AST migration before unblocking preservation_l2.
  • (2) alone: introduces inductive-over-derivations predicate with no other use in the codebase.
  • (3) alone: ends with conditional preservation_l2 forever (no path to unconditional).

The staged plan: (3) ships today's value at Stage 1, (1) lands L4's value at L4's timeline (Stage 2), (2)'s value is harvested at exactly the point CPS is necessary not over-engineered (Stage 3), (4) reaches unconditional preservation_l2 as the natural sum.

Stage 1's correctness is delivered, not provisional

Each of the 2 conditions on Stage 1's preservation_l2 has a mechanised counterexample:

Programs outside the conditional form a precisely-documented soundness class.

Sequencing

Changes

No formal/*.v changes; Coqc 8.18.0 unaffected.

Predecessor PRs

Owner-directive compliance (across all 4 stages)

  • ✅ No Semantics.v / Typing.v / Counterexample.v (legacy) touch.
  • ✅ No new Axiom / Admitted markers.
  • ✅ No closure of residual Semantics_L1.v admits — strictly NEW infrastructure under the four-layer redesign.
  • ✅ Per-layer derivation: preservation_l2 closes via L2 infra; legacy preservation remains Admitted (PROVABLY FALSE) per 2026-05-27 directive.

Test plan

Refs: #225 (Phase 3b parking lot), #230 (regions_introduced_by), #233 (Phase 4b), #234 (Phase 4c), #235 (parent finding), #236 (parallel Coq EACCES fix), #239 (Stage 1), #240 (Stage 2), #241 (Stage 3), #242 (Stage 4).

🤖 Generated with Claude Code

@hyperpolymath hyperpolymath enabled auto-merge (squash) May 30, 2026 15:43
@hyperpolymath hyperpolymath force-pushed the proof-debt/phase-3b-design-gap-finding branch from d8de922 to 1fcaaf9 Compare May 30, 2026 15:46
@hyperpolymath hyperpolymath changed the title docs: Phase D slice 4 Phase 3b design-gap finding — files #235 docs+ci: Phase 3b design-gap finding (#235) + Coq build EACCES fix May 30, 2026
@hyperpolymath hyperpolymath changed the title docs+ci: Phase 3b design-gap finding (#235) + Coq build EACCES fix docs+ci: Phase 3b 4-stage staged resolution plan (#235→#239/#240/#241/#242) + Coq build EACCES fix May 30, 2026
hyperpolymath and others added 2 commits May 30, 2026 17:10
…DE.md DO #4 (closes nothing, files #235)

Pre-implementation review of Phase 3b's option (a) precondition

  (forall r, In r (regions_introduced_by e) -> In r R_in_v)

found it INSUFFICIENT to discharge T_Lam_L1_*_Eff body cases of the
planned subst_typing_gen_l1_m_tfuneff lemma.

Why: the substitution lemma recurses into inner lambda bodies (Phase
2 does so via the IH at formal/Semantics_L1.v:1929-1942). Inner
T_Lam_L1_*_Eff bodies type at the lambda's declared R_in_inner. R_in
is type-level — it lives in the TFunEff slot of the function's TYPE,
not in syntax. `regions_introduced_by(e)` only collects ERegion
subterms' first arguments; R_in_inner is invisible to it.

`tfuneff_lambda_retype_l1_m` (PR #224) requires R' ⊆ R_in_v to
discharge T_Lam_L1_*_Eff's side condition. We have no way to bound
inner R_in by R_in_v.

Phase 2's `subst_typing_gen_l1_m_ground_nonlinear` dodges this via
`ground_nonlinear_retype_l1_m`, which is fully (m, R, G)-polymorphic.
Phase 3b's TFunEff retype has no analogous escape.

Three resolution options documented:
  1. Syntactic helper `declared_lambda_r_ins` — requires ELam
     annotation extension (parameter type only in current syntax).
  2. Semantic precondition over the derivation — clean meaning,
     awkward in Coq.
  3. Leaf-only Phase 3b via `tfuneff_lambda_free e` predicate —
     tactical landing; Phase 5 compound-value redesign subsumes
     (1)/(2) at leisure.

Recommended: option (3). Owner decision required before Phase 3b
implementation can start.

This PR contains documentation only:
  - formal/SUBST-LEMMA-GENERALIZATION-DESIGN.md gains a Phase 3b
    addendum documenting the gap and three resolution options.
  - .machine_readable/6a2/STATE.a2ml flips phase to
    `blocked-on-owner-decision` with next_action pointing at #235.

No formal/*.v changes.

Predecessor PRs unaffected:
  - Phase 4a (#228) MERGED.
  - Phase 4b (parallel session, #233) MERGED.
  - Phase 4c counterexample (#234) auto-merge pending.

Phase 4c's `Counterexample_L2.v` independently justifies the
conditional preservation_l2 statement regardless of which Phase 3b
resolution lands.

Per CLAUDE.md owner directive §DO #4 (escalate before patching):
this PR IS the escalation.

Owner-directive compliance:
  - No Semantics.v / Typing.v / Counterexample.v touch
  - No new Axiom / Admitted markers
  - No closure of residual Semantics_L1.v admits
  - No sibling-region-disjointness side conditions
  - No proposal to close `Theorem preservation` to Qed.

Refs: #225 (Phase 3b parking lot), #230 (regions_introduced_by
helper), #233 (Phase 4b), #234 (Phase 4c counterexample),

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…edes 3-options framing)

Owner-approved 2026-05-30 PM. Captures all three "Interesting" values
from the option-1/2/3 analysis without committing to any single
option's downsides.

| Stage | Issue | Scope |
|---|---|---|
| Stage 1 — IMMEDIATE | #239 | Leaf-only Phase 3b via tfuneff_lambda_free + Counterexample_L2_nested.v + 2-condition preservation_l2. |
| Stage 2 — parallel L4 track | #240 | ELam T_param R_in R_out body annotation extension. |
| Stage 3 — post-Stage-2 | #241 | Relaxed Phase 3b via declared_lambda_r_ins + CPS proof style. Nested-condition collapses. |
| Stage 4 — Phase 5 | #242 | Compound non-linear + region-substitution machinery + UNCONDITIONAL preservation_l2. |

Stage 1 green-lit, ships next session. Stages 2-4 tracked but not
actioned. Stage 3 blocked on Stage 2; Stage 4 blocked on Stage 3;
Stage 2 independent of Stage 1.

Why staging beats single-option commitments:
- (1) alone forces AST migration before unblocking preservation_l2.
- (2) alone introduces inductive-over-derivations with no other use.
- (3) alone ends with conditional preservation_l2 forever.

The staged plan harvests:
- (3)'s tactical landing + honest 2-condition statement at Stage 1.
- (1)'s L4 alignment when L4 is ready at Stage 2.
- (2)'s higher-order proof style at exactly the point CPS is
  necessary (Stage 3) — not over-engineered before.
- (4)'s region-substitution machinery as the natural sum.

Stage 1's 2-condition statement is delivered correctness, not a
placeholder. Each condition has a mechanised counterexample
(Counterexample_L2.v for fresh-region gap, new
Counterexample_L2_nested.v for nested-lambda gap).

This PR contains documentation only:
  - formal/SUBST-LEMMA-GENERALIZATION-DESIGN.md gains a Phase 3b
    resolution addendum (the 4-stage plan superseding 3-options).
  - .machine_readable/6a2/STATE.a2ml flips phase back to
    `implementation`; next_action points at Stage 1 (#239).

No formal/*.v changes in this PR.

Owner-directive compliance (across all 4 stages):
  - No Semantics.v / Typing.v / Counterexample.v (legacy) touch
  - No Axiom / Admitted markers
  - No closure of residual Semantics_L1.v admits — strictly NEW
    infrastructure under the four-layer redesign
  - Per-layer derivation: preservation_l2 closes via L2 infra;
    legacy preservation remains Admitted (PROVABLY FALSE) per
    2026-05-27 directive

Refs: #235 (parent finding), #239 (Stage 1), #240 (Stage 2),
#241 (Stage 3), #242 (Stage 4).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath force-pushed the proof-debt/phase-3b-design-gap-finding branch from 2512860 to 724abf3 Compare May 30, 2026 16:11
@hyperpolymath hyperpolymath changed the title docs+ci: Phase 3b 4-stage staged resolution plan (#235→#239/#240/#241/#242) + Coq build EACCES fix docs: Phase 3b 4-stage staged resolution plan (#235 → #239 / #240 / #241 / #242) May 30, 2026
@hyperpolymath hyperpolymath merged commit c8e1f2f into main May 30, 2026
6 of 16 checks passed
@hyperpolymath hyperpolymath deleted the proof-debt/phase-3b-design-gap-finding branch May 30, 2026 16:22
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 75 issues detected

Severity Count
🔴 Critical 11
🟠 High 16
🟡 Medium 48

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action perpolymath/standards/.github/workflows/governance-reusable.yml@main\n needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in abi-verify.yml",
    "type": "missing_timeout_minutes",
    "file": "abi-verify.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in boj-build.yml",
    "type": "missing_timeout_minutes",
    "file": "boj-build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "missing_timeout_minutes",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in coq-build.yml",
    "type": "missing_timeout_minutes",
    "file": "coq-build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in governance.yml",
    "type": "missing_timeout_minutes",
    "file": "governance.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in hypatia-scan.yml",
    "type": "missing_timeout_minutes",
    "file": "hypatia-scan.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in instant-sync.yml",
    "type": "missing_timeout_minutes",
    "file": "instant-sync.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in mirror.yml",
    "type": "missing_timeout_minutes",
    "file": "mirror.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in rust-ci.yml",
    "type": "missing_timeout_minutes",
    "file": "rust-ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

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