# Protected Package Current Context Source Lane Scaffold V01

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

Upstream design: [#186](https://github.com/pinklon/ai-capability-discipline/issues/186)

Access posture dependency: [#188](https://github.com/pinklon/ai-capability-discipline/issues/188)

Route protection readiness: [#182](https://github.com/pinklon/ai-capability-discipline/issues/182)

Date: 2026-06-30

Repository: `pinklon/ai-capability-discipline`

Baseline commit: `a5e219881e0f8cc432873a9b48ed8fb4c781a7c5`

## Purpose And Implementation Boundary

This packet records the first protected Package plus current context source-lane scaffold for the source-grounded assistant proof surface.

The scaffold makes the proof contract inspectable without broadening runtime scope: package-only mode remains the default, Package plus current context remains explicit opt-in on the protected proof surface, package citations remain distinct from current/public citations, and current/public material remains enrichment only.

This is a repo-local source-lane contract, validator, and receipt artifact. It does not add uncontrolled web retrieval, private or company-specific sources, durable external retrieval infrastructure, vector databases, Supabase, graph databases, hosted retrieval services, durable memory, uploaded/session-source behavior, Cloudflare configuration changes, Cloudflare CLI/API use, provider/model configuration changes, provider secret exposure, issue relabeling, #269/#271 reopening, or `codex-automerge`.

## Protected Mode Scope

| Source context mode | Default | Surface | Source authority behavior |
|---|---:|---|---|
| Package only | Yes | Proof page and server-side API boundary | Uses approved package citations or deterministic refusal. No current/public retrieval is requested. |
| Package plus current context | No | Protected proof page and server-side API boundary only | Requires explicit selection, approved package support, separately cited current/public refs, and lane-separated synthesis. |

The mode is not a general chat mode. It is not a public default. It does not accept browser-supplied current claims, arbitrary URLs, uploaded files, private documents, company-specific sources, or model memory as current evidence.

## Source Lane Contract

The scaffold preserves these lane identities:

| Lane | Source class | Citation class | Authority boundary |
|---|---|---|---|
| Package says | Approved package refs selected from the generated assistant corpus | `package citation` | Approved package authority for the answer lane. |
| Current/public source says | Server-retrieved current/public refs from allowlisted source configuration | `current/public citation` | Enrichment only. Not approved package authority. |
| Synthesis / implications | Generated interpretation over cited package and current/public refs | generated derivative interpretation | Must label what comes from package versus current/public evidence. |
| Divergence / update candidate | Generated comparison lane | generated derivative interpretation | May identify a review candidate, but does not update package authority. |

Current/public refs must carry source identity separately from package refs, including title, source URL or stable reader target, retrieval timestamp, source type, trust label, freshness label, and claim boundary when available.

## Existing Runtime Anchors

The current implementation anchors the scaffold in these repo-controlled files:

- `docs/source-grounded-chat-proof.html` keeps `package_only` checked by default and exposes `package_current_context` as an explicit source-context option.
- `docs/assets/source-grounded-chat-proof.js` labels Package plus current context behavior, renders package citations and current/public citations with separate citation classes, and reports direct browser provider and current-source request counts.
- `functions/api/source-grounded-chat.js` accepts only `package_only` and `package_current_context`, blocks current retrieval when approved package support is absent, retrieves current/public refs only through the server-side adapter, and requires Package says, Current/public source says, Synthesis / implications, and Divergence / update candidate lanes for Package plus current context synthesis.
- `docs/source-grounded-chat-proof-runbook.md` documents package-only default behavior, explicit Package plus current context behavior, server-side-only retrieval, current/public citation metadata, and the rule that current/public content is not package authority.

## Approved Corpus Boundary

This scaffold does not add current/public source content to approved package outputs.

The generated assistant corpus may include this packet as evidence-admin architecture context, but the packet itself is not a current/public source registry entry, runtime source, approved source-set entry, package authority expansion, or default-answer source.

Current/public source material remains outside approved package authority unless a separate owner-approved package update process promotes package content through source, generated artifacts, validation, receipt, and review.

## Refusal And Not-Found Preservation

The existing refusal behavior remains part of the scaffold:

- no user input refuses before provider execution
- no approved package citations refuses before current retrieval or provider execution
- approval-boundary requests refuse before current retrieval or provider execution
- missing proposal evidence refuses before current retrieval or provider execution
- provider/model failures return sanitized server-boundary errors

Package plus current context does not weaken citation-first behavior. If package support is absent, current retrieval is blocked and provider execution is skipped.

## Provider Boundary

Provider/model calls continue only through `/api/source-grounded-chat`.

The browser may assemble a proof request package and render citations, but it must not call provider APIs or current/public source URLs directly. Direct browser provider request count and direct browser current-source request count remain proof-visible boundary fields.

Provider secrets, API keys, base URLs, cookies, Cloudflare tokens, OTP values, raw request headers, raw response headers, and secret-bearing redirect URLs must not appear in static HTML, static JavaScript, context-pack material, validation receipts, or browser-visible metadata.

## Validation Coverage

This scaffold is validated by:

```bash
python3 -B scripts/build_context_pack.py
python3 -B validation/scripts/check_protected_package_current_context_source_lane_scaffold.py
python3 -B validation/scripts/check_context_pack.py
python3 -B validation/scripts/check_minimal_external_chat_proof.py
python3 -B validation/scripts/check_published_site_contract.py
python3 -B validation/scripts/run_all.py
git diff --check
```

The focused validator checks:

- package-only remains the checked default in the proof UI
- Package plus current context remains explicit opt-in
- package and current/public citation classes remain separate
- server prompt assembly requires the four lane labels
- current retrieval is blocked when approved package support is absent
- current/public retrieval is server-side allowlisted behavior, not browser-side retrieval
- this packet is evidence-admin context only in the generated assistant corpus
- hard boundaries remain documented

If `check_published_site_contract.py` or `run_all.py` fails only because the local static server cannot bind in the sandbox, rerun through the established local-server privilege path and record both the initial failure and the privileged rerun result.

## Explicit Boundary Confirmation

This scaffold does not make external/current context the default mode.

This scaffold does not add uncontrolled web retrieval.

This scaffold does not add private or company-specific sources.

This scaffold does not treat current/public context as approved package authority.

This scaffold does not add durable external retrieval infrastructure.

This scaffold does not add vector DB, Supabase, graph DB, hosted retrieval service, or durable memory.

This scaffold does not expose provider secrets.

This scaffold does not change provider/model configuration.

This scaffold does not change Cloudflare configuration or use Cloudflare CLI/API.

This scaffold does not weaken approved-corpus grounding.

This scaffold does not weaken citation-first behavior.

This scaffold does not weaken not-found or refusal behavior.

This scaffold does not implement uploaded/session-source behavior.

This scaffold does not relabel issues.

This scaffold does not reopen #269 or #271.

This scaffold does not apply `codex-automerge`.
