jolt/test/unit
Yogthos fbca0890f5 Refactor phase 4: lift run-mode into config.janet + fix the cache-key footgun
main.janet held ~45 lines of env-knob policy (open-mode / direct-link / optimize
/ shapes / whole-program gates) that couldn't be unit-tested without the CLI, and
two disk-image caches (api/init-cached, main/deps-image) each hand-built a
POSITIONAL "%q|%q|..." key that silently misaligned if a ctx-shaping knob was
added in only one place.

config.janet now owns:
  ctx-shaping-env-vars  the canonical list of env vars that shape the built ctx
  ctx-cache-key         a labeled key (name=value) over a prefix + every shaping
                        var, so adding a knob updates BOTH cache keys at once and
                        can't positionally alias two different builds
  resolve-run-mode      [open-mode? main-entry?] -> the ctx env knob map

main shrinks to: compute open-mode?/main-entry? from argv, call resolve-run-mode,
install the knobs. Both deps-image-path (main) and image-cache-path (api) build
their keys via ctx-cache-key. New test/unit/config-test.janet locks in the
run-mode cases and asserts every ctx-shaping env var participates in the key.

Scope: this is 4a + the 4b cache-key footgun fix. The optional 4b cleanup
(folding the load/save image dance + aot marshal helpers into one ctx_image
module) is left for a follow-up — it's lower value and higher blast radius.

No behavior change (cache keys now key on a superset of env vars, so at worst a
one-time cold rebuild). Gate green: conformance 355x3, clojure-test-suite 4718
pass (>= 4695 baseline), config-test, full jpm test exit 0.
2026-06-15 03:15:24 -04:00
..
compile-fallback-test.janet core: AOT context image — init-cached recovers the bootstrap cost across processes 2026-06-10 13:57:37 -04:00
config-test.janet Refactor phase 4: lift run-mode into config.janet + fix the cache-key footgun 2026-06-15 03:15:24 -04:00
eval-test.janet core: AOT context image — init-cached recovers the bootstrap cost across processes 2026-06-10 13:57:37 -04:00
evaluator-test.janet core: AOT context image — init-cached recovers the bootstrap cost across processes 2026-06-10 13:57:37 -04:00
interop-test.janet core: AOT context image — init-cached recovers the bootstrap cost across processes 2026-06-10 13:57:37 -04:00
lazy-seq-test.janet core: AOT context image — init-cached recovers the bootstrap cost across processes 2026-06-10 13:57:37 -04:00
macro-test.janet test: restructure into unit / integration / spec layers + shared harness 2026-06-05 00:00:16 -04:00
persistent-map-test.janet phm: grow the bucket array past load factor 2 (map-read 4.5x recovery) 2026-06-10 17:06:03 -04:00
reader-test.janet Protocol/interop fixes to run metosin/malli (jolt-ltwk) (#105) 2026-06-15 03:20:33 +00:00
types-test.janet Compiler research (#10) 2026-06-09 07:30:25 +08:00