# MC Quality Trail — validator_agent + agent_output write semantics (Patch #10036)

## Summary

Patch bundle MC #10036 (landed 2026-04-29) backfills two missing quality-trail columns in Mission Control. Prior to this patch, 0 of 6,529 tasks had `validator_agent` populated, making audit and quality trending impossible. The patch adds `--validator <slug>` and `--quality <int>` flags to `mc.js ready`, and makes `mc.js done` write the task outcome to `agent_output` when that column is NULL. All writes use no-clobber semantics so existing data is never overwritten. Validated by Proveo (MC #10038, 8/8 PASS, GLOBAL\_VERDICT: PASS).

## New CLI flags — mc.js ready

<table id="bkmrk-flagtypevalidationef"><thead><tr><th>Flag</th><th>Type</th><th>Validation</th><th>Effect</th></tr></thead><tbody><tr><td>`--validator <slug>`</td><td>string</td><td>regex `[a-z][a-z0-9_-]{1,40}`</td><td>Writes `validator_agent` + `validation_timestamp = datetime('now')`</td></tr><tr><td>`--quality <int>`</td><td>integer</td><td>0–10 inclusive</td><td>Writes `quality_score`</td></tr></tbody></table>

## No-clobber semantics

Both flags are strictly optional. If a flag is absent or empty the corresponding column is **not touched** — existing values are preserved. This applies to both commands:

- **mc.js ready:** if `--validator` is omitted, `validator_agent` and `validation_timestamp` remain unchanged. If `--quality` is omitted, `quality_score` remains unchanged.
- **mc.js done:** the outcome string is written to `agent_output` only when `agent_output IS NULL`. If the column already has a value the done-outcome is preserved in `task_history` only and a log line confirms: `[mc.js done] agent_output already set — outcome preserved in history only`.

## Postflight derivation — GLOBAL\_VERDICT to quality score

The task-postflight skill (SKILL.md Section 6) derives the `--quality` integer from the GLOBAL\_VERDICT emitted by the validator agent:

<table id="bkmrk-global_verdict--qual"><thead><tr><th>GLOBAL\_VERDICT</th><th>--quality value</th></tr></thead><tbody><tr><td>PASS</td><td>10</td></tr><tr><td>PARTIAL</td><td>5</td></tr><tr><td>FAIL</td><td>0</td></tr></tbody></table>

## Example invocation

```
node ~/system/tools/mc.js ready 9999 "validation passed" --validator proveo --quality 10
```

This single command marks the task ready, records the validator identity, timestamps the validation, and writes the quality score in one atomic call.

## Audit query

To find tasks closed after the patch date that are still missing a validator (quality trail gap):

```
SELECT id, title, status, completed_at FROM tasks
WHERE status='done' AND validator_agent IS NULL AND completed_at > '2026-04-29';
```

## Cross-references

- **MC #10036** — master patch task (implementation)
- **MC #10038** — Proveo validation subtask (8/8 PASS, GLOBAL\_VERDICT: PASS)
- **MC #10039** — this documentation subtask (Skillforge)
- **task-postflight SKILL.md Section 6** — /Users/makinja/.claude/skills/task-postflight/SKILL.md lines 251–320 — canonical derivation table and flag usage examples