Skip to content

refactor: separate typed job queries and post-record response projection - #770

Merged
yyjeqhc merged 2 commits into
mainfrom
refactor/query-projection-postprocessing
Sep 29, 2026
Merged

yyjeqhc merged 2 commits into
mainfrom
refactor/query-projection-postprocessing

Conversation

@Xiiiing

@Xiiiing Xiiiing commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Continue the local architecture cleanup after #769, based on 58bfc0bbcfe90f92c6b0f69a881de2af40ac033a. Two independently reviewable commits:

  1. 1f6488a1 — share typed Job inventory with Console projections. Introduce an internal, non-serializable JobInventoryPage. Normalize filters, obtain caller-visible matching Registry records, apply status/order/limit, then let the model and Console use their own explicit projections. The Console no longer constructs and reparses model-facing Job JSON or discarded validation metadata; list_jobs projects only returned records.
  2. a55ca880 — isolate ordinary Kernel post-record response finalization. Authorization, dispatch, control transitions, permission evidence, and Session recording stay in the Kernel. The dedicated response stage captures canonical audit/telemetry evidence before consuming the existing one-shot model projection plan, then applies the same ordered response overlays. Its internal result keeps canonical audit output separate from the model response.

Boundaries preserved

  • No new crate, dependency, configuration, tool name, direct/gateway admission rule, HTTP/MCP schema, or App resource URI. No Host schema refresh is needed for this PR.
  • Registry visibility remains applied before filtering and limits; exact Project/Session filtering, ordering, default/clamped limits, invalid-input recovery, and Console optional fields remain unchanged.
  • Inventory queries retain their existing Registry lifecycle refresh. Work Result/passive-attention snapshots deliberately keep their separate non-refreshing query path; this refactor does not unify different observation lifetimes.
  • Console serialization uses an allowlist; private command/path/request/error metadata does not become UI data. Activity enums retain the existing snake_case wire values.
  • Canonical evidence is captured before model compaction. Recorder-gap hints, admin-only trace references, Window/peer collaboration, and passive Job attention retain their original ordering and scope checks. No replay, implicit Session selection, or new execution authority.
  • Specialized gateways and early-denial paths retain their existing behavior.

Validation

The final committed tree 6a47d8bb82256627564a38fb16f17180a2b645da matches the reviewed, formatted and tested source tree.

  • 8 new focused regressions pass (also included in the full library run): query/model ordering and bounds, foreign visibility, invalid-filter parity, Console field/enum serialization, Session non-recording reads, pre-compaction audit/telemetry, effect uncertainty and exact Job identity, redundant/over-budget response hints.
  • cargo test --locked -p webcodex --lib: 3,095 passed, 3 ignored, 0 failed. Full root-library coverage was used because the ordinary Kernel response stage is shared by many tools.
  • cargo fmt --all --check and git diff --check.
  • bash scripts/workspace_boundary_check.sh: all 21 packages pass, with unchanged dependencies/layer direction/test ownership.
  • Independent review of the original-to-new response phase order, typed projection allowlists, and final source files.

No full workspace/all-features or native Windows/macOS execution was run locally. No frontend changes or UI latency benchmark; reduced intermediate JSON work is an implementation property, not a measured throughput claim. No deployment, restart, release, or merge performed.

Architecture ownership is documented in the new Typed queries and post-record responses section of docs/ARCHITECTURE.md.

@yyjeqhc yyjeqhc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed on the exact current head in ~/git/webcodex-review against 58bfc0bbcfe90f92c6b0f69a881de2af40ac033a. The typed Job inventory refactor preserves visibility-before-filtering, ordering/limits, invalid-filter behavior, Console allowlisting, and non-recording query semantics. The Kernel post-record extraction preserves the original response-phase order: canonical telemetry/audit capture precedes model projection, while recorder-gap, collaboration, observe_jobs and passive-attention overlays remain response-only and do not gain dispatch or Session authority. Focused local regressions passed (job_query 3/3, post_record 3/3, fmt/diff checks), and the PR CI's Linux server/workspace/runner/tooling/contract lanes are green. No blocking findings.

@yyjeqhc
yyjeqhc merged commit ced9797 into main Sep 29, 2026
15 checks passed
@yyjeqhc
yyjeqhc deleted the refactor/query-projection-postprocessing branch September 29, 2026 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants