Skip to main content
← Back to list
01Issue
FeatureClosedUAT
AssigneesNone

#253 UAT additions for W2 lifecycle services (Install/Remove/Upgrade)

Opened by stack72 · 5/5/2026

Context

W2 (swamp-club#231 / PR systeminit/swamp#1310) introduces three lifecycle services owning the catalog-write surface end-to-end: `InstallExtensionService`, `RemoveExtensionService`, `UpgradeExtensionService`. The unit/integration test suite covers the contracts at the lifecycle-service layer (5433 tests passing). The existing UAT at `tests/cli/extension/` exercises CLI-level flows and continues to pass (87/87 with the W2 binary).

Per plan v4's Testing field, UAT additions for the new lifecycle layer are tracked as a follow-up, NOT a merge gate — existing UAT covers the user-visible flows; these proposed additions extend coverage to W2-specific contracts.

Proposed scenarios

1. swamp-club#201 closure at the user-visible layer

`tests/cli/extension/rm_catalog_pruning_test.ts` (new file):

  • Pull `@swamp/aws/ec2`.
  • `swamp model type search --json` returns ec2 types.
  • `swamp extension rm @swamp/aws/ec2`.
  • `swamp model type search --json` returns 0 ec2 types.
  • `swamp doctor extensions` reports zero stale catalog rows for ec2.

This is the user-visible #201 closure. Today's UAT covers rm but not the catalog-row-pruning observation via `type search`.

2. Atomic upgrade pattern

`tests/cli/extension/upgrade_atomicity_test.ts`:

  • Pull v1 of an extension.
  • `swamp extension pull @` — same name, different version.
  • Catalog has only v2's rows (no v1 leftovers, no `DuplicateTypeError` in the output).

Pinned by the unit-level upgrade service tests; UAT-level coverage proves the CLI surface honors the pattern end-to-end.

3. Force-pull regression

`tests/cli/extension/pull_force_regression_test.ts`:

  • Pull v1.
  • `swamp extension pull @ --force` succeeds (does NOT fail with `DuplicateTypeError`).

Today this scenario is implicitly covered by sibling_coinstall, but a focused test pins the contract.

4. Half-state recovery messages (commit 10's pinned UserError text)

`tests/cli/extension/half_state_recovery_test.ts`:

  • Construct a fault scenario (process kill mid-saveAll, or use the FaultingStubRepository if exposed via a test seam).
  • Assert the user-facing message contains the pinned recovery action: `swamp doctor extensions`, retry hint, etc.

This is harder to drive from UAT (needs fault injection). Could defer to integration-level once a CLI-driven fault seam exists.

5. DuplicateTypeUserError JSON shape

`tests/cli/extension/duplicate_type_json_test.ts`:

  • Construct a cross-extension type collision (two extensions pulled that share a `(kind, type)` — needs a fixture extension or registry mock).
  • `swamp extension pull --json` exit code 1.
  • JSON output contains `duplicateType.kind`, `duplicateType.type`, `duplicateType.existing`, `duplicateType.conflicting`.

This tests the structured shape that AI agents and `jq` consumers depend on.

Acceptance

  • New UAT files in `tests/cli/extension/` covering the scenarios above.
  • All scenarios pass against the post-W2 binary.
  • Existing UAT (87 tests) continues to pass.

Out of scope

  • Cross-process concurrency stress (separate follow-up, swamp-club issue).
  • Doctor extensions repair path (swamp-club#251).
02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED

Closed

5/6/2026, 5:09:04 PM

No activity in this phase yet.

03Sludge Pulse
Editable. Press Enter to edit.

stack72 commented 5/6/2026, 5:09:02 PM

Sign in to post a ripple.