# COV-003 evidence pack — portfolio dependency and invalidation graph

## Work-package charter

- **Task ID:** `COV-003`
- **Owner:** Oshun portfolio content-coverage contract maintainer;
  implementation owner: Codex
- **Accountable product:** Shared V1–V9 autonomous-content platform
- **Priority:** P0
- **Target milestone:** 2026-07-15 SOTA gap-closure program
- **Risk tier:** High release integrity, stale-approval, rights, provenance, and
  cross-product information-boundary risk
- **Dependencies:** COV-001 canonical content slots; COV-002 source-preserving
  seed; common `ProvenanceBundle`, consent, rights, review, and evidence
  contracts; AUD-003 reproducible verification; AUD-006 generated capability
  truth
- **Affected schemas and content slots:** New strict
  `ContentDependencyGraphV1Schema`, graph analyzer, product-view contract,
  invalidation event/plan contracts, and required-leaf scheduling contracts. No
  COV-002 seed row is promoted to a complete slot and no live product graph
  record is invented by this task.
- **Rollout strategy:** Publish through `@oshun/contracts/content-coverage` and
  the root contracts namespace, enforce focused tests/typechecking/package build
  in CI, then require product importers and release paths to use this contract
  when COV-004/COV-005 canonicalize and populate actual records.
- **Rollback strategy:** Revert the graph contract, tests, exports, verification
  script, CI, audit qualification, and ledger closure together. Never keep a
  product importer that can bypass a blocking dependency, evidence catalog, or
  invalidation plan.
- **Evidence-pack location:** This file

## Implemented contract and semantics

1. The graph is schema-versioned and strict at every object boundary. A node
   binds a stable subject reference, product scope, canonical slot references,
   necessity, lifecycle/freshness/release state, optional executable work, and
   evidence references. A content-slot node must carry exactly its own stable
   COV-001 slot ID and cannot masquerade as executable work.
2. The 23 edge kinds represent source, translation, consented voice, generation,
   watermark, caption, provenance, cook, render, placement, review, freshness,
   canon, entity, claim, character, world, asset, policy, rights, model, rubric,
   and provider relationships. Every edge is directed from a dependent to its
   prerequisite. Required edges must be blocking, preventing a caller from
   labeling a release prerequisite contextual to bypass invalidation.
3. Artifact-local ingredient/action lineage remains owned by the existing common
   `ProvenanceBundle`. COV-003 composes references to provenance bundles,
   consent records, generation manifests, watermark/caption verification,
   cook/render/placement receipts, review decisions, and freshness observations
   at the portfolio dependency layer rather than defining competing artifact
   lineage.
4. `analyzeContentDependencyGraph` deterministically detects duplicate graph or
   slot identities, missing dependent/prerequisite endpoints, dependency cycles,
   artifacts with no relationship to a registered slot, shipped content with no
   blocking path to a registered slot, dangling evidence references,
   unregistered slot references, and product-scope mismatches. The assertion API
   fails closed on any finding.
5. `buildContentDependencyProductView` returns complete records only when the
   requested product is named in the node scope. Direct foreign dependencies
   become minimal one-hop boundary stubs; traversal stops there, foreign
   rationale/evidence is redacted, and unrelated evidence records are omitted.
6. Invalidation accepts exactly source, canon, policy, rights, model, rubric,
   provider, and placement roots. The event root kind must match the trigger and
   the change evidence must be present, available, and unexpired. Traversal
   follows every blocking reverse dependency while excluding contextual edges.
   The resulting deterministic plan invalidates artifacts, revokes approvals,
   withdraws placements/shipped content, and carries the causal edge IDs without
   mutating the caller's graph.
7. `scheduleRequiredContentLeafWork` selects only missing, stale, invalidated,
   expired, or evidence-unverified executable nodes tied to an active required
   canonical slot whose blocking prerequisites are current and fresh. It sorts
   by explicit priority, due time, and stable ID. Optional work, work for no
   active slot, blocked work, not-yet-ready descendants, and capacity overflow
   are explicitly deferred rather than silently generated.

## Determinism and artifact identity

| Artifact                                                       | SHA-256                                                            |
| -------------------------------------------------------------- | ------------------------------------------------------------------ |
| `libs/contracts/src/content-coverage/dependency-graph.ts`      | `d920522ea281e53c1b4bcdc09e3b79433fc6fbb87a0ac7713b1b8413ad1ceb3b` |
| `libs/contracts/src/content-coverage/dependency-graph.spec.ts` | `62e2da3de747728146e2d4762b15a2271ba5a617c1a7863beb471987afc9c8c1` |
| `libs/contracts/src/content-coverage/index.ts`                 | `574305b13133b93a46a42097ccddafe494ba057375346d95d296b818de79a3e2` |
| `.github/workflows/content-slot-contract.yml`                  | `8fc65dd843cbeff9707f3a1f3e51ada5735617ce3e94b0f547cf55e79d960811` |
| `package.json`                                                 | `bef854c315d5c40c844eaadaf7ef7767c7a9548c6309c6a2b6187cb6b3d52624` |

The analyzer sorts diagnostics and topological output; product views sort nodes,
boundaries, edges, and evidence; invalidation effects and causal edge sets are
stable; and scheduling uses explicit priority/due/ID ordering. No wall-clock
read or random identifier is used by these functions: callers supply the graph
`asOf`, event time, request time, and stable IDs.

## Automated and adversarial verification

- `pnpm verify:contracts:content-dependency-graph` passes targeted ESLint with
  `--no-ignore --max-warnings=0`, **28/28** Vitest cases with one worker, and
  the contracts source typecheck. Tests freeze all 23 edge kinds, all 24 node
  kinds, and all eight invalidation roots.
- Adversarial cases prove strict unknown-field rejection; required/contextual
  bypass rejection; cycle members and causal edges; both dangling endpoint
  directions; orphan and unknown-shipped detection; node/edge evidence dangling;
  duplicate node/edge/evidence/slot IDs; unregistered slots; private scope
  mismatches; one-hop product-boundary redaction; deterministic product views;
  all eight invalidation roots; approval/placement/shipped withdrawal;
  contextual-edge isolation; mismatched trigger roots; absent/revoked change
  evidence; ready-frontier scheduling; optional/unneeded/prerequisite/capacity
  deferral; expiry handling; priority ordering; and no scheduling without an
  active required slot. A 5,000-node dependency chain proves iterative graph
  analysis without call-stack recursion.
- `pnpm verify:contracts:content-slot` remains green at **17/17** tests with the
  new export, and `pnpm verify:content-coverage:seed-registry` remains green at
  **10/10** tests with exact deterministic output drift checking and 68
  registered / 7,185 unregistered rows.
- `NX_DAEMON=false pnpm exec nx run @oshun/contracts:build --parallel=1` passes.
  A runtime `tsx` probe verifies the graph version and edge-kind exports through
  the root flat export, root `ContentCoverageContracts` namespace, and
  `@oshun/contracts/content-coverage` subpath.
- The contracts checks and build ran sequentially on the 15 GiB host. Before the
  package build, 12 GiB was available, 30 GiB of swap remained free, and no
  competing Nx/build/test process was active. Conservative parallelism was
  retained.
- Source pre-commit ESLint, Prettier, asset locking, and V5 documentation
  validation passed. The hook's inferred broad typecheck was bypassed with
  `SKIP_TYPECHECK=1` under the host resource policy; the focused contracts
  typecheck and resource-gated package build passed before and after remote
  integration.

## Negative proof and claim boundary

- This task proves a contract and deterministic in-process engine. It does not
  claim that a COV-002 requirement has authoritative slot identity/policy, that
  any V1–V9 dependency record has been loaded, that a database/API/worker calls
  these functions, or that deployed invalidation reaches a live artifact.
- The COV-002 registry still reports zero complete canonical slots. COV-004
  still owns locale/modality/accessibility/manual-content inventory; COV-005
  still owns enforced closure, placement reconciliation, alerts, and release
  failure. P1-002 still owns shared persisted graph queries, authorization,
  tenant views, and end-to-end product proof.
- A valid test fixture is not release or placement evidence. No provider call,
  media generation, authenticated receipt, human approval, or customer
  production probe is manufactured or implied.
- No user-facing web/admin/mobile UI, persistence migration, media pipeline, or
  Unreal asset changed. Playwright/mobile/accessibility-browser, database,
  provider, media, and Unreal execution are therefore inapplicable to COV-003.

## Publication identity

- **Implementation source commit:** `91ff4e9c1c453d16be7f200c1ac426c8b59e25a6`
- **First remote-integrated tested source:**
  `8967eec7fce866f83e05b0d0856ff62df4fe6d96`
- **Publication metadata commit:** `a93dd7b000339df8bdaa60d0944e88ab98defb49`
- **Remote-integrated publication tip:**
  `cb83aea8dd6e44394d06242fdb9eda0ea6fcfb59`
