Skip to content

chore(tidy): T-2 — remove out-of-scope submarine-game docs from root#360

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/tidy-2-game-files
May 25, 2026
Merged

chore(tidy): T-2 — remove out-of-scope submarine-game docs from root#360
hyperpolymath merged 1 commit into
mainfrom
claude/tidy-2-game-files

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Phase T-2 of the repo-tidy stack (per the owner's "Delete outright" instruction in the tidy plan).

Removes three large root-level documents that describe a submarine game (DAMAGE-SYSTEM.md 1,071 lines, CONTROLS-REFERENCE.md 556 lines, GAME-BUNDLING-STRATEGY.md 552 lines — 2,182 lines combined). They sit at the root of the AffineScript compiler repository and have zero incoming references — grep -r across the working tree's .md/.adoc/.yml/code surface finds no hits.

They appear to be artefacts of an earlier experimental game project that bled into this repo via an old merge or templating mishap. The current language / typed-wasm / stdlib work has no use for any of it; if a future AffineScript-built game needs a damage model / control scheme / bundling strategy, the right place for those docs is the game's own repo, not the compiler's.

Git history preserves the deleted content.

Test plan

  • CI green (no callers exist; expected to be a pure-delete no-op).
  • Repo-root listing visibly shorter; this clears 3 of the 12 loose root .md files the broader tidy is addressing.

Stack


Generated by Claude Code

@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 112 issues detected

Severity Count
🔴 Critical 15
🟠 High 47
🟡 Medium 50

⚠️ 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": "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@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": "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"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/lib/compile.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/lib/runner.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 25, 2026
…-queue clear)

Every open PR (#357#360) is MERGEABLE/UNSTABLE because main itself has three
independent baselines red. Same red shows up on every new PR. Fix each at
source so it stops blocking the whole queue.

## 1. `bench/dune` — `Unknown field "alias"` (build + lint)

`(test ...)` in dune 3.x does not accept `(alias <name>)` as an inline field.
The pattern that works under dune 3.14:

  (executable ...)         ; build the bench runner without auto-@runtest
  (rule (alias bench)      ; only run when explicitly targeted via @bench
        (action (run ...)))

Preserves the visibility-only contract (`just bench` / `dune runtest @bench`
still work; normal `dune runtest` no longer pulls bench in).

## 2. Anti-pattern false-positive on `.res` test fixture (governance)

`tools/res-to-affine/test/fixtures/sample.res` is the input corpus for the
`.res → .affine` migration tool (#57). The estate ban on `.res` files
correctly flags it, but the file is fixture-by-construction. The governance
bundle already supports an in-file pragma read from the first 8 lines —
add `// hypatia:ignore cicd_rules/banned_language_file` to the fixture
header so the exemption travels with the file rather than living in a
side-channel `.hypatia-ignore` list.

## 3. npm 404 on `@hyperpolymath/affine-vscode` (vscode-smoke)

The adapter package is gated on owner action #104 (org create + NPM_TOKEN +
`affine-vscode-v0.1.0` tag push) and has not landed. Until then `npm install`
404s and the smoke harness can't even load the extension.

Two layers of fix:

- `editors/vscode/package.json`: move `@hyperpolymath/affine-vscode` from
  `dependencies` → `optionalDependencies` so `npm install` tolerates the
  404 instead of erroring out. When the package eventually publishes, real
  installs pick it up automatically.

- `lib/codegen_node.ml`: the `--vscode-extension` codegen was emitting an
  unconditional `const _makeVscodeBindings = require("...")` at top level.
  Replace with a defensive `try { } catch (_e) { if code !== MODULE_NOT_FOUND
  throw }` wrapper plus a guarded `extraImports` that returns `{}` when the
  adapter is absent. Other require errors (syntax, transitive failure) are
  still rethrown so real bugs aren't masked. Same patch applied to the
  already-committed `editors/vscode/out/extension.cjs` so today's CI sees
  the fix without a compiler rebuild round-trip.

This is the upstream fix — any future extension compiled with
`--vscode-extension` inherits graceful degradation. activate() / deactivate()
resolve cleanly when the adapter is missing; the in-editor smoke harness
(#139) verifies activation + command registration + restartLsp cycling,
which do not require the binding adapter.

Refs #104 (adapter publish remains owner-blocked but no longer load-bearing
for CI); Refs #57 (migration assistant); Refs #139 (vscode smoke harness).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request May 25, 2026
…ure exemption (#361)

## Summary

Every open PR (#357#360) is `MERGEABLE` / `UNSTABLE` because **main
itself** has three independent baselines red. The same four checks fail
on each PR. Fix each red at source so the queue inherits a clean
baseline.

- **`bench/dune`** — `Unknown field "alias"` (breaks `build` + `lint`)
- **anti-pattern policy** — flags
`tools/res-to-affine/test/fixtures/sample.res` (intentional fixture for
#57)
- **`vscode-smoke`** — `npm install` 404s on the not-yet-published
`@hyperpolymath/affine-vscode` (#104 owner-blocked)

## Foundational fixes (one PR; each at the correct upstream level)

| Surface | File | Fix |
|---|---|---|
| dune 3.x compatibility | `bench/dune` | Replace `(test ...) (alias
bench)` with `(executable ...)` + a dedicated `(rule (alias bench)
...)`. Keeps `just bench` / `dune runtest @bench` working; doesn't
auto-pull bench into `@runtest`. |
| Banned-language fixture exemption |
`tools/res-to-affine/test/fixtures/sample.res` | In-file `//
hypatia:ignore cicd_rules/banned_language_file` pragma (governance
bundle reads first 8 lines for `hypatia:ignore <rule>`). Exemption
travels with the file rather than living in a side-channel
`.hypatia-ignore`. |
| Compiler upstream | `lib/codegen_node.ml` | Wrap the
`--vscode-extension` adapter require in `try { } catch (_e) { if
(_e.code !== "MODULE_NOT_FOUND") throw _e; }`. `extraImports` returns
`{}` when the adapter is absent. Real require errors (syntax, transitive
failures) are still rethrown so genuine bugs aren't masked. Any future
extension built with this flag inherits graceful degradation. |
| Committed compiler output | `editors/vscode/out/extension.cjs` | Apply
the same try/catch in the regenerated `.cjs` so today's CI picks up the
fix without a full compiler rebuild round-trip. |
| Package metadata | `editors/vscode/package.json` | Move
`@hyperpolymath/affine-vscode` from `dependencies` →
`optionalDependencies` so `npm install` tolerates the 404 instead of
failing the install. When `#104` lands the publish-tag, real installs
pick the package up automatically. |

## Why one PR, not three

The three fixes touch independent surfaces but the queue is blocked on
the **union** of the three failures. Splitting would require landing
this PR first (otherwise the dune red blocks every dependent fix), then
landing the other two on a now-green main. Bundling avoids that rebase
round-trip and lets PRs #357#360 inherit a clean baseline in one merge.

## Why this is foundational, not a workaround

- The dune fix matches dune ≥3.0's canonical pattern for "build this but
only run on explicit alias" — not a hack.
- The fixture pragma uses the governance bundle's documented in-file
exemption mechanism (same machinery used by other estate repos).
- The defensive adapter load is at the **codegen source** in
`lib/codegen_node.ml`, so any future extension compiled with
`--vscode-extension` inherits the behaviour. The committed `.cjs` patch
is a regen-equivalent (would be reproduced verbatim by a fresh `dune
build && affinescript compile … --vscode-extension`).

## Test plan

- [ ] `build` job passes (`dune build` no longer hits the `(alias
bench)` syntax error)
- [ ] `lint` job passes (same)
- [ ] `governance / Language / package anti-pattern policy` passes
(fixture exempted by pragma)
- [ ] `vscode-smoke` passes (`npm install` tolerates optional
`@hyperpolymath/affine-vscode`; extension activates without the adapter;
commands register; restartLsp cycles; deactivate resolves)
- [ ] No regression on green checks (CodeQL, Semgrep, Hypatia scans,
governance subjobs, migration-assistant, etc.)
- [ ] After merge: PRs #357#360 transition `UNSTABLE` → `CLEAN` (after
rebase or new CI cycle)

Refs #104 (adapter publish remains owner-blocked but no longer
load-bearing for CI), Refs #57 (migration assistant — fixture intent),
Refs #139 (vscode smoke harness).

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath force-pushed the claude/tidy-2-game-files branch from cdfcbb8 to f4d6aa5 Compare May 25, 2026 22:44
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 108 issues detected

Severity Count
🔴 Critical 15
🟠 High 49
🟡 Medium 44

⚠️ 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": "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@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": "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"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/lib/compile.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/lib/runner.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath enabled auto-merge (squash) May 25, 2026 22:46
hyperpolymath added a commit that referenced this pull request May 25, 2026
`dune build @fmt` rejects the one-line forms my #361 commit landed on
main — dune's formatter wants `(modules ...)` with each module on its
own line, and `(action ...)` with the body on its own line.

This is a follow-up to PR #361 (already merged); the @fmt check has
been failing on every build since #361 because of that one-liner. The
`dune runtest` / `just bench` semantics are unchanged.

Combined with the env_at/arg_at wiring and string_length codegen
lowering earlier in this PR, this should clear the build red on the
4-PR queue (#357-#360) and on this branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…po root

`DAMAGE-SYSTEM.md` (1,071 lines), `CONTROLS-REFERENCE.md` (556 lines),
and `GAME-BUNDLING-STRATEGY.md` (552 lines) describe a submarine game
(component damage model, control schemes, AGPL-vs-PMPL bundling
strategy for shipping AffineScript as part of a game binary). All
three landed at the root of the *compiler* repository and have no
incoming references from anywhere in the working tree — `grep -r`
across `.md`/`.adoc`/`.yml`/code finds zero hits.

They appear to be artefacts from an earlier experimental game
project that bled into this repo via an old merge or templating
mishap. The current AffineScript compiler / language / typed-wasm
work has no need for any of this content; the right place for a
game built with AffineScript is a separate downstream repo, not
the language repo's root.

Per the owner's explicit instruction (multiple-choice answer
"Delete outright" in the tidy plan), removing them outright;
git history preserves them if a future game-bundling effort
ever needs to reference them.

No code change. No CI impact.
@hyperpolymath hyperpolymath force-pushed the claude/tidy-2-game-files branch from f4d6aa5 to 56b925e Compare May 25, 2026 23:36
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 108 issues detected

Severity Count
🔴 Critical 15
🟠 High 48
🟡 Medium 45

⚠️ 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": "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@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": "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"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/lib/compile.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/lib/runner.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  }
]

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.

2 participants