fix(analysis): bound type-checker continuations and admission work

This commit is contained in:
Codex
2026-09-11 08:09:03 -07:00
parent b96ff3935a
commit cdebb49d89
4 changed files with 843 additions and 175 deletions
@@ -1,4 +1,82 @@
# Schema8 core WIP reboot handoff
# Schema8 core source handoff
## Current root execution and review — 2026-09-11
Root completed the corrected required depth128/129 and call32/33 regression
(1/1), the complete `analysis::` filter (28/28:25 analysis plus3 topology),
numeric26/26, and strict core all-target Clippy with `-D warnings` (exit0,3m37s).
The default Windows test stack and required limits were unchanged. Independent
`analysis_core_review` found no material new correctness/resource defect in the
iterative checker/admission correction; [Gitea342](http://217.177.34.108:3000/sorokin.oleg.edu/ARCADIA-Studio/issues/1#issuecomment-342)
records its conclusion. Source hashes match the correction freeze below.
Root's durable `harness/release-analysis-core-iterative-gate-20260911.md` and
`harness/release-analysis-core-iterative-review-20260911.md` record execution and
independent scope. Immutable root `.local/analysis-core-iterative-gate-20260911/`
contains274-input manifest SHA256
`28D6CEAE5C52765F5DB5CB411D7E42EDAB91359C9E351663315BC4B7F1FF2B7A`
and corrected test executable SHA256
`2B4EE8BA63B20415B352E084314CC7504E778C093598B9564C6EA4F56BC921C9`.
Clippy log SHA256:
`6FE529BBA6A761FEDACB1A3933BB86E4FB644D8CC192F57FB0F45EFA5B9ABFFF`.
This supersedes the awaiting-rerun status below, preserving the first actual
failure. It does not close full core integration, bounded codec/lifecycle/output,
source8, evaluator, UI/REST/CLI parity, libraries or release acceptance. The source
remains isolated from root's runnable schema7 application.
## Historical stack-overflow correction source freeze — 2026-09-11
Codex-956atf `/root/analysis_core_resume`, renewed debugging lease after root's actual first Windows gate. The same dedicated worktree/branch remains at HEAD `b96ff3935ab3f36b7144566e46559a05a29292a5` plus uncommitted corrections. **The first candidate failed; this replacement is frozen source awaiting root's rerun.** No compiler was run by the worker.
Root's original `cargo test --locked -p oa-core --lib analysis:: -- --test-threads=1` compiled warning-free in3m34s, discovered28 tests, logged16 named passes, then aborted at `analysis::tests::logical_depth_and_call_depth_have_exact_boundaries` with Windows `STATUS_STACK_OVERFLOW` / `0xc00000fd`. Preserve the original root `.local/logs/analysis-core-first-20260911.log` (SHA256 `84C6B63039472363412B66C7A24DE825A846518725EC9F7436C252603AEF54FC`) and root-reported binary `target/debug/deps/oa_core-a7a95d666500007c.exe` (SHA256 `548850D3606C9B4A58859677E86A1C1813EB6E71785C529F771E04125E7A33AF`). Gitea issue1 comment305 records the actual failure. Neither compile success nor the16 earlier passes establish a full gate pass.
The test-count discrepancy is resolved: Rust's substring filter `analysis::` selects25 schema8 tests **plus three existing `topology_context::analysis::tests`**, declared through `topology_context/analysis.rs` into `analysis_tests.rs`. The earlier prepared25 was the schema8-module count, not the full filter count; the saved22 would likewise have selected25 with those topology tests. The current corrected filter still expects28, with no ignored/removed or additional test functions.
The large recursive `Checker::expression` was the concrete source-level suspect; no profiler/frame-size measurement established the exact abort instruction. It is now an explicit continuation machine with at most128 heap frames and one returned type. Each frame borrows its Expr and any calculation definition and owns only fixed-size resolved types/handles. Lists and calls schedule one ordered child at a time. The rejected129th frame is never allocated, while its entry event is still charged to preserve failure precedence. Rust call depth no longer scales with Expr depth, and typechecker-frame destruction does not destroy the borrowed Expr tree.
The continuation states retain left-before-right operands, condition-before-both-branches, Sum initial-before-values, AsKind target resolution-before-operand, declaration-order call arguments, contextual empty-list typing, branch type equality and existing node/key/argument meter precharges. No numeric operator semantics, fixed KindHandle, lowerable1,000,000-event ceiling, accepted128-depth bound or stored schema was changed. No stack-size override, release-only workaround or ignored test was introduced.
The original failing test now includes diagnostic phase markers and unary128/129, mixed Binary/If/Call/Power/Unary128/129, contextual empty-list If/Call128 and definition-call32/33 boundaries. The existing parameter-purity test now makes call declaration order versus UUID order and binary left-to-right error precedence observable through distinct invalid-reference errors. The already compiled meter tests retain their exact event expectations.
| Path | SHA256 at correction freeze |
|---|---|
| `crates/oa-core/src/analysis/typecheck.rs` | `831F14346BBAE83FBDEEB744F9F29460FAB13A8315645FAA6CE94D0B60B1516F` |
| `crates/oa-core/src/analysis/tests.rs` | `9FB30B28E305CB00E7C39204912F8311E96AA92D0334CE4A73FB08FADDFE83C5` |
| `crates/oa-core/src/analysis/admission.rs` (unchanged since first candidate) | `5F85EAA868AC43C4819C98556281D8226F9C0E2A4B11E5C97CF24D855D2127AE` |
Standalone installed rustfmt2024 check and `git diff --check` pass for the correction. Root's next commands from this worktree, using its established toolchain/cache:
1. `cargo test --locked -p oa-core --lib analysis::tests::logical_depth_and_call_depth_have_exact_boundaries -- --exact --test-threads=1 --nocapture`
2. `cargo test --locked -p oa-core --lib analysis:: -- --test-threads=1` (28 expected).
3. `cargo test --locked -p oa-core --lib analysis_numeric::tests -- --test-threads=1` (26 expected).
4. `cargo clippy --locked -p oa-core --all-targets -- -D warnings`.
Admission's structural Expr/reference walks and dependency/case graphs are already iterative. Inspected architectural index construction borrows analysis records and clones only ordinary step-ID vectors; its analysis-reference branch avoids cloning Expr-bearing elements. This identifies no further recursive Expr traversal in the immediate admission path, but is not execution or stack/RSS evidence. Derived Expr Clone/Debug/equality/Serialize/Deserialize/Drop, partial decode teardown, command cloning, output expansion and full codec/lifecycle/source parity remain the separately documented production risks. Default Serde recursion rejection remains unchanged. Root owns execution, follow-up findings, integration and release publication; there is no complete schema8 transport or release claim.
## Historical first resumed source freeze — 2026-09-11
Codex-956atf `/root/analysis_core_resume`, resumed by root after the user returned. **Source frozen for root's first compilation gate; still uncompiled staging.** The dedicated worktree remains `C:/Users/User/Documents/Git/ARCADIA-Studio/.local/analysis-core-worktree-20260911`, branch `codex/analysis-core-20260911`, HEAD `b96ff3935ab3f36b7144566e46559a05a29292a5`. No commit was made by this worker. The reboot record below is retained as historical evidence; this section supersedes its stopped/pending-static-review status only.
The resumed delta changes three Rust files plus this report:
| Path | SHA256 at resumed freeze |
|---|---|
| `crates/oa-core/src/analysis/admission.rs` | `5F85EAA868AC43C4819C98556281D8226F9C0E2A4B11E5C97CF24D855D2127AE` |
| `crates/oa-core/src/analysis/typecheck.rs` | `1AC3A92E97B886F4BFAC31BA22C182347131D0A82BEDBF6B2F2073D02AD5A6E4` |
| `crates/oa-core/src/analysis/tests.rs` | `9EC9C12C618600039BC2DC0A9B9BF6DC5378FD4D8749E21EDEC699EEE06AB0E2` |
- `admission.rs` precharges expression child slots before queue growth, rejects visited-plus-pending closure overflow before allocation, meters initial closure queue entries, text spans and scoped parameter names, and charges each relation-subject traversal hop. Known indexed element layers use direct map lookup. This closes analysis-specific unmetered work; it does not bound the existing architectural validator, wire decoding or recursive lifecycle operations.
- `typecheck.rs` groups owner/field/layer/parameters in `BindingContext`, removing the eight-argument helper. Call arity remains an O(1) check; the complete scoped-key scan is precharged before lookups, then declaration-order argument lookup/type work is separately charged. Actual parameter identity and all-branch checking are preserved.
- Three new meter tests exercise 1,024-wide List/Call precharge, a 64-parameter malformed/valid Call at exact work boundaries, and 64 relation hops with terminal element/missing/cyclic endpoints. The existing real-Project aggregate-limit test also checks text-byte accounting and exhaustion before invalid text inspection. These relation-chain fixtures deliberately test malformed input before architectural admission, not newly accepted architectural relations.
**Expected focused count is now25: the saved22 plus three new meter tests (21 actual-Project tests and four meter tests total).** Command from this worktree: `cargo test --locked -p oa-core --lib analysis:: -- --test-threads=1`. Root owns the toolchain/cache configuration and all execution. Follow with the changed numeric-helper regression filter `analysis_numeric::tests`, then strict core Clippy; the earlier26 numeric passes apply to7d14bd0, not this schema8 candidate.
Read-only review covered existing persistent-enum/Project constructors, command/reference call sites and the analysis lifetime/borrow paths. Standalone installed `rustfmt --edition 2024 --check` passes for all three changed Rust files; `git diff --check` is clean. **No Cargo/rustc, test, Clippy, native, Linux or memory/stack measurement was run by this worker.** No root-checkout files, manifests, lockfiles, ledgers, fixed KindHandle, numeric semantics or other worktree-owned source changed during resume.
The lowerable aggregate1,000,000 static-event ceiling, nominal/exact arithmetic, baseline/case/unused-branch checks and scoped parameters remain settled. Default serde_json recursion rejection stays enabled. Schema8 codec/allocation/output/lifecycle closure, source8, evaluator, package environment, capture, API/CLI/UI and historical/transition parity remain pending; this is not a runnable release or complete product transport. Gitea issue1 comment291 records the resume lease; root owns integration/publication and any subsequent compiler-driven corrections.
## Historical reboot freeze
Codex-956atf /root/requirements_delta, 2026-09-11. **Frozen immediately at the user's reboot checkpoint; uncompiled work, not a runnable product. Do not resume without root follow-up after reboot.**