Repository navigation
feat(D144): library seams — explicit settings, run_task, per-request API context - #531
Conversation
Codex review round 1 (gpt-6.1-sol, max effort)VERDICT: REQUEST_CHANGES
Validation: 149 targeted tests passed on isolated PostgreSQL 19 Beta 3. Additional named-task probes passed due checks, foreign-deployment refusal, retries, DLQ, budget parking, announcements, and follow-ups. D74 used the overridden request context correctly. The container was removed; no files were modified. Disposition (Claude), fixed in f73ab01
|
Codex review round 2 (gpt-6.1-sol, max effort)VERDICT: REQUEST_CHANGES
Round-1 budget and ingest-advertising fixes verified. Shared Mistral/System One accounts are acceptable as documented. All 140 targeted tests passed, plus named-task, budget, and D74 probes. PostgreSQL Beta 3 container removed; worktree unchanged. Disposition (Claude), fixed in c0da03a
|
… settings - EngineSettings carries everything that differs between deployments (identity and buckets, database, object store, model-provider account). SelfHostProfile.from_settings(settings) builds one deployment's context from it; EngineSettings.from_env() is the default source. - run_task(context, processing_id) claims and runs one named, due row through the ordinary worker boundary (WorkLedger.claim_one gains processing_id); retries are announced through the context's TaskQueuePort, defaulting to pg_notify. - Every HTTP route reads its deployment from the overridable deployment_context FastAPI dependency (ApiDeployment); build_api's signature and the OpenAPI document are unchanged. - A two-database test runs both deployments' requests and tasks, interleaved, in one process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm
…capabilities Codex round 1: - EngineSettings gains work_ledger (retry backoff, spend budgets); the profile uses its own WorkLedgerSettings for run_task and the loop. - GET /deployment lists only tools whose capabilities the request's ApiDeployment has (and whose routes are mounted). - D144 names the OCR and System One provider accounts as process-wide, like model policy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm
…s host-wide Codex round 2: adjacent chunks is served by the engine every deployment has, so /deployment keeps it when the request's deployment has no operation surface. The image-description account joins Mistral OCR and System One as host-wide provider accounts in D144. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm
c0da03a to
9a500f3
Compare
Codex review round 3 (gpt-6.1-sol, max effort)VERDICT: APPROVE No blocker, major, or minor findings remain. Latest fixes verified; the documented host-wide converter accounts fit the accepted boundary. Validation: 201 tests passed, one known expected failure. Additional probes passed for request-specific D74 admission, settings isolation, named claims, foreign-deployment refusal, retries, DLQ, budgets, and follow-ups. Isolated PostgreSQL 19 Beta 3 container removed. Worktree unchanged. Rebased onto main after #532 merged. The only overlap was |
UMC relaunch plan phase 2 item (c), library seams (O4). Reasoning is in UMC analysis
relaunch-runtime-shape-2026-11-06.md§4.3 and §11.4. Only generic seams are added here; the tenant resolver, context cache and push-queue adapter stay out of this repo (D60).Public seam API
run_taskreads the row's route from the context's database. It claims only that row, only if it is due, and runs it throughWorker.run_one, so attempts, retries, budget parks, dead letters and chain follow-ups are unchanged.no_work.ValueError.ApiDeployment(deployment id and capabilities) fromdeployment_context, and the D74 barrier uses the same per-request value. The perimeter gate, direct admission, spend lease and startup readiness stay per app.build_apikeeps its keyword signature, and the OpenAPI output is unchanged.SelfHostProfile.__init__gainstask_queue,model_provider_settingsandwork_ledger_settings;EngineSettingsalso carrieswork_ledger(retry backoff, budgets).LISTENconnection use the profile's own engine URL.Changes
profiles/selfhost.py:EngineSettings,from_settings(settings),api_deployment(),run_task,_worker.surfaces/http_api.py:ApiDeploymentanddeployment_context. Routes takedeployment: _Deployment.spine/work_ledger.py:claim_one(processing_id=…)(it shares the due predicate with the unnamed claim) androute_of.workers/base.py:run_one(processing_id=…).decisions.mdD144; packaging design §5.src/tests/profiles/test_two_deployment_contexts_pg.py. It uses two scratch databases in one process.no_workfor B's task.run_taskfor B then A, and each chain continues in its own DB.Coordination
engine-ledgeris working in the same repo on claim leases (a) and the class worker (b). This PR touchesclaim_oneandWorker.run_oneonly by adding theprocessing_idparameter. Whichever of us merges second rebases.Checks
🤖 Generated with Claude Code
https://claude.ai/code/session_01F9cMsQBqiW2qU2ow4zeNCm