Skip to content

docs: Stage B properly CLOSED (truth the #215 ADR-012 wont-fix; Refs #176 #215) - #242

Merged
hyperpolymath merged 1 commit into
mainfrom
docs/stageb-close-properly
May 19, 2026
Merged

docs: Stage B properly CLOSED (truth the #215 ADR-012 wont-fix; Refs #176 #215)#242
hyperpolymath merged 1 commit into
mainfrom
docs/stageb-close-properly

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Stage B properly CLOSED — truth the #215 ADR-012 won't-fix

The ledger said Stage B "near-closed" with residual #215 families
remaining (one family per PR). Stale and actively misleading.

#215 is CLOSED with an owner-ratified ADR-012 disposition: the
residual ~68 S/R + state-401 R/R conflicts are an intentional
WON'T-FIX
. Menhir resolves them correctly, the full gate proves every
accepted parse is the intended one, and eliminating them is exactly the
systemic precedence/left-factoring contortion (estate-wide blast radius,
cosmetic-only payoff) that ADR-012 forbids.

Closure is by disclosure, not surgery — verified present in
justfile: just build masks the benign notices but prints the count +
correctness proof + ADR pointer; just build-loud / dune build reveal
everything. Policy: docs/specs/SETTLED-DECISIONS.adoc "Parser-Conflict
Disclosure".

"near-closed" invited the precise grammar work ADR-012 forbids — a
documentation-drift hazard squarely in scope for DOC-01..09 / #176.

Corrected:

Docs-only; gate unaffected. Refs #176 #215 — not Closes (#215 is
already closed; this truths the ledger to match its disposition).

🤖 Generated with Claude Code

…#176 #215)

The ledger said Stage B "near-closed (residual #215 families remain, one
family per PR)". That is stale and actively misleading: #215 is CLOSED
with an owner-ratified ADR-012 disposition that the residual ~68 S/R +
state-401 R/R conflicts are an INTENTIONAL WON'T-FIX. Menhir resolves
them correctly, the full gate proves every accepted parse is the
intended one, and eliminating them is exactly the systemic
precedence/left-factoring contortion (estate-wide blast radius,
cosmetic-only payoff) ADR-012 forbids. Closure is by disclosure, not
surgery: `just build` masks the benign notices but prints the count +
correctness proof + ADR pointer; `just build-loud` / `dune build` reveal
all (verified present in justfile; policy in
docs/specs/SETTLED-DECISIONS.adoc "Parser-Conflict Disclosure").

"near-closed" invited the precise grammar work ADR-012 forbids — a
documentation-drift hazard (DOC-01..09 / #176). Corrected:
- docs/ECOSYSTEM.adoc Stage B row: near-closed -> CLOSED + the ADR-012
  residual-conflict disposition + the disclosure mechanism + an explicit
  "do not reopen" note.
- docs/TECH-DEBT.adoc critical-path: Stage B CLOSED (ADR-012 won't-fix).
- docs/CAPABILITY-MATRIX.adoc parser row: Stage B CLOSED, no longer
  "tracked as the #215 workstream".

Docs-only; gate unaffected. Refs #176 #215 (not Closes — #215 already
closed; this truths the ledger to match its disposition).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath
hyperpolymath merged commit c6756c7 into main May 19, 2026
11 of 12 checks passed
@hyperpolymath
hyperpolymath deleted the docs/stageb-close-properly branch May 19, 2026 15:28
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 44 issues detected

Severity Count
🔴 Critical 12
🟠 High 21
🟡 Medium 11

⚠️ 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": "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 30, 2026
…r (step #242) (#445)

## Summary

Adds six externs to `stdlib/Deno.affine` to unblock the TS→AffineScript
estate migration:

- `walkRecursive(root) -> [String]` — depth-first file walk
- `args() -> [String]` — `Deno.args`
- `exit(code) -> Int` — `Deno.exit` (never returns)
- `dateNowIso() -> String` — `new Date().toISOString()`
- `consoleError(s) -> Int` — stderr; returns 0
- `regexMatch(s, pat) -> Bool` — `new RegExp(pat).test(s)`

These were surfaced by surveying the campaign #239 step 2 tail-batch-1
candidates: two pure-logic Deno CLI scripts (`panic-attack
docs/campaigns/2026-05-26/01-triage.ts` and
`standards/scripts/check-ts-allowlist.ts`) become portable using only
the existing `Deno.affine` surface plus these six additions.

## Lowering

- `walkRecursive`, `regexMatch` get tiny prelude shims
(`__as_walkRecursive` recurses through `Deno.readDirSync`;
`__as_regexMatch` wraps `RegExp.test`).
- `args`, `exit`, `dateNowIso`, `consoleError` lower directly to host
expressions.

## Test plan

- [x] `dune build` — green
- [x] New fixture
`tests/codegen-deno/deno_scripting.{affine,harness.mjs}` — in-memory FS
for walk, captured stderr, intercepted exit. New harness passes.
- [x] All 12 codegen-deno harnesses pass
- [x] `dune runtest` — 346 tests green

## Refs

- Refs hyperpolymath/standards#242 (STEP 3 — STDLIB FILL)
- Refs hyperpolymath/standards#239 (campaign umbrella)

## Notes

This is the first-cut for step 3. Other gaps not addressed here (HTTP
server, `fetch`, `crypto.subtle`, `Deno.Command`, recursive-stat with
`isFile`/`isDirectory` flags) remain on the step-3 docket — they block
heavier ports (mock-echidna, civic-connect services, dotfiles health
host) which are out of scope for tail-batch-1.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
hyperpolymath added a commit that referenced this pull request Jun 1, 2026
…efs #239, #242) (#504)

Closes the smallest, safest tractable gaps that the four merged STEP-2
TS→AffineScript ports — phronesis#19, session-sentinel#25,
tropical-resource-typing#15, nafa-app#23 — flagged for STEP 3 of the
estate-wide campaign (`hyperpolymath/standards#239`, sub-issue `#242`).

## What lands

### `stdlib/Deno.affine` (+6 externs)

| extern | lowers to | gap |
|---|---|---|
| `statIsFile(path) -> Bool` | `Deno.statSync(path).isFile` | 3 |
| `statIsDirectory(path) -> Bool` | `Deno.statSync(path).isDirectory` |
3 |
| `bytesLength(b) -> Int` | `(b).length` | 4 |
| `bytesByteAt(b, i) -> Int` | `(b)[i]` | 4 |
| `bytesAsciiSlice(b, s, e) -> String` |
`String.fromCharCode(...(b).slice(s, e))` | 4 |
| `importMetaUrl() -> String` | `import.meta.url` | 5 |

The `bytes*` accessors give AffineScript first-class read access to the
opaque `Bytes` returned by `readFileBytes` so callers can peek at
file-magic / fixed-width binary headers without round-tripping through
`readTextFile` (which throws on binary). `importMetaUrl` exposes the JS
`__dirname` / `__filename` idiom for "find my own location"; only legal
at module top level, which the Deno-ESM backend's output already is.

### `stdlib/string.affine` (1 char)

`fn ends_with` → `pub fn ends_with`. The function existed but was
private, so the four STEP-2 ports each inlined a `string_sub`-backed
helper instead of importing it. Gap 2.

### `lib/codegen_deno.ml` — wildcard `let _` fix (gap 7)

`StmtLet { sl_pat = PatWildcard _; … }` now lowers to a bare expression
statement instead of `const _ = X;`. Three back-to-back `let _ = side()`
discards in the same scope tripped JS `SyntaxError: Identifier '_' has
already been declared`. The wildcard pattern doesn't bind, so dropping
the binding entirely preserves AffineScript semantics (evaluate for side
effects).

```js
// before
function discard_chain() {
  const _ = side(1);
  const _ = side(2);   // ❌ SyntaxError
  const _ = side(3);
  return 42;
}

// after
function discard_chain() {
  side(1);
  side(2);
  side(3);
  return 42;
}
```

### Tests

`tests/codegen-deno/deno_scripting_part2.{affine,deno.js,harness.mjs}` —
11 assertions across the new lowerings + the wildcard fix. The harness
reaching its discard-chain assertion is itself the test for gap 7: a
syntax-error generated module would have thrown at the dynamic `import`
line before any assert ran.

## Verification

| step | result |
|---|---|
| `dune build bin/main.exe` | ✅ |
| `dune runtest` | ✅ 353/353 |
| `./tools/run_codegen_deno_tests.sh` | ✅ all harnesses (incl. the new
one) |

## What does not land here (deferred deliberately)

- **gap 1** — `Deno.test` extern lowering. The four merged STEP-2 ports
use a panic-on-fail `main()` driver and it works; not unblocking STEP 4.
- **gap 6** — native TOML parser. Heavier work; STEP-2 ports used regex
field-presence checks where TOML mattered.

Gaps 9 (`AFFINESCRIPT_STDLIB` env discovery ladder, shipped #433) and 10
(negative integer literals, verified working in all contexts — match
arms, array literals, equality, ternaries) were audited as
already-resolved.

## Refs

- Closes 6 of the 10 gaps blocking `hyperpolymath/standards#242` (STEP 3
of `#239`).
- Unblocks STEP 4 (`#243`, mid-tier 4-9 file ports) and STEP 5 (`#244`,
idaptik DLC) for any consumer that needs stat predicates, byte
accessors, module-URL inspection, the public `ends_with`, or multiple
`let _` discards in a single scope.

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

Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
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