Skip to content

migration: 6 integer-brain kernels (wave 2) from string-gated idaptik modules#585

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/cool-keller-gr5sl
Jun 14, 2026
Merged

migration: 6 integer-brain kernels (wave 2) from string-gated idaptik modules#585
hyperpolymath merged 2 commits into
mainfrom
claude/cool-keller-gr5sl

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Migration wave 2 — 6 integer-brain kernels from string-gated idaptik modules

Continues the integer-brain extraction (the C1–C12 pattern: pure-integer decision logic crosses to .affine/wasm; strings/floats/async stay host-side as "senses"). Each kernel is a four-gate deliverable — G1 compile, G2 independent-oracle differential parity, G4 assail-clean — and every one was re-verified by me, not just self-reported by the agent that wrote it:

Kernel Exports Parity
DLCLoader tier_count/clamp/of_number, par_moves, hint_threshold 46/46
CharacterSelectScreen csel_trunc_* / grid placement 161/161
StateDiff change_flag, matches_target, is_mismatch 108/108
InstructionParser min/max/accepts_arg_count, is_parseable_opcode 297/297
Coprocessor_Compute gcd, mod_nonneg, is_prime, fib, pow_clamped, signal, thermal, cablesag, power_* 4839/4839
Coprocessor_Security LCG spine + XOR-fold/checksum bit-arithmetic 1533/1533

All assail-clean (0 findings). Re-decompositions, not transliterations — e.g. CharacterSelectScreen sees only the length Int (the string stays host-side), InstructionParser reuses the canonical VmInstruction 0..22 opcode band (text parse host-side), Coprocessor_Security's LCG models i32 wraparound with Math.imul/|0 in its independent oracle.

NO_NEW_BRAINS this wave (honest non-results): GossamerFs (%raw IPC senses), KernelMonitor (already covered by the uirenderlogic cross-cutting coprocessor), SafeJson (pure JSON-text parsing — no integer core).

A 7th kernel (Moletaire) is still extracting and will be added to this branch when verified.

https://claude.ai/code/session_01WoKhFQePiRsAj7aqnxbG8s


Generated by Claude Code

claude added 2 commits June 14, 2026 01:44
… modules

Each a four-gate deliverable (G1 compile, G2 independent-oracle parity,
G4 assail-clean), all re-verified by the parent (not just self-reported):

- DLCLoader (46/46): tier 0..4 band fold + absent/explicit flag selects;
  completes the pre-existing DLCLoaderCoprocessorBridge.js contract.
- CharacterSelectScreen (161/161): card-desc truncation over the length
  Int (string stays host-side) + integer card-grid placement.
- StateDiff (108/108): per-variable change/mismatch classification;
  option<int> lowered to a (present,value) i32 pair.
- InstructionParser (297/297): opcode->operand-arity validation over the
  canonical VmInstruction 0..22 band (text parse stays host-side).
- Coprocessor_Compute (4839/4839): gcd/mod_nonneg/is_prime/fib/pow_clamped
  + signal/thermal/cablesag/power scalar kernels (is_prime via d*d<=n;
  pow saturating at 2^30-1).
- Coprocessor_Security (1533/1533): the Numerical-Recipes LCG generator
  spine + XOR-fold/checksum bit-arithmetic (Math.imul/|0 i32 oracle).

NO_NEW_BRAINS this wave: GossamerFs (%raw IPC senses), KernelMonitor
(already in the uirenderlogic coprocessor), SafeJson (pure JSON-text
parsing). Re-decomposition kept all strings/floats/async host-side; no
string subscript / string == in any brain.

https://claude.ai/code/session_01WoKhFQePiRsAj7aqnxbG8s
The companion-AI behaviour brain from Moletaire.res (1317 LOC) + its
MoletaireCoprocessors/MoletaireHunger helpers: 60 pure-Int exports — the
11-state machine + transitions, equipment/level/behaviour taxonomies as
closed integer bands, the 5 coprocessor effect ladders, order gates,
carry capacity, item-eat roll, and the hunger system (classifier, rate,
gravity-pull, colour/display bands, objective-risk predicates).
G2 2027/2027, G4 clean.

ABI note recorded by the agent (useful for future brains): AffineScript
Int is i32 in the wasm ABI, so the two float-derived kernels were
rescaled to keep every intermediate under 2^31 (fold /1000 after each
milli-factor; gravity pull takes plain px^2 not milli-px^2), verified
bit-identical to BigInt references before wiring the oracles.

NO_NEW_BRAINS: MoletaireMusic (Web-Audio synthesis sense — float
note-frequency arrays + %raw AudioContext, only a bare mod(step,16)).

https://claude.ai/code/session_01WoKhFQePiRsAj7aqnxbG8s
@hyperpolymath hyperpolymath marked this pull request as ready for review June 14, 2026 01:47
@hyperpolymath hyperpolymath merged commit 76ff88b into main Jun 14, 2026
27 checks passed
@hyperpolymath hyperpolymath deleted the claude/cool-keller-gr5sl branch June 14, 2026 01:47
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 40 issues detected

Severity Count
🔴 Critical 2
🟠 High 22
🟡 Medium 16

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "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": "Issue in scorecard-enforcer.yml",
    "type": "scorecard_publish_with_run_step",
    "file": "scorecard-enforcer.yml",
    "action": "split_scorecard_publish_job",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in instant-sync.yml",
    "type": "secret_action_without_presence_gate",
    "file": "instant-sync.yml",
    "action": "peter-evans/repository-dispatch",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Shell execution -- validate input before passing to shell (1 occurrences, CWE-78)",
    "type": "js_exec_sync",
    "file": "/home/runner/work/affinescript/affinescript/packages/affinescript-cli/mod.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "Shell execution -- validate input before passing to shell (2 occurrences, CWE-78)",
    "type": "js_exec_sync",
    "file": "/home/runner/work/affinescript/affinescript/packages/affine-vscode/mod.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "Shell execution -- validate input before passing to shell (1 occurrences, CWE-78)",
    "type": "js_exec_sync",
    "file": "/home/runner/work/affinescript/affinescript/affinescript-vite/src/affine-plugin-improved.js",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "expect() in hot path (32 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/affinescript/affinescript/affinescriptiser/src/codegen/wasm_gen.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "expect() in hot path (29 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/affinescript/affinescript/affinescriptiser/src/codegen/affine_gen.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "unsafe block -- requires SAFETY comment (2 occurrences, CWE-676)",
    "type": "unsafe_block",
    "file": "/home/runner/work/affinescript/affinescript/runtime/src/panic.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "unsafe block -- requires SAFETY comment (1 occurrences, CWE-676)",
    "type": "unsafe_block",
    "file": "/home/runner/work/affinescript/affinescript/runtime/src/alloc.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  }
]

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.

2 participants