^R D4: extract host-detection into scripts/lib/launcher/host-detect.sh + launcher-contract.md#394
Conversation
…yte-identical move, shellcheck/shfmt/bash-n/manifest green and outputs verified equal; launcher is user-visible but behavior is unchanged) First increment of roadmap item D4 (modularize the launcher). Moves the five host-detection helpers verbatim out of scripts/workcell into a new sourced module scripts/lib/launcher/host-detect.sh: - support_matrix_host_override_allowed - detected_host_os - detected_host_arch - detected_host_distro - detected_host_distro_version The functions are self-contained (uname/ps/PPID/env vars and each other only) and are sourced before their first call site alongside the other scripts/lib modules. Registers the new file in the validate-repo.sh and dev-quick-check.sh shell gates and regenerates the control-plane manifest hash for scripts/workcell. No logic change; the extracted block is byte-identical to the original. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… code execution impact; supporting documentation for the D4 refactor) New contract doc for the launcher decomposition (roadmap item D4). This first increment documents the host-detection module: what each of the five functions returns, the WORKCELL_TEST_SUPPORT_MATRIX_HOST_* harness- only overrides gated by support_matrix_host_override_allowed, and that values are emitted lowercased and normalized. Links the doc from its existing mention in the D4 section of the improvement-tracks plan. The doc will grow as more launcher modules are extracted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94feadb157
ℹ️ 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".
…(the extracted scripts/lib/launcher/host-detect.sh is now sourced launcher code, but GenerateControlPlaneManifest in internal/metadatautil/core.go only listed scripts/workcell + the older lib helpers, so the new module was outside the signed/provenance-verified manifest and host-detection changes wouldn't be caught; add it to hostArtifacts and regenerate control-plane-manifest.json) (manifest verify + go test green; supporting the D4 host-detect extraction - closes the provenance gap the move opened)
|
Fixed: added scripts/lib/launcher/host-detect.sh to the hostArtifacts list in internal/metadatautil/core.go's GenerateControlPlaneManifest and regenerated the manifest, so the extracted module is now inside the signed/provenance-verified control-plane manifest (a host-detection change is now caught). manifest verify + go test ./internal/metadatautil green. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. 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". |
D4 (modularize the launcher) — increment 1 of N.
scripts/workcellis a 9046-line monolith; D4 splits it into sourcedscripts/lib/launcher/modules with adocs/launcher-contract.md. Each increment is behavior-preserving and small enough to fit the PR-shape limit (moving code counts as delete+add, so this is inherently multi-PR).What
scripts/lib/launcher/host-detect.sh: the 5 host-detection functions (support_matrix_host_override_allowed,detected_host_os/_arch/_distro/_distro_version) moved verbatim (byte-identical) fromscripts/workcell, with the standard lib header. They're self-contained (onlyuname/ps/env) and first called far after the source point, so sourcing the module in the existingscripts/lib/*.shblock preserves definition order.scripts/workcell: 116-line deletion + onesource …/host-detect.shline.shell_filesgates (validate-repo.sh,dev-quick-check.sh); regenerated the control-plane manifest.docs/launcher-contract.mdwith the host-detection section (function contracts + theWORKCELL_TEST_SUPPORT_MATRIX_HOST_*harness overrides); grows as more modules land.Behavior-preserving
Pure move, zero logic change — the extracted functions are byte-identical to the originals, and sourcing + calling the module returns the same values.
Validation
shellcheck -x,shfmt -d,bash -n scripts/workcell, control-plane manifest verify, markdownlint, and a source-and-call output-equality check — all green. 330 lines / 7 files. (Full container scenario suite runs in CI.)🤖 Generated with Claude Code