Skip to content

stdlib: add extern binding modules for Grammy, Sqlite, Network, Crypto, Ajv#100

Merged
hyperpolymath merged 1 commit into
mainfrom
feat/stdlib-extern-bindings
May 11, 2026
Merged

stdlib: add extern binding modules for Grammy, Sqlite, Network, Crypto, Ajv#100
hyperpolymath merged 1 commit into
mainfrom
feat/stdlib-extern-bindings

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Adds five new \stdlib/*.affine\ extern-binding modules, completing acceptance criterion 3 of issue #65 (port telegram bot + axel-protocol tests to .affine once #35 + #42 land).

Both blockers are now closed:

Modules added

File Purpose
\stdlib/Grammy.affine\ Grammy Telegram Bot framework bindings
\stdlib/Sqlite.affine\ SQLite database bindings (Deno sqlite / node:sqlite)
\stdlib/Network.affine\ Synchronous HTTP bindings
\stdlib/Crypto.affine\ Cryptographic primitives + \ ime_ms()\
\stdlib/Ajv.affine\ AJV v8 JSON Schema Validator bindings

All follow the pattern established by \stdlib/Vscode.affine\ (Phase 2 of #35): \pub extern type\ for opaque handles, \pub extern fn\ for host-provided operations. The Node-CJS shim populates the import table at runtime.

Test plan

🤖 Generated with Claude Code

…o, Ajv

These five modules provide the extern type and extern fn declarations
needed by avow-protocol/telegram-bot and axel-protocol in hyperpolymath/standards
to complete the TS->AffineScript port tracked in issue #65.

Grammy: Telegram bot (Grammy framework) bindings
Sqlite: SQLite database bindings
Network: synchronous HTTP bindings
Crypto: cryptographic primitives + wall-clock time
Ajv: AJV v8 JSON Schema Validator bindings

All follow the established pattern from stdlib/Vscode.affine (issue #35 Phase 2).
Each module declares pub extern type / pub extern fn; the Node-CJS shim
populates the import table at runtime.

Part of: #65 acceptance criterion 3
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit 1ce4261 into main May 11, 2026
17 of 21 checks passed
hyperpolymath added a commit to hyperpolymath/standards that referenced this pull request May 11, 2026
…ript (#45)

## Summary

Closes hyperpolymath/affinescript#65.

Ports all TypeScript and ReScript files identified in the TS-elimination
audit (2026-05-02, recommendation #9) to AffineScript. Both blocking
issues are now closed: affinescript#35 (Node-CJS backend) and
affinescript#42 (\�xtern type\ / \�xtern fn\ parsing).

### Files changed

**Added (AffineScript ports):**
- \�vow-protocol/telegram-bot/avow-telegram-bot/src/stamp-mock.affine\ —
STAMP mock verification library
- \�vow-protocol/telegram-bot/avow-telegram-bot/src/database.affine\ —
SQLite database layer
- \�vow-protocol/telegram-bot/avow-telegram-bot/src/bot.affine\ — Grammy
Telegram bot
- \�vow-protocol/telegram-bot/avow-telegram-bot/test-mock.affine\ —
stamp-mock tests (self-contained, deno-test harness)
- \�xel-protocol/src/AxelSts.affine\ — Native DNS TXT record parser
(replaces AxelSts.res)
- \�xel-protocol/test/axel-sts_test.affine\ — Parser tests
(self-contained, deno-test harness)
- \�xel-protocol/test/validate-policy.affine\ — Policy schema validation
script
- \�xel-protocol/test/validate-policy_test.affine\ — Policy schema tests

**Deleted:**
-
\�vow-protocol/telegram-bot/avow-telegram-bot/src/{bot,database,stamp-mock}.ts\
- \�vow-protocol/telegram-bot/avow-telegram-bot/test-mock.ts\
- \�xel-protocol/src/AxelSts.res\ + \AxelSts.res.js\
-
\�xel-protocol/test/{axel-sts_test,validate-policy,validate-policy_test}.ts\

### Extern stdlib modules

\�ot.affine\, \database.affine\, \ alidate-policy*.affine\ depend on
extern binding modules added in companion PR
hyperpolymath/affinescript#100 (Grammy, Sqlite, Network, Crypto, Ajv).
Merge that PR first.

### Test plan

- [ ] \�ffinescript-deno-test\ passes for \ est-mock.affine\ and
\�xel-sts_test.affine\ (self-contained, no extern deps beyond builtins)
- [ ] \�ot.affine\ + \database.affine\ compile with \�ffinescript check
--target node-cjs\
- [ ] \ alidate-policy.affine\ compiles with \�ffinescript check
--target node-cjs\
- [ ] Language policy CI: no \.ts\ or \.res\ files remain in the ported
directories
- [ ] Companion stdlib PR (affinescript#100) merged before this one

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

[Ecosystem] Port telegram bot + axel-protocol tests to .affine once #35 + #42 land

1 participant