Skip to content

fix(stdlib): rename try->attempt, ref->make_ref (#135 slice 6)#156

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/135f-keyword-ident-rename
May 17, 2026
Merged

fix(stdlib): rename try->attempt, ref->make_ref (#135 slice 6)#156
hyperpolymath merged 1 commit into
mainfrom
fix/135f-keyword-ident-rename

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

What

#135 slice 6 — keyword-as-identifier. result.affine fn try<T> (try = try/catch keyword) → attempt; effects.affine extern fn ref<T> (ref = ownership keyword) → make_ref.

Pure stdlib rename — zero grammar/compiler change, zero risk. No other stdlib file referenced the old names (verified). The triage doc recommended rename (local + safe) over a broad contextual-keyword grammar change.

Verification

Both files clear the keyword parse wall and advance to deeper, distinct later-slice defects (result → empty-array (T,Int) = slice 7; effects → generic-extern kind-checking). Suite unaffected (stdlib-only change; 226 green).

Advances #135 (does not close). Refs #128, #135.

🤖 Generated with Claude Code

#135 slice 6 — keyword-as-identifier. Two stdlib externs/fns were named
with reserved keywords and could not parse in fn-name position:

- result.affine `fn try<T>` — `try` is the try/catch/finally keyword
  -> renamed `attempt` (its body still uses the real `try { } catch`).
- effects.affine `extern fn ref<T>` — `ref` is the ownership keyword
  -> renamed `make_ref`.

Pure stdlib rename — zero grammar/compiler change, zero risk. No other
stdlib file referenced the old names (verified). Both files now clear
the parse wall and advance to deeper, distinct later-slice defects
(result -> empty-array `(T,Int)` family = slice 7; effects -> generic-
extern kind-checking, separate). Resolve-at-source via rename was the
recommended option in the triage doc (local + safe vs a broad
contextual-keyword grammar change).

Advances #135. Refs #128, #135.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit d0654d4 into main May 17, 2026
11 of 12 checks passed
@hyperpolymath hyperpolymath deleted the fix/135f-keyword-ident-rename branch May 17, 2026 10:18
hyperpolymath added a commit that referenced this pull request May 17, 2026
…GE) (#157)

Live state after 8 merged PRs (#149-#156). 9/19 stdlib files compile
end-to-end. Refines remaining root causes from raw symptoms:

- Slice 7 was mis-hypothesised as "empty-array literal" — that pattern
  compiles in isolation; the real cause is HOF `fold` instantiated
  monomorphically by `sum`/`product`. Reclassified, not guessed.
- New sub-defects surfaced as earlier walls fell: `&mut T` ref params
  (option, slice 9), `as` keyword-as-param-name (collections, slice
  6b), generic-extern kind-checking (effects, slice 10).
- Tags each remaining slice by autonomy/risk: 6b/5 safe-bounded;
  4/7/8/9/10 correctness-/grammar-critical (rigorous, not auto-rushed).

Refs #128, #135.

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

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