fix(codegen): emit the declared cgi identity — it was searched for in a list that cannot contain it #89
Open
tim.lingo
wants to merge 1 commits from
fix/cgi-identity-emission-clean into dev
pull from: fix/cgi-identity-emission-clean
merge into: :dev
:main
:feat/engram-reseed-route
:feat/el-route-decorators
:test/dev-ci-baseline
:fix/cgi-identity-emission-clean
:fix/cgi-identity-emission
:dev
:feat/AddingReadme
:stage
:reconcile/el-cluster-windows-runtime
:fix/durable-response-truncation
:fix/engram-lexical-tokenized-search
:fix/http-fs-read-len
:hotfix/ci-stage-main-publish-hardening
:hotfix/ci-dev-publish-hardening
:hotfix/stage-elc-engram-integration
:feat/ranked-engram-search
:hotfix/win-runtime-portability
:hotfix/runtime-engram-get-node-by-label
:feat/engram-semantic-search
:hotfix/elc-fixes
:hotfix/el-runtime-leak-and-persist
:integrate/local-main-commits
:fix/runtime-load-merge-2026-06-30
:fix/windows-rusage-guard
:fix/http-response-truncation
:salvage/tim-wip-presync-20260625
:feat/windows-el-runtime
:feat/accumulation-layer
:fix/runtime-integrity-reconcile
:fix/engram-save-atomic-darwin
:chore/live-darwin-runtime
:feat/wm-api-and-http-serve-async
:fix/engram-node-full-field-corruption
:fix/llm-model-and-utf8
:fix/elb-monolithic-link
:fix/ci-gcloud-install-order
:fix/native-test-precompile-runtime
:fix/ci-base-dev-first-run
:fix/elc-parser-elb-build
:fix/elc-oom-checkout
:fix/css-str-join-separator
:fix/html-template-if-style-script
:fix/elb-gcc-bracket-depth
:fix/ci-openssl-linker
:feat/ci-hook-test
:feat/native-testing
:runtime/integrate
:fix/http-serve-1-arg-compat
:feat/el-html-templates
:feat/js-browser-runtime
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "fix/cgi-identity-emission-clean"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Retargeted from main to dev: the release workflow enforces 'main <- stage only', so this follows the repo's promotion chain dev -> stage -> main. Same head commit as #88.
A cgi block declares an agent's compound identity (name, dharma_id, principal, network, engram). None of it reached the compiled output. Every binary built with this compiler carried no declared identity — which is what IDPROTO claims 1-2 require it to carry.
THE BUG: a cgi block is a top-level declaration, so codegen_streaming classifies it with is_top_level_decl and releases it. The identity emission then searched toplevel_exec_stmts for that same block — a list declarations are excluded from by construction. The search could never succeed. The code documented its own false assumption ('cgi blocks are rare and small, they end up in toplevel_exec_stmts') and emitted nothing, silently, with no diagnostic on any channel.
THE FIX: capture the cgi fields before el_release(stmt); emit from the captured locals instead of searching that list.
DISCRIMINATING PROOF (same source, both compilers):
pre-fix elc -> el_cgi_init calls: 0, identity strings: 0
fixed elc -> el_cgi_init calls: 1, identity strings: 1, all five fields present
A soul built with this compiler and deployed on the operator machine prints its identity as its first startup line; the string is present in the binary and was absent in every prior build.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
A cgi block is a top-level declaration, so codegen_streaming classifies it via is_top_level_decl and releases it. The identity emission then searched toplevel_exec_stmts for that same block. Declarations are excluded from that list by construction, so the search could never succeed. A probe printed what it actually saw for a program whose first statement is a cgi block: [Let, Expr]. It emitted nothing, silently, with no diagnostic on any channel. The code documented its own assumption — 'Since cgi blocks are rare and small, they end up in toplevel_exec_stmts' — and that assumption was false. Capture the declared values before the release and emit from them. The search is deleted rather than repaired, so the failure mode is removed rather than relocated. Proven discriminating (old fails, new passes): minimal cgi program, old -> 0 el_cgi_init minimal cgi program, fixed -> el_cgi_init with all four declared values neuron soul, fixed -> principal present in the compiled binary (0 before), boots in 2s, interface 110 routes in / 110 out Consequence: a binary now carries its declared identity as a compiled constant, which is what the identity protocol requires. Whether the runtime surfaces it to state_get("soul_principal") is unverified and separate. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>BLOCKED BY #91, not by this change.
An empty commit against dev (PR #90) also fails — run 3798, red after 12m14s. dev CI is broken independent of any change.
Locally, in the workflow's own image: dev head and dev+this-branch produce byte-identical test output. Both build the self-hosted compiler and elb; both fail the same three timezone tests. This PR alters nothing the workflow exercises.
Holding here until #91 is fixed. The change itself is deployed and verified on the operator machine: the soul built with this compiler prints its declared identity as its first startup line and carries the principal string in the binary (0 -> 1).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.