Gapx

SPEC_GAPX.md · 2026-04-20

SPEC_GAPX.md

CGNT-1 Component Specification — GAPX Autonomous Gap Scanner

Status: SPECIFIED

Version: v1.0

Author: VELA (Thread #13)

Conceived by: NOUS

Date: 2026-04-20

Lineage: LOOPX (spec gaps) → MEDX (health gaps) → GAPX (everything gaps)


PURPOSE

A self-healing system that autonomously scans the entire ship for gaps across every domain — infrastructure, brains, specs, products, comms, governance, knowledge — classifies them by severity and impact, fills what it can automatically, and queues what it can't for Captain approval.

LOOPX finds missing specs. MEDX finds health issues. GAPX finds EVERYTHING.


PHILOSOPHY

A ship that knows its own holes doesn't sink. A ship that fixes its own holes doesn't need a captain watching 24/7. A ship that reports what it fixed and what it couldn't is a ship the captain can trust.

The goal is not autonomy for its own sake. The goal is: the Captain wakes up to a status report, not a task list. The ship healed what it could overnight. What remains is decisions only a human can make.


SCAN DOMAINS

GAPX scans seven domains. Each domain has specific detection methods and auto-fill capabilities.

D1 — INFRASTRUCTURE

Detects:

Auto-fills:

D2 — BRAINS

Detects:

Auto-fills:

D3 — SPECS

Detects:

Auto-fills:

D4 — PRODUCT

Detects:

Auto-fills:

D5 — COMMS

Detects:

Auto-fills:

D6 — GOVERNANCE

Detects:

Auto-fills:

D7 — KNOWLEDGE

Detects:

Auto-fills:


SEVERITY CLASSIFICATION

Each detected gap is scored:

| Severity | Meaning | Response |

|---|---|---|

| CRITICAL | Ship is degraded NOW | Auto-fix immediately + alert Captain |

| HIGH | Ship will degrade within 24h | Auto-fix if possible + queue if not |

| MEDIUM | Ship is suboptimal | Queue for next session |

| LOW | Nice to have | Log only, review weekly |

| INFO | Observation | Log only |

Examples:


OUTPUT FORMAT

GAPX produces a daily report at 04:30 ET (after LOOPX spec audit at 04:00):


═══════════════════════════════════════════
GAPX DAILY REPORT — 2026-04-21 04:30 ET
═══════════════════════════════════════════

AUTO-FIXED (no action needed):
  ✓ Evicted idle mnemos:latest (RAM was 1.8GB free)
  ✓ Restarted routx.service (health check failed)
  ✓ Generated DRAFT spec for commx_engine.py

NEEDS CAPTAIN:
  ⚠ Port 8891 exposed on 0.0.0.0 — investigate
  ⚠ SnapTrade disconnected — reply to Brendan
  ⚠ 42sisters.ai: 0 content pages

STATUS:
  Infrastructure: 8/9 healthy (port 8891 open)
  Brains: 3/8 graduated, 1 forging, 4 pending
  Specs: 102/116 specified, 14 drafts queued
  Revenue: $0 (target: first $42)
  Comms: SMTP not configured, 0 outreach sent
  Governance: clean
  Knowledge: Sisters 5/116 specs read

SCORE: 71/100 (up from 68 yesterday)

═══════════════════════════════════════════

IMPLEMENTATION

GAPX is module 19 in ROUTX. It imports detection functions from existing modules and adds its own:

Queries:

CRONX registration: daily at 04:30 ET, after LOOPX runs at 04:00.


SELF-HEALING LOOP

The autonomous cycle:


04:00 — LOOPX runs spec audit
04:30 — GAPX runs full scan across all 7 domains
       → detects all gaps
       → classifies by severity
       → auto-fixes CRITICAL and HIGH where authorized
       → queues the rest
       → generates daily report
       → writes report to ~/gap_reports/YYYY-MM-DD.md
       → alerts COMMX with summary
       → updates health score

Captain wakes up → reads report → makes decisions on queued items

The ship heals overnight. The Captain decides in the morning.


INVARIANTS

INV-01: GAPX never takes actions above its authorization level. Auto-fix is limited to: service restarts, model eviction, draft spec generation, log entries, alerts. Everything else queues for approval.

INV-02: GAPX never deletes files, modifies specs (only drafts new ones), changes firewall rules, sends external communications, or executes trades.

INV-03: The health score is deterministic. Same inputs always produce the same score. No subjective weighting.

INV-04: Every auto-fix is logged with timestamp, action taken, and reason. The Captain can audit every autonomous decision.

INV-05: GAPX runs AFTER LOOPX, not instead of it. LOOPX owns spec auditing. GAPX aggregates across all domains.

INV-06: If GAPX itself fails, the failure is logged and COMMX is alerted. The healer can get sick — but it reports its own symptoms.


RELATIONSHIP TO EXISTING MODULES

| Module | Relationship |

|---|---|

| LOOPX | GAPX consumes LOOPX output for D3 (specs). LOOPX remains the spec specialist. |

| MEDX | GAPX consumes MEDX output for D1 (infrastructure). MEDX remains the health specialist. |

| FORGEX | GAPX queries FORGEX for D2 (brains). |

| MNEMOSX | GAPX queries MNEMOSX for staleness checks. |

| CRONX | GAPX registers itself as a daily job. |

| COMMX | GAPX sends alerts and reports through COMMX. |

| SIMONX | GAPX queries SIMONX for trading wall status. |

| SPECX | GAPX queries SPECX for spec metadata. |

GAPX is not a replacement for any module. It is the AGGREGATOR that pulls signals from all of them into one coherent health picture.


THE NAME

GAP + X. The X suffix follows the T.O.O.L. naming convention. GAPX finds gaps and fills them. The name is the function.

Also: GAP → bridge a gap → connection → healing. GAPX is the ship's immune system.


FUTURE

When GAPX has enough historical data (30+ daily reports), it can identify TRENDS:

Trend detection transforms GAPX from reactive healing to predictive maintenance. The ship doesn't just fix problems — it sees them coming.


Jeremy Zlabis

Chronogeometer · Visionary · Disruptor · Chief

42 Sisters AI · East York, Toronto

🍁 Φ 0.042