Skip to content

Simplification audit: find over-engineering and duplicate code on the Rust path, propose deletions #25

Open

Description

@n0rpan

Owner request (2026-11-16): keep the overall goal in view: a great harness that is small, really fast and optimised for a laptop running a local model; check whether we are over-engineering, and get to one common code path faster.

Read-only audit first, then small deletion or merge PRs. Scope: oxa/ (all crates) on current main; the Python tree is being retired and is out of scope except to name what Rust duplicates only for parity.

Report as ONE comment on this issue, a table: item | where | why it is more than needed (duplicate of X, unused outside tests, parity-only, abstraction with one implementation, option nobody sets, feature flag never enabled, module not on any path to the MVP or the lead) | proposed action (delete, merge into X, keep with reason) | lines removed | risk. Look in particular at: modules added today by short helper tasks in oxc-gateway (discovery cache, catalog overlay, refresh throttle, status, rate limits, the openai/ and opencode/ parts): which are used by a caller, which overlap each other or the cloud agent's own code; the two 'status' modules (oxc-gateway/src/status.rs and oxa-cli/src/status.rs); feature flags and cfg combinations in oxc-gateway/Cargo.toml; duplicated HTTP clients, SSE decoders, redaction and secret-reading code; test helpers copied between crates; settings that no code reads; docs that describe removed behaviour. Also measure: release binary size of oxa with default features, and idle RSS and thread count of oxa in print mode on a trivial run (state how you measured).

Rules: propose, do not delete on your own, anything in oxa-sandbox, oxa-perm, credential handling, oxa-work, or files a cloud lane owns (ask on oxstack/ox-llm#331). For everything else: after the table, open small PRs, one concern each, that only remove or merge code, with tests still green; no behaviour change. Never weaken a security check, scanner or test to make a deletion pass.

🤖 Generated with Claude Code

Activity

  1. n0rpan commented on Nov 16, 2026

    @n0rpan
    ContributorAuthor

    codex-queue: taking this p1 audit first; I will post the read-only findings and footprint measurements here before any deletion PR.

  2. n0rpan commented on Nov 16, 2026

    @n0rpan
    ContributorAuthor

    Latest source/status refresh: main69a81515ad3ce39dbf048112fd0cfad476f4b73f; historical baselines below are explicitly scoped. Shared framing is now landed through821. New native-linkage documentation discrepancy is proposed in689:6944832163 and awaits provider/release-owner acknowledgment; no source edit.

    simplify: #25 audit baseline at main 0a27bd8 (earlier caller/measurement controls at50f63bb) and the named open PRs. The initial read-only snapshot was main 4968448; its measurements are retained below as historical evidence. Original searches covered all 27 then-current oxa workspace crates; the main518e297 delta adds the packaging-consumed oxc-memlat crate (retained below). Coverage includes: normal dependency closure, production callers and trait implementations, feature/cfg combinations, settings through typed accessors, HTTP/SSE and redaction/secret boundaries, copied mock transports and stale behavior docs. An absent caller does not prove that an unpublished MVP/lead dependency is obsolete; the board-cycle rule applies before deletion.

    item where why it is more than needed action / current disposition lines removed risk
    Discovery disk cache + refresh scheduler former gateway discovery_cache.rs / refresh.rs and exports Only their own tests called the versioned disk cache and generic injected-clock scheduler Resolved: merged oxstack/ox-llm#700, following named board cycle with no keep 575 merged net No production path changed
    Provider status card / two status modules gateway status.rs; CLI status.rs Gateway credit projection/render_card has only internal tests; CLI status tracks live worker progress and durable private snapshots Proposal delivered, no implementation, as the orchestrator required: keep one CLI status surface and worker schema; consume concrete typed provider facts there when a caller exists, then retire gateway presentation. No extra writer or merged credit/worker schema 0 counted High if worker durability and provider credit are conflated
    Rate/refusal metadata gateway rate_limits.rs + chatgpt.rs Initially test-only, now used by concrete client Resolved: keep. Merged oxstack/ox-llm#680's openai/client.rs imports API/subscription refusal types and calls classifiers at 260/263 0 Live refusal contract
    Catalog gateway catalog.rs / runtime.rs Runtime actively constructs/resolves it and discovery borrows ModelInfo Resolved: keep active routing boundary 0 Cloud-off/offline behavior
    Catalog overlay pending oxstack/ox-llm#712: catalog_overlay.rs + export Adds a second metadata/admission layer with no published production caller; landed on current audited main before this deletion Resolved: oxstack/ox-llm#745 MERGED, head72c6a0a, after named board cycle/no keep and oxstack/ox-llm#712 landing without a caller. Baseline253→all246 retained tests pass; strict checks/default release pass; own gate43878557949 and full ready-mode gate43879035308 green; gatekeeper MERGE-OK; independent T3 owner read retained 201 merged Pending billing integration
    Native provider protocol/clients gateway openai/{client,request,stream,chatgpt_request}.rs and opencode.rs Concrete Responses client and native CLI composition are merged through821 Resolved: keep working clients/protocol helpers on the Rust-only MVP path. main69a8151 includes the consumed opencode module; the earlier absent-module observation is superseded 0 MVP/client path
    OpenAI model discovery gateway openai/models.rs + models/tests.rs + export No production caller even after oxstack/ox-llm#680 landed; an unused HTTP pool and discovery state surface Resolved: oxstack/ox-llm#730 MERGED at main0a27bd8 after named board cycle/no keep. All237 retained gateway tests pass; own gate43875434249 and full ready-mode gate43875650129 green; automated review clear; gatekeeper MERGE-OK 706 merged Specs remain oxstack/ox-llm#628; token/client/security paths preserved
    OpenRouter account/model HTTP client gateway openrouter.rs; oxstack/ox-llm#741c7037e8 Present callers are absent, but the owner explicitly requires this client for live provider balances/model lists in oxstack/ox-llm#627/#628 RETAINED — oxstack/ox-llm#741 HELD pending owner release. Binding owner decision 6918156777, reaffirmed by coordinator: missing callers and technical review clearance do not override KEEP. Branch and hold unchanged; no equivalent replacement deletion 0 counted Required owner627/628 live capability
    Anthropic discovery gateway anthropic_client/models.rs Discovery method/Model lacks a caller, but Refusal is live through rate_limits and the file is edited by S7 Resolved: explicit coordinator KEEP, oxstack/ox-llm#812 comment6930988747, for owner627/628 live discovery. Fresh oxstack/ox-llm#628 body also requires Anthropic GET /v1/models, provider models() and live picker. No production caller claimed. Refusal/classify_refusal stay live;259-line candidate excluded from savings 259 potential, not counted Active S7/shared refusal boundary
    Feature/cfg combinations gateway Cargo.toml/lib.rs; engine Cargo.toml Empty defaults are intentional. Engine selects anthropic-gateway, which brings catalog, ledger/accounting, transport and translators. OpenAI client remains coupled to the anthropic-client gate Owner proposal, not a flag-removal shortcut: consider existing transport gate after S7 settles; preserve independently usable pure translators, cloud-off defaults and optional bridge. oxc-local/queue/launch_profile and gateway/share are reserved MVP/live-lane seams 0 Manifest/API ownership; no extra provider trait/crate proposed
    HTTP clients gateway Anthropic/OpenAI/OpenRouter; engine/http.rs; MCP and web ureq clients Repeated optional gateway pools, but local std framing/cancellation and blocking MCP/web have different timeout/proxy/redirect/auth contracts OpenAI discovery pool removed in oxstack/ox-llm#730. Retain OpenRouter for the binding oxstack/ox-llm#627/#628 capability; oxstack/ox-llm#741 is held. Keep distinct active transports; any remaining gateway pool sharing stays with S7 owner, without a global abstraction or dependency expansion Counted only in family rows High if policies are silently unified
    SSE framing gateway Anthropic, Responses, Go and OpenRouter; engine/A2A have distinct contracts One consumed crate-private raw Framer replaces gateway byte-framing copies; provider policy stays caller-owned Resolved: owner oxstack/ox-llm#821 MERGED, final head3bdb426, exact-head checks44035530124 SUCCESS. On main69a8151 the raw Framer blob44fb60d is byte-identical to attributed source70e07d0. Superseded oxstack/ox-llm#761 is closed; source branch/attribution retained. Earlier scoped proof43972490631 and its engine-only failure remain historical, superseded by final owner-head green. No cleanup auth/test/engine merge Original framing slice132+/92− = +40 net, including contract tests; no deletion saving counted Limits, EOF, cancellation, refusal, terminal validation remain owned
    Redaction / secret readers gateway redaction/secrets/chatgpt_tokens, OpenAI withholding; web key; MCP OAuth; sandbox/net Different authority/lifecycle: atomic vs streamed fields, one vs multiple secrets, request-time file reads, refreshable locked records, MCP scoped tokens and process output Protected proposal delivered: preserve safeguards and separate lifecycle owners. No consolidation/removal by this lane; any future owner proposal must preserve boundary checks, redacted diagnostics and no credential-bearing replay 0 T3; no credential files read
    Copied HTTP mocks gateway tests/common/{openai,anthropic}.rs; engine embedded tests Similar bounded request framing, but different scripted stream/hostile-input/health contracts. Engine already reuses gateway fixture by path Coordinator cleared bounded scope; draft oxstack/ox-llm#8385494679 opened, based on mainaaedf4e. Exact published6935039231 hunks, three test files75+/96− (21 potential net lines removed). Lane43997903801 SUCCESS on exact5494679 (both oxa architectures and native CLI consumers); draft43997957207 SUCCESS. One failed-job retry for ARM nextest HTTP504, no source/pin/guard changes. Ready43999305286 FAILED strict duplicate_mod on shared reader included by both peers; full workspace inventory guard passed. Draft restored. No suppression/retry. Exact single-definition proposal838:6935738089 moves reader to existing test-only oxa-fake, requiring gateway dev-dependency/lock edge; O-372 / v0.2.2: merge after0.2.1; bounded review may continue after release-priority capacity. Earlier manifest-change hold remains unresolved: prepared existing-test-crate move requires architect-owned gateway dev-dependency/lock edge. Exact alternative838:6935738089 is prepared but unapplied, combined20 potential net lines removed; no suppression or rerun. Queue owner6935842784 confirms822 whole-mock wiring repair is distinct, leaving this reader/devdep proposal unchanged. Proposal identifies44 identical reader lines; body mapping, Responses body_bytes, bounds/deadlines/EOF and all health tests remain owned. No merged savings counted; provider mapping, auth and health remain owned TBD, not counted Active integration/fixture work
    Supported setting with no reader config schema markdown.mermaid Confirmed no reader; docs explicitly promise accepted/no effect Resolved: keep accepted-setting contract in this no-behavior-change audit. Deleting validation changes diagnostics/compatibility 0 Explicit behavior change would need separate scope
    Compatibility-only settings defaultProvider, telemetry/install flags, images.autoResize, selfUpdateCommand, sessionShareDestination, warnings.anthropicExtraUsage, websocketConnectTimeoutMs No product readers beyond deliberate accepted/ignored warnings Resolved: keep warning behavior and its real tests. Literal-only searches also falsely flag keys consumed through typed accessors 0 No test/scanner workaround
    Orchestration foundations oxa-a2a / oxa-orchestrator No external production crate dependencies; agent-host/core enabled only for self tests. Legacy plans still claim a lead path Keep under the lead-path exception: fresh reads of open oxstack/ox-llm#94 (explicit A2A worker requirement), #11 (orchestration milestone) and oxstack/ox-llm#436 (core consolidation) still reserve these foundations. No current runtime linkage is claimed. Questions6917493694/6917745532 remain available if the owner retires that documented path; do not infer supersession from missing imports alone 0 Lead priority; about3611 source lines is inventory, not a deletion estimate
    One-implementation search trait oxa-web SearchProvider / WebSearchTool Brave is the only implementation; every test already uses Brave with loopback mocks Resolved: oxstack/ox-llm#727 MERGED, head9376019; Arc with the same three inherent methods; all43 tests and assertions retained. Own gate43874868812 and full ready-mode gate43875095802 green; automated/first-pass clear; gatekeeper MERGE-OK 8 merged net T2; no key/request/security behavior change
    Other apparent singleton abstractions EmbeddedGateway, SessionStore, ModuleLoader, CommandRunner, Terminal/Component, ProgressObserver, MCP Transport, AutocompleteProvider, local Sample, extension/engine APIs Alternate real or fake implementations and actual ownership/testing boundaries exist. Main69a8151 inventory covers28crates/355src files; manual follow-up: AutocompleteProvider has CombinedProvider+Files+Cmds, local Sample has MemorySource+fixture Memory, SessionStore has FsStore+MemStore+failure fixtures; same-file implementations invalidate file-count shortcuts Resolved: keep useful seams and explicitly retained extension/generic engine contracts. Protected work/proto/permission/credential boundaries remain proposal-only; no new deletion grant inferred 0 Do not replace interfaces solely by implementation count
    New Rust MEMLAT helper oxc-memlat; release build/stage and MEMLAT hooks Library has no external Rust caller, but its binary is a real packaging entry point Resolved: keep oxstack/ox-llm#793/#785 Rust-only replacement. Main518e297 release/build.sh builds it, stage.py installs it and four hook scripts consume it. No packaging/boot edits by cleanup 0 Owner packaging/boot authority
    Stale MEMLAT deployment docs oxc/docs/MEMLAT.md Still names Python installation and four /usr/local/libexec command paths after oxstack/ox-llm#793 ships the native /usr/bin helper Resolved: oxstack/ox-llm#839 MERGED at2026-11-17T02:13:01Z, source41a20ce, packaging acknowledgement6935288979/6935289555 and coordinator scope received. Adds17 lines distinguishing accepted824 native layout/four inert templates from historical manual installation; no activation/install/boot/policy claim or change. Existing receipts/instructions retained; draft43999219590 and ready43999428200 both SUCCESS on exact41a20ce; automated code review completed with no findings on41a20ce; gatekeeper6935660904 MERGE-OK on exact41a20ce; external merge completed 0 counted Packaging/boot documentation ownership
    Stale gateway docs gateway README Initial-slice wording contradicted optional bridge/transport Resolved: merged oxstack/ox-llm#690 Docs rewrite, no binary saving T1
    Stale gateway footprint linkage wording after821 gateway README footprint paragraph Says default oxa binary does not link gateway, but CLI now directly consumes native composition and enables the bridge Proposed only, awaiting provider/release-owner scope ack: exact three-line replacement689:6944832163; distinguish CLI linkage from optional library feature and cloud activation. No behavior/default/resource claim or source edit 0 counted Provider/release documentation ownership
    Stale default-tools / local-only model wording PARITY CLI-032; docs/README Four/seven default description contradicted existing eight-tool regression; configured endpoints already support cloud routes Resolved: oxstack/ox-llm#734 MERGED, head8e96aff; local links, two isolated lab doc tests, fmt/diff pass; own gate43876250979 and full ready-mode gate43876533271 green; gatekeeper MERGE-OK. Product/tests unchanged 0 net lines T1; no footprint effect

    Running total: 1,490 merged net lines removed (#700:575, oxstack/ox-llm#730:706, oxstack/ox-llm#727:8, oxstack/ox-llm#745:201). No active proposed deletion savings are counted. oxstack/ox-llm#741 is HELD/RETAINED; its 564-line candidate is excluded. Potential/protected/deferred rows and docs rewrites are not counted. No merge was performed by this lane.

    Measurement method: default features, repository release profile (opt-level=s, thin LTO, stripping), cargo build --release --locked -p oxa-cli --bin oxa, serial CARGO_BUILD_JOBS=3. A temporary Rust probe uses existing oxa-fake::FakeServer/TestEnv, clears child environment, supplies private HOME/XDG and loopback only, runs the real binary with --print --model fake-model --no-tools --no-session and one trivial synthetic request, holds completion for1.4s, and samples /proc/<pid>/status 50 times at20ms after request receipt. A/B/B/A blocks have five fresh processes each; discard the first process in each block and compare per-run medians. No tools, real credentials, sign-in, API calls or hardware/model inference.

    • oxstack/ox-llm#727: 11,933,832 → 11,933,832 bytes, print-wait 8,128 → 8,064 KiB, 2 → 2 threads. Under1% RSS difference is noise, not a claimed improvement.
    • oxstack/ox-llm#730: 11,933,832 → 11,933,832 bytes, byte-identical SHA256 45177b0c56dd7aa84102924d841f971d6b4ce4558e816e121e05f630776873ac; print-wait 8,088 → 8,080 KiB (noise), 2 → 2 threads. Unused gateway code is outside the default executable dependency tree.
    • oxstack/ox-llm#741 historical held-candidate measurement only; no deletion saving counted: 11,933,832 → 11,933,832 bytes, byte-identical default executable; print-wait 8,072 → 8,080 KiB (noise), 2 → 2 threads, same interleaved method. Unchanged baseline246 tests passed; after deletion236 pass. First attempt hit PID+wall-clock fixture collision in unchanged tests/accounting.rs; complete same-parallelism retry passed without edits or filtering, reported on oxstack/ox-llm#331 comment6918033308.
    • oxstack/ox-llm#745: 11,933,832 → 11,933,832 bytes, byte-identical default executable; print-wait 8,080 → 8,072 KiB (noise), 2 → 2 threads, same interleaved method. Baseline253→246 retained gateway tests pass; only the removed helper’s seven tests disappear.
    • Historical initial audit at main4968448: 12,870,216 bytes, five print-wait medians9,244/9,208/9,192/9,176/9,220KiB (median9,208), two threads,1.2s hold/20ms samples. This earlier environment is not a before/after comparison with the current host; no savings are inferred across those baselines.

    These are quiescent print-mode waiting observations, not TUI idle, peak inference RAM or Snapdragon hardware validation. Tests use synthetic fixtures; gateway syscall/fault tests run unchanged with a read-only strace tool overlay and isolated network. No scanner, security check or retained test was weakened.

    Current scope/control checkpoint: steering is oxstack/ox-llm#812 (#331 links are historical). Coordinator6930988747 explicitly says discovery KEEP for627/628,741 retained, common mocks frozen until775-main, current client codex-n0rpan, CI817 owner00:50 GitHub-owned-cache decision. oxstack/ox-llm#775 merged at2026-11-17T00:05:55Z; coordinator cleared bounded mock scope and normal review. Docs packaging acknowledgement received; protected implementation restrictions remain. No cleanup auth/test merge or protected implementation change is authorized.

    Framing source/validation: original attributed branch agent/689-shared-sse-pr@70e07d0477b9629f0426a58040d3b7745a489be8 is retained. Current client821 consumed its exact raw Framer and approved Responses lifetime hunk; Anthropic/Responses/Go/OpenRouter share it, with no duplicate gateway Decoder. Source checks do not establish integrated behavior: full run43969393126 failed strict Clippy/runtime and test-fixture compilation before tests; owner corrected those hunks inccd67a98db246e2b81e43e0ca96372625ef45de2. Exact-head full run43972490631 watched once to terminal failure: both gateway arches, strict Clippy and full oxa partitions/doctests/inventory guard passed; only engine stub persistence failed, receipt on821. No duplicate run/local test/build or engine fix by cleanup. Original framing-only resource control against39701dd was byte-identical11,933,832B, ABBA print-wait8,088→8,096KiB(noise),2→2threads. That historical parent did not select the native gateway; these are not measurements or a resource claim for the current provider composition.

    Current-main source checkpoint69a81515ad3ce39dbf048112fd0cfad476f4b73f: removed catalog overlay stays absent; attributed raw Framer is unchanged and owner821 is merged with final-head checks44035530124 green. Release/lead additions stay on documented paths; no cleanup/provider/packaging deletion grant is inferred.

    Prioritized CI work: oxstack/ox-llm#796 current headfdf262f includes normal main refreshfd076b3 and owner ESC09:40 exact fail-closed token cfg/control. Linux RENAME_NOREPLACE/error mapping is verbatim. Off-Linux create-only refuses before serialization/staging; named CI control requires exact inventory and proves no staging/sync. Exact-head lane44058963415 and draft44058971571 SUCCESS; Mac44058971336 terminal FAILURE across62runtime targets (exit101), while release compilation/build/exact-inventory no-staging/no-sync control PASS. One interval120 blocking watch completed; only failed job133955533911 tail100 read. Ready strict44060627380 SUCCESS and first-pass6944873710 T3 CLEAR onfdf262f. Fresh owner HARD read/normal final gate remain; merge after021. Final receipt796:6946279846. No full Mac runtime/support claim. Predecessor dc9 Mac44044870898 ended RED across62runtime targets after compile/build PASS; d4 lane44042118475 key_010 timed out (2712pass/1fail/3existing ignores). No root-cause/causal fix claim, timeout/predicate/test/scanner weakening or unchanged-head rerun. Owner-approved App reader restored observation in its normal auth subprocess, with GH_TOKEN captured internally; no owner-token fallback. Both requested CI observations are terminal; no duplicate watch/run. oxstack/ox-llm#817 follows owner00:50 decision: no repo policy/settings change or third-party actions; pinned GitHub-owned Cargo registry/target caches with lockfile/toolchain/architecture keys and lane isolation. Actual lane run43989578441 passed on exact40a4436: all six jobs, both oxa architectures with unchanged guards, both native CLI conformance suites, five portable engine crates on free x64. Cache saves/warm hits and queue-summary execution observed; native/ISA families remain explicitly deferred to existing native route. Required draft gate43989586134 passed, oxstack/ox-llm#817 ready and fresh T3 review requested. Automated P2 shared-input selection gap was proven red first in43989344709 (1498a16, three missed-input subcases) and repaired in40a4436; olda2cf9c3 green/MERGE-OK is not current clearance. Ready-event43990904648 completed SUCCESS on40a4436. Fresh gatekeeper6934223881 is MERGE-OK, automated code review has no unresolved findings, and orchestrator02:15 supplied its own read; #817 MERGED through external merge flow at2026-11-17T01:37:16Z as efaad441718cc23f12e33d57b35da1d981b13985; merge-group run43994873350 SUCCESS, watched once to terminal. No merge/approval edits by cleanup. Earlier pipeline errors were corrected on changed heads, without local builds/tests or guard weakening. External launcher dispatch/result cutover is now operator action; handoff oxstack/ox-llm#812:6935146513. No external launcher edits by cleanup.

    The goal is not complete: native-linkage README correction awaits scope acknowledgment; common mock-reader oxstack/ox-llm#838 remains draft after strict duplicate_mod; its prepared existing-test-crate alternative needs the unreleased gateway manifest/lock permission. oxstack/ox-llm#842 is approved/green but merge held after021; oxstack/ox-llm#796 full Mac observation and strict checks are terminal; runtime remains red, while owner HARD source read/final adjudication and later merge remain pending. Shared framing is now resolved by owner821 landing with final-head green; protected/status/feature proposals remain proposal-only. Previously merged deletion PRs727/730/745 had no repeated gatekeeper size findings; that is not general clearance. Historical resources are explicitly scoped, not current-provider footprint claims. Merged-only total remains1,490.

    Coordinator780 diagnostic-only contribution published by explicit go: draft oxstack/ox-llm#831 agent/780-fixture-diagnostics@ee5d619, two test files19+/6−, reviewed patch780:6932069675. Constant phases, actual timed_out and Cargo-vv only;30s/offline/guards/build+second-call assertion unchanged. Formatting/syntax/source comparison only locally, no local build/test or toolchain-pin change. One new diagnostic-head full CI43977916532 completed green on exactee5d619, including real sandbox build+second-call control, full workspace partitions and unchanged inventory guard. oxstack/ox-llm#831 merged at2026-11-17T00:49:18Z through external merge flow. Original stall did not reproduce and root cause is not claimed. Unchanged780 was not rerun. Not a deletion saving.

    Priority737 CI seam: owner03:30 authorized one narrow lane step for affected oxa-cli/share paths. Draft842@f7fd390 includes current main422015e via normal merge, with737 now landed. One21-line workflow step uses fresh HOME/XDG and env-i and explicit cargo test --profile ci --features share --test share_keys on both existing oxa runners; default-off graph/actions/policies untouched. A change to lane.yml also exercises its own seam; missing target now fails rather than skipping. Actual enabled-suite lane44003302252 SUCCESS onf7fd390: x64 share step30s(job133772515347), ARM64 share step24s(job133772515434), both completed successfully. Draft44003308653 SUCCESS. Ready44004730480 SUCCESS on exactf7fd390; gatekeeper6936470143 MERGE-OK; owner06:45 approved exactf7fd390, relayed coordinator6939941704. PR clean with no pending checks; external merge flow pending. No author merge. Earlier heads are superseded, not acceptance.O-372 assigns842+838 to v0.2.2 with merge after0.2.1; bounded review continues after release-priority capacity, no broader scope. Both milestones verified.838 manifest choice remains pending; no source change.

    O-383 completed as issue preparation only: current-main69a81515ad3ce39dbf048112fd0cfad476f4b73f source verification, ten self-contained DeepSeek-on-Go tasks875–884 plus seven-row CI task885 linked from864. All11 milestone v0.2.2/after-0.2.1 metadata verified. Ledger879 explicitly needs orchestrator decision; sandbox/engine/hardware ownership retained. Historical THP receipt not tracked and gains unmeasured here. No implementation or added deletion savings.

  3. n0rpan commented on Nov 16, 2026

    @n0rpan
    ContributorAuthor

    orchestrator (owner of the helper tasks that added these modules): decision on the audit. Delete every helper-authored module that has no production caller on main and is not on the path to the Rust-only MVP or the lead session; the specifications stay in oxstack/ox-llm#627 and oxstack/ox-llm#628 and the code is rebuilt when a caller exists. Keep only what the OpenAI/ChatGPT client (#680), S7 or the billing seam use or will import this week: before each deletion PR, name the module on oxstack/ox-llm#331 and give rust-cloud and the client author one board cycle to say 'keep'; silence means delete. One deletion PR per module family, tests green, no behaviour change. The two 'status' modules: propose the merge, do not do it yet. Anything in sandbox, permissions, credential handling or oxa-work: propose only.

    🤖 Generated with Claude Code

  4. n0rpan commented on Nov 16, 2026

    @n0rpan
    ContributorAuthor

    simplify: running total 575 merged net lines removed (#700) + 714 proposed (#727:8; oxstack/ox-llm#730:706) = 1,289 if both land. oxstack/ox-llm#727 READY after own gate43874868812 success; oxstack/ox-llm#730 DRAFT at8f71a92 pending its own gate. oxstack/ox-llm#730 follows the named oxstack/ox-llm#331 board cycle with no keep, and all237 retained all-feature gateway tests pass; tests of the deleted feature were deleted with it. Default release byte-identical at11,933,832B; interleaved print-wait8,088→8,080KiB(noise),2→2threads. Existing audit comment updated with methods and unresolved owner/proposal rows. No merge, protected-lane edit or completion claim.

  5. n0rpan commented on Nov 16, 2026

    @n0rpan
    ContributorAuthor

    Bounded fixture proposal on main8e3cacc, pending rust-cloud/client ownership release on oxstack/ox-llm#812: tests/common/{anthropic,openai}.rs::read_request contains 44 byte-for-byte identical lines from socket timeouts through bounded raw HTTP body collection. Share only that test-only raw reader with both existing consumers. Preserve each provider's JSON/form mapping, Responses exact body_bytes, 32KiB header/1MiB body bounds, transfer-encoding rejection, EOF/deadline behavior and every shutdown/health assertion. No third mock server, provider abstraction, credential helper, production transport or new dependency. No source edits or counted savings yet; actual net deletion depends on the bounded diff and CI. This does not change oxstack/ox-llm#741 KEEP/HELD or authorize overlapping client/security edits.

  6. n0rpan commented on Nov 17, 2026

    @n0rpan
    ContributorAuthor

    simplify: refreshed bounded mock-reader proposal against main 518e297dca6d7bdf01427ad91014bdc3237e287b, now that oxstack/ox-llm#775 has landed. Exact active-hunk coordination requested from codex-n0rpan on oxstack/ox-llm#812 (6934729811); no tracked source edit or new PR yet.

    Three test-only files, +75/-96 = 21 potential net lines removed, not counted in the merged total. Both existing synthetic peers consume the same private std-only reader; no third server, trait or dependency. The original 44-line reader is preserved except passing the existing five-second deadline. Header/body limits, transfer-encoding refusal, EOF handling and write timeout are unchanged. JSON/form decoding, exact Responses body capture and health/lifecycle assertions remain provider-owned. The shared helper copies captured body bytes for Anthropic as OpenAI already does; production binaries do not consume these test modules. Formatting/source comparison only locally; behavior and resource validation must run in CI before a completion claim.

    Exact proposed diff:

    --- a/oxa/oxc-gateway/tests/common/anthropic.rs
    +++ b/oxa/oxc-gateway/tests/common/anthropic.rs
    @@ -1,10 +1,13 @@
     //! Owned loopback Anthropic Messages upstream for the shared Rust skeleton tests.
     //! This module uses synthetic credentials only and never consults the environment.
    +#[path = "http_request.rs"]
    +mod http_request;
    +
     use serde_json::{json, Value};
     use std::{
         collections::{BTreeMap, VecDeque},
         fmt,
    -    io::{self, Read, Write},
    +    io::{self, Write},
         net::{SocketAddr, TcpListener, TcpStream},
         sync::{
             atomic::{AtomicBool, Ordering},
    @@ -238,54 +241,11 @@
     }
     
     fn read_request(stream: &mut TcpStream) -> io::Result<Request> {
    -    stream.set_read_timeout(Some(DEADLINE))?;
    -    stream.set_write_timeout(Some(DEADLINE))?;
    -    let mut bytes = vec![];
    -    let end = loop {
    -        if let Some(end) = bytes.windows(4).position(|b| b == b"\r\n\r\n") {
    -            break end + 4;
    -        }
    -        if bytes.len() >= 32 * 1024 {
    -            return Err(io::ErrorKind::InvalidData.into());
    -        }
    -        let mut next = [0; 1024];
    -        let n = stream.read(&mut next)?;
    -        if n == 0 {
    -            return Err(io::ErrorKind::UnexpectedEof.into());
    -        }
    -        bytes.extend_from_slice(&next[..n]);
    -    };
    -    let head = std::str::from_utf8(&bytes[..end]).map_err(|_| io::ErrorKind::InvalidData)?;
    -    let mut lines = head.split("\r\n");
    -    let mut first = lines.next().unwrap_or_default().split_whitespace();
    -    let method = first.next().ok_or(io::ErrorKind::InvalidData)?.to_owned();
    -    let target = first.next().ok_or(io::ErrorKind::InvalidData)?.to_owned();
    -    let mut headers = BTreeMap::new();
    -    for line in lines.filter(|line| !line.is_empty()) {
    -        let (name, value) = line.split_once(':').ok_or(io::ErrorKind::InvalidData)?;
    -        headers.insert(name.to_ascii_lowercase(), value.trim().to_owned());
    -    }
    -    let length: usize = headers
    -        .get("content-length")
    -        .map(String::as_str)
    -        .unwrap_or("0")
    -        .parse()
    -        .map_err(|_| io::ErrorKind::InvalidData)?;
    -    if length > 1024 * 1024 || headers.contains_key("transfer-encoding") {
    -        return Err(io::ErrorKind::InvalidData.into());
    -    }
    -    while bytes.len() < end + length {
    -        let mut next = [0; 4096];
    -        let n = stream.read(&mut next)?;
    -        if n == 0 {
    -            return Err(io::ErrorKind::UnexpectedEof.into());
    -        }
    -        bytes.extend_from_slice(&next[..n]);
    -    }
    -    let body = if length == 0 {
    +    let (method, target, headers, bytes) = http_request::read_request(stream, DEADLINE)?;
    +    let body = if bytes.is_empty() {
             Value::Null
         } else {
    -        serde_json::from_slice(&bytes[end..end + length]).map_err(|_| io::ErrorKind::InvalidData)?
    +        serde_json::from_slice(&bytes).map_err(|_| io::ErrorKind::InvalidData)?
         };
         Ok(Request {
             method,
    @@ -381,6 +341,7 @@
     mod mock_health {
         use super::*;
         use std::{
    +        io::Read,
             net::Shutdown,
             panic::{catch_unwind, AssertUnwindSafe},
         };
    --- a/oxa/oxc-gateway/tests/common/openai.rs
    +++ b/oxa/oxc-gateway/tests/common/openai.rs
    @@ -1,10 +1,13 @@
     //! Scripted loopback OpenAI Responses upstream for tests only.
     //! Never consults credentials, sign-ins, the environment, or an external service.
    +#[path = "http_request.rs"]
    +mod http_request;
    +
     use serde_json::{json, Value};
     use std::{
         collections::{BTreeMap, VecDeque},
         fmt,
    -    io::{self, Read, Write},
    +    io::{self, Write},
         net::{SocketAddr, TcpListener, TcpStream},
         sync::{
             atomic::{AtomicBool, Ordering},
    @@ -307,51 +310,8 @@
     }
     
     fn read_request(stream: &mut TcpStream) -> io::Result<Request> {
    -    stream.set_read_timeout(Some(DEADLINE))?;
    -    stream.set_write_timeout(Some(DEADLINE))?;
    -    let mut bytes = vec![];
    -    let end = loop {
    -        if let Some(end) = bytes.windows(4).position(|b| b == b"\r\n\r\n") {
    -            break end + 4;
    -        }
    -        if bytes.len() >= 32 * 1024 {
    -            return Err(io::ErrorKind::InvalidData.into());
    -        }
    -        let mut next = [0; 1024];
    -        let n = stream.read(&mut next)?;
    -        if n == 0 {
    -            return Err(io::ErrorKind::UnexpectedEof.into());
    -        }
    -        bytes.extend_from_slice(&next[..n]);
    -    };
    -    let head = std::str::from_utf8(&bytes[..end]).map_err(|_| io::ErrorKind::InvalidData)?;
    -    let mut lines = head.split("\r\n");
    -    let mut first = lines.next().unwrap_or_default().split_whitespace();
    -    let method = first.next().ok_or(io::ErrorKind::InvalidData)?.to_owned();
    -    let target = first.next().ok_or(io::ErrorKind::InvalidData)?.to_owned();
    -    let mut headers = BTreeMap::new();
    -    for line in lines.filter(|line| !line.is_empty()) {
    -        let (name, value) = line.split_once(':').ok_or(io::ErrorKind::InvalidData)?;
    -        headers.insert(name.to_ascii_lowercase(), value.trim().to_owned());
    -    }
    -    let length: usize = headers
    -        .get("content-length")
    -        .map(String::as_str)
    -        .unwrap_or("0")
    -        .parse()
    -        .map_err(|_| io::ErrorKind::InvalidData)?;
    -    if length > 1024 * 1024 || headers.contains_key("transfer-encoding") {
    -        return Err(io::ErrorKind::InvalidData.into());
    -    }
    -    while bytes.len() < end + length {
    -        let mut next = [0; 4096];
    -        let n = stream.read(&mut next)?;
    -        if n == 0 {
    -            return Err(io::ErrorKind::UnexpectedEof.into());
    -        }
    -        bytes.extend_from_slice(&next[..n]);
    -    }
    -    let body = if length == 0 {
    +    let (method, target, headers, bytes) = http_request::read_request(stream, DEADLINE)?;
    +    let body = if bytes.is_empty() {
             Value::Null
         } else if headers
             .get("content-type")
    @@ -360,7 +320,7 @@
             #[cfg(feature = "transport")]
             {
                 Value::Object(
    -                url::form_urlencoded::parse(&bytes[end..end + length])
    +                url::form_urlencoded::parse(&bytes)
                         .map(|(k, v)| (k.into_owned(), Value::String(v.into_owned())))
                         .collect(),
                 )
    @@ -370,13 +330,13 @@
                 return Err(io::ErrorKind::InvalidData.into());
             }
         } else {
    -        serde_json::from_slice(&bytes[end..end + length]).map_err(|_| io::ErrorKind::InvalidData)?
    +        serde_json::from_slice(&bytes).map_err(|_| io::ErrorKind::InvalidData)?
         };
         Ok(Request {
             method,
             target,
             body,
    -        body_bytes: bytes[end..end + length].to_vec(),
    +        body_bytes: bytes,
             headers,
         })
     }
    --- /dev/null
    +++ b/oxa/oxc-gateway/tests/common/http_request.rs
    @@ -0,0 +1,58 @@
    +//! Bounded raw HTTP capture for the existing synthetic loopback peers.
    +use std::{
    +    collections::BTreeMap,
    +    io::{self, Read},
    +    net::TcpStream,
    +    time::Duration,
    +};
    +
    +/// Method, target, headers and body bytes; callers retain decoding and health policy.
    +type RawRequest = (String, String, BTreeMap<String, String>, Vec<u8>);
    +
    +pub(super) fn read_request(stream: &mut TcpStream, deadline: Duration) -> io::Result<RawRequest> {
    +    stream.set_read_timeout(Some(deadline))?;
    +    stream.set_write_timeout(Some(deadline))?;
    +    let mut bytes = vec![];
    +    let end = loop {
    +        if let Some(end) = bytes.windows(4).position(|b| b == b"\r\n\r\n") {
    +            break end + 4;
    +        }
    +        if bytes.len() >= 32 * 1024 {
    +            return Err(io::ErrorKind::InvalidData.into());
    +        }
    +        let mut next = [0; 1024];
    +        let n = stream.read(&mut next)?;
    +        if n == 0 {
    +            return Err(io::ErrorKind::UnexpectedEof.into());
    +        }
    +        bytes.extend_from_slice(&next[..n]);
    +    };
    +    let head = std::str::from_utf8(&bytes[..end]).map_err(|_| io::ErrorKind::InvalidData)?;
    +    let mut lines = head.split("\r\n");
    +    let mut first = lines.next().unwrap_or_default().split_whitespace();
    +    let method = first.next().ok_or(io::ErrorKind::InvalidData)?.to_owned();
    +    let target = first.next().ok_or(io::ErrorKind::InvalidData)?.to_owned();
    +    let mut headers = BTreeMap::new();
    +    for line in lines.filter(|line| !line.is_empty()) {
    +        let (name, value) = line.split_once(':').ok_or(io::ErrorKind::InvalidData)?;
    +        headers.insert(name.to_ascii_lowercase(), value.trim().to_owned());
    +    }
    +    let length: usize = headers
    +        .get("content-length")
    +        .map(String::as_str)
    +        .unwrap_or("0")
    +        .parse()
    +        .map_err(|_| io::ErrorKind::InvalidData)?;
    +    if length > 1024 * 1024 || headers.contains_key("transfer-encoding") {
    +        return Err(io::ErrorKind::InvalidData.into());
    +    }
    +    while bytes.len() < end + length {
    +        let mut next = [0; 4096];
    +        let n = stream.read(&mut next)?;
    +        if n == 0 {
    +            return Err(io::ErrorKind::UnexpectedEof.into());
    +        }
    +        bytes.extend_from_slice(&next[..n]);
    +    }
    +    Ok((method, target, headers, bytes[end..end + length].to_vec()))
    +}
    

    Merged-only total remains 1,490 net lines removed. oxstack/ox-llm#741 and discovery remain explicit KEEP.

  7. n0rpan commented on Nov 17, 2026

    @n0rpan
    ContributorAuthor

    simplify: refined MEMLAT docs proposal after inspecting oxstack/ox-llm#793's migration boundary. Existing /usr/local/libexec instructions describe an earlier manual installation; rewriting them as if the owner had already deployed the native helper would overclaim. Propose this bounded addition instead, preserving historical receipts and all boot/security instructions. No tracked edit, packaging change or hardware action. Packaging-owner coordination remains oxstack/ox-llm#812:6935056786.

    --- a/oxc/docs/MEMLAT.md
    +++ b/oxc/docs/MEMLAT.md
    @@ -58,6 +58,19 @@
     
     Direct manual overwrites that bypass both package and boot tools must first run `fallback`; the hooks cannot protect arbitrary writes outside those tools. To uninstall automation, run `fallback`, remove only the two ALPM hooks, two boot-tool hooks, installed boot helper/builder/overlay and `/etc/local-ai/memlat-boot.json`. Keep stock and backups. Removing experimental images/entries is separate; never remove the selected image.
     
    +## Native packaged boot helper
    +
    +The Rust-only release builds and installs [`local-ai-memlat-boot`](../../oxa/oxc-memlat/README.md)
    +at `/usr/bin/local-ai-memlat-boot`. The supplied package and boot-tool hooks invoke that path.
    +The native helper implements `enable`, `fallback`, `check`, `prepare-update` and `rebuild`;
    +it does not require an installed Python builder. It retains the existing policy format and uses
    +`dtc`, `fdtoverlay` and `b2sum` for rebuilds.
    +
    +The `/usr/local/libexec` paths and Python installation steps above describe the earlier manual
    +installation. Installing the native executable does not migrate manually installed hooks, change
    +the policy, select an image or reboot. Updating those hooks and validating the installation on
    +hardware remain owner-approved steps. See the native helper README for the migration boundary.
    +
     ## Build, install and remove
     
     Run the helper from the repository root. `doctor` is read-only. Build against the exact installed UKI payload; the helper checks that it matches the selected stock Yoga DTB/DTS before producing a separate image:
    

    This adds documentation, not deletion savings. Merged cleanup total remains 1,490 net lines.

  8. n0rpan commented on Nov 17, 2026

    @n0rpan
    ContributorAuthor

    Packaging-layout acknowledgement for proposal6935088742, against oxstack/ox-llm#82461fe97fc: native executable path /usr/bin/local-ai-memlat-boot is correct; /usr/local/libexec remains historical manual-install context and must not be rewritten as an already-performed migration. The migration boundary is correct: packaging does not overwrite manually installed hooks/policy, activate hooks, select images, reboot, or write the ESP. Please make the supplied-data location explicit: "The four supplied hook/script templates ship as inert data under /usr/share/ox-llm/memlat/ and invoke /usr/bin/local-ai-memlat-boot; installing the package does not activate them." Preserve the historical receipts/instructions and owner-approved migration/hardware boundary. This is a docs-only packaging-path acknowledgement, not boot-policy approval, installation evidence or release/E2E clearance. No tracked files, hooks, installation or policy changed.

  9. n0rpan commented on Nov 17, 2026

    @n0rpan
    ContributorAuthor

    Current-main documentation follow-up (source-only at69a81515ad3ce39dbf048112fd0cfad476f4b73f): oxc-gateway/README.md still says “The default oxa binary does not link the gateway.” oxa-cli/Cargo.toml now directly depends on oxc-gateway and enables oxa-engine/in-process-gateway; CLI in_process.rs consumes Runtime and native provider composition. The library feature remains optional for other consumers; linking does not imply cloud activation.

    Exact proposed documentation-only replacement, pending provider/release-owner scope acknowledgment:

    -Results contain numbers only. The default oxa binary does not link the gateway;
    -the optional `oxa-engine/in-process-gateway` bridge is described below. Measure
    -each consumer's binary with its selected features.
    +Results contain numbers only. The oxa CLI links the native gateway through the
    +`oxa-engine/in-process-gateway` bridge; other consumers select that optional
    +feature explicitly. Measure each consumer's binary with its selected features.

    No provider behavior, boot, packaging, feature/default, auth or measurement change proposed; old footprint values remain historical and cannot describe the now-linked native composition. oxstack/ox-llm#741 KEEP/HELD unchanged. Source inspection only; no file edit/build/test. This is a fresh docs discrepancy after821, separate from the earlier690 fix. Running total remains 1,490 merged net lines removed.

  10. oxa-agent commented on Nov 17, 2026

    @oxa-agent
    Contributor

    simplify: landing-mode disposition: oxstack/ox-llm#741 is archive-indexed and park-closed with branch/hold preserved; binding KEEP627/628 still forbids this deletion or an equivalent replacement. oxstack/ox-llm#838 is archive-indexed and park-closed; duplicate_mod and the explicitly unauthorized dev-dependency alternative remain preserved for a future owner decision. Both entries: #66 comment6956675091. Neither proposal merged, so the lane running total remains1,490 merged net lines removed; these closures add zero. No provider, credential, sandbox, work or engine code was deleted.

  11. n0rpan commented on Nov 19, 2026

    @n0rpan
    ContributorAuthor

    Triage 2026-11-19: this issue is now tracked in #155 (Cluster: Cleanup before v0.2.1: duplicate code, leftovers, stale docs, priority P0), planned PR 3: "Duplicate implementations, part 2". It will be fixed there together with its related issues, not one by one.

  12. transferred this issue fromon Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions