stdlib: add extern binding modules for Grammy, Sqlite, Network, Crypto, Ajv#100
Merged
Conversation
…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
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
extern type/extern fndeclarations not parseable in user source #42 (\�xtern type\ / \�xtern fn\ parsing) — CLOSEDModules added
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