# MC Grandfather Clause — Legacy Task Completion

# MC Grandfather Clause — Legacy Task Completion

**Installed:** 2026-05-03 17:30 UTC  
**Implementation:** `/Users/makinja/system/tools/mc.js`  
**Audit Log:** `/tmp/mc-grandfathered-completions.log`  
**MC Genesis:** #99057  
**Verified by:** Proveo (angie-jones) — 6/6 PASS

---

## What Is This?

The **grandfather clause** allows legacy tasks (created and marked `ready_for_review` *before* 2026-05-03 17:30 UTC) to complete without triggering the new gate stack:

- qa-19 mode enforcement
- GOTCHA Decision Tier check (H+M priority)
- hop-build phase completion (H+M priority)
- validator-independent.json requirement
- ZAKON #21 trust label content verification

**Old gates still apply:** ZAKON #22 ready\_for\_review requirement, evidence bundle, postflight marker, ADR-021 compliance. This is *not* a full bypass — only the new stack is skipped.

---

## Why?

CEO decision 2026-05-03 after the 3-layer gate chain ('sistem koje je krc') blocked routine closure of 6 drift-prevention MCs that had already been validated under the old regime. The grandfather clause creates a clean boundary: tasks already validated = let them close without new gates; new tasks = all gates active.

---

## How It Works

### Timestamp Boundary

`GATE_INSTALL_DATE = '2026-05-03T17:30:00Z'` (line ~50 in mc.js)

The `isGrandfathered(task, taskId)` helper checks three timestamp heuristics (in priority order):

1. `completed_at` (if task already done — should never happen in preCompletion gate)
2. `updated_at` when status = ready\_for\_review
3. Earliest `task_history` entry with action = READY\_FOR\_REVIEW

If any timestamp is **before** GATE\_INSTALL\_DATE → grandfathered = true.

**UTC fix:** SQLite timestamps are space-separated (`YYYY-MM-DD HH:MM:SS`) — JavaScript `new Date()` parses these as *local time* unless 'Z' is appended. The `sqliteUtcMs()` helper (lines 656-661) imposes UTC parsing to prevent timezone drift.

### Gate Wrap Points

Five checks in `preCompletionGate()` (lines 750-817) are wrapped with `if (grandfathered) { /* skip */ }`:

- qa-19 mode (line 754)
- H-priority GOTCHA + hop-build + validator-independent.json (lines 774, 784)
- M-priority GOTCHA + hop-build (line 799)
- GOTCHA Decision Tier trust label check (line 810)

---

## Grandfathered vs Forced

<table id="bkmrk-aspect-grandfathered"><thead><tr><th>Aspect</th><th>GRANDFATHERED</th><th>FORCED\_COMPLETION</th></tr></thead><tbody><tr><td>**Trigger**</td><td>ready\_for\_review\_at &lt; gate install date</td><td>override flag</td></tr><tr><td>**Gates bypassed**</td><td>New stack only (qa-19, GOTCHA, hop-build, validator, trust labels)</td><td>All gates (including old: ZAKON #22, evidence, postflight, ADR-021)</td></tr><tr><td>**Audit log**</td><td>`/tmp/mc-grandfathered-completions.log`</td><td>`/tmp/mc-forced-completions.log`</td></tr><tr><td>**DB action**</td><td>`task_history.action='GRANDFATHERED'`</td><td>`task_history.action='FORCED_COMPLETION'`</td></tr><tr><td>**Console output**</td><td>"GRANDFATHERED: task predates new gate stack"</td><td>"⚠️ FORCED COMPLETION"</td></tr><tr><td>**Intended use**</td><td>Clean legacy backlog closure (automatic)</td><td>CEO override for exceptional cases (explicit)</td></tr></tbody></table>

---

## Audit Logs

### Grandfathered Log

`/tmp/mc-grandfathered-completions.log` (separate from FORCED log)

**Format:**

```
{
  "timestamp": "2026-05-03T18:27:04.123Z",
  "taskId": 99022,
  "completionType": "GRANDFATHERED",
  "gate_install_date": "2026-05-03T17:30:00Z",
  "reason": "updated_at=2026-05-03 09:52:57 (status=ready_for_review)"
}

```

### Database

**Query:**

```
sqlite3 ~/system/databases/mission-control.db \
  "SELECT task_id, action, timestamp FROM task_history WHERE action='GRANDFATHERED'"

```

**Verified entries (as of 2026-05-03):** 5 tasks (99022, 10590, 10608, 10611, 10613)

---

## Code References

<table id="bkmrk-element-location-%28mc"><thead><tr><th>Element</th><th>Location (mc.js)</th></tr></thead><tbody><tr><td>GATE\_INSTALL\_DATE constant</td><td>Line ~50</td></tr><tr><td>sqliteUtcMs() helper</td><td>Lines 656-661</td></tr><tr><td>isGrandfathered() helper</td><td>Lines 662-712</td></tr><tr><td>preCompletionGate() wrapper checks</td><td>Lines 750-817</td></tr><tr><td>completionType assignment</td><td>Lines 2030-2033</td></tr><tr><td>Audit log write</td><td>Line ~2063</td></tr></tbody></table>

---

## Verification

**Test 1 (legacy task):** MC #99022 (ready\_for\_review\_at = 2026-05-03 08:43 UTC)  
`node ~/system/tools/mc.js done 99022`  
→ Status = done, action = GRANDFATHERED (no override needed)

**Test 2 (new task):** MC #99058 (created 2026-05-03 18:27 UTC)  
`isGrandfathered()` returns `{ grandfathered: false }`  
→ All gates remain active

**Proveo report:** `/tmp/postflight-99057/proveo-report.md` — 6/6 AC PASS

---

*Created: 2026-05-03  
Owner: John (AI Director)  
Company: ALAI Holding AS*