Skip to content

feat(stdlib): alib.affine conformance module (closes #416) - #420

Merged
hyperpolymath merged 1 commit into
mainfrom
feat/alib-conformance-module
May 28, 2026
Merged

feat(stdlib): alib.affine conformance module (closes #416)#420
hyperpolymath merged 1 commit into
mainfrom
feat/alib-conformance-module

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

aLib roadmap T1 item #10. Adds stdlib/alib.affine exposing the 22 aLib v0.1.0 operations under their canonical aLib names — single import point for consumers wanting the aLib surface rather than the AffineScript-idiomatic surface.

The 22 ops by category

Category Ops
arithmetic (5) add, subtract, multiply, divide, modulo
comparison (6) less_than, greater_than, equal, not_equal, less_equal, greater_equal
logical (3) and, or, not
string (3) concat, length, substring
collection (4) map, filter, fold, contains
conditional (1) if_then_else

Count correction: the roadmap row 10 said "20"; current aggregate.json v0.1.0 has 22. Row updated to match.

Type model

Number ↦ Int for v0.1.0 since aggregate.json test vectors use integer arithmetic. A parallel alib_float set can be added when Float-typed test vectors land — keeping the alib::add surface integer-pure preserves the simple consumer API and avoids Number ambiguity at the call site.

Implementation

  • add/subtract/multiply/etc. — thin operator wrappers
  • length / concat / substring — bind to existing stdlib functions + the string_sub builtin
  • map/filter — written explicitly (avoids a cross-module visibility quirk pending the alib ci: Bump actions/checkout from 4.1.1 to 6.0.2 #9 audit)
  • fold/contains — re-exported from prelude via aliased import (use prelude::{ fold as prelude_fold, ... })
  • if_then_else — eager evaluation per aLib spec; consumers wanting laziness use the language if … else … expression directly

Downstream unlocks

Test plan

Refs

🤖 Generated with Claude Code

aLib roadmap T1 item #10. Adds `stdlib/alib.affine` exposing the 22
aLib v0.1.0 operations under their canonical aLib names:

* 5 arithmetic: add, subtract, multiply, divide, modulo
* 6 comparison: less_than, greater_than, equal, not_equal,
  less_equal, greater_equal
* 3 logical:    and, or, not
* 3 string:     concat, length, substring
* 4 collection: map, filter, fold, contains
* 1 conditional: if_then_else

Note the count correction in the roadmap row: was "20", current
aggregate.json v0.1.0 has 22 ops across 6 categories. The signature
of each export matches aLib's `signature_string` field (Number ↦
Int for v0.1.0; a parallel `alib_float` set can be added when
Float-typed test vectors land).

The module wraps existing prelude / builtin operations rather than
re-implementing — `map`/`filter` are written explicitly to avoid
the cross-module visibility quirk (visibility audit pending);
`fold`/`contains` re-export from prelude via aliased import.

Type-checks clean under `affinescript check stdlib/alib.affine`.
Unlocks alib roadmap items #11 (schema loader) and #12 (test-vector
executor).

Closes #416. Refs umbrella #413.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hyperpolymath
hyperpolymath merged commit ac6aaae into main May 28, 2026
21 of 23 checks passed
@hyperpolymath
hyperpolymath deleted the feat/alib-conformance-module branch May 28, 2026 11:16
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 81 issues detected

Severity Count
🔴 Critical 4
🟠 High 10
🟡 Medium 67

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "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": "Issue in affine-vscode-publish.yml",
    "type": "unknown",
    "file": "affine-vscode-publish.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "unknown",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "unknown",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in ci.yml",
    "type": "unknown",
    "file": "ci.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

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

1 participant