# #1050 C1 fix round — Round 8 pipefail-safe expected-set membership

BASE HEAD
- 58ada98d2b430da28c46cf92eebdb6d45b8b1846
- Review 122 (rev-security-02) found expected_names | grep -Fxq could falsely reject valid markers under pipefail when grep closed the pipe after an early match and the producer exited 141.
- Independent canonical-Alpine live-manifest stress reproduced intermittent false failures at the current four-arm set size. No small-manifest safe threshold is claimed.

DETERMINISTIC RED
- The focused suite now generates a 20,001-name manifest with a valid target sorted first and invokes the real mark path.
- Before remediation, in canonical Alpine ci-base:
  docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/workspace" -w /workspace git.mosaicstack.dev/mosaicstack/stack/ci-base:latest bash tools/verify-greenfield-execution-coverage.test.sh
  => canonical_sigpipe_tdd_red_rc=1
  => [fixture-suite] case is not in the expected set: a-target
- This control exercises the production checker invocation rather than an approximated producer and makes the early-close race deterministic by exceeding pipe capacity.

IMPLEMENTATION
- The mark path now fully materializes expected_names into expected_snapshot and fails closed if production fails.
- grep -Fxq reads the completed snapshot through a here-string; there is no producer/consumer pipeline to close early.
- Missing names still fail with the same attributable message. No `|| true` or other failure suppression was introduced.
- Exact-set checks, marker inventory, aggregation, archive binding, fixture dispositions, expected-RED manifest, e2e installer, #869 wiring, and acquisition behavior are unchanged.

GREEN
- Local focused suite: greenfield execution coverage tests passed.
- Canonical Alpine focused suite: greenfield execution coverage tests passed.
- Canonical Alpine live production-manifest stress: 1,000 valid greenfield-git-absent arm marks, failures=0.
- Canonical grep-q pipeline mutant through the real checker path => rc=1 with the attributable false rejection; restored subject => GREEN.
- Existing Round-6 controls retained:
  ignore-arms aggregation helper => rc=1
  ignore-cases aggregation helper => rc=1
  always-RED aggregation helper => rc=1
  delete production .mosaic-test-work archive exclusion => rc=1
- Round-8 mutant workspace: /tmp/c1-round8-mutants.aS1xTI

FENCED FILES
- tools/e2e-install-test.sh HEAD/worktree SHA-256: a93113565aa69f2c6f3d792b78251021bb3bbe3f7813d5fed547ab0099fa3b98 (byte-identical)
- tools/fixtures/greenfield-expected-red.tsv HEAD/worktree SHA-256: baae06c664d0ab7ffe4c32ec106bfcb6f9dd74b46461d3c4440b73dc582af1a2 (byte-identical)

LOCAL BASELINES
- /home free before and after validation: 11G
- Bash syntax focused scripts: PASS
- ShellCheck focused scripts: PASS
- pnpm test:installer: PASS
- pnpm typecheck: PASS (45/45)
- pnpm lint: PASS (25/25)
- pnpm format:check: PASS
- woodpecker-cli lint --strict .woodpecker/greenfield-install.yml: PASS
- git diff --check: PASS

INDEPENDENT REVIEW
- Codex code review: APPROVE, confidence 0.96, six files reviewed, zero findings. It confirmed full materialization removes the SIGPIPE race and the deterministic regression control exercises the real early-match mark path.
- Codex security review: risk NONE, confidence 0.98, six files reviewed, zero findings. It confirmed fail-closed producer handling, constrained/quoted names, and no new injection, traversal, secret, access-control, cryptographic, dependency, or logging risk.
- The code-review sandbox could not execute the suite or install ShellCheck because its filesystem is read-only; local and canonical-container dynamic evidence above supplies those gates.

PENDING
- commit, queue guard, one lease-pinned push, provider attribution read-back
- replacement-head canonical CI; no manual trigger or polling
