test(abi,ffi): port TypeScript test suite to Idris2 + Zig; purge wokelangiser#25
Merged
Merged
Conversation
wokelangiser is a GDPR/CCPA/accessibility/i18n compliance tool. Its
manifest here was pointed at the wider estate (rescript-ecosystem,
flat-mate, echidna, neural-foundations) — none of those are gossamer
code, and the 6.9MB compliance report + 689KB generated consent gates
were dead bytes inflating the Linguist JavaScript share to 86%.
Removals:
- wokelangiser.toml (estate-scope config)
- generated/wokelangiser/ (consent gates, banner, compliance report)
- .gitignore exception lines for the above
Linguist:
- generated/** now linguist-generated (covers the legitimate tlaiser
TLA+ specs and any future generator output)
No build / CI impact — Justfile, container/, and .github/workflows had
no references to wokelangiser.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
First phase of replacing tests/*.ts (Deno-FFI tests) with native Idris2
tests against the gossamer-abi package. Goal: eliminate TypeScript from
the gossamer tree per the language-rule split (Idris2 = ABI tests,
Zig = FFI/e2e/bench tests, no TS/JS).
Tests added (107 cases, all green):
- ResultCodeTest (35) — Result enum, resultToInt/FromInt round-trip,
errorDescription, GuardMode, Platform
- GuardModeTest (38) — GuardMode enum, requireOpen / requireUnguarded,
window-constraint validation, async IPC slots
- CapabilityTest (17) — grant / check / revoke / resourceKind /
activeCount lifecycle
- IPCTest (17) — IPC channel open / bind / dispatch / close,
message routing, command-name validation
Test infrastructure:
- tests/idris2/Test/Spec.idr minimal harness (assertEq, assertNotEq,
assertTrue, allPass, runTestSuite, runTests)
- tests/idris2/Main.idr aggregating runner — append new suites here
- gossamer-abi-tests.ipkg depends on installed gossamer-abi package
- Justfile `test-abi` target wired into `just test`
Idris2 toolchain note: the installed idris2 has a stale baked-in prefix
(.asdf/...), so test-abi recomputes IDRIS2_PREFIX from the binary path.
Remaining ports (TS files still on disk, not yet eliminated):
- tests/property/contracts_test.ts → Idris2
- tests/aspect/security_test.ts → Idris2
- tests/unit/dialog_test.ts → Zig
- tests/e2e/webview_lifecycle_test.ts → Zig
- tests/bench/{gossamer,startup}_bench.ts → Zig
After all ports land, tests/*.ts and the deno.json test:* tasks get
deleted in a final cleanup commit.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Phase 2 of the TS-elimination campaign. Adds the remaining 6 ports,
deletes all tests/*.ts files, and removes the Deno test infrastructure.
Idris2 ports added (suites land in gossamer-abi-tests):
- ContractsTest.idr (15 tests) property-style invariants via LCG PRNG
- SecurityTest.idr (25 tests) IPC + shell + FS + webview-title + cap hardening
Zig ports added (under src/interface/ffi/test/):
- dialog_test.zig (17 tests) Dialog mock + filter parser
- webview_lifecycle_test.zig (15 tests) state machine + mocked FFI e2e
- gossamer_bench.zig (24 benches) core ops microbenchmarks
- startup_bench.zig (19 benches) startup-path microbenchmarks
Cleanup:
- Delete all 10 tests/*.ts files + empty subdirs (unit/property/aspect/e2e/bench)
- Delete deno.json (was solely for the TS test runner)
- Update tests/README.adoc to describe the new Idris2 + Zig layout
- Update GETTING-STARTED.md to drop deno bench reference
- Update TEST-NEEDS.md to point at `just test` instead of deno
- Justfile: add `test-zig-unit` (dialog + webview) and `test-zig-bench`
(gossamer_bench + startup_bench with -OReleaseFast)
Final tallies:
Idris2 ABI tests: 147 (across 6 suites, all green)
Zig unit/e2e: 32 (dialog 17 + webview 15, all green)
Zig benchmarks: 43 (gossamer 24 + startup 19, all green)
TypeScript files: 0 (eliminated)
Notes preserved as comments in the ports:
- SecurityTest's HTML sanitiser uses partial helpers (manifestly
terminating but not structurally recursive — Idris2 needs `partial`)
- startup_bench preserves the TS port's 15 result codes (3 more than
Types.idr defines — pre-existing TS drift, benchmark-only so harmless)
- Optimizer DCE makes some bench numbers 0.0 ns/op even with
-OReleaseFast; doNotOptimizeAway used where it mattered
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 31 issues detected
View findings[
{
"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": "Action actions/upload-artifact@v4 needs attention",
"type": "unpinned_action",
"file": "release.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action actions/download-artifact@v4 needs attention",
"type": "unpinned_action",
"file": "release.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
"type": "believe_me",
"file": "/home/runner/work/gossamer/gossamer/src/interface/abi/IPCDispatch.idr",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
"type": "believe_me",
"file": "/home/runner/work/gossamer/gossamer/src/interface/abi/ResourceCleanup.idr",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
"type": "believe_me",
"file": "/home/runner/work/gossamer/gossamer/src/interface/abi/GrooveTermination.idr",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
"type": "believe_me",
"file": "/home/runner/work/gossamer/gossamer/src/interface/abi/HandleLinearity.idr",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
"type": "believe_me",
"file": "/home/runner/work/gossamer/gossamer/src/interface/abi/WindowStateMachine.idr",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
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
Three commits, prepared as one PR because they share one goal — get the gossamer test suite off TypeScript and onto the architecturally-correct languages per the project rule ("Idris2 = ABI only, Zig = FFI/API only, Ephapax = everything else, no TypeScript/JavaScript").
56ca829chore(linguist): purge the wokelangiser footprint (~50k lines of estate-scan output that wasn't relevant to gossamer); addgenerated/** linguist-generatedto .gitattributes so generated content stops skewing language stats.3550f6atest(abi): port 4 unit test suites (result_code, guard_mode, capability, ipc) from TypeScript to Idris2 — they test ABI invariants, so Idris2 is the right home.d927591test(abi,ffi): complete the port — security + contracts → Idris2 (ABI aspect/property), dialog + webview_lifecycle → Zig (FFI), benches → Zig (FFI). Deletedeno.json+ all TS test files.Adds
tests/idris2/Test/Spec.idr— a small homegrown harness (MkTest,assertEq,assertTrue,runTestSuite) because there's no Idris2 BDD framework that fits the ABI-test style. AggregatingMain.idrruns all suites, sums pass/fail, exits non-zero on any failure.Why
The existing TS tests violated the architecture rule and required a Deno runtime in the dev loop that nothing else in gossamer needs. The Idris2 tests live alongside the ABI types they exercise (
src/interface/Gossamer/ABI/*.idr), and the Zig tests live alongside the FFI they exercise (src/interface/ffi/test/*.zig). One toolchain less to maintain.Test plan
gossamer-abi-testsrunner exits 0 with all suites green.just test-abiandjust test-zig-unit/test-zig-benchtargets.Notes
Test.Specis intentionally minimal. If a richer Idris2 test pattern emerges across the estate, it should be lifted intorepos-monorepo/panic-free-tests-and-benchesas a cladistic registry — that's a separate workstream the user has already flagged.test-abi,test-zig-unit,test-zig-benchtargets that handle the IDRIS2_PREFIX resolution + the per-suite Zig commands.proof-debt/standards-131-abi-rescue-wip); replayed onto fresh main here so the test-suite work has its own clean PR independent of any proof-debt commits.🤖 Generated with Claude Code