$npx -y skills add WILLOSCAR/research-units-pipeline-skills --skill artifact-contract-auditorAudit one research Workspace for declared Unit outputs and Pipeline target Artifacts, writing output/CONTRACT_REPORT.md; use for mid-Run coverage snapshots or final delivery completeness, not deep provenance integrity.
| 1 | # Artifact Contract Auditor |
| 2 | |
| 3 | This Skill measures **coverage**: whether files promised by Units and the locked |
| 4 | Pipeline exist at the point they are required. It does not replace the deeper |
| 5 | Attempt, Manifest, Artifact-hash, and ledger checks in `pipeline.py audit`. |
| 6 | |
| 7 | ## Inputs |
| 8 | |
| 9 | - `UNITS.csv`. |
| 10 | - `PIPELINE.lock.md`. |
| 11 | - The locked `pipelines/*.pipeline.md` target-Artifact contract. |
| 12 | |
| 13 | ## Outputs |
| 14 | |
| 15 | - `output/CONTRACT_REPORT.md`. |
| 16 | |
| 17 | ## Steps |
| 18 | |
| 19 | ### 1. Resolve the active contracts |
| 20 | |
| 21 | Read `PIPELINE.lock.md`, resolve the Pipeline inside this repository, and parse |
| 22 | `UNITS.csv`. Treat an invalid lock or malformed Unit table as a reportable |
| 23 | contract failure rather than guessing another Workflow. |
| 24 | |
| 25 | Completion criterion: one Pipeline contract and one readable Unit table are |
| 26 | bound to the audit. |
| 27 | |
| 28 | ### 2. Check completed Unit outputs |
| 29 | |
| 30 | For every `DONE` Unit, verify each required output exists. Outputs prefixed with |
| 31 | `?` are optional. A missing required output is Unit-level contract drift even |
| 32 | when the Pipeline is still running. |
| 33 | |
| 34 | Completion criterion: every `DONE` Unit is classified as output-complete or is |
| 35 | listed with each missing required path. |
| 36 | |
| 37 | ### 3. Check final Pipeline targets when applicable |
| 38 | |
| 39 | Determine whether all Units are terminal (`DONE` or `SKIP`). Only then require |
| 40 | every non-optional target Artifact declared by the Pipeline. During a partial |
| 41 | Run, report missing final targets as expected rather than failures. |
| 42 | |
| 43 | Completion criterion: final-target completeness is evaluated against the |
| 44 | actual Run phase, not merely file absence. |
| 45 | |
| 46 | ### 4. Write the report |
| 47 | |
| 48 | Always write `output/CONTRACT_REPORT.md` with one status: |
| 49 | |
| 50 | - `PASS`: terminal Run, complete Unit outputs, complete Pipeline targets. |
| 51 | - `OK`: partial Run, consistent completed Unit outputs. |
| 52 | - `FAIL`: missing output from a `DONE` Unit, or missing final target from a |
| 53 | terminal Run. |
| 54 | |
| 55 | Completion criterion: the report names the evaluated Pipeline, Run phase, |
| 56 | status, and every blocking missing path. |
| 57 | |
| 58 | ### 5. Route the next action |
| 59 | |
| 60 | For missing Unit outputs, reopen or rerun the owning Unit through the Pipeline |
| 61 | adapter. For missing final targets, identify the owning Unit or Skill. When |
| 62 | file coverage passes, use `scripts/pipeline.py audit` for provenance integrity. |
| 63 | |
| 64 | Completion criterion: every `FAIL` item has an owner and repair route; a `PASS` |
| 65 | claim is explicitly limited to declared file coverage. |
| 66 | |
| 67 | ## Context Pointers |
| 68 | |
| 69 | - The locked Pipeline front matter is the only source for target Artifacts. |
| 70 | - `UNITS.csv` is the only source for Unit output obligations. |
| 71 | - Use the deep Run Audit for Attempt pairing, Manifest identity, hashes, |
| 72 | Decisions, Failures, and Evaluation consistency. |
| 73 | |
| 74 | ## Script |
| 75 | |
| 76 | ### Quick Start |
| 77 | |
| 78 | ```bash |
| 79 | uv run python .codex/skills/artifact-contract-auditor/scripts/run.py \ |
| 80 | --workspace workspaces/<name> |
| 81 | ``` |
| 82 | |
| 83 | ### All Options |
| 84 | |
| 85 | - `--workspace <path>`: Workspace to audit. |
| 86 | - `--unit-id <U###>`, `--inputs`, `--outputs`, `--checkpoint`: optional |
| 87 | Pipeline-runner compatibility arguments. |
| 88 | |
| 89 | ### Examples |
| 90 | |
| 91 | Inspect the interface: |
| 92 | |
| 93 | ```bash |
| 94 | uv run python .codex/skills/artifact-contract-auditor/scripts/run.py --help |
| 95 | ``` |
| 96 | |
| 97 | Run the deeper provenance audit after coverage passes: |
| 98 | |
| 99 | ```bash |
| 100 | uv run python scripts/pipeline.py audit --workspace workspaces/<name> |
| 101 | ``` |
| 102 | |
| 103 | ## Side Effects |
| 104 | |
| 105 | The audit may create or replace `output/CONTRACT_REPORT.md`. It must not edit |
| 106 | research content, Unit statuses, checkpoint approvals, or source Artifacts. |