Skip to content

INT-10: affinescript-lsp resolves compiler via the ADR-019 shim (#260 S4) - #287

Merged
hyperpolymath merged 1 commit into
mainfrom
int10-282-lsp-shim
May 19, 2026
Merged

INT-10: affinescript-lsp resolves compiler via the ADR-019 shim (#260 S4)#287
hyperpolymath merged 1 commit into
mainfrom
int10-282-lsp-shim

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Closes #282. Refs #260, #181, ADR-019.

What

S4 of #260 / ADR-019: affinescript-lsp now resolves a working compiler via the ADR-019 distribution path instead of assuming affinescript is on PATH. S1/S2/S3 (ADR-019, release matrix, the @hyperpolymath/affinescript shim) are already on main (#283/#284/#285).

How

New tools/affinescript-lsp/src/compiler.rsresolve_compiler() with precedence:

  1. AFFINESCRIPT_COMPILER — explicit binary path (source/dev escape hatch, and the smoke-test seam).
  2. affinescript on PATH — a source/dev install.
  3. The ADR-019 shim: deno run … jsr:@hyperpolymath/affinescript@0.1.0 — the shim itself downloads + SHA256-verifies + caches + execs the pinned Release binary.

No bespoke compiler-bundling in the LSP. The shim spec is pinned in the LSP in lockstep with the shim package's deno.json version (the ADR-019 "one version + checksum per shim release" rule). check_document() now invokes the resolved compiler.

Tests

  • Locate/exec smoke (per the issue): the LSP resolves and execs a compiler and reads back its --json contract — hermetic (fake compiler, no network / Deno / installed toolchain).
  • Resolution-precedence unit tests (env override > PATH > shim; empty env ignored; shim pin is exact, not floating).
  • Full LSP suite green: 26/26. Crate builds (pre-existing warnings only).

Ledger: docs/TECH-DEBT.adoc INT-10 marked done, #260 S4 closed.

🤖 Generated with Claude Code

…im (#260 S4)

Wires affinescript-lsp onto the ADR-019 compiler distribution path
(#260 S1/S2/S3 already merged: ADR-019 + release matrix + the
@hyperpolymath/affinescript shim).

- New src/compiler.rs: resolve_compiler() with precedence
  AFFINESCRIPT_COMPILER → `affinescript` on PATH → the pinned
  `jsr:@hyperpolymath/affinescript` shim (shim does download +
  SHA256-verify + cache + exec). No bespoke compiler-bundling in
  the LSP. Shim spec pinned in lockstep with the shim deno.json.
- check_document() now invokes the resolved compiler instead of a
  hardcoded `affinescript` on PATH.
- Smoke test: the LSP can locate + exec a resolved compiler and
  read back its --json contract (hermetic fake compiler, no net /
  Deno); plus resolution-precedence unit tests. 26/26 green.
- TECH-DEBT ledger: INT-10 closed, #260 S4 done.

Closes #282. Refs #260, #181, ADR-019.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath
hyperpolymath merged commit 160efa0 into main May 19, 2026
12 of 13 checks passed
@hyperpolymath
hyperpolymath deleted the int10-282-lsp-shim branch May 19, 2026 21:13
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 47 issues detected

Severity Count
🔴 Critical 12
🟠 High 21
🟡 Medium 14

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Stray AI.a2ml in root -- use 0-AI-MANIFEST.a2ml only",
    "type": "banned",
    "file": "AI.a2ml",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "high"
  },
  {
    "reason": "Superseded by 0-AI-MANIFEST.a2ml",
    "type": "banned",
    "file": "AI.djot",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "high"
  },
  {
    "reason": "Issue in quality.yml",
    "type": "missing_workflow",
    "file": "quality.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in security-policy.yml",
    "type": "missing_workflow",
    "file": "security-policy.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Action actions/checkout@v4 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": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/example/smoke_driver.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/cli.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

hyperpolymath added a commit that referenced this pull request May 20, 2026
…m 0.1.1 (#291)

Closes the INT-10 wiring gap on #282: the LSP code path that resolves
the compiler via `jsr:@hyperpolymath/affinescript@<pin>` (#287) was
inert until pins.js had real sha256 values.  Fills the two binaries
that the v0.1.0 Release workflow (run 26124042846) produced before the
macos-13 leg stalled in the runner queue:

- linux-x64:    c1ce65308bace96669d2a178732cd5ee180845d85a5775e119a221b98fe2a5da
- macos-arm64:  2cac3ba54ae7778d31d1bd780d11b56a5cf78b5d5ee6c1d33edd3f8e753943d5

`macos-x64` stays fail-closed (empty sha256 ⇒ `resolveCompiler` refuses)
per the rule documented at the top of pins.js — an unpinned binary is
never executed.  A follow-up release will fill it once the macos-13
build clears CI.  SHAs were computed from binaries downloaded directly
off the v0.1.0 Release (the canonical SHA256SUMS manifest only gets
written by release.yml's `checksums` job after all three matrix legs
succeed, so it does not yet exist on this Release).

Bumps `@hyperpolymath/affinescript` 0.1.0 → 0.1.1 in lockstep
(pins.js header rule), and tracks it in the LSP via
`SHIM_SPEC = "jsr:@hyperpolymath/affinescript@0.1.1"`.

Verification
- `deno test` (packages/affinescript-cli): 6/6 green
- `cargo test` (tools/affinescript-lsp): 26/26 green
- Real end-to-end smoke (off the v0.1.0 Release, host = linux-x64):
  `resolveCompiler()` downloaded `affinescript-linux-x64`,
  checksum-verified against the new pin, cached, and execed
  `--version` → `0.1.0` (exit 0).

Refs #282, #260, #181.  ADR-019 in docs/specs/SETTLED-DECISIONS.adoc.
Not `Closes #282` — owner-gated on the macos-x64 leg landing.

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

1 participant