fix(relay): stop charging worker startup to the authored source deadline - #648
Conversation
`public_rhai_commands_accept_the_released_contract_for_an_unknown_product` failed on protected main against a tree byte-identical to the one that had just passed on the pull request head, reporting `derived_error_mismatch: expected=fixture.request_mismatch, actual=fixture.execution_contract_invalid`. The offline fixture runner built its hard deadline from the authored operation deadline alone. That deadline bounds a source call, but offline there is no source, so the same budget also had to cover starting the worker process and compiling the script before the fixture's first call was made. `WorkerProcess::evaluate` already adds `WORKER_STARTUP_GRACE` to the deadline it builds for itself, and the debug-build value of ten seconds exists because process start in a debug build is slow; the fixture runner did not add it, so a loaded runner could spend the whole eight-second authored deadline before the mismatched request was ever issued. The child still enforces its own script limits, so this widens no script budget. `run_rhai_worker` also collapsed every `WorkerError` into `ExecutionContractViolation`, so running out of wall clock was reported as the compiled plan being violated. That is what made a transient stall read as a defect in a correct fixture. A timeout now reports the existing `source.deadline_exceeded` class instead. Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
… main Adopters who want to try a fix before the next release currently have to build the toolset from source. A manually dispatched workflow builds the same three binaries for Linux amd64, Linux arm64, and macOS arm64 from a protected `main` revision that already passed CI, and publishes them as a prerelease tagged `v<workspace-version>-dev.<run>.<attempt>`. The installer accepts that tag shape and, when it sees one, replaces the release verification pointer with an explicit statement that the checksums are unsigned, no authenticity check was performed, and the build is not a Registry Stack release. Review notes, release provenance: - The workflow is `workflow_dispatch` only and refuses any ref other than `main`, refuses a revision that is not the current `origin/main`, and refuses to publish without a successful `push`-event CI run for that exact SHA. - The tag carries the run and attempt, so it is unique per dispatch, and validation proves both the git tag and the release destination are absent before anything is built. `gh release upload`, `gh release delete`, `--clobber`, `git push`, and `git update-ref` are absent, and the gate inventory forbids them returning. - `contents: write` appears once, in the publish job. That job does not check out the repository, so no branch workflow code runs with the write token. `packages: write`, `id-token: write`, and `attestations: write` are forbidden. - The prerelease is created with `--prerelease --latest=false` against the validated SHA, so it cannot become the latest release the docs deployment reads. - The installer is smoked against the assembled assets before publication, and the asset roster and checksums are reverified in the publish job. Covered by four structure tests in `test_release_workflow_structure.py`, the required, ordered, and forbidden gate entries in `check-gates-inventory.py`, and the installer tag-shape tests. Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18b0c467e6
ℹ️ 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".
| gh release create "${tag}" development-assets/* \ | ||
| --repo "${GITHUB_REPOSITORY}" \ | ||
| --target "${source_sha}" \ |
There was a problem hiding this comment.
Bind the dev release tag before publishing
If a repository writer creates the run-derived ${tag} after the validate job's absence check but before this publish step, gh release create will attach the release to that existing tag; per gh release create --help, --target only affects automatic tag creation when the tag is absent. That can publish assets and notes claiming ${source_sha} while the public release/tag resolves to another commit, breaking the provenance guarantee for these development builds; create/verify the tag binding atomically, or use a pre-created verified tag with --verify-tag, before exposing the release.
Useful? React with 👍 / 👎.
Two independent changes.
fix(relay): stop charging worker startup to the authored source deadlinepublic_rhai_commands_accept_the_released_contract_for_an_unknown_productfailed on protected
mainagainst a tree byte-identical to the one that hadjust passed on the pull request head:
The offline fixture runner built its hard deadline from the authored operation
deadline alone (
deadline: 8sfor that integration). That deadline bounds asource call, but offline there is no source, so the same budget also had to
cover starting the Rhai worker process and compiling the script before the
mismatched request was issued.
WorkerProcess::evaluatealready addsWORKER_STARTUP_GRACEto the deadline it builds for itself, and thedebug-build value exists because process start in a debug build is slow; the
fixture runner did not add it. The child still enforces its own script limits,
so this widens no script budget.
run_rhai_workeralso collapsed everyWorkerErrorintoExecutionContractViolation, so running out of wall clock was reported as thecompiled plan being violated. That is what made a transient stall read as a
defect in a correct fixture. A timeout now reports the existing
source.deadline_exceededclass.Confidence caveat. The failing test is
#[cfg(target_os = "linux")]and wasnot reproduced directly; the diagnosis is inferred from the code path. Three
WorkerErrorvariants reach that line without the host having recorded aterminal error:
TimedOut,SpawnFailed, andIpcFailed. Every other variantis deterministic given the same inputs and is ruled out by the green run on the
identical tree. This fixes and reclassifies
TimedOut. If the cause wasactually
SpawnFailed, a recurrence is still reported as a plan violation.Extending
OfflineFixtureErrorwith a harness-failure class would change adocumented stable diagnostic set and is left as a separate decision.
Two tests, both confirmed failing without the change.
feat(evidence): publish manual development builds of the toolset from mainA manually dispatched workflow builds the three binaries for Linux amd64, Linux
arm64, and macOS arm64 from a protected-
mainrevision that already passed CI,and publishes them as a prerelease tagged
v<workspace-version>-dev.<run>.<attempt>. The installer accepts that tag shapeand, when it sees one, replaces the release verification pointer with an
explicit statement that the checksums are unsigned, no authenticity check was
performed, and the build is not a Registry Stack release.
Release-provenance review notes are in the commit message. In summary: the
workflow is
workflow_dispatchonly andmainonly, requires a successfulpush-event CI run for the exact SHA, proves the tag is absent as both a gittag and a release before building, carries
contents: writein one job thatdoes not check out the repository, publishes with
--prerelease --latest=falseagainst the validated SHA, and contains no
gh release upload,gh release delete,--clobber,git push, orgit update-ref. The gateinventory forbids those returning.
Verification
cargo fmt --checkcargo clippy --locked --workspace --all-targets -- -D warningscargo test --locked -p registry-relaycargo test --locked -p registryctlcargo test --locked -p registry-evidencectl --test install_scriptpython3 -m unittest release.scripts.test_release_workflow_structure release.scripts.test_check_gates_inventorypython3 release/scripts/check-gates-inventory.pyshellcheckandshfmt -doninstall.shREGISTRY_RELEASE_SOURCE_MODE=monorepo release/scripts/check-release-source-model.shpython3 -m unittest release.scripts.test_registry_release