Repository navigation
[obvious-fleet] Backend: per-stage real selection with implementation markers - #297
Conversation
HSS_ORCH_REAL_STAGES names stages whose real implementations run even with stage stubs on; the cpu alias covers every weightless stage and objects is refused without HSS_OBJECTS_DEVICE=cpu. run_stage publishes impl/<stage>.json under the pinned hss-stage-impl/v1 contract, and the result stage's inputs carry impl/. Docs in backend/docs/real-cpu-stages.md.
|
@codex review |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 098d8fdfc7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@greptileai review this at plus |
[Medium impact] Adds per-stage real implementation selection for local development. Fix the CPU alias and dev-only environment guard before merging.
|
HSS_ORCH_REAL_STAGES treated a missing or blank SMP_ENVIRONMENT as dev, while Settings reads the same values as prod. An unconfigured production process could therefore mix real and stand-in stages. Only an exact "dev" now passes, matching Settings. The remote refusal compared HSS_ORCH_MODAL_REMOTE to "1" only; load_orch also accepts true/yes/on in any case. It now uses the same _flag parser. The cpu alias no longer includes dense, which falls back to model weights on photo-only packets, and is refused while VISION_EXTERNAL_CALLS is on, since reads and criteria would then make paid calls. The journey test now checks the markers the result stage receives in its work dir, rather than filtering run.artifacts after the run. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…markers Brings in the impl/<stage>.json marker writer from #297 (run_stage) and the fail-closed stage selection from Z3, so the result stage has markers to read. graph.py conflict: both sides add "impl/" to the result inputs; kept the Z3 side, which also documents the marker contract. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uard Stage selection: fail closed without explicit dev; fix cpu alias and remote spellings
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Note Review skipped Codemetrics is installed on this repository, but it hasn't been added to your team yet. To enable AI code reviews for this repo, go to your dashboard and add BaseScanning to your team's repositories. |
fleet-packet: burst14-bs-stage-selection
What changed
Until now,
HSS_ORCH_STAGE_STUBS=1was all or nothing: a local run answered every stage with its stand-in fromserver/orchestrator/stubs/<stage>.py, so the result never depended on the scan and no real stage code could be exercised locally without running the full real orchestration (Modal, GPU, credentials). This change adds the middle setting and makes the choice observable:HSS_ORCH_REAL_STAGES(newbackend/server/orchestrator/stage_selection.py) names the stages whose real implementations run even with stage stubs on, per stage. A local or dev run can now exercise one real stage at a time against stand-in upstreams — e.g.HSS_ORCH_REAL_STAGES=validateruns the real packet validation and records which code served every other stage.impl/<stage>.json(stored atcaptures/{capture_id}/runs/{run_id}/impl/<stage>.json) under the pinned contracthss-stage-impl/v1, recordingimplementation(realorstand-in) and the exact dottedcallablethat executed — read off the resolved callable itself, so a per-run selection override (the capture-placement runner's) is recorded as what it ran, not what a global setting implies. Unset, behavior is byte-for-byte today's: every non-exempt stage recordsstand-in.impl/(graph.pySTAGE_INPUTS), so the composer receives every marker of its run and downstream result consumers can name which implementation produced each input. The pinned contract is shared withobv/burst14-bs-result-names-stand-ins; it is defined once inrunner.py(IMPL_SCHEMA) and copied verbatim there.The
cpualias selects every stage whose real path is deterministic CPU work (no GPU, no model weights, no paid call):validate poses reads scale dense coverage scene objects_3d placement criteria result.objectsis the one deliberate exclusion — its real path loads OWLv2/SigLIP weights — and listing it is refused unlessHSS_OBJECTS_DEVICE=cpuopts into local weights.Why
A per-run answer to "which code produced this?" needs two halves: the ability to run real stages locally at all (the selection), and a durable per-run record of what actually ran (the markers). The selection is dev-only by construction — refused together with
HSS_ORCH_MODAL_REMOTE=1(a remote run already runs everything real) and outsideSMP_ENVIRONMENT=dev— so production cannot silently run a half-real orchestration. Refusals raise at runner import, which is the startup of every process that can run a stage, and name the offending variable and value.The markers land in
impl/inside the run directory rather than in run metadata so they ride the existing artifact publication, hydration, and result-input machinery with no new transport, and survive in storage next to the artifacts they describe.How it works
flowchart LR env["HSS_ORCH_REAL_STAGES\n(comma list or 'cpu')"] --> parse["stage_selection.py\nparse + refusals"] parse -->|"is_real(stage)"| sc["runner.stage_callable"] sc -->|"selected / stubs_exempt"| real["real module\nserver.<stage>"] sc -->|"not selected"| stub["stand-in\nserver.orchestrator.stubs.<stage>"] real --> marker stub --> marker marker["run_stage → impl/<stage>.json\nhss-stage-impl/v1"] --> result["result stage inputs\ninclude impl/"]Caption: the selection only changes which callable
stage_callableresolves; the marker records what actually ran, and the result stage receives every marker.UI changes
N/A — orchestration backend only; no client-visible surface changes.
Verification
backend/server/orchestrator/tests/test_stage_selection.py— 14 tests: parsing (unset/blank, whitespace,cpualias covering exactlyCPU_STAGES, alias +objects= all 12), refusals (unknown stage,HSS_ORCH_MODAL_REMOTE=1, non-dev environment,objectswithout local-weights device — each message names the variable), the selection cache following the environment, callable selection under stubs (selected → real, unselected → stub,stubs_exemptplacement stays real, stubs-off unaffected), runner-import-time validation of a bad value, and two in-process journey runs on the committedbackend/data/fixtures/packets/mini-arkitpacket: withvalidateselected the run reaches today's terminal state through the real packet validation with mixed impl markers (validatereal/server.packet.run,posesstand-in,placementreal viastubs_exempt), and unset the markers record exactly today's implementations; the result stage's hydration carries the wholeimpl/directory. No Modal, GPU, network, or credentials.pytest server/orchestrator/tests— 195 passed.pytest backend/tests/test_capture_real_downstream.py— 12 passed (the feat(backend): --real-downstream runs the real criteria and result through the capture front door #292 capture-real-downstream journey, which overridesstage_callableper run, is unchanged and its override is what the marker's callable field is designed to record honestly).pytest backend/tests/test_runtime_join_journey.py— 6 passed.ruff check .— clean; the new test file isruff format-clean.make test— 4 failed, 1520 passed, 19 skipped, 14 errors in 10:43: the failure set is the branch base's documented baseline exactly — 4server/eval/tests/test_gates.py(SD-96 gates) failures plus 14 collection errors intests/test_capture_cold_restart.py, every name in files this branch does not touch; zero failures attributable to this change.objectsreal path with local weights is refused-by-default and not exercised end-to-end here (no weights on the dev box); the refusal itself is tested.Risk
backend/docs/real-cpu-stages.md) name this and recommend selecting upstream stages together. This is a dev-only knob and fails at run time, not silently.impl/artifacts are new keys under the run directory; only the result stage's declared inputs change, and_publishcallers treat unknown keys uniformly. Runs that fail a stage publish no marker for it, same as any other artifact.alpha, untouched here:ruff format --checkflagsserver/orchestrator/tests/test_greptile_followup.py;make lintwill report it on the base branch too.Checklist
Human author: Sam Gu (sgu07966@gmail.com)
🔗 Obvious Project · 🧵 Obvious Thread · 🔀 Obvious PR Artifact
Opened by the maintainer from the Obvious thread's own description, so every review bot reviews it (CodeRabbit skips PRs authored by bots). The work and its commits are by Obvious.
Co-authored-by: obvious-autobuild[bot] <262744130+obvious-autobuild[bot]@users.noreply.github.com>