# Run-Scoped Enrichment Source Selection Request Model V01

Issue: #413

Parent: #411

Depends on: #412

## Purpose

This artifact defines the request-side model for selecting approved enrichment sources for one answer run.

This is field guidance and deterministic validation evidence, not policy, not package authority, and not runtime source enablement.

The model references the static enrichment-source registry from #412 at `docs/product-architecture/enrichment_source_registry_v01.json`. It does not duplicate registry source data and does not mutate the registry.

## Request Shape

The request model is:

```json
{
  "question": "",
  "source_scope": "package_plus_enrichment",
  "selected_profile": "general_ai_capability",
  "enrichment_source_selection": {
    "selected_source_ids": [],
    "excluded_source_ids": [],
    "selection_scope": "run_only"
  },
  "session_sources": []
}
```

The companion machine-readable contract is `docs/product-architecture/run_scoped_enrichment_source_selection_request_model_v01.json`.

## Source Scope

Only these source scopes are valid:

- `package_only`
- `package_plus_enrichment`

`package_only` is the default-safe posture. It must not carry active enrichment-source selection.

`package_plus_enrichment` is explicit. It may use only selected approved enrichment source IDs that resolve to the #412 registry and pass the request-time safety gates.

No arbitrary web scope, external lookup scope, browser fetch scope, provider direct call scope, or user URL retrieval scope is added.

## Profile Selection

`selected_profile` is required and visible in every request.

Valid profiles are:

- `general_ai_capability`
- `ai_security`
- `ai_governance`
- `gxp_regulated_life_sciences`
- `medical_device_samd`
- `ot_endpoint_infrastructure`
- `foundation_model_providers`
- `agent_rag_engineering`
- `independent_evidence`
- `vendor_product_docs`

Profile selection does not mutate global defaults. It does not promote vendor/provider sources to defaults. It does not change package authority.

## Enrichment Source Selection

`enrichment_source_selection.selection_scope` must be exactly `run_only`.

`selected_source_ids` and `excluded_source_ids` must resolve to existing `source_id` values in `docs/product-architecture/enrichment_source_registry_v01.json`.

Unknown selected or excluded IDs are deterministically refused.

Preview-only, unavailable, deprecated, and retired sources cannot enter generation.

Licensed-required sources cannot enter generation unless the registry marks them usable by metadata-only or rights-cleared controlled-excerpt policy. Metadata-only use means source identity and metadata only, not full licensed text.

Package + enrichment requests may include only allowed selected source IDs. Package-only requests must not include active selected or excluded enrichment source IDs.

Request handling must not mutate:

- the enrichment-source registry
- default source policies
- package authority
- approved package source sets
- provider or model configuration
- Cloudflare configuration

## Vendor And Provider Rule

Vendor and provider sources are never global defaults.

Vendor and provider sources may be selected only by product trigger, profile trigger, or explicit user selection.

This request model validates explicit user selection. It does not add product-trigger logic, profile-trigger auto-selection, global default selection, or source fetching.

## Session Sources

`session_sources` remains separate from registered enrichment sources.

Session source text is user-provided session material. It is not an enrichment registry entry, not approved package corpus, not durable memory, and not package authority.

Session sources must not:

- resolve to registry `source_id` values
- persist beyond the run
- be added to the registry
- become package authority
- trigger URL fetching
- mutate approved source sets

This artifact models session source validation only as needed for request validation. It does not implement the #416 UX.

## Validation Scope

`validation/scripts/check_run_scoped_enrichment_source_selection_request_model.py` validates:

- the request contract shape
- required `source_scope` values
- required `selected_profile` values
- exact `run_only` selection scope
- selected and excluded source ID resolution against the #412 registry
- deterministic refusal of unknown selected and excluded IDs
- blocking of preview-only, unavailable, deprecated, retired, and disallowed licensed sources
- allowed metadata-only or rights-cleared controlled-excerpt policy for licensed-required sources
- package-only requests have no active enrichment selection
- package plus enrichment requests use allowed registry sources only
- request validation does not mutate the registry artifact
- session sources are not persisted, promoted, registry-resolved, or URL-fetching inputs
- vendor/provider sources are not global defaults

## Boundary Confirmations

- No UX panel is added.
- No answer telemetry is added.
- No source fetching is added.
- No source registration workflow is added.
- No arbitrary web search is added.
- No browser-side fetch is added.
- No browser-side provider call is added.
- No provider or model configuration is changed.
- No Cloudflare configuration is changed.
- No durable memory is added.
- No session source text is persisted.
- No approved package authority is mutated.
- No approved package source set is mutated.
- The enrichment source registry is not mutated by request handling.
- #78 is not mutated.
- #271 is not reopened.
- #414, #415, #416, #417, #418, and #419 are not implemented.
- `codex-automerge` must not be applied.
