DoD Compliance Sweep
Validate Definition of Done compliance across closed epics/tickets. Operates in
two modes: batch (retroactive sweep of recently completed tickets) and
targeted (pre-close gate for a specific epic or ticket).
Dual Mode
- Batch (
/dod-sweep): Query Linear for tickets completed in the lookback
window via tracker.list_issues, filter by completedAt.
- Batch since-last-cycle (
/dod-sweep --since-last-cycle): Query Linear for
tickets completed since the last autopilot close-out cycle. Reads the last cycle
timestamp from $ONEX_STATE_DIR/autopilot/cycle-state.yaml field
last_cycle_id, which stores the cycle boundary timestamp. Falls back to
--since-days 7 if no prior cycle exists.
- Targeted (
/dod-sweep <TICKET-ID>): If the target is an epic, expand child
tickets. If a single ticket, sweep just that one.
Per-Ticket Verification Mode
When --per-ticket-verify is passed (or when invoked from autopilot as Step B1),
the sweep runs dod-verify individually against each discovered ticket instead of
delegating to the batch check_dod_compliance.py handler. This provides granular
evidence receipts per ticket.
Flow:
- Discover tickets (via batch or since-last-cycle query)
- For each ticket, invoke the
dod-verify skill logic:
- Locate ticket contract at
$ONEX_CC_REPO_PATH/contracts/{ticket_id}.yaml
- If contract exists with
dod_evidence[], run evidence checks via the shared
runner at plugins/onex/skills/_lib/dod-evidence-runner/dod_evidence_runner.py
- Collect the DoD verification result for the ticket. Durable per-ticket
receipt persistence is not yet implemented in the backing node and must not be claimed until it is.
- Flag any tickets with incomplete DoD evidence (failed or missing checks)
- Aggregate results and report summary
Check Confidence Tiers
The 6 per-ticket checks are organized into two confidence tiers:
Primary (Artifact Checks -- High Confidence)
Deterministic file existence and content parsing. If the file is there and
parseable, the check is authoritative.
- CONTRACT_EXISTS:
ls $ONEX_CC_REPO_PATH/contracts/{ticket_id}.yaml
- RECEIPT_EXISTS: Check deterministic location
$ONEX_CC_REPO_PATH/.evidence/{ticket_id}/dod_report.json first, then
$ONEX_STATE_DIR as fallback. In targeted mode, also validate receipt
freshness -- receipt must be newer than the ticket's completedAt date.
- RECEIPT_CLEAN: Parse receipt JSON, verify
result.failed == 0.
Supporting (Operational Checks -- Medium Confidence)
Depends on cross-repo search, SHA linkage, and drift artifact grep. Can produce
UNKNOWN when linkage cannot be established cleanly.
- PR_MERGED:
gh pr list --search "{ticket_id}" --state merged --json number
across repos. If no PR found, record UNKNOWN with detail "No merged PR found
matching ticket ID -- may indicate PR title/branch naming mismatch" rather than
hard FAIL.
- CI_GREEN: Use the GitHub check-runs endpoint for the merged commit SHA --
verify all conclusions are "success". If the SHA cannot be determined, record
UNKNOWN.
- INTEGRATION_SWEEP_EVIDENCE: If contract has
interfaces_touched, grep
$ONEX_CC_REPO_PATH/drift/integration/*.yaml for ticket_id. This verifies
presence of sweep evidence linked to the ticket, not substantive correctness
of every relevant integration surface. If no interfaces_touched, this check
is automatically PASS (not applicable).
Receipt Freshness Doctrine (Targeted Mode Only)
In targeted mode (pre-close gate), receipts must be associated with the
completion being audited, not merely exist from some historical run:
- Validate: receipt timestamp > ticket's
completedAt date, OR receipt was
generated within the current session.
- Deterministic ticket-specific receipt locations
(
$ONEX_CC_REPO_PATH/.evidence/{ticket_id}/dod_report.json) are preferred
over broad find discovery to prevent false association.
- In batch mode (retroactive sweep), existence-only is acceptable since the
goal is historical audit, not real-time gating.
UNKNOWN Semantics
UNKNOWN is not a single state. It may represent:
| Meaning |
Example |
Gate behavior |
| Exempt / not checked |
Ticket predates contract system |
Non-blocking |
| Inconclusive linkage |
PR search found no match by ticket ID |
Non-blocking if primary checks pass |
| Mixed check state |
Some checks PASS, others UNKNOWN |
Non-blocking but flagged |
| No evidence-backed passes |
All tickets exempt |
Non-blocking (rollout accommodation) |
Targeted-Mode Gate Decision Matrix
| Primary checks |
Supporting checks |
Gate result |
Action |
| Any FAIL |
anything |
BLOCK |
Create follow-up tickets |
| All PASS |
All PASS |
ALLOW CLEAN |
Mark epic Done |
| All PASS |
Some UNKNOWN |
ALLOW WITH WARNING |
Mark epic Done, post warning |
| All PASS |
Any FAIL |
ALLOW WITH FOLLOW-UP |
Mark epic Done, create follow-up |
| All exempt |
n/a |
ALLOW UNKNOWN-REVIEW |
Mark epic Done (rollout accommodation) |
Exemption Handling
- Load
$ONEX_CC_REPO_PATH/dod_sweep_exemptions.yaml
- Skip tickets completed before cutoff_date
- Skip explicitly exempted ticket IDs
- Check
expires_on if present -- expired exemptions are no longer valid
Follow-Up Ticket Creation and Dedup
For each failed ticket (when not --dry-run):
- Search existing open tickets for
[dod-sweep-gap:{ticket_id}] marker in
description. If found and still open, update the existing ticket's description
with the current failed check set rather than creating a duplicate.
- If found but closed (gap recurred), create a new ticket with reference to the
previous closed one.
- On recurrence, record the delta explicitly (prior state vs current failed state)
rather than silently overwriting history.
Follow-up ticket format:
- Title:
fix: DoD gap -- {ticket_id} -- {failed_check_names}
- Parent: same epic as the original ticket
- Description includes: which checks failed, passed, and UNKNOWN, with confidence
tier of each failed check
Rendered Output Evidence Enforcement
Tickets with any of the following labels MUST have at least one rendered_output
evidence item in their dod_evidence[] array:
data_pipeline
dashboard
display
projection
Check logic:
- For each ticket in the sweep, check if any of the above labels are present
- If label match: verify
dod_evidence[] contains at least one item with type: rendered_output
- If missing: flag the ticket as
RENDERED_OUTPUT_MISSING in the sweep report
- Create a follow-up ticket with title
fix: DoD gap -- {ticket_id} -- missing rendered_output evidence
This enforcement encodes the Visual Output Verification requirement into the automated
DoD compliance pipeline.
Report Output
- Write
ModelDodSweepResult YAML to
$ONEX_CC_REPO_PATH/drift/dod_sweep/{date}.yaml
- Print summary table to stdout -- table distinguishes passed, failed, exempted,
and UNKNOWN counts
- Emit
dod.sweep.completed Kafka event (non-blocking)
Recurring Usage
/loop 2h /onex:dod_sweep --dry-run
/loop daily /onex:dod_sweep
1---2name: dod-sweep3description: "DoD compliance sweep -- dispatches to node_dod_sweep_orchestrator for execution"4version: 1.1.05mode: full6level: advanced7debug: false8category: verification9tags: [dod, sweep, compliance, contracts, evidence, autonomous]10composable: true11args:12 - name: target13 description: "Optional OMN-XXXX epic/ticket ID for targeted mode (omit for batch)"14 required: false15 - name: --since-days16 description: "Look-back window for batch mode (default: 7)"17 required: false18 - name: --since-last-cycle19 description: "Use the last autopilot close-out cycle timestamp as the look-back boundary (overrides --since-days)"20 required: false21 - name: --per-ticket-verify22 description: "Run dod-verify individually against each discovered ticket. Default: true (pass --no-per-ticket-verify to disable)"23 required: false24 - name: --dry-run25 description: "Report only, no follow-up tickets"26 required: false27metadata:28 source: https://skillmd.com/skills/omninode-ai/dod-sweep29---3031<!-- routing-enforced: dispatches to node_dod_sweep_orchestrator. -->3233# DoD Compliance Sweep3435Validate Definition of Done compliance across closed epics/tickets. Operates in36two modes: **batch** (retroactive sweep of recently completed tickets) and37**targeted** (pre-close gate for a specific epic or ticket). <!-- skill-boundary-ok: iteration described here is performed by node_dod_sweep_orchestrator handler, not the skill itself -->3839## Dual Mode4041- **Batch** (`/dod-sweep`): Query Linear for tickets completed in the lookback <!-- skill-boundary-ok: ticket iteration is performed by node_dod_sweep_orchestrator handler, not the skill -->42 window via `tracker.list_issues`, filter by `completedAt`.43- **Batch since-last-cycle** (`/dod-sweep --since-last-cycle`): Query Linear for44 tickets completed since the last autopilot close-out cycle. Reads the last cycle45 timestamp from `$ONEX_STATE_DIR/autopilot/cycle-state.yaml` field <!-- skill-boundary-ok: state file read is performed by node_dod_sweep_orchestrator handler, not the skill -->46 `last_cycle_id`, which stores the cycle boundary timestamp. Falls back to47 `--since-days 7` if no prior cycle exists.48- **Targeted** (`/dod-sweep <TICKET-ID>`): If the target is an epic, expand child49 tickets. If a single ticket, sweep just that one.5051## Per-Ticket Verification Mode5253When `--per-ticket-verify` is passed (or when invoked from autopilot as Step B1),54the sweep runs `dod-verify` individually against each discovered ticket instead of55delegating to the batch `check_dod_compliance.py` handler. This provides granular56evidence receipts per ticket.5758Flow:591. Discover tickets (via batch or since-last-cycle query)602. For each ticket, invoke the `dod-verify` skill logic: <!-- skill-boundary-ok: per-ticket iteration is performed by node_dod_sweep_orchestrator handler -->61 - Locate ticket contract at `$ONEX_CC_REPO_PATH/contracts/{ticket_id}.yaml`62 - If contract exists with `dod_evidence[]`, run evidence checks via the shared63 runner at `plugins/onex/skills/_lib/dod-evidence-runner/dod_evidence_runner.py`64 - Collect the DoD verification result for the ticket. Durable per-ticket <!-- skill-boundary-ok: result collection is performed by node_dod_sweep_orchestrator handler -->65 receipt persistence is not yet implemented in the backing node and must not be claimed until it is.663. Flag any tickets with incomplete DoD evidence (failed or missing checks)674. Aggregate results and report summary6869## Check Confidence Tiers7071The 6 per-ticket checks are organized into two confidence tiers:7273### Primary (Artifact Checks -- High Confidence)7475Deterministic file existence and content parsing. If the file is there and76parseable, the check is authoritative.77781. **CONTRACT_EXISTS**: `ls $ONEX_CC_REPO_PATH/contracts/{ticket_id}.yaml`792. **RECEIPT_EXISTS**: Check deterministic location80 `$ONEX_CC_REPO_PATH/.evidence/{ticket_id}/dod_report.json` first, then81 `$ONEX_STATE_DIR` as fallback. In targeted mode, also validate receipt82 freshness -- receipt must be newer than the ticket's `completedAt` date.833. **RECEIPT_CLEAN**: Parse receipt JSON, verify `result.failed == 0`.8485### Supporting (Operational Checks -- Medium Confidence)8687Depends on cross-repo search, SHA linkage, and drift artifact grep. Can produce88UNKNOWN when linkage cannot be established cleanly.89904. **PR_MERGED**: `gh pr list --search "{ticket_id}" --state merged --json number`91 across repos. If no PR found, record `UNKNOWN` with detail "No merged PR found92 matching ticket ID -- may indicate PR title/branch naming mismatch" rather than93 hard FAIL.945. **CI_GREEN**: Use the GitHub check-runs endpoint for the merged commit SHA --95 verify all conclusions are "success". If the SHA cannot be determined, record96 `UNKNOWN`.976. **INTEGRATION_SWEEP_EVIDENCE**: If contract has `interfaces_touched`, grep98 `$ONEX_CC_REPO_PATH/drift/integration/*.yaml` for ticket_id. This verifies99 presence of sweep evidence linked to the ticket, not substantive correctness100 of every relevant integration surface. If no `interfaces_touched`, this check101 is automatically PASS (not applicable).102103## Receipt Freshness Doctrine (Targeted Mode Only)104105In targeted mode (pre-close gate), receipts must be associated with the106completion being audited, not merely exist from some historical run:107108- Validate: receipt timestamp > ticket's `completedAt` date, OR receipt was109 generated within the current session.110- Deterministic ticket-specific receipt locations111 (`$ONEX_CC_REPO_PATH/.evidence/{ticket_id}/dod_report.json`) are preferred112 over broad `find` discovery to prevent false association.113- In batch mode (retroactive sweep), existence-only is acceptable since the114 goal is historical audit, not real-time gating.115116## UNKNOWN Semantics117118UNKNOWN is not a single state. It may represent:119120| Meaning | Example | Gate behavior |121|---------|---------|---------------|122| Exempt / not checked | Ticket predates contract system | Non-blocking |123| Inconclusive linkage | PR search found no match by ticket ID | Non-blocking if primary checks pass |124| Mixed check state | Some checks PASS, others UNKNOWN | Non-blocking but flagged |125| No evidence-backed passes | All tickets exempt | Non-blocking (rollout accommodation) |126127## Targeted-Mode Gate Decision Matrix128129| Primary checks | Supporting checks | Gate result | Action |130|---------------|-------------------|-------------|--------|131| Any FAIL | anything | BLOCK | Create follow-up tickets |132| All PASS | All PASS | ALLOW CLEAN | Mark epic Done |133| All PASS | Some UNKNOWN | ALLOW WITH WARNING | Mark epic Done, post warning |134| All PASS | Any FAIL | ALLOW WITH FOLLOW-UP | Mark epic Done, create follow-up |135| All exempt | n/a | ALLOW UNKNOWN-REVIEW | Mark epic Done (rollout accommodation) |136137## Exemption Handling1381391. Load `$ONEX_CC_REPO_PATH/dod_sweep_exemptions.yaml`1402. Skip tickets completed before cutoff_date1413. Skip explicitly exempted ticket IDs1424. Check `expires_on` if present -- expired exemptions are no longer valid143144## Follow-Up Ticket Creation and Dedup145146For each failed ticket (when not `--dry-run`): <!-- skill-boundary-ok: follow-up ticket creation is performed by node_dod_sweep_orchestrator handler -->1471481. Search existing open tickets for `[dod-sweep-gap:{ticket_id}]` marker in149 description. If found and still open, update the existing ticket's description150 with the current failed check set rather than creating a duplicate.1512. If found but closed (gap recurred), create a new ticket with reference to the152 previous closed one.1533. On recurrence, record the delta explicitly (prior state vs current failed state)154 rather than silently overwriting history.155156Follow-up ticket format:157- Title: `fix: DoD gap -- {ticket_id} -- {failed_check_names}`158- Parent: same epic as the original ticket159- Description includes: which checks failed, passed, and UNKNOWN, with confidence160 tier of each failed check161162## Rendered Output Evidence Enforcement163164Tickets with any of the following labels MUST have at least one `rendered_output`165evidence item in their `dod_evidence[]` array:166- `data_pipeline`167- `dashboard`168- `display`169- `projection`170171**Check logic:**1721. For each ticket in the sweep, check if any of the above labels are present <!-- skill-boundary-ok: label-presence iteration is performed by node_dod_sweep_orchestrator handler -->1732. If label match: verify `dod_evidence[]` contains at least one item with `type: rendered_output`1743. If missing: flag the ticket as `RENDERED_OUTPUT_MISSING` in the sweep report1754. Create a follow-up ticket with title `fix: DoD gap -- {ticket_id} -- missing rendered_output evidence`176177This enforcement encodes the Visual Output Verification requirement into the automated178DoD compliance pipeline.179180## Report Output1811821. Write `ModelDodSweepResult` YAML to183 `$ONEX_CC_REPO_PATH/drift/dod_sweep/{date}.yaml`1842. Print summary table to stdout -- table distinguishes passed, failed, exempted,185 and UNKNOWN counts1863. Emit `dod.sweep.completed` Kafka event (non-blocking)187188## Recurring Usage189190```191/loop 2h /onex:dod_sweep --dry-run192/loop daily /onex:dod_sweep193```