Skip to content

feat(M-A Stage 5): install.sh K-1 companion-install prompts - #258

Merged
artyhoo merged 1 commit into
stagingfrom
feat/install-sh-k1-extension
May 27, 2026
Merged

feat(M-A Stage 5): install.sh K-1 companion-install prompts#258
artyhoo merged 1 commit into
stagingfrom
feat/install-sh-k1-extension

Conversation

@artyhoo

@artyhoo artyhoo commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Stage 5 I-phase of M-A umbrella — implements Stage 2 v3 K-1 design in install.sh
  • 3 companion prompts (Superpowers, TaskMaster, OhMyOpencode) + aif-handoff informational note, inserted after Phase 3 (AIF templates) before Phase 4 (Scripts)
  • All prompts default [y/N]; COMPANIONS=none|all|csv env var + --companions= flag for headless; non-tty auto-default; idempotency detect-and-skip; warn-and-continue on failure
  • AIF Phase 3 byte-identical to staging (verified by content marker, not line range)

Verify-trace

  • install.sh K-1 block at expected position — verified grep -n "Optional companion installs" install.sh shows line 332
  • Zero [Y/n] occurrences — verified grep -E "\[Y/n\]" install.sh EMPTY
  • 3 companion handlers present — verified grep -cE "should_install_(superpowers|taskmaster|omo)" install.sh = 18 references
  • AIF Phase 3 block byte-identical — verified content-marker diff shows no changes inside # ─── 3. AI Factory templates ─── block
  • SSOT row docs(skills): sync shipped prose to C-1 resolution (close DN-1) #84 additive only — verified git diff origin/staging -- prior-art-evaluations.md shows single + line, zero -
  • Only 3 files changed — verified git diff origin/staging --stat shows install.sh + prior-art-evaluations.md + 1 new verification log
  • D6 active install via claude plugin install ... --scope user (VERIFIED-FREE per Stage 2 v3 §4.8)
  • D5 OhMyOpencode print-only (no auto bunx oh-my-openagent install)
  • D1/D2/D3 (Cline/OpenCode/Cursor) deferred — no stubs in diff
  • Maintainer reviews verification log + smoke-test output
  • Stage 6 picks up after merge for README install instructions update

§1.7 Forward-check applied

  • no-paid-llm-in-ci: claude plugin install --scope user is VERIFIED-FREE per Stage 2 v3 §4.8 (administrative subcommand; claude --help scopes --max-budget-usd to --print/-p only). No CI changes. Evidence: docs/meta-factory/research-patches/2026-05-27-stage-5-install-sh-k1-verification.md:158
  • build-first-reuse-default §1: SSOT row docs(skills): sync shipped prose to C-1 resolution (close DN-1) #84 added (ADOPT verdict for the CLI subcommand mechanism). No new BUILD capability. Evidence: docs/meta-factory/prior-art-evaluations.md:152
  • universal-satellite vision: All 3 prompts default [y/N]; COMPANIONS=none or non-tty auto-default produces zero interactive prompts. No companion mandatory. Evidence: install.sh:332-462 (entire K-1 block)
  • T-Stage2-A (zero forced-default-yes): grep on install.sh:332 shows no [Y/n] patterns. Evidence: install.sh:357 install.sh:397 install.sh:437 (all three prompts use [y/N])
  • CLAUDE.md PR strategy (no drive-by): Only 3 files touched. Evidence: install.sh:1 docs/meta-factory/prior-art-evaluations.md:1 docs/meta-factory/research-patches/2026-05-27-stage-5-install-sh-k1-verification.md:1

Falsifiers: wrong if claude plugin install --scope user is NOT a valid shell-runnable CLI subcommand on the consumer machine — would be falsified by claude plugin --help not listing install subcommand. Wrong if Anthropic announces billing extension to administrative subcommands beyond --print/-p mode — would be falsified by re-running probes in Stage 2 v3 §4.8.

§1.7 Backward-check applied

  • install.sh Phase 3 (AIF templates): UNCHANGED byte-identical. Evidence: install.sh:309 install.sh:330 (the AIF block bounds; content diff against staging is empty)
  • Stage 2 v3 binding spec + Stage 3 collision audit + README.md + CLAUDE.md + .claude/rules/*.md: NOT edited. Evidence: install.sh:1 docs/meta-factory/prior-art-evaluations.md:1 docs/meta-factory/research-patches/2026-05-27-stage-5-install-sh-k1-verification.md:1 are the only 3 files in git diff origin/staging --name-only output
  • prior-art-evaluations.md: only additive row docs(skills): sync shipped prose to C-1 resolution (close DN-1) #84; no existing rows modified. Evidence: docs/meta-factory/prior-art-evaluations.md:152 (single + line; zero deletions)
  • D1/D2/D3/D6-Option-B deferred without dangling stubs: no .clinerules/, .opencode/plugins/, .cursor/rules/, extraKnownMarketplaces artefacts. Evidence: install.sh:332 install.sh:462 (K-1 block scoped only to 3 active companions + aif-handoff info note)

Conclusion: No silent supersession; no scope creep; AIF Phase 3 untouched; v1→v2→v3 design chain preserved through Stage 2 v3 §4.8 verify trace.

…Stage 2 v3 design

Implements Stage 2 v3 final design (PR #255 merged). New section after Phase 3 (AIF), before Phase 4 (Scripts). Per-companion prompts default [y/N]. COMPANIONS env var + --companions= flag + non-tty auto-default for headless. Idempotency via detect-and-skip with tool-availability guards. Warn-and-continue on failure. D1/D2/D3 deferred; D5=Option A (print + instruct); D6=Option A ONLY (passive pre-seed deferred to future M-A wave per Stage 2 v3 §4.8 maintainer decides escape).

3 companions: Superpowers + TaskMaster (CC plugin active install via claude plugin install --scope user); OhMyOpencode (print + instruct only per D5 Option A); aif-handoff informational note (Phase 3 auto). Stage 3 §4.2 OhMyOpencode escape hatch documented. Stage 3 §4.3 Cline/OpenCode gap deferred per D1/D2.

Prior-art: prior-art-evaluations.md#84 (claude plugin install <plugin> --scope user — administrative subcommand, VERIFIED-FREE per Stage 2 v3 §4.8, verdict ADOPT).
@artyhoo
artyhoo merged commit 7e75aab into staging May 27, 2026
27 of 28 checks passed
artyhoo added a commit that referenced this pull request Aug 18, 2026
#1467)

S2 of the skill-harmonization-mechanisms umbrella (spec §5.3, D-H5/P-5).
Four parts, all four required — the diff is deliberately not prose-only.

1. Runtime-bridge split (`AifHandoffBackend`): `dispatch()` was create+unpause
   in one atomic call, so a lane became observable only AFTER the work started.
   Split into `claim()` (POST /tasks paused:true), `release()` (unpause) and
   `cancelClaim()` (DELETE), behind an optional `ClaimCapableBackend` interface
   + `supportsClaims()` guard. `dispatch()` is now literally claim+release with
   the original rollback, so the one-shot callers are behaviourally unchanged —
   all 227 pre-existing runtime-bridge tests pass untouched. New CLI entrypoint
   `cli/claim.ts` exposes the three verbs; unlike `dispatch.ts` it exits
   NON-zero and never falls back to ManualBackend, because a claim that
   silently failed is worse than no claim.

2. `/pipeline` §6 Step 3 reordered: claim-create fires BEFORE the Phase -1
   window, release on GO, cancel on RED. Detail routed to
   `references/claim-machinery.md` + `references/stage-gates.md` so SKILL.md
   stays at 599 lines (the 600 gate).

3. `probe-inflight.sh` signal 6 (`claim`): the jq filter for signal 5 selects
   only done/verified tasks carrying a branch, so a fresh paused claim was
   invisible to ALL five existing signals. Matching is by slug in
   title+description — no claim marker field, because a second status
   vocabulary is what P-5 forbids.

4. Orphan expiry: a claim past `PROBE_CLAIM_TTL_MIN` (default 120min) reads
   `STALE-CLAIM` instead of blocking the stage forever (starvation mode TD-F5).
   Surfaced, never auto-cancelled — an automatic sweep would race the sessions
   it protects. Unparseable/missing createdAt counts as live (fails toward
   blocking).

Also: `cli/claim.ts` + the split backend are added to the runtime-bridge vendor
drop. The shipped `/pipeline` now instructs a consumer to run it, and the
vendor README's own admitting criterion (PR #1432 precedent) is «vendor what a
shipped skill instructs the consumer to run» — otherwise the promise is a
documented lie. Install baselines regenerated (`SNAPSHOT_MODE=capture`); the
reviewed delta is exactly 4 lines per JS fixture: the pipeline SKILL.md hash,
the two new reference docs, and `.prettierignore` (the installer auto-adds
shipped docs to its managed ignore block — reproduced and confirmed against a
pristine staging checkout, which is 15/15 clean).

Live proof (probe P4, spec §6) against the running aif queue, not the diff:
FRESH → claim-create → CLAIMED (age=0m live) → cancel → 404 → FRESH; orphan
branch proven on the real task's own createdAt with the clock advanced 3h →
STALE-CLAIM; slug isolation and cwd-independence both confirmed.

Own cold review of the diff before handoff (T19) caught three defects, all fixed
here with regression tests:
  (a) the stale count was `grep -c ' stale '` over the whole detail line, so a
      claim titled "demo fix stale refs" counted as expired one minute after
      creation — the verdict then told the operator to cancel a lane somebody was
      actively holding. Counts now read the fixed field-3 state token, and titles
      are squashed to one line so they cannot inflate the count either.
  (b) `cancelClaim()` returned void, so the CLI printed "lane is free" even when
      the DELETE failed. It returns a boolean now and the CLI exits non-zero with
      an honest message — best-effort must not mean unreported.
  (c) the live proof then showed (b) firing on a REPEAT cancel: a 404 means the
      claim is already gone, i.e. success. 404 is now treated as cancelled, so an
      idempotent retry stops raising a false alarm.

The kickoff §3 sanctioned a `Prior-art: skipped` escape hatch here; the pre-push
gate rejected it, correctly — `cli/claim.ts` is 140 LOC under `packages/`, which
is a capability commit by CLAUDE.md's own definition. The gate won, and the
fresh context7 pass it forced (3 phrasings, `/lee-to/aif-handoff`, 2026-08-18)
paid for itself twice. It CONFIRMED the design premise — «paused tasks are
excluded from coordinator selection queries», so a claim really does occupy no
lane — and it surfaced prior art the design had not accounted for: upstream
already claims tasks atomically via `lockedBy`/`lockedUntil` with automatic
stale-claim release. T16 check says that is a different problem class (mutual
exclusion between poll cycles over an EXISTING row, vs. our intent registered
BEFORE any row exists), so it is not the surface to reuse; its stale-claim
vocabulary IS adopted for the orphan branch, with the auto-release half
deliberately declined — our claim's owner may still be alive. Recorded as SSOT
#258 (ADAPT) following the #125 precedent for re-evaluating a candidate against
a different capability; #28 keeps its row and gets a `Last reviewed` bump.

§1.7: forward-check applied — the new claim protocol is itself gated, not trusted: probe verdicts are asserted in packages/core/skills/dispatcher/probe-inflight.test.ts:1 (claim signal, orphan expiry, precedence) and the backend split in packages/runtime-bridge/test/aif-claim-split.test.ts:1, so the guard cannot silently regress to attention; backward-check sweep — every probe consumer enumerated by grep, not by memory: .claude/skills/dispatcher/SKILL.md:65 was the only surface documenting the signal table + verdict ladder and is updated (signal 6 + CLAIMED/STALE-CLAIM), the sibling CLI entrypoint guard in packages/runtime-bridge/test/dispatch-import-no-sideeffect.test.ts:69 was extended to claim.ts, the shipped vendor drop was re-vendored so the promise in .claude/skills/pipeline/SKILL.md:433 reaches a consumer, and CLAUDE.md's pre-dispatch section enumerates no verdicts so it needed no edit (surfaced, not silently skipped).

Prior-art: prior-art-evaluations.md#258 (verdict ADAPT — the claim reuses the
existing aif `paused` REST primitive rather than adding one; upstream's own
`lockedBy`/`lockedUntil` claim is a T16 problem-class mismatch, vocabulary
adopted for STALE-CLAIM, mechanism not).
Prior-art: prior-art-evaluations.md#28 (verdict DEFER — its «pipeline automation
requires machine-readable state without human presence» trigger fired; the
capability-specific re-evaluation is #258, per the #125 precedent).

Co-authored-by: Test <test@example.com>
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