Skip to content

feat(tea): INT-07 host-side TEA runtime + run loop (Refs #182)#258

Merged
hyperpolymath merged 1 commit into
mainfrom
int07-182-tea-runtime
May 19, 2026
Merged

feat(tea): INT-07 host-side TEA runtime + run loop (Refs #182)#258
hyperpolymath merged 1 commit into
mainfrom
int07-182-tea-runtime

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

INT-07 — host-side TEA runtime + run loop (#182)

lib/tea_bridge.ml defines the TEA runtime ABI, but the
affinescript-tea satellite never existed (the "first slice
scaffolded" claim was aspirational, same pattern as the dom.as stub).

Landed — affinescript-tea/

  • parseTeaLayout() — decodes the affinescript.tea_layout custom section (binary format matched to Tea_bridge.build_tea_layout_section). The runtime is generic over the model, not hard-coded to the demo TitleModel.
  • TeaAppload/init/dispatch/model/setScreen/run. Reuses the INT-02 host-agnostic loader (Deno/Node/browser) + ownership accessor; model() is layout-driven.
  • run({messages, view}) — generic run loop over any (async) iterable of i32 msgs; view(model) after init and each dispatch.
  • Linear-msg invariant enforced host-side: affinescript_update invoked exactly once per dispatch, non-re-entrant — a synchronous host-callback re-entry throws (a second message inside one cycle would violate the linearity affinescript.ownership asserts).

Verification

affinescript-tea/mod_test.js9 Deno tests driving the canonical affinescript tea-bridge module (layout, ownership=Linear msg, init/update arithmetic, setScreen, run loop, non-integer reject, no false lockout) plus a hand-built importing fixture that genuinely exercises the re-entrancy guard. All green. dune test --force 278/278 (no compiler change; zero regression).

INT-01 dependency cleared (#253 merged). Router/navigation runtime is the separate INT-09 (lib/tea_router.ml), out of scope.

Refs #182. Not Closes — owner closes per ISSUE-CLOSURE.

🤖 Generated with Claude Code

`lib/tea_bridge.ml` defines the TEA runtime ABI (exports
affinescript_init / affinescript_update(msg:Linear) / getters /
memory; affinescript.tea_layout + affinescript.ownership custom
sections) but the `affinescript-tea` satellite never existed (the
"first slice scaffolded" claim was aspirational, like dom.as).

New `affinescript-tea/` satellite:
- `parseTeaLayout()` — decodes the `affinescript.tea_layout` section
  (binary fmt matched to Tea_bridge.build_tea_layout_section), so the
  runtime is GENERIC over the model, not hard-coded to the demo
  TitleModel.
- `TeaApp` — load/init/dispatch/model/setScreen/run. Reuses the INT-02
  host-agnostic loader for Deno/Node/browser parity + the ownership
  accessor. `model()` is layout-driven.
- `run({messages, view})` — generic run loop over any (async) iterable
  of i32 msgs; `view(model)` after init and each dispatch.
- Linear-msg invariant enforced host-side: `affinescript_update` called
  exactly once per dispatch, non-re-entrant (a synchronous host-callback
  re-entry throws).

Tests: `affinescript-tea/mod_test.js` — 9 Deno tests driving the
canonical `affinescript tea-bridge` module (layout, ownership=Linear
msg, init/update/setScreen, run loop) + a hand-built importing fixture
that genuinely exercises the re-entrancy guard. All green.

Gate: `dune test --force` 278/278 (no compiler change; zero regression).
INT-01 dep cleared (#253 merged). Router/nav runtime is the separate
INT-09 (`lib/tea_router.ml`), out of scope.

Refs #182. Not Closes — owner closes per ISSUE-CLOSURE.
@hyperpolymath hyperpolymath merged commit abf86e8 into main May 19, 2026
12 of 13 checks passed
@hyperpolymath hyperpolymath deleted the int07-182-tea-runtime branch May 19, 2026 17:17
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 44 issues detected

Severity Count
🔴 Critical 12
🟠 High 21
🟡 Medium 11

⚠️ 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": "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"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-deno-test/lib/compile.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/lib/runner.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

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.

1 participant