Skip to content

feat(setup): S2-engine — companion manifest engine (one-click-installer) - #444

Merged
artyhoo merged 1 commit into
stagingfrom
worktree-oci-s2-engine
Jun 10, 2026
Merged

feat(setup): S2-engine — companion manifest engine (one-click-installer)#444
artyhoo merged 1 commit into
stagingfrom
worktree-oci-s2-engine

Conversation

@artyhoo

@artyhoo artyhoo commented Jun 10, 2026

Copy link
Copy Markdown
Owner

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

  • New setup.d/engine.sh (47 LOC) — verbatim from the plan (byte-identical, diff against plan block empty); ENGINE_LIB_ONLY=1 guard mirrors install.sh:50-57 INSTALL_SH_LIB_ONLY precedent.
  • New tests/install-sh/engine.test.sh — 5 assertions, TDD red (PASS=3 FAIL=2, source error) → green PASS=5 FAIL=0. One-flag deviation from plan, mutation-checked: dry-run case uses grep -qx (whole-line) instead of grep -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 bare SHOULD_NOT_RUN line → caught.

Prior-art consult

  • Not a capability commit (outside packages/, no new deps; pre-push gate scoped to packages/ per prior-art.ts:111-112). Lineage trailer carried anyway: Prior-art: aif-handoff installMcpServer precedent (spec §11; same pattern as commit ecb6457 / PR #311).
  • No new capability area; no SSOT row edits (S4 Task 6 owns row docs(skills): sync shipped prose to C-1 resolution (close DN-1) #84 update).

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 0
  • Sibling regression: no-companion-blocks.test.sh → PASS=4 FAIL=0
  • CI ci-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)

  • Plan Task 3 internal bug (test substring-grep vs engine dry-run output) — fixed minimally on the test side here; if maintainer prefers cutting the command from dry-run output instead, it's a one-printf change but impoverishes Task 9 e2e expectations. Flagged for the S2→S3 stage-gate.
  • Engine interactive branch (read -r) has no plan-provided test — untested by design here; S3/S5 e2e covers the flow.

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).
@artyhoo
artyhoo merged commit 6a39a4e into staging Jun 10, 2026
22 checks passed
@artyhoo
artyhoo deleted the worktree-oci-s2-engine branch June 10, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant