# Source Registry Admin Dry-Run Receipt Schema V01

Issue: [#335](https://github.com/pinklon/ai-capability-discipline/issues/335)

Date: 2026-06-28

Repository: `pinklon/ai-capability-discipline`

Baseline commit: `29c6116a47b03206337fabf6f0668a1359699186`

Status: dry-run receipt-preview schema enforcement only. This ticket adds dry-run receipt-preview schema enforcement only. This ticket does not implement live Source Registry Admin commands, does not mutate source registries, does not mutate Preview or Production source sets, does not enable sources, does not disable sources, does not retire sources, does not promote sources, does not use Cloudflare CLI or API, does not call external URLs, does not change provider or model configuration, does not change runtime retrieval behavior, does not change package authority, does not start Production apply, does not start OKF implementation, does not start Google SDLC implementation, does not start multi-agent orchestration implementation, does not create additional implementation tickets, does not close #271, does not reopen #269, does not close #269, and does not apply `codex-automerge`.

## Purpose

Formalize the dry-run receipt-preview schema emitted by `scripts/source_registry_admin_dry_run.py`.

This slice turns receipt-preview output from a parser convenience field into a governed validation surface. It keeps the work bounded to schema, fixtures, documentation, and deterministic repo-local validation.

## Relationship To Command Contract

#329 / PR #330 defines Source Registry Admin command contract v01.

The command contract defines the administrative command surface, receipt expectations, refusal behavior, lifecycle transitions, environment behavior, authority-lane behavior, and hard boundaries. This receipt schema enforces the receipt-preview posture for that command surface before any live command authority exists.

This ticket does not replace the command contract.

## Relationship To Schema/Lifecycle Validation

#331 / PR #332 defines Source Registry Admin schema and lifecycle validation.

The schema/lifecycle foundation defines source-record shape, lifecycle states, allowed and forbidden transitions, environment eligibility, authority-lane constraints, and fixture validation. This receipt schema does not redefine source records. It validates that dry-run receipt previews carry enough before/proposed posture to make those lifecycle and environment checks auditable.

## Relationship To Dry-Run Command Parser

#333 / PR #334 defines Source Registry Admin dry-run command parser v01.

The dry-run parser recognizes every command-contract command, validates a bounded subset deeply, refuses unsafe requests, and emits deterministic dry-run output. This ticket narrows and validates the parser's `receipt_preview` output shape and refused-output receipt posture.

## Non-Goals

This dry-run receipt schema slice does not:

- implement live Source Registry Admin commands
- mutate source registries
- mutate Preview or Production source sets
- enable, disable, retire, or promote any source
- use Cloudflare CLI or API
- call external URLs
- change provider or model configuration
- change runtime retrieval behavior
- change package authority
- start Production apply
- start OKF implementation
- start Google SDLC implementation
- start multi-agent orchestration implementation
- create additional implementation tickets
- create extraction-profile implementation tickets
- close #271
- reopen #269
- close #269
- apply `codex-automerge`

## Receipt-Preview Schema

Accepted dry-run commands that would be mutating in a future implementation require these receipt-preview fields:

- `schema`
- `dry_run`
- `command`
- `status`
- `source_id`
- `operator_or_actor`
- `timestamp`
- `previous_lifecycle_state`
- `proposed_lifecycle_state`
- `previous_active_environments`
- `proposed_active_environments`
- `validation_checks`
- `refusal_checks`
- `registry_snapshot_required`
- `registry_snapshot_ref`
- `last_known_good_required`
- `last_known_good_ref`
- `snapshot_posture`
- `citation_use_documentation_impact`
- `rollback_reference_required`
- `mutations_performed`
- `boundary_confirmations`

Accepted non-mutating dry-run commands require this reduced receipt-preview posture:

- `schema`
- `dry_run`
- `command`
- `status`
- `validation_checks`
- `mutations_performed`
- `boundary_confirmations`

Refused dry-run outputs require this refusal receipt posture:

- `schema`
- `dry_run`
- `command`
- `status: refused`
- `reason`
- `failed_checks`
- `mutations_performed`
- `boundary_confirmations`

## Mutating Command Receipt Posture

Future-mutating command receipt previews must carry before/proposed lifecycle and environment posture, even when the current dry-run parser recognizes a command without deep command-specific validation.

Commands requiring full receipt-preview coverage:

- `add_source`
- `approve_source`
- `register_source`
- `validate_source`
- `enable_preview`
- `disable_preview`
- `mark_production_eligible`
- `promote_to_production`
- `disable_production`
- `emergency_disable`
- `rollback_registry`
- `retire_source`

Production-impacting previews for `mark_production_eligible`, `promote_to_production`, and `disable_production` must state that production eligibility and validation evidence are required before any future live path could proceed.

Rollback and emergency-disable previews for `disable_preview`, `disable_production`, `emergency_disable`, and `rollback_registry` must state rollback-reference posture. Environment-changing previews must state last-known-good posture where required.

Receipt previews for snapshot-posture commands must include `registry_snapshot_ref`, `last_known_good_ref`, and `snapshot_posture` so dry-run output can name the registry snapshot and last-known-good evidence expected before any future environment mutation.

## Non-Mutating Command Receipt Posture

Non-mutating command previews must still identify schema, dry-run status, command, validation checks, mutation posture, and boundary confirmations.

Commands requiring reduced receipt-preview posture:

- `list_sources`
- `list_active_sources`
- `show_source_detail`
- `generate_receipt`
- `run_source_smoke`

These previews must not imply source registry writes, source-set writes, source enablement, source disablement, retirement, promotion, Production apply, runtime retrieval changes, provider/model changes, Cloudflare use, or package-authority change.

## Refusal Receipt Posture

Refused dry-run outputs must preserve the refusal reason and failed checks.

Refused output is validated as a receipt posture in its own right. It must include `schema`, `dry_run: true`, `status: refused`, `reason`, `failed_checks`, `mutations_performed: false`, and boundary confirmations.

## Required Invariants

- `dry_run` must be `true`.
- `mutations_performed` must be `false`.
- Mutating command previews must include lifecycle before/proposed fields.
- Mutating command previews must include environment before/proposed fields.
- Production-impacting command previews must require production eligibility and validation evidence.
- Rollback and emergency-disable command previews must require last-known-good or rollback target posture.
- Snapshot-posture command previews must include registry snapshot and last-known-good reference fields.
- Receipt preview must never imply live source registry mutation.
- Receipt preview must never imply Preview or Production mutation.
- Receipt preview must never imply source enablement, disablement, retirement, or promotion occurred.
- Receipt preview must never imply package-authority promotion.
- Refused outputs must preserve refusal reason and failed checks.

## Fixture Strategy

Fixtures live under `validation/fixtures/source_registry_admin/`.

- `dry_run_receipt_preview_schema_v01.json` defines the governed receipt-preview shape.
- `dry_run_receipt_previews_valid_v01.json` contains accepted mutating, accepted non-mutating, and refused receipt-preview examples that must pass.
- `dry_run_receipt_previews_invalid_v01.json` contains expected failure cases for missing posture, mutation implication, and missing refusal reason.
- `dry_run_commands_valid_v01.json` remains the parser-command fixture set used to prove all command outputs conform.
- `dry_run_commands_invalid_v01.json` remains the parser-refusal fixture set used to prove refused outputs conform.

## Validation Coverage

The focused validator is `validation/scripts/check_source_registry_admin_dry_run_receipt_schema.py`.

It checks:

- schema fixture existence and command coverage
- valid receipt-preview fixture acceptance
- invalid receipt-preview fixture rejection for expected reasons
- dry-run parser accepted output conformance
- dry-run parser refused output conformance
- future-mutating command full receipt-preview posture
- non-mutating command reduced receipt-preview posture
- `dry_run: true`
- `mutations_performed: false`
- boundary confirmations
- no live mutation implication
- documentation and JSON companion existence
- relationship to #329/#330 command contract
- relationship to #331/#332 schema/lifecycle validation
- relationship to #333/#334 dry-run parser
- `run_all.py` wiring
- context-pack discoverability
- validation receipt presence

## Boundary Confirmations

This ticket adds dry-run receipt-preview schema enforcement only.

This ticket does not implement live Source Registry Admin commands.

This ticket does not mutate source registries.

This ticket does not mutate Preview or Production source sets.

No source registries were mutated.

No source sets were mutated.

No source was enabled, disabled, retired, or promoted.

No Cloudflare CLI or API was used.

No external URLs were called.

No provider or model configuration was changed.

No runtime retrieval behavior was changed.

No package authority was changed.

No Production apply was started.

No OKF implementation was started.

No Google SDLC implementation was started.

No multi-agent orchestration implementation was started.

#271 remains open.

#269 remains closed.

`codex-automerge` was not applied.

## Post-Closeout Next Action

After this dry-run receipt schema slice is merged and locally closed out, choose whether to add dry-run registry snapshot / last-known-good model or continue extraction-profile work for the next source.
