Skip to content

playground: implement source so just dev/test/probability work (#6)#15

Merged
hyperpolymath merged 2 commits into
mainfrom
fix/playground-source-issue-6
May 16, 2026
Merged

playground: implement source so just dev/test/probability work (#6)#15
hyperpolymath merged 2 commits into
mainfrom
fix/playground-source-issue-6

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Closes #6

playground/ had its toolchain in place but src//test/ were empty, so every runnable recipe failed.

What this adds

File Purpose
src/ternary.ts Kleene 3-valued core (T/F/U): not/and/or/implies + lazy (bet A B C). AND/OR match the truth table documented in the Justfile.
src/probability.ts betWeighted, betConditional, seeded rng (mulberry32), expectation.
src/main.ts just dev / deno task dev entry point.
examples/uncertainty.ts just uncertainty — interval + Gaussian number-tower sample; comparison returns U on overlap.
test/ternary_test.ts, test/probability_test.ts 10 Deno tests.

Verification

  • just test10 passed | 0 failed (was a no-op)
  • just dev / just ternary-demo / just probability / just uncertainty → all run
  • deno check, deno fmt --check, deno lint → clean

🤖 Generated with Claude Code

hyperpolymath and others added 2 commits May 17, 2026 00:18
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>
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 53 issues detected

Severity Count
🔴 Critical 9
🟠 High 16
🟡 Medium 28

⚠️ Action Required: Critical security issues found!

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

@hyperpolymath hyperpolymath merged commit 646bc29 into main May 16, 2026
20 of 31 checks passed
@hyperpolymath hyperpolymath deleted the fix/playground-source-issue-6 branch May 16, 2026 23:53
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.

playground/ is scaffolded but has no source — just dev/just test/just probability all fail

1 participant