Skip to content

fix(stdlib): option.affine — final STAGE-A file, stdlib 19/19 (#128)#192

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/128-option-final
May 18, 2026
Merged

fix(stdlib): option.affine — final STAGE-A file, stdlib 19/19 (#128)#192
hyperpolymath merged 1 commit into
mainfrom
fix/128-option-final

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Last failing stdlib/*.affine. With this, every stdlib module type-checks (19/19).

  • take/get_or_insert: Rust-style &mut Option<T> → AffineScript mut opt: Option<T> (grammar has no &mut; ownership-prefix is the convention)

  • drop prelude map import (option defines its own Option map; prelude's is the list map — same name-conflict class as fix(stdlib): collections.affine prelude arg-order + let mut (#128) #191)

  • transpose/map_filter: rewrite list-map via the file's own for-loop ++ idiom (the shadowed map was Option-map)

  • cat_options: Unit statement-block arm so it matches None => {} (a bare assignment expr is typed as its RHS → Array vs Unit; collect already works via its Never arm)

  • collect/cat_options: reassigned valueslet mut

  • stdlib 18 → 19/19 — STAGE A coherence complete

  • dune test 233/233, zero regression

Refs #128

- take/get_or_insert: Rust-style `&mut Option<T>` -> AffineScript
  `mut opt: Option<T>` ownership-prefix param (grammar has no `&mut`)
- drop prelude `map` from the import (option defines its own Option
  `map`; prelude's is the list map — name conflict, same class as
  collections#191)
- transpose/map_filter: rewrite the list-map with the file's own
  for-loop ++ idiom instead of the (shadowed) map
- cat_options: Unit statement-block match arm so it matches the
  `None => {}` arm (a bare assignment expr is typed as its RHS ->
  Array vs Unit across arms; collect already works via its Never arm)
- collect/cat_options: reassigned `values` -> `let mut`

stdlib 18->19/19 — STAGE A coherence complete. 233/233 dune test, zero regression.

Refs #128

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit 58c8eb8 into main May 18, 2026
11 of 12 checks passed
@hyperpolymath hyperpolymath deleted the fix/128-option-final branch May 18, 2026 03:58
@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