Repository navigation
refactor: clarify runtime ownership, result projection and observation lifecycles - #771
Conversation
yyjeqhc
left a comment
There was a problem hiding this comment.
Deep-reviewed on the exact current head in special:/root/git/webcodex-review against merged #770 (ced97978). The apparent 9k+/8k+ size is dominated by checked-in frontend bundle regeneration plus an ~1.4k-line model-projection relocation; I reviewed the semantic changes separately. Result projection remains post-record and non-authoritative, Runtime-owned Git snapshot registries preserve caller/project/session fences while isolating independent runtimes, typed validation summaries preserve current-source uncertainty, and UI observation refactors preserve uncertain-write/lease identities. One review finding was fixed in e9eda7bd: an exact Session detail 403/404 no longer turns into a 5-second automatic polling loop; transient errors remain recoverable. Independent validation: root webcodex --lib 3097/3097, webcodex-validation --lib 106/106, frontend runtime 152/152 after the fix, TypeScript check, generated-dist check, and git diff --check. No remaining blocking findings.
Summary
Continue the maintenance work after #770, based on
ced97978cb250c1d3b01434c2585d27c9ecda931, in special/root/git/webcodex-review.Five related work groups, separated into six reviewable commits:
52691a4d— isolate model result projection from execution dispatch. Move the existing projection policies and their tests totool_runtime/result_projection.rs; keep execution targeting, prestart denials, permission/Session orchestration and pre-record expectations in dispatch. The existing one-shot plan and pre-compaction audit order remain unchanged.3bef3979— Runtime-owned Git snapshot registries. Remove the two process-globalOnceLockregistries. Runtime clones share their review/Changes registries; independent Runtime instances cannot read, refresh or evict one another's snapshots. Add clone/isolation/capacity/drop coverage. Existing caller/source fences, review TTL and live/sealed retention classes remain.f6c64fef— compute current validation evidence from typed summaries. ReuseValidationSummarydirectly instead of generating JSON and reading counts/reasons back from it. A private current-source status enum deliberately has noPassedvariant; historical success remains separate from unproven current-source evidence. Serialize the existing public shape at the boundary. This is a local domain calculation cleanup, not a redesign of all handoff/continuation JSON ports.eafb9aa3— shared UI observation lifecycle. Goal and Session read resources use narrow request slots for single-flight, cancellation, late-response fencing, null/error release and explicit refresh coalescing. Detail/messages progress independently. Goal, Session, Agent inventory and Window collaboration use the shared visibility scheduler. Window resume coalesces for 150 ms. Endpoint renewal and pending sends retain their independent lifecycle and exact mutation identities. Regenerate the checked-in bundle.4b518bac— disposable Session ledger scale/recovery experiment and maintenance documentation. Add ordinary small recovery/corrupt-copy tests plus an explicitly ignored larger experiment at 100/1,000/10,000 minimal Sessions. Do not change the production storage engine or evict Active identities.5d1395bc— documentation-only retention scope clarification. Numerical quotas are now per Runtime, shared by clones, not an aggregate process-wide cap across deliberately independent runtimes.Boundaries and scope
Session scale evidence
One local unoptimized test-profile run with synthetic minimally populated Sessions, temporary files, real SessionStore and production snapshot writer:
All exact identity and Active/Closed recovery checks passed. These are diagnostic observations, not production capacity limits or optimized throughput claims. Full event tails, concurrent load, RSS, native Windows/macOS storage and power-loss durability were not measured. Existing temp-file/flush/rename persistence is unchanged. Growth suggests investigating write amplification and linear LRU touch cost with representative data before choosing an incremental storage design.
Validation
webcodex-validation --lib: 106 passed on final formatted source.check:distpassed. The largefrontend/dist/app.jsdiff is regenerated bundle output; review the source hooks/tests separately.cargo fmt --all --checkandgit diff --checkpass.Validated implementation tree:
53699bf2764fd7ecf94111a968da5be9ec1816edat4b518bac. Final tree:63a3a29dcfda09bc6a6bd7da071f5107039f740e; the last commit changes two documentation files only, andgit diff --exit-code 4b518bac HEAD -- src crates frontendpassed. The validation tool's source-freshness metadata reportedstale; this is not relabeled as proven freshness. Test results above come from the completed execution and the explicitly compared source tree.No full workspace/all-features suite, production browser latency benchmark, or native Windows/macOS execution was performed.
Details and reproduction:
docs/implementation/runtime-maintenance-boundaries.md,docs/ARCHITECTURE.md,docs/TESTING.md, anddocs/agent/ui-progressive-loading.md.