Skip to content

feat(stdlib): ESC-02 — portable Json primitive (stdlib/json.affine) - #273

Merged
hyperpolymath merged 1 commit into
mainfrom
esc02-stdlib-json
May 19, 2026
Merged

feat(stdlib): ESC-02 — portable Json primitive (stdlib/json.affine)#273
hyperpolymath merged 1 commit into
mainfrom
esc02-stdlib-json

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Closes the #229 JSON.t target / STDLIB-02 #161 / ESC-02 #246.

stdlib/json.affine — pure recursive Json ADT
(JNull|JBool|JInt|JFloat|JString|JArray|JObject([(String,Json)])) +
encode_*/decode_*/get_field/escape_string/stringify. module json;, prelude+string only, no host dep — target-agnostic. JSON.t
json::Json.

String→Json parse is deliberately the typed Http-boundary bridge
(ADR-018: typed extern is the host bridge; stdlib/Http.affine spine
note puts parse at Response.json), not a hand-rolled stdlib parser.

Recovered from the stranded feat/stdlib-json-echidna63 draft (whose
branch diff is destructive — only the file is sound). Validated on
current main: check json.affine → Type checking passed; #136 AOT gate
auto-discovered it (AOT json.affine [OK]); gate 278→279, zero
regression
. Refs #161 #246 #229 (not Closes — Http-boundary parse
bridge tracked in #161).

🤖 Generated with Claude Code

stdlib/json.affine: pure, target-agnostic, self-contained JSON value
type + combinators — pub type Json = JNull | JBool | JInt | JFloat |
JString | JArray([Json]) | JObject([(String,Json)]) plus
encode_*/decode_*/get_field/escape_string/stringify. `module json;`,
uses prelude + string only; no host dependency. The #229 JSON.t target
ports to json::Json.

String->Json parse is deliberately NOT a hand-rolled stdlib parser: per
ADR-018 the host bridge is typed extern, and the spine note in
stdlib/Http.affine puts the parse at the Http response boundary
(Response.json) where the host fetch result crosses in — tracked there.

Recovered from the stranded feat/stdlib-json-echidna63 draft (that
branch's full diff is destructive — deletes #248 estate-rs-audit data +
wit/; only the json.affine FILE is sound). Extracted, validated on
current main: main check json.affine -> Type checking passed; the #136
stdlib AOT gate auto-discovered it (AOT json.affine OK); full gate
278 -> 279, zero regression. Refs #161 #246 #229 (not Closes — #161 also
tracks the Http-boundary parse bridge).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 47 issues detected

Severity Count
🔴 Critical 12
🟠 High 21
🟡 Medium 14

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Stray AI.a2ml in root -- use 0-AI-MANIFEST.a2ml only",
    "type": "banned",
    "file": "AI.a2ml",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "high"
  },
  {
    "reason": "Superseded by 0-AI-MANIFEST.a2ml",
    "type": "banned",
    "file": "AI.djot",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "high"
  },
  {
    "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/checkout@v4 needs attention",
    "type": "unpinned_action",
    "file": "publish-jsr.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action denoland/setup-deno@v2 needs attention",
    "type": "unpinned_action",
    "file": "publish-jsr.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/example/smoke_driver.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/cli.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath merged commit adb177b into main May 19, 2026
15 of 16 checks passed
@hyperpolymath
hyperpolymath deleted the esc02-stdlib-json branch May 19, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant