# Complete - m-principal-provider-credential-slot-routing/06+01,02_host_local_bootstrap

## Completed At

2026-08-01

## Summary

Completed host-local first-principal bootstrap hardening and Client wire absence guards after three review loops; final verdict: PASS.

## Loop History

| Plan | Review | Verdict | Notes |
|------|--------|---------|-------|
| `plan_local_G06_0.log` | `code_review_cloud_G06_0.log` | FAIL | Required atomic first-principal admission, stdout write-error propagation, and a source-level Client wire absence regression. |
| `plan_local_G07_1.log` | `code_review_cloud_G07_1.log` | FAIL | Required production-real SQLite contention handling and file-specific guard sensitivity fixtures. |
| `plan_cloud_G08_2.log` | `code_review_cloud_G08_2.log` | PASS | Independent-store and compiled-process contention returned typed losers, and all representative forbidden wire variants were rejected. |

## Implementation and Cleanup

- Applied a bounded SQLite `busy_timeout` DSN pragma to every credential-store pool connection without changing PostgreSQL selection or exposing the caller DSN.
- Replaced the single-pool first-bootstrap race with five independent stores and exact success/token/refusal and persisted-row assertions.
- Replaced the shared narrow wire regex with proto, ClientServer, and Dart-specific guards plus forbidden and allowed mutation fixtures.

## Final Verification

- `go test -count=50 -race ./apps/control-plane/internal/credentialstore -run 'CreateFirstPrincipalWithToken'` - PASS; `ok iop/apps/control-plane/internal/credentialstore`.
- `go test -count=1 ./apps/control-plane/cmd/control-plane -run 'BootstrapManagement(IsAbsentFromWireSources|GuardRejectsForbiddenVariants)|BootstrapCommandRemainsCLIOnly'` - PASS; all real-source and mutation guards passed.
- `go test -count=1 ./apps/control-plane/cmd/control-plane -run 'PrincipalBootstrap|Bootstrap'` - PASS; CLI bootstrap, one-time output, restart, refusal, redaction, and guard tests passed.
- `go test -count=1 ./apps/control-plane/...` - PASS; all Control Plane packages passed.
- `go vet ./apps/control-plane/...` - PASS; no findings.
- Compiled five-process bootstrap oracle - PASS; exactly one process emitted a token and four returned typed `already exists` refusals, with zero lock or other errors.
- Predecessor count, `gofmt -d`, and `git diff --check` checks - PASS.

## Remaining Nits

- None.

## Follow-up Work

- None.
