feat(setup): S2-engine — companion manifest engine (one-click-installer) - #444
Merged
Conversation
Task 3 of one-click-installer plan (S2 engine sub-wave). engine.sh is verbatim from the plan. One deviation in the test: the dry-run case uses grep -qx (whole-line) instead of grep -q — the plan-verbatim pair is internally inconsistent (engine's dry-run message echoes install_cmd, substring grep flags the echo as execution → PASS=4). Whole-line match detects actual execution only; mutation-checked (eval-in-dry-run mutant is caught). Spec mandates dry-run prints the plan, so the engine output keeps the command. Prior-art: aif-handoff installMcpServer precedent (spec §11; same pattern as commit ecb6457 / PR #311).
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
S2 sub-wave 2/3 of the one-click-installer umbrella (plan Task 3, after S1 #442). Adds the sourceable function lib
setup.d/engine.sh(companion_step <name> <detect> <install> <kind> <mode>, detect-first, official-installer-only, no pin) + its test. Engine takes args — manifest parsing stays in Task 5/S3, so the sibling tab-delimiter change does not touch this lib.Changes
setup.d/engine.sh(47 LOC) — verbatim from the plan (byte-identical, diff against plan block empty);ENGINE_LIB_ONLY=1guard mirrorsinstall.sh:50-57INSTALL_SH_LIB_ONLYprecedent.tests/install-sh/engine.test.sh— 5 assertions, TDD red (PASS=3 FAIL=2, source error) → greenPASS=5 FAIL=0. One-flag deviation from plan, mutation-checked: dry-run case usesgrep -qx(whole-line) instead ofgrep -q— the plan's own engine prints[dry-run] would install fake: echo SHOULD_NOT_RUN(command embedded mid-line by design per spec «print the plan»), so the plan's substring grep false-positives against the plan's own engine (verbatim pair yields PASS=4 FAIL=1). Detector non-vacuity proven: a mutant that evals install in dry-run emits a bareSHOULD_NOT_RUNline → caught.Prior-art consult
packages/, no new deps; pre-push gate scoped topackages/perprior-art.ts:111-112). Lineage trailer carried anyway:Prior-art: aif-handoff installMcpServer precedent (spec §11; same pattern as commit ecb6457 / PR #311).Test plan
bash tests/install-sh/engine.test.sh→ PASS=5 FAIL=0 (worker verify-trace; red phase + mutation falsifier pasted)bash -n setup.d/engine.sh→ exit 0no-companion-blocks.test.sh→ PASS=4 FAIL=0ci-success(runs on PR)§1.7 Self-discipline check (REQUIRED if PR touches discipline-bearing files)
§1.7 Skipped: sourceable bash lib + its test only; no rules, principles, templates or discipline-bearing docs touched.
🟢 Простыми словами
Добавлена функция-«движок»: ей говорят «компаньон такой-то, проверь так, поставь так» — она сначала проверяет, не стоит ли уже, спрашивает разрешения (или берёт
--yes), и только потом ставит официальной командой. В режиме--dry-runничего не ставит, только показывает план. Покрыто 5 тестами.Observations (out of scope)
interactivebranch (read -r) has no plan-provided test — untested by design here; S3/S5 e2e covers the flow.