playground: implement source so just dev/test/probability work (#6)#15
Merged
Conversation
The playground/ had its toolchain (Justfile, deno.json, rescript.json) but
empty src/ test/ — every runnable recipe failed. Add a faithful TypeScript
realisation of BetLang's core:
- src/ternary.ts — Kleene 3-valued logic (T/F/U) + lazy (bet A B C);
AND/OR match the table documented in the Justfile
- src/probability.ts — bet/weighted, bet_conditional, seeded RNG, expectation
- src/main.ts — dev entry point wiring both demos
- examples/uncertainty.ts — interval + Gaussian number-tower sample
- test/*_test.ts — 10 Deno tests (truth tables, De Morgan, laziness,
weighted-draw tolerance, EV convergence)
just dev/test/test-verbose/ternary-demo/probability/uncertainty now all run;
deno check + fmt + lint clean; test is no longer a no-op (10 passed).
Closes #6
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Matches the convention in the canonical standards repo (tracks deno.lock). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 53 issues detected
View findings[
{
"reason": "Merge artifact in root",
"type": "stale",
"file": "SPEC.core.scm.orig",
"action": "delete",
"rule_module": "root_hygiene",
"severity": "medium"
},
{
"reason": "No permissions declaration -- add permissions: read-all",
"type": "missing_permissions",
"file": "comprehensive-quality.yml",
"action": "add_permissions",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/betlang/betlang/playground/src/main.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/betlang/betlang/playground/src/probability.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/betlang/betlang/playground/src/ternary.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/betlang/betlang/playground/test/probability_test.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/betlang/betlang/playground/test/ternary_test.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "TypeScript file detected -- banned language",
"type": "banned_language_file",
"file": "/home/runner/work/betlang/betlang/playground/examples/uncertainty.ts",
"action": "flag",
"rule_module": "cicd_rules",
"severity": "critical"
},
{
"reason": "Atom creation from untrusted input may exhaust atom table (1 occurrences, CWE-400)",
"type": "erlang_atom_from_untrusted",
"file": "/home/runner/work/betlang/betlang/lsp/bet-lsp/build/packages/thoas/src/thoas_decode.erl",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "Atom creation from untrusted input may exhaust atom table (1 occurrences, CWE-400)",
"type": "erlang_atom_from_untrusted",
"file": "/home/runner/work/betlang/betlang/lsp/bet-lsp/build/packages/gleam_erlang/src/gleam@erlang@process.erl",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
}
]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.
Closes #6
playground/had its toolchain in place butsrc//test/were empty, so every runnable recipe failed.What this adds
src/ternary.tsnot/and/or/implies+ lazy(bet A B C). AND/OR match the truth table documented in the Justfile.src/probability.tsbetWeighted,betConditional, seededrng(mulberry32),expectation.src/main.tsjust dev/deno task deventry point.examples/uncertainty.tsjust uncertainty— interval + Gaussian number-tower sample; comparison returnsUon overlap.test/ternary_test.ts,test/probability_test.tsVerification
just test→ 10 passed | 0 failed (was a no-op)just dev/just ternary-demo/just probability/just uncertainty→ all rundeno check,deno fmt --check,deno lint→ clean🤖 Generated with Claude Code