Repository navigation
feat(providers): contract 1.2.0 — target_dir and run options for hooks (#405 prep) - #440
Conversation
#405 prep) Additive minor of the provider contract (wire list 1.2.0, 1.1.0, 1.0.0): - `target_dir`: required on every 1.2.0 context — the absolute generated `.labelle/<backend>_<target>/` on hooks (same for every step, whatever `output_dir` is, `bundle --output` included), null on commands; never emitted below 1.2.0. - `run`: on every `run`-step hook of a 1.2.0 wire, absent elsewhere: `{ env: [{name,value}], args, timeout_ms }`, where `env` is exactly the `runner.appendRunOptionEnv(runOptionEnv(..))` list the core launch sets, `args` the tokens after `--`, `timeout_ms` the `--timeout`. The CLI maps nothing to any platform. - `provider_hooks.Site` gains `target_dir` and `run_options`, filled by the pipeline (`run_options` only for `labelle run`; other run-step hooks get the empty set). - A provider capped below 1.2.0 gets the older wire with neither key and, when run options were passed to its run hook, one `note:` line. - Decoder: strict key presence per wire (`target_dir` required at 1.2.0, unknown below it; optional keys never null), run only on run-step hooks, well-formed env names. Tests: decoder accept/reject matrix, negotiation (1.2/1.1/1.0 ranges), runPhase plumbing, hookRunOptions vs the core launch list, and an e2e replace-run hook on a provider target recording its context while a planted host-launch sentinel (which the unreplaced run does execute) never runs. Docs: provider-contract-v1.md, provider-hooks.md. Claude-Session: https://claude.ai/code/session_01R2K5sJDL5Msn1uRTkybiDP
|
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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! 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". |
PR 0b of the #405 plan (android as the first provider). Stacked on #439 (main → development sync).
Contract 1.1.0 gave hooks no target directory and no run options, so a
replace runhook couldn't receive--scene/--screenshot/--after, and abundlehook with--outputlost track of the generated tree. This PR adds a generic, additive contract 1.2.0. The CLI does no platform mapping, and the agnosticism guard stays green.Wire
1.2.0; the CLI speaks{1.2.0, 1.1.0, 1.0.0}. NewcarriesRunContext(wire)next tocarriesBuildNumber.target_diris required on every 1.2.0 context. On a hook it's the absolute.labelle/<backend>_<target>/, the same for every step whateveroutput_diris (includingbundle --output). It's null on commands and never emitted below 1.2.0.runis present on everyrun-step hook of a 1.2.0 wire and absent everywhere else. Shape:{ "env": [{"name","value"}…], "args": [tokens after --], "timeout_ms": int|null }.envis exactly whatrunner.appendRunOptionEnv(runOptionEnv(parsed_args))produces for the core launch.run-step hooks, such aswasm serve's, get the empty set.labelle: note: run options not passed to '<pkg>/<id>' (provider contract <wire> < 1.2.0)line.target_diris required at 1.2.0 and unknown below it, optional keys are never null,runis only allowed on run-step hooks, and env names must be well formed.Plumbing:
provider_hooks.Sitegainstarget_dir(required) andrun_options.pipeline.zigfills them in;run_optionsis set only forlabelle run, throughpipeline/run.zighookRunOptions.Tests
runPhasehands outtarget_dirfor every step, andrunonly for the run stephookRunOptionsmatches the core launch list, with the headless knobs excludedtest/provider_hooks_e2e.py, on a provider target with replace hooks on all four steps:labelle run --scene=x --screenshot=s --after=2s --timeout=30s -- a b: the replace-run hook's context has the threeLABELLE_*pairs,args == ["a","b"]andtimeout_ms == 30000.target_diris correct for build, run, bundle andbundle --output <elsewhere>.<1.2.0gets neither key and exactly one note; with no options there is no note.Docs:
docs/provider-contract-v1.md(additive minor, schema, negotiation) anddocs/provider-hooks.md.Verified locally (macOS, Zig 0.16.0), each exit code checked separately:
zig fmt --checkon the touched fileszig buildzig build -Dtarget=x86_64-windowszig build test: 1082/1087 passed (5 skipped), guard includedzig build test-provider-dispatchNote: CI's
pull_requesttrigger listsmain,developmentandfeat/**. A PR whose base ischore/sync-main-into-developmentwon't get CI until #439 merges and this PR is retargeted todevelopment.https://claude.ai/code/session_01R2K5sJDL5Msn1uRTkybiDP
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.