Skip to content

feat(engine): consolidate the engine PRs, with on-device-labelling docs and compat tests - #80

Closed
flxkm522 wants to merge 1 commit into
developfrom
feature/engine-consolidation
Closed

flxkm522 wants to merge 1 commit into
developfrom
feature/engine-consolidation

Conversation

@flxkm522

@flxkm522 flxkm522 commented Oct 12, 2026 •

Copy link
Copy Markdown

What this is

One consolidated PR for the redrob-code engine work, reviewed and refactored, plus the on-device-labelling documentation and compatibility tests (formerly #81, now folded in). The Electron/desktop app and the build-off / Quality-Lab stack are the separate alpha/desktop drafts and are not part of this.

Part A — Engine consolidation (was seven PRs, now closed)

Was What
#67 insights route + /v1/chat/completions (serve the OpenAI face for real; forward x-redrob-session)
#68 regenerate the JS SDK that had fallen behind the routes
#69 → #70 → #71 → #73 → #74 image_generate (edit / reference images), speech_generate (mp3), POST /redrob/speech, POST /redrob/transcribe
#79 shared on-device labellers (route-labeller, work-labeller) as source workspace packages

Integration fix: the chat-completion handler reads LLMClient inside the request, so it was a per-request requirement of the embedded API that Layer.provide(serviceLayer) did not discharge — it leaked and broke the untouched sdk-next caller. LLMClient is global, so it is now provided once via HttpRouter.provideRequest inside makeRoutes (packages/server/src/routes.ts).

Lean/doc pass (behaviour-preserving): constant-derived size messages; idiomatic [...text].length; a tightened describe() union guard; a corrected plugin/host comment; /redrob/speech+/redrob/transcribe documented in LOCAL-ENGINE-API.md; and route-coverage scenarios added for the two /redrob/* routes.

Part B — On-device labelling: docs + compatibility (answering the CTO review)

  • docs/ON-DEVICE-LABELLING.md (new) — the single reference for why there is encoder code (we wrap pinned OSS models — distiluse, multilingual-e5-base — not our own encoders, for on-device privacy + one implementation across products), where the tensors live (only the small trained layers are ours and in git: work-head.json 159KB, prototypes.json 232KB; base weights are hash-pinned downloads), the model-free-CI vs opt-in-eval story, and the backwards-compat model. Carries the pending checklist to move the e5 release asset from redrob-cowork to redrob-code (SHA pins unchanged; the URL is not flipped here because a not-yet-uploaded release would 404 every download).
  • httpapi-chat-completion.test.ts — two new v1-contract cases: the newer optional fields (max_completion_tokens, reasoning_effort, user) stay accepted, and unknown request fields are ignored, not rejected (a Console-style redrob block + a bogus key). The second pins the exact forward/third-party-compat guarantee and fails CI if the schema ever rejects excess properties.
  • test.yml — the labellers (linux) comment now spells out that the unit suites are model-free and CI-safe, and the real encoders are needed only by the opt-in eval/model dev commands (off the PR path).

Verified

bun turbo typecheck 20/20; bun install --frozen-lockfile clean; engine tool/server tests + the 7 chat-completion contract cases pass; core 6/6; work-labeller 77/77.

(This supersedes #81, whose three files are now the single commit here.)

…cs and compat tests

One change on develop that both consolidates the redrob-code ENGINE work and
documents + pins the on-device labelling it introduces. The Electron/desktop app
and the build-off / Quality-Lab stack are the separate alpha/desktop drafts and are
NOT part of this.

== Engine consolidation (was seven PRs) ==
- #67 insights route + /v1/chat/completions (serve the OpenAI face for real; forward
  x-redrob-session to the Console).
- #68 regenerate the JS SDK that had fallen behind the routes.
- #69-#74 the media tools and endpoints: image_generate (edit / reference images),
  speech_generate (mp3), POST /redrob/speech and POST /redrob/transcribe, all on the
  engine own Redrob credential.
- #79 the shared on-device labellers (route-labeller, work-labeller) as source
  workspace packages, consumed downstream by Cowork/Office/Design.

Integration fix: the chat-completion handler reads LLMClient inside the request, so it
was a per-request requirement of the embedded API that Layer.provide(serviceLayer) did
not discharge, leaking as a residual requirement and breaking the untouched sdk-next
caller. LLMClient is a global service, so it is now provided once via
HttpRouter.provideRequest inside makeRoutes (packages/server/src/routes.ts).

Lean/doc pass (behaviour-preserving): size-limit messages derive from their constants;
speech_generate characters() uses [...text].length; the insights describe() union guard
is tightened; a misleading plugin/host comment removed; /redrob/speech + /redrob/transcribe
documented in LOCAL-ENGINE-API.md; and the httpapi route-coverage harness gained scenarios
for the two /redrob/* routes.

== On-device labelling: docs + compatibility (answering the CTO review) ==
- docs/ON-DEVICE-LABELLING.md (new): the single reference for WHY there is encoder code
  (we wrap pinned off-the-shelf models -- distiluse, multilingual-e5-base -- not our own
  encoders, for on-device privacy + one implementation across products), WHERE the tensors
  live (only the small trained layers are ours and in git: work-head.json 159KB,
  prototypes.json 232KB; base weights are hash-pinned downloads), the model-free-CI vs
  opt-in-eval story, and the backwards-compat model for third-party clients. Includes the
  pending checklist to move the e5 release asset from redrob-cowork to redrob-code (SHA
  pins unchanged; the url is not flipped now because a not-yet-uploaded release would 404).
- httpapi-chat-completion.test.ts: two new v1-contract cases -- the newer optional fields
  (max_completion_tokens, reasoning_effort, user) stay accepted, and unknown request fields
  (a Console-style redrob block, a bogus key) are IGNORED not rejected. The second pins the
  exact forward/third-party-compat guarantee and fails CI if the schema rejects excess props.
- test.yml: the labellers job comment now spells out that the unit suites are model-free and
  CI-safe, and the real ~140MB/~278MB encoders are needed ONLY by the opt-in eval/model dev
  commands, which stay off the PR path.

Verified: bun turbo typecheck 20/20; bun install --frozen-lockfile clean; engine tool/server
tests + the 7 chat-completion contract cases pass; core 6/6; work-labeller 77/77.
@flxkm522
flxkm522 force-pushed the feature/engine-consolidation branch from 8194746 to 3f5d322 Compare October 12, 2026 12:07
@flxkm522 flxkm522 changed the title feat(engine): consolidate the engine PRs into one, reviewed and refactored feat(engine): consolidate the engine PRs, with on-device-labelling docs and compat tests Oct 12, 2026
@flxkm522
flxkm522 requested a review from its-janghoon October 12, 2026 12:08
@its-janghoon

Copy link
Copy Markdown
Member

Closed by the maintainer: engine PRs are not being taken right now. Branch kept.

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