Files
scriptc/tests/library-mode/teach/profile.json
Chris Tate e1f93475cb Deliver runtime-detected library traps structured, with codes, entry symbols, and profile overlays
- The library trap funnel (scr_library.c) now assembles every detected trap into the ratified 0x01 text 0x1F code 0x1F symbol [0x1F remediation] form: the baseline human line rides unchanged as field 0, and 0x01-led messages (facade-authored throws, the compile-time SC4012 contract trap) still pass verbatim.
- Trap kinds classify over the runtime's own message conventions into a new SC4013-SC4019 runtime code family (escaped exception, range, type, syntax, OOM, internal invariant, residual), documented beside SC4012 in the diagnostics registry; no arithmetic kind exists because no runtime site can fire one.
- Every generated entry prologue (init, reset, collect, each export, both emissions) records its external symbol in a SCR_LIB-only static slot the funnel reads, so the structured message names the trapping entry as the host linked it; profile teachings/remediations for the family land as a program-TU overlay table both backends emit identically.
- K5/K7/init-trap fixtures now pin the structured layout with the spec's parse rule (default text, code, entry symbol, fields=3 on a no-teachings profile), and new K12 tests pin the SC4014 teaching/remediation overlay plus the undeclared-code default; the verbatim and text-leads-printable pins stay.
- The default executable lane is byte-identical (signature-stripped cmp over a stash/rebuild pair); all library suites and the diagnostics suite are green on both emissions.
2026-07-23 19:57:38 -05:00

31 lines
1.2 KiB
JSON

{
"profile_format": 1,
"name": "conformance-teach",
"entry": "lib.ts",
"emission": "llvm",
"abi": {
"prefix": "kv_",
"init_symbol": "kv_init",
"sink_register_symbol": "kv_set_panic_sink",
"collect_symbol": null,
"result_reset_symbol": null
},
"exports": [
{ "export": "wrap", "symbol": "kv_wrap", "params": ["bytes"], "returns": "f64" },
{ "export": "teach", "symbol": "kv_teach", "params": [], "returns": "f64" },
{ "export": "teachStr", "symbol": "kv_teach_str", "params": [], "returns": "f64" },
{ "export": "boomRuntime", "symbol": "kv_boom_runtime", "params": ["f64"], "returns": "f64" },
{ "export": "failRuntime", "symbol": "kv_fail_runtime", "params": [], "returns": "f64" }
],
"determinism": {
"teachings": {
"SC4012": "inbound bytes length does not fit the marshalling class — the host and this library disagree about the call contract\n",
"SC4014": "this core read past the end of a collection — an index the embedding fed it does not exist\n"
},
"remediations": {
"SC4012": "pass the buffer's true byte length; lengths must stay below 2^53",
"SC4014": "clamp indices to the collection's length before calling into the core"
}
}
}