routes: @route dispatch conversion + latent Bool/String crash fixes + soul.c regen #151

Closed
will.anderson wants to merge 0 commits from el-route-decorators into main
Owner

Convert routes.el from ~89 hand-written dispatch branches to 75 @route-decorated handlers with VBD roles (@manager/@accessor/@utility), driven by the modular compiler @route dispatch (el PR feat/el-route-decorators). routes.elh updated.

Latent bugs fixed (surfaced because the modular compiler, unlike the old inlining compiler, faithfully emits every source statement per-module):

  • safety.el: malformed soft-phrases literal (extra unescaped quote)
  • sessions.el: str_replace quote arg + topic_tags JSON escaping
  • memory.el mem_save / neuron-api.el consolidate: engram_save returns a Bool, not a String; str_eq(result, "") dereferenced the Bool (0x1) as a char*, segfaulting the awareness loop on boot and POST /api/neuron/consolidate. Now checked as Bool (if !save_result). The old compiler dropped these checks, masking the bug in shipped dist/soul.c.

dist/soul.c regenerated through the bounded per-module path (modular elc per module + amalgamation embedding dist/elp-c-decls.h), never by folding soul.el through elc (27GB OOM).

Verified on a throwaway snapshot/port (live untouched): boots with awareness active and no segfault; @route dispatch matches the manual dispatcher on all sampled routes + the 4 hazard pairs (distinct, non-shadowing); consolidate returns 200 instead of segfaulting.

NOTE: pushed to top-level branch el-route-decorators because refs/heads/feat/* is blocked server-side (permission denied on the ref lock) on this repo.

Base main. Review only, do not merge.

Convert routes.el from ~89 hand-written dispatch branches to 75 @route-decorated handlers with VBD roles (@manager/@accessor/@utility), driven by the modular compiler @route dispatch (el PR feat/el-route-decorators). routes.elh updated. Latent bugs fixed (surfaced because the modular compiler, unlike the old inlining compiler, faithfully emits every source statement per-module): - safety.el: malformed soft-phrases literal (extra unescaped quote) - sessions.el: str_replace quote arg + topic_tags JSON escaping - memory.el mem_save / neuron-api.el consolidate: engram_save returns a Bool, not a String; str_eq(result, "") dereferenced the Bool (0x1) as a char*, segfaulting the awareness loop on boot and POST /api/neuron/consolidate. Now checked as Bool (if !save_result). The old compiler dropped these checks, masking the bug in shipped dist/soul.c. dist/soul.c regenerated through the bounded per-module path (modular elc per module + amalgamation embedding dist/elp-c-decls.h), never by folding soul.el through elc (27GB OOM). Verified on a throwaway snapshot/port (live untouched): boots with awareness active and no segfault; @route dispatch matches the manual dispatcher on all sampled routes + the 4 hazard pairs (distinct, non-shadowing); consolidate returns 200 instead of segfaulting. NOTE: pushed to top-level branch el-route-decorators because refs/heads/feat/* is blocked server-side (permission denied on the ref lock) on this repo. Base main. Review only, do not merge.
will.anderson added 1 commit 2026-08-10 22:55:11 +00:00
routes: convert manual dispatch to @route + fix latent Bool/String crashes
Neuron Soul CI / build (pull_request) Failing after 45s
Neuron Soul CI / deploy (pull_request) Failing after 10m28s
a5f411e739
Convert routes.el from ~89 hand-written dispatch branches to 75 @route-decorated
handlers with VBD roles (@manager/@accessor/@utility), driven by the modular
compiler's native @route dispatch. routes.elh updated to match.

Fix four latent bugs that the modular compiler surfaces (unlike the old inlining
compiler, it faithfully emits every source statement, so per-module compilation
no longer silently drops code):
  - safety.el: malformed soft-phrases literal (extra unescaped quote)
  - sessions.el: str_replace quote arg + topic_tags JSON escaping
  - memory.el mem_save and neuron-api.el consolidate: engram_save returns a Bool,
    not a String; str_eq(result, "") dereferenced the Bool value (0x1) as a char*,
    segfaulting the awareness loop on boot and POST /api/neuron/consolidate.
    Check it as a Bool (if !save_result). The old compiler dropped these checks,
    masking the bug in the shipped dist/soul.c.

Regenerate dist/soul.c through the bounded per-module path (modular elc per module
plus amalgamation that embeds dist/elp-c-decls.h), never by folding soul.el through
elc (27GB OOM). Verified on a throwaway snapshot and port: boots with the awareness
loop active and no segfault, @route dispatch matches the manual dispatcher across
all sampled routes and the four shadowing-hazard pairs, and consolidate returns 200.
will.anderson closed this pull request 2026-08-15 23:46:48 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.