Skip to content

state: shift next_action to preservation_l2 — slice 3 closed#210

Merged
hyperpolymath merged 1 commit into
mainfrom
phase-d-slice-3-state-shift-to-preservation-l2-2026-05-28
May 28, 2026
Merged

state: shift next_action to preservation_l2 — slice 3 closed#210
hyperpolymath merged 1 commit into
mainfrom
phase-d-slice-3-state-shift-to-preservation-l2-2026-05-28

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Updates .machine_readable/6a2/STATE.a2ml to reflect Phase D slice 3 closure (PR #209 merged) and point the next concrete code work at preservation_l2 over the now-thickened has_type_l2.

Changes

  • @state.last_action — documents session 6: T_App_L2_Eff implementation (PR feat(L2): T_App_L2_Eff — Phase D slice 3 option 5a code lands #209), commit hash, full rule shape, the two forced refactors (project_l2_to_l1 option-return + weaken_modality structural induction), verification evidence (coqc 8.18.0 clean + Print Assumptions → "Closed under the global context" across all three exposed theorems).

  • @state.next_action — shifts to preservation_l2. Spells out the two-case induction:

    • L2_lift_l1 case: carries forward preservation_l1's legacy TFun body-R-rigidity admit (slice 4b inherited debt — honest, not concealed).
    • T_App_L2_Eff case (slice 4a, the new constructor): handles EApp step-cases. S_App_Step1 / S_App_Step2 reduce via IHs; β-reduction inverts e1 to obtain a T_Lam_L1_*_Eff lambda whose body lives at L1 via the side-condition guarantee forall r, In r R -> In r R_in.
    • Anti-pattern refusal list per CLAUDE.md owner directive.
  • @blockers TypingL1.v entry — adds T_Lam_L1_*_Eff (slice 2) + T_App_L1 (TFun-only) notes so a fresh agent understands why TFunEff lambdas are inert at L1.

  • @blockers TypingL2.v entry — new. Documents the post-feat(L2): T_App_L2_Eff — Phase D slice 3 option 5a code lands #209 shape: two constructors, partial projection, induction-based weaken_modality, all Qed, zero axioms.

  • @artifacts TypingL2.v linethin wrapperL2_lift_l1 + T_App_L2_Eff (Phase D slice 3).

Verification

No .v change, no proof change. Single machine-readable file diff.

Test plan

  • CI green on merge

🤖 Generated with Claude Code

…rged (PR #209)

Updates STATE.a2ml to reflect Phase D slice 3 closure (PR #209) and
points the next concrete code work at preservation_l2 over the
thickened has_type_l2.

Changes:

- @state.last_action: documents session 6 (T_App_L2_Eff implementation)
  with commit hash, full rule shape, refactor details (project_l2_to_l1
  option-return + weaken_modality structural induction), and verification
  evidence (coqc 8.18.0 clean + zero axioms via Print Assumptions).

- @state.next_action: shifts from "implement T_App_L2_Eff" (now satisfied
  by #209) to "state and prove preservation_l2 over has_type_l2". Spells
  out the two-case induction (L2_lift_l1 carries forward legacy admit;
  T_App_L2_Eff handles EApp step-cases including β-reduction inversion).
  Includes the anti-pattern refusal list per CLAUDE.md owner directive.

- @blockers TypingL1.v entry: adds T_Lam_L1_*_Eff and T_App_L1 (TFun-only)
  notes so a fresh agent reading the file understands why TFunEff lambdas
  are inert at L1.

- @blockers TypingL2.v entry: new. Documents the post-#209 shape — two
  constructors, partial projection, induction-based weaken_modality, all
  Qed, zero axioms.

- @artifacts TypingL2.v line: updated from "thin wrapper" to
  "L2_lift_l1 + T_App_L2_Eff (Phase D slice 3)".

No code change, no proof change. Single machine-readable file diff.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath enabled auto-merge (squash) May 28, 2026 13:28
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 69 issues detected

Severity Count
🔴 Critical 11
🟠 High 11
🟡 Medium 47

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in abi-verify.yml",
    "type": "unknown",
    "file": "abi-verify.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in boj-build.yml",
    "type": "unknown",
    "file": "boj-build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "unknown",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in governance.yml",
    "type": "unknown",
    "file": "governance.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in hypatia-scan.yml",
    "type": "unknown",
    "file": "hypatia-scan.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in instant-sync.yml",
    "type": "unknown",
    "file": "instant-sync.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in mirror.yml",
    "type": "unknown",
    "file": "mirror.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in rust-ci.yml",
    "type": "unknown",
    "file": "rust-ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in rust-ci.yml",
    "type": "unknown",
    "file": "rust-ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in scorecard-enforcer.yml",
    "type": "unknown",
    "file": "scorecard-enforcer.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath merged commit 5763648 into main May 28, 2026
17 checks passed
@hyperpolymath hyperpolymath deleted the phase-d-slice-3-state-shift-to-preservation-l2-2026-05-28 branch May 28, 2026 13:29
hyperpolymath added a commit that referenced this pull request May 28, 2026
)

## Summary

State the full `preservation_l2` goal in a comment block + ship the
provable-now `L2_lift_l1` case as `preservation_l2_via_l1`. The β-case
for `T_App_L2_Eff` requires generalising `subst_typing_gen_l1_m`
(non-linear `T1`) — escalated per CLAUDE.md owner directive rather than
closed via ad-hoc admit.

## What lands

- **`preservation_l2_via_l1`** — closes the `L2_lift_l1` case of
`preservation_l2` by deferring to `Semantics_L1.preservation_l1`.
Provable directly; **no new admits/axioms** in `TypingL2.v`.
- **`preservation_l2_lift_case`** corollary — same theorem, flatter
shape for callers that already destructured the lift.
- **Comprehensive doc block** stating the full `preservation_l2` goal,
the planned structural-induction proof, and the architectural blocker
for the `T_App_L2_Eff` β-case.

## Why partial — the architectural blocker

The β-case (`S_App_Fun` applied to `T_App_L2_Eff`) requires invoking
`subst_typing_gen_l1_m` (`Semantics_L1.v:1358`) with `T1 =` lambda
parameter type. That lemma carries an `is_linear_ty T1 = true`
precondition. Effect-typed lambdas at `TFunEff T1 T2 R_in R_out` may
have non-linear `T1` (`TUnit` / `TBool` / `TI32` / …), so the
substitution lemma does not fire in general.

Per CLAUDE.md owner directive 2026-05-27 §"DO escalate before patching
when a side condition is needed", this is the escalation point —
generalising `subst_typing_gen_l1_m` to non-linear `T1` is next-slice
infrastructure work, **not** an ad-hoc side-condition on the L2 typing
rule.

## Verification (coqc 8.18.0)

- Clean rebuild across `formal/` tree.
- `Print Assumptions preservation_l2_via_l1` →
`Semantics_L1.preservation_l1` (the legacy admit, honest carry-forward).
**Zero NEW axioms introduced.**
- `Print Assumptions weaken_modality` → unchanged ("Closed under the
global context").
- Admit count: `TypingL2.v` retains 0 \`Admitted.\` / 0 \`Axiom\` / 0
inner \`admit.\`; `Semantics_L1.v` + `Semantics.v` unchanged.

## Owner-directive compliance

- ✅ `Semantics.v` untouched
- ✅ `Typing.v` untouched
- ✅ `Counterexample.v` untouched
- ✅ Zero new \`Admitted\`/\`Axiom\` in `TypingL2.v`
- ✅ T_App_L2_Eff β-case **not** closed via \`Admitted.\` (per session-6
memory note's explicit anti-pattern)

## Next-slice infrastructure required to close full preservation_l2

1. **Generalise `subst_typing_gen_l1_m`** to non-linear `T1` (or sibling
lemma) — substitution at a non-linear binding position.
2. **Inversion principles for `has_type_l2`** on `EApp`.
3. **Inversion on `T_Lam_L1_*_Eff`** for body extraction.

(1) is the load-bearing item; (2) and (3) compose mechanically once (1)
lands.

## Refs

- `formal/PRESERVATION-DESIGN.md` §5.1 (lines 468-474) — load-bearing
design quote endorsing the L2 venue for effect-typed application
elimination.
- PR #209 — T_App_L2_Eff constructor (Phase D slice 3).
- PR #210 — STATE.a2ml shift to "state and prove preservation_l2".

## Test plan

- [x] \`coqc 8.18.0\` clean rebuild
- [x] \`Print Assumptions preservation_l2_via_l1\` → only legacy
\`preservation_l1\` admit
- [x] Zero new \`Admitted.\` / \`Axiom.\` / \`admit.\` in TypingL2.v
- [x] GPG-signed commit
- [ ] CI green
- [ ] Auto-merge SQUASH fires

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request May 28, 2026
…ase D slice 4 next sub-slice (#212)

## Summary

Reflect the escalation point identified by PR #211. Full
\`preservation_l2\` over \`has_type_l2\` blocks at the T_App_L2_Eff
β-case on \`subst_typing_gen_l1_m\`'s \`is_linear_ty T1 = true\`
precondition — that's the next-slice load-bearing infrastructure work,
surfaced cleanly in STATE.a2ml.

## Changes

- **\`next_action\`**: shift from "state and prove preservation_l2" (now
partially satisfied by #211's \`preservation_l2_via_l1\`) to "generalise
\`subst_typing_gen_l1_m\` (Semantics_L1.v:1358) to handle non-linear
T1". Specifies the sibling-lemma approach (vs folding case-split into
the existing 30-downstream lemma) and the resulting closure path for
T_App_L2_Eff β-case.
- **\`last_action\`**: record PR #211 partial landing
(\`preservation_l2_via_l1\` + corollary + doc block, GPG-signed
\`1131141\`, auto-merge SQUASH armed \`2026-05-28T13:41:20Z\`).
- **\`@blockers\` TypingL2.v entry**: post-#211 carries
\`preservation_l2_via_l1\` + corollary; full \`preservation_l2\` over
\`has_type_l2\` blocked at T_App_L2_Eff β-case.
- **\`@artifacts\`**: TypingL2.v annotation extended to include
\`preservation_l2_via_l1\` (Phase D slice 4 partial).

## Why STATE.a2ml ride in its own PR (not folded into #211)

Per session-6 lesson recorded in the \`preservation_l2_via_l1\` session
memory note: STATE.a2ml shifts ride in their own PR after the code PR is
queued. Keeps the diff narrow and makes \`git blame\`-style triage
trivial.

## Refs

- PR #211 — \`preservation_l2_via_l1\` + doc block (open, auto-merge
SQUASH armed)
- PR #210 — STATE shift after PR #209 (merged) — same pattern
- \`formal/PRESERVATION-DESIGN.md\` §5.1 lines 468-474 — load-bearing
design quote

## Test plan

- [x] STATE.a2ml single-file diff
- [x] GPG-signed commit
- [ ] CI green
- [ ] Auto-merge SQUASH fires
- [ ] Merges AFTER #211 (or independently; STATE.a2ml has no code
dependency on TypingL2.v)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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