# TLDR Loop — Insight to Implementation Pipeline

# TLDR Loop — Insight to Implementation Pipeline

## Overview

The TLDR actionizer daemon closes the learning loop between daily TLDR email insights and ALAI's Mission Control task system. Instead of manually triaging insights or dumping them into an ever-growing backlog, the daemon automatically classifies, gates by relevance, routes to specialist owners, and creates tracked tasks — all without human intervention.

**CEO Directive (2026-05-08):** "Želim da ne sjedi u backlog i da se to krene u implementaciju" — No more backlog dumps. Every insight gets actionable routing or explicit discard.

### Problem Solved

- **Before:** TLDR insights manually reviewed → backlog queue → forgotten
- **After:** Automated classification → relevance gating → specialist routing → tracked M/L tasks
- **Result:** Zero backlog accumulation, specialist-aligned ownership, priority-based scheduling

## Daemon Flow Diagram

```

flowchart LR
    A[TLDR Email<br></br>09:00 daily] --> B[tldr-briefing.js<br></br>Extracts insights]
    B --> C[insights JSON log<br></br>~/system/logs/tldr-insights/YYYY-MM-DD.json]
    C --> D[tldr-actionizer.js<br></br>09:30 daily]
    D --> E{Ollama<br></br>TASK/SUGGEST/SKIP}
    E -->|SKIP| F[Discard<br></br>No MC task]
    E -->|SUGGEST| G2[Slack FYI only<br></br>No MC task]
    E -->|TASK| G{Ollama<br></br>HIGH/MED/LOW relevance}
    G -->|LOW| F
    G -->|HIGH or MED| H[OWNER_ROUTER<br></br>Keyword match]
    H --> I[MC Task Created<br></br>Priority M/L<br></br>TTL 30d]
    I --> J[Slack #exec<br></br>Summary]
```

## OWNER\_ROUTER Table

The daemon routes insights to specialist company owners based on keyword pattern matching. First match wins (order matters).

<table id="bkmrk-pattern-%28regex%2C-case"><thead> <tr> <th>Pattern (regex, case-insensitive)</th> <th>Owner</th> <th>Example Keywords</th> </tr></thead><tbody> <tr> <td>`security|breach|cve|vulnerab|ddos|exploit|malware|ransom|cyber`</td> <td>**securion**</td> <td>CVE-2024-1234, DDoS attack, ransomware</td> </tr> <tr> <td>`llm|gpt|claude|llama|model|rag|agent|fine-tun|embed|inference|ollama`</td> <td>**agentforge**</td> <td>GPT-5.5, RAG pipeline, Ollama fleet</td> </tr> <tr> <td>`payment|stripe|psd2|fintech|invoice|billing|bank|finance`</td> <td>**finverge**</td> <td>Stripe API, PSD2 compliance, invoicing</td> </tr> <tr> <td>`docker|kubernetes|k8s|deploy|ci/cd|terraform|cloud run|aws|azure|gcp|nginx`</td> <td>**flowforge**</td> <td>Cloud Run, Kubernetes, CI/CD pipelines</td> </tr> <tr> <td>`ios|android|mobile|swift|flutter|react native`</td> <td>**skybound**</td> <td>Flutter 3.22, iOS performance, React Native</td> </tr> <tr> <td>*(No match)*</td> <td>**codecraft** (default)</td> <td>Generic SaaS, backend, frontend</td> </tr></tbody></table>

**Safety Invariant:** `owner='backlog'` is forbidden. The daemon will throw an error if any route resolves to 'backlog'. All tasks must go to a specialist owner or the default (codecraft).

## Owner Assignment Rules

The daemon uses a two-stage Ollama LLM gate to determine owner and priority:

1. **Classification Gate (TASK / SUGGEST / SKIP)**
    - **SKIP:** Generic advice not specific to ALAI's stack/products/market → Discard, no MC task
    - **SUGGEST:** Potentially valuable but needs CEO review before implementing → Slack summary only, **no MC task created**
    - **TASK:** Concrete, actionable, implementable within 1 week, clearly fits roadmap → MC task created
2. **Relevance Gate (HIGH / MED / LOW)**
    - **HIGH:** Directly actionable for ALAI products, stack, or market focus (e.g., specific Ollama optimization, security patch for Node.js/Kotlin, feature for Bilko/Drop/Tok/Lobby)
    - **MED:** Broadly relevant to ALAI's industry or tech direction, warrants CEO awareness
    - **LOW:** Generic industry news with no clear ALAI connection → Discard, no MC task

### Owner &amp; Priority Decision Matrix

<table id="bkmrk-relevance-classifica"><thead> <tr> <th>Relevance</th> <th>Classification</th> <th>Owner</th> <th>Priority</th> <th>MC Task?</th> </tr></thead><tbody> <tr> <td>HIGH</td> <td>TASK</td> <td>OWNER\_ROUTER result</td> <td>M</td> <td>✅ Yes (30d TTL)</td> </tr> <tr> <td>HIGH</td> <td>SUGGEST</td> <td>*(N/A)*</td> <td>*(N/A)*</td> <td>❌ No (Slack FYI only)</td> </tr> <tr> <td>MED</td> <td>TASK</td> <td>OWNER\_ROUTER result</td> <td>L</td> <td>✅ Yes (30d TTL)</td> </tr> <tr> <td>MED</td> <td>SUGGEST</td> <td>*(N/A)*</td> <td>*(N/A)*</td> <td>❌ No (Slack FYI only)</td> </tr> <tr> <td>LOW</td> <td>Any</td> <td>*(Discarded)*</td> <td>*(No task)*</td> <td>❌ No</td> </tr></tbody></table>

**Key Rule:** NEVER assign `owner='backlog'`. All tasks route to a specialist or CEO triage bucket.

## Noise Prevention (2026-06-04)

**MC #102890 | Problem:** The daemon originally created an MC task for BOTH classification classes — `TASK→"[TLDR] Implement"` and `SUGGEST→"[TLDR] Review"`. The `SUGGEST/Review` tasks accumulated unbounded. 63 noise tasks spanning 2026-04-23 through 2026-06-03 were triage-closed on 2026-06-03/04 (one-time manual cleanup).

### The Fix: At-Source Prevention

**SUGGEST class no longer creates MC tasks** (since 2026-06-04). `SUGGEST` insights now appear only in the Slack summary as *"Suggestions (FYI, no MC task)"*. Only `TASK` class creates an MC task, with a `--ttl-minutes 43200` (30 days) backstop.

**There is NO automatic age-based decay / bulk-close of existing tasks.** The initial fix (2026-06-04) included a 14-day auto-decay mechanism that would bulk-close old `[TLDR]` tasks at daemon startup. CEO judged this too risky — it could silently close genuine `"[TLDR] Implement"` tasks that simply hadn't been picked up yet. **The auto-decay logic was REMOVED** per CEO decision.

Existing backlog is cleaned by manual/operator triage only, never silently. The 63 tasks closed on 2026-06-03/04 were a one-time manual cleanup, not an automated job.

### The Casing Bug + Fix

**Bug (historical):** During initial implementation, the decay query used `status='OPEN'` (uppercase) but mission-control.db stores status lowercase (`'open'`). SQLite is case-sensitive for string comparisons, so the query matched 0 rows (silent no-op).

**Fix:** Normalized to `status='open'` (lowercase) and `created_at` threshold to `'YYYY-MM-DD HH:MM:SS'` space-format. This verified the daemon's query mechanics were correct before the auto-decay feature was ultimately removed.

### Operational Notes

- **Schedule:** Runs daily at 09:30 Oslo time via `com.john.tldr-actionizer` LaunchAgent
- **TTL backstop:** 30 days (43,200 minutes) — ONLY mechanism for automatic task closure
- **Logs:** `~/system/logs/tldr-actionizer.log`

## Operator Runbook

### How to Add New Domain Pattern

1. Edit `~/system/daemons/tldr-actionizer.js` and update the `OWNER_ROUTER` constant (lines 66-87).
2. Add corresponding unit test in `~/system/daemons/tests/tldr-actionizer-router.test.js` (mirror the pattern + test case).
3. Run test: `node ~/system/daemons/tests/tldr-actionizer-router.test.js` — verify all tests pass.
4. Restart daemon: `launchctl stop com.john.tldr-actionizer && launchctl start com.john.tldr-actionizer`

**Example:** To route design insights to vizu:

```
{
  pattern: /figma|sketch|design system|ui|ux|prototyp|wireframe/i,
  owner: 'vizu'
}
```

### How to Override Routing for Specific Insight

If the daemon incorrectly routes an insight, manually reassign the MC task:

```
node ~/system/tools/mc.js assign <task_id> <new_owner>
```

### How to Inspect Dry-Run Output

Test routing logic without creating real MC tasks:

```
node ~/system/daemons/tldr-actionizer.js --dry-run --date 2026-05-07
```

Output written to `/tmp/tldr-router-dryrun-99824.json` with classification, relevance, and assigned owner for each insight.

### How to Verify Daemon Health

```
tail -50 ~/system/logs/tldr-actionizer.log | jq
```

Check for:

- `"level": "info"` — normal operation
- `"level": "warn"` — classification unclear or Ollama timeout (daemon defaults to safe fallback)
- `"level": "error"` — MC task creation failed

**LaunchAgent:** `com.john.tldr-actionizer` (runs daily at 09:30 Oslo time)

```
launchctl list | grep tldr-actionizer        # Check status
launchctl stop com.john.tldr-actionizer     # Manual stop
launchctl start com.john.tldr-actionizer    # Manual start
```

## Backlog Sweep History

On 2026-05-08, MC #99823 performed a one-time sweep of existing backlog tasks to re-route or close them per the new routing rules. Results:

<table id="bkmrk-mc-id-priority-old-o"><thead> <tr> <th>MC ID</th> <th>Priority</th> <th>Old Owner</th> <th>New Owner/Status</th> <th>Relevance</th> <th>Reasoning</th> </tr></thead><tbody> <tr><td>9475</td><td>M</td><td>backlog</td><td>agentforge</td><td>HIGH</td><td>PII redaction → Bilko/Drop/Lobby data pipelines</td></tr> <tr><td>10081</td><td>L</td><td>backlog</td><td>closed</td><td>LOW</td><td>HAL breach is news-only, no ALAI tie</td></tr> <tr><td>99371</td><td>L</td><td>backlog</td><td>closed</td><td>LOW</td><td>Video gen — ALAI doesn't do video</td></tr> <tr><td>99372</td><td>L</td><td>backlog</td><td>closed</td><td>LOW</td><td>Codex cosmetic update — no action</td></tr> <tr><td>99373</td><td>L</td><td>backlog</td><td>closed</td><td>LOW</td><td>UK challenger bank — wrong market (we're Nordic/Balkan)</td></tr> <tr><td>99374</td><td>M</td><td>backlog</td><td>securion</td><td>MED</td><td>DDoS hardening — Securion service-line</td></tr> <tr><td>99375</td><td>M</td><td>backlog</td><td>securion</td><td>MED</td><td>Trellix breach awareness — Securion supply-chain</td></tr> <tr><td>99565</td><td>M</td><td>backlog</td><td>agentforge</td><td>HIGH</td><td>GPT-5.5 token cost — directly relevant to Pillar #9 cost ceiling</td></tr> <tr><td>99566</td><td>L</td><td>backlog</td><td>closed</td><td>LOW</td><td>Voice infra — ALAI doesn't do voice</td></tr> <tr><td>99567</td><td>M</td><td>backlog</td><td>securion</td><td>HIGH</td><td>Deepsec — ALAI Sec service-line aligned (memo 2026-05-01)</td></tr> <tr><td>99568</td><td>L</td><td>backlog</td><td>closed</td><td>LOW</td><td>Meta-AI-research news — no concrete action</td></tr></tbody></table>

**Summary:** 11 tasks processed, 5 re-routed to specialist owners (agentforge, securion), 6 closed as low-relevance.

## Known Gaps

### 1. ANVIL Ollama No Models Loaded

**Impact:** Daemon currently safe-fails ALL insights to `alem/MED+SUGGEST` because ANVIL Ollama (localhost:11434) has 0 models loaded. Classification and relevance gates return unclear responses, triggering default fallback.

**Fix Options:**

- **Option A:** Load `llama3.1:8b` model on ANVIL Ollama: ```
    ollama pull llama3.1:8b
    ```
- **Option B:** Repoint daemon to FORGE Ollama (10.0.0.2:11434) which already has `qwen3:8b-q8_0` loaded: ```
    # Edit ~/system/daemons/tldr-actionizer.js line 48:
    const OLLAMA_URL = process.env.OLLAMA_HOST || 'http://10.0.0.2:11434';
    ```

**Status:** Open (no fix deployed yet). Daemon runs daily but all insights currently default to CEO triage bucket.

### 2. OWNER\_ROUTER Constant Drift Risk

**Issue:** The `OWNER_ROUTER` constant is defined in both:

- `~/system/daemons/tldr-actionizer.js` (lines 66-87)
- `~/system/daemons/tests/tldr-actionizer-router.test.js` (lines 20-42)

If the daemon constant is updated without syncing the test file, unit tests become stale and may pass incorrectly.

**Recommendation:** Extract `OWNER_ROUTER` into a shared module:

```
// ~/system/daemons/lib/owner-router.js
module.exports = [ /* patterns */ ];

// In both files:
const OWNER_ROUTER = require('./lib/owner-router');
```

**Status:** Open (technical debt, does not block current operation).

## Genesis MC IDs

- **Parent:** MC #99822 (TLDR routing reform H-priority)
- **Sweep:** MC #99823 (backlog sweep, done)
- **Patch:** MC #99824 (CodeCraft OWNER\_ROUTER implementation, done, commit `9acd41f10`)
- **Validation:** MC #99825 (Proveo 6/6 PASS, done)
- **Documentation:** MC #99826 (this page, Skillforge)
- **Decay Fix:** MC #102890 (3-part pile-up fix + casing bug, 2026-06-04, live validated; auto-decay removed per CEO decision same day)

**Delivery Date:** 2026-05-08 (initial), 2026-06-04 (noise prevention fix)

**CEO Directive:** "Želim da ne sjedi u backlog i da se to krene u implementaciju" — Implemented same-day.

---

*Authored by Skillforge | ALAI Holding AS | Last updated 2026-06-04*