Archived
runtime: durable fix for HTTP response truncation (both runtimes) — unblocks Windows brain #79
Closed
will.anderson
wants to merge 0 commits from
fix/durable-response-truncation into main
pull from: fix/durable-response-truncation
merge into: :main
:main
:stage
:dev
:fix/runtime-stack-on-dev
:fix/runtime-growth-guard
:fix/runtime-shim-retire
:fix/runtime-extract-text
:feat/el-speaks
:wire/write-realizes-signal
:fix/singleton-guards-the-state
:fix/transduce-decomposition
:design/correspondence-and-censorship
:docs/correspondence-and-ownership-2026-08-16
:fix/geometry-readable
:docs/builtin-recipe-gate
:fix/sigpipe
:feat/grounding-gradient
:fix/utf8-truncation
:fix/ground-echo-and-self
:fix/think-stance
:fix/cross-cutting-concerns
:feat/el-geometry-transduce
:fix/awareness-thread-engram-race
:fix/think-anchor
:fix/geometry-ingest
:fix/state-get-leak
:wt/soul-runtime-reconcile
:fix/bool-is-int-like
:fix/eq-operand-inference
:fix/missing-import-is-an-error
:feat/alloc-accounting-containers
:fix/math-log-base10
:fix/compiler-quadratic-strlen
:feat/alloc-accounting
:fix/elc-rebuildable-compiler-builtins
:fix/engram-query-param-and-seed-link
:merge-pr103-v2
:merge-swarm-ccr-v2
:feat/engram-ggml-cosine-batch
:improve/ggml-cosine-fp32-and-init
:fix/nsbx-tooling-hardening
:feat/transduce-unify
:fix/engram-search-latency-reconciled
:feat/engram-metal-cosine-batch
:feat/reframe-region-setop
:worktree-agent-a1bb8ac67d9006e08
:feat/neuron-sandbox
:worktree-agent-af50f3458d7754f19
:worktree-agent-acc02900ef4ade35e
:worktree-agent-aaf04b0a9714c4070
:worktree-agent-a6577c8211c332c5b
:worktree-agent-a6177cda24c71d1df
:worktree-agent-a55d5c2d0e8f2c88b
:worktree-agent-a7e7a591a07291058
:worktree-agent-a456e0cf8cd2ee361
:worktree-agent-a0dc4a33cf5558d4e
:worktree-agent-ac2381b0b9615ab20
:wt/swarm-ccr
:integration/langfaculty-20260814
:feat/nsbx-dev-env
:stage-elp-native-lang
:docs/operator-naming-convention
:stage-elp-lang-consolidation
:stage-elp-es-port
:engram-tiered-storage
:feat/engram-reseed-route
:feat/el-route-decorators
:test/dev-ci-baseline
:fix/cgi-identity-emission-clean
:fix/cgi-identity-emission
: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
: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/durable-response-truncation"
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?
Root cause: the fs_read binary-length hint (
_tl_fs_read_len) was applied to ANY HTTP body, so any handler that read a file then wrapped it into a larger reply had the response truncated to the file's length — Content-Length lied and the send stopped short. This is the Mac 988 safety-contact bug AND the Windows 'every answer cut off, app refuses the new user' bug (the Windows brain is an old build without even the per-handler workaround, so everything truncates).Durable fix (pointer-identity, same approach as #78 by Tim, extended): pair the length hint with the exact buffer pointer it describes (
_tl_fs_read_buf); apply the raw byte count ONLY when the response IS that buffer. Every wrapped/derived body uses strlen. Also closes the stale-hint heap over-read that a plain max() would leave open.Key difference from #78: applied to BOTH the mainline runtime AND the frozen release runtime (
lang/releases/v1.0.0-20260501) that the desktop souls compile against. #78 only touched mainline and is 21 commits behind main; the release copy still carried the raw leak — the reason the Windows brain kept truncating. This branch is rebased onto current main and supersedes #78.Verification: both runtimes
gcc -fsyntax-onlyclean. E2E no-truncation evidence produced via the Windows brain rebuild gate (988 POST+GET full untruncated JSON).Closes the truncation class on every platform. Does not force a Mac rebuild — the in-flight Mac DMG keeps working via its existing workaround and can drop it later.
Measured no-truncation evidence (release runtime, lang/releases/v1.0.0-20260501 — the runtime desktop souls compile against). Harness reproduces the bug pattern: handler fs_read()s a 10-byte file, then wraps it into a 160-byte 988-safety-contact JSON reply; response captured off a socketpair.
BEFORE (origin/main, raw leak):
Content-Length header : 10
Actual body bytes sent: 10
Expected (full) reply : 160
RESULT: FAIL — reply truncated to file length; body cut at '{"ok":true'
AFTER (this branch):
Content-Length header : 160
Actual body bytes sent: 160
Expected (full) reply : 160
RESULT: PASS — full untruncated reply; complete valid JSON
Both runtimes gcc -fsyntax-only clean. Binary file-serving path preserved by the eff_body == _tl_fs_read_buf pairing (same approach Tim E2E-verified in #78).
Superseded by the reconciled el-cluster landing (feature #80 -> dev -> stage #81 -> main #82). Its content is included in that reconciled runtime now on the dev->stage->main chain. Closing to drive el open PRs to zero.