refactor(orchestrator): return validated worker results (CL20)

This commit is contained in:
Boki 2026-10-26 20:40:58 -04:00
parent 6055aeeee9
commit 8a5d0c3ef2
8 changed files with 145 additions and 23 deletions

View file

@ -75,3 +75,18 @@ CL17 implementation commit: `984dc1a9`.
Research and paper share pure diagnostic initialization and owner-feedback projection, keeping their separate confirmation/SQL commit boundaries. Feed planning and paper admission share the existing timestamp/phase/UTF-8/source comparator. `canonicalJson` moved unchanged to a neutral module with its legacy re-export; canonical consumers no longer depend on legacy recovery.
Implemented by `/root/implement_cl19`, independently accepted by `/root/review_cl19`, integrated by `/root`. Root runtime/feed/recovery/architecture suite: 60 passed, 6,959 assertions; application types passed. Root disposable canonical-paper, crash and strategy-recovery suite: 35 passed, 275 assertions. Root also compared the entire canonicalJson function/comment against baseline bytes. Tests cover research/paper state/RNG/feedback parity and detached initial state, malformed-owner atomicity, native-accepted Unicode ordering and historical serialization. Explicit authored-test types/lint/format passed. Worktree Bun browser-bundle errors cleared on separate architecture rerun; root combined focused invocation passed. Logs: `/tmp/stock-bot-engine-cleanup-20261026/cl19-root-{tests,types,postgres}.log`.
CL19 implementation commit: `6055aeee`.
### CL20 — accepted
The worker supervisor exposes a narrow typed retained-result entry while preserving raw trace/strategy callers. It retains the existing validated envelope and returns it only after successful child close and candidate cleanup; the canonical adapter no longer reparses it. Input snapshots, child error/cancellation handling, trust-boundary/persistence validation and financial semantics are unchanged.
Implemented by `/root/implement_cl20`, independently reviewed/integrated by `/root`. Root rebuilt the orchestrator and ran retained-strategy-worker, canonical-worker-lifecycle, canonical-strategy-worker and native-replay-report: 59 passed, 232 assertions. New cases prove raw/typed parity, specific malformed identity/policy/artifact/analytics failures, caller mutation isolation, cancellation/reuse and valid result followed by exit code 23. The existing supervisor cleanup-failure branch was inspected unchanged; it was not newly fault-injected. Application and explicit authored-test typechecks, lint, formatting and diff checks passed. A worktree Zod bundling failure cleared after copying that dependency locally into ignored node_modules; root checkout tests passed unchanged. Logs: `/tmp/stock-bot-engine-cleanup-20261026/cl20-root-{build,tests,types}.log`.
### Remaining-wave integration — accepted
`CARGO_BUILD_JOBS=2 bun run check` passed on the integrated CL17–CL20 changes: 134 tooling, 43 utility, 44 calculation, 1,236 integration and 150 Rust tests; 14 existing conditional integration skips and 4 ignored Rust tests remain. Builds, application/contract typechecks, lint and secret audit passed. Root separately ran the disposable database suites recorded above (12 stored-source/recovery and 35 canonical-paper/crash/recovery cases, with overlapping recovery coverage). No browser E2E or full database suite was rerun; UI and financial schema/policy are unchanged. No performance claims or activation. Full log: `/tmp/stock-bot-engine-cleanup-20261026/remaining-wave-check.log`.
CL14–CL20, all seven scheduled cleanup stories, are complete. CL21 remains conditional on an actual replay scheduling/calendar need and explicit activation. The 72 task records outside this wave remain unchanged, including earlier CL01–CL13 review status and the six original conditional tasks. Disposable test containers were stopped/removed; isolated worktrees and logs remain for inspection.