Skip to content

docs(adr): ADR-022 — origin variables + Polonius-style loan solver (Refs #177) — surgical refile of #398#407

Merged
hyperpolymath merged 1 commit into
mainfrom
adr-022-surgical
May 27, 2026
Merged

docs(adr): ADR-022 — origin variables + Polonius-style loan solver (Refs #177) — surgical refile of #398#407
hyperpolymath merged 1 commit into
mainfrom
adr-022-surgical

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Surgical refile of #398. The original branch core-01/polonius-adr carried 386 commits' worth of phantom history (commits with main equivalents at different SHAs after squash-merges), and a naive cherry-pick onto current main would have clobbered the linear_bindings work landed today via #397.

This branch carries only the 3 intended changes from #398:

  • docs/decisions/0022-polonius-origin-variables.adoc (347 lines) — long-form ADR
  • .machine_readable/6a2/META.a2ml (143 lines) — structured [[adr]] block
  • lib/borrow.ml (5 lines net) — single in-comment edit in the closing residual-TODO block, pointing readers at ADR-022

Owner ratified the architectural bundle 2026-05-27: OCaml Polonius solver in lib/borrow_polonius/, surface-syntax fully elided for v1, M1–M4 stage gates with lexical checker as merge oracle through M3.

Closes

Closes #398 (the stale-base original).

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

…efs #177)

Surgically reconstructed from PR #398 (stale-base, 386 phantom commits)
onto current main, preserving the linear_bindings work from #397 which
landed during this session. Three changes:

- docs/decisions/0022-polonius-origin-variables.adoc — long-form ADR (347 lines)
- .machine_readable/6a2/META.a2ml — structured [[adr]] block ADR-022 (143 lines)
- lib/borrow.ml — single in-comment edit pointing readers at ADR-022,
  preserving the linear_bindings field + LinearCapturedByClosure error
  variant + helpers that #397 landed.

Owner ratified the architectural bundle 2026-05-27: OCaml Polonius
solver in lib/borrow_polonius/, surface-syntax fully elided for v1,
M1–M4 stage gates with lexical checker as merge oracle through M3.

Closes #398.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit 03c926e into main May 27, 2026
@hyperpolymath hyperpolymath deleted the adr-022-surgical branch May 27, 2026 14:20
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 54 issues detected

Severity Count
🔴 Critical 4
🟠 High 11
🟡 Medium 39

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Action actions/checkout@v6 needs attention",
    "type": "unpinned_action",
    "file": "publish-jsr.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action denoland/setup-deno@v2 needs attention",
    "type": "unpinned_action",
    "file": "publish-jsr.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in affine-vscode-publish.yml",
    "type": "unknown",
    "file": "affine-vscode-publish.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "unknown",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "unknown",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

hyperpolymath added a commit that referenced this pull request May 30, 2026
#177 (#473)

## Summary

- Refresh `docs/TECH-DEBT.adoc` CORE-01 row: ledger listed Slices C' / D
/ ref-to-ref binding as residual, but those landed (PRs #395 / #396 /
#397).
- Flip the Stage D ASCII status from `ACTIVE` to `CLOSED`.
- Mark the row `CLOSED 2026-05-30`; remaining residual is scoped
exclusively to ADR-022 (Polonius origin/region variables) which is a
separate, ADR-gated workstream filed at
`docs/decisions/0022-polonius-origin-variables.adoc` (PR #407).

## Why now

#177 was the issue tracking CORE-01 Phase-3 (borrow-graph validation,
S1). The stated scope — adding graph validation plus regression fixtures
under `tests/` — has shipped:

- **Code:** `lib/borrow.ml:1635-1715` documents pt1 + pt2 (return-escape
+ `&mut` parser surface) + pt3 Slices A (NLL last-use) / B
(flow-sensitive re-assignment) / C-light (CFG-join for
`ExprHandle`/`ExprTry`) / C' (loop soundness) / D (linear-capture by
closure) + ref-to-ref binding.
- **Tests:** `test/test_e2e.ml` "E2E Borrow Graph" suite — **28 hermetic
regression tests** (covering each landed slice with positive +
anti-regression cases).
- **Slices that landed since the ledger was last updated:** #395
(ref-to-ref binding), #396 (Slice C' loop soundness), #397 (Slice D
linear-capture), #399 (whole-place assignment clears moves), #400
(self-assign guard + return-escape coverage for ref-to-ref).
- **ADR-022 (#407):** Polonius origin/region variables — architectural
change to the type system. M1–M4 migration plan in the ADR; lexical
checker is the merge oracle through M3.

## Build oracle

Local toolchain has an unrelated cross-installation OCaml conflict
(`astring.cmxa` from opam vs system `stdlib.cmxa`); using CI-on-main as
oracle instead.

CI green on `main` at `4f0f3ca7` (2026-05-30 15:19Z) with all CORE-01
work present.

## Test plan

- [ ] CI green on this branch
- [ ] No code in the diff; doc-only change (no behaviour impact)
- [ ] `Closes #177` link resolves on merge

Closes #177.

🤖 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