Skip to content

Latest commit

 

History

History
75 lines (57 loc) · 3.41 KB

MODS.md

File metadata and controls

75 lines (57 loc) · 3.41 KB

Mods Reference

All 12 mods, verified against source. Load order = composition order for appendSystemPrompt. Registration check: cmd mods list.

Workflow enforcement

dream-gate.ts (683 lines)

The editing constitution. Two halves:

  • correlate tool — lazy reverse-import index over source files. py/ts/js(x) extractors register at boot; java/go/rust/ruby/c#/php lazy-register on first file of that type; unknown extensions cached-negative. Edges are resolution-verified (relative walk for ESM, dotted-suffix for python, dir-name keys for index/__init__; bare alias specs must be ≥2-segment suffixes — npm names never match local files). Depth 1–3 importer tree + batch hint. Index builds once per user run (~1–2s cold, O(1) warm lookups).
  • gate hook — blocks planless edit/write/apply_patch with a scaffold that teaches the workflow ("Do NOT brute-force retry"). A conforming plan arms a batch allowance covering exactly the files it named, until run_start. Config: none required. Validity evidence: see ARCHITECTURE.md §1.

Turn pipeline

dream-sensor.ts (186)

Keyword classifier → injects relevant skill summaries into system prompt each turn. Advisory by design — never gate-blocking.

dream-skills.ts (45)

Lightweight skill-manifest injection companion to dream-sensor.

loop-guard.ts (133)

Detects deterministic tool-call loops (same args → byte-identical result ×N) via per-call hashing; emits [LOOP DETECTED] guidance instead of letting the model spin.

crash-guard.ts (46)

Process-level net: transport-class exceptions (EPIPE, ECONNRESET, …) absorbed and logged; unknown classes logged loudly as audit events. Session survives provider blips.

Visibility

tok-meter.ts (215)

Live tok/s · total tokens · cost in the TUI footer from streaming events; prices from the Command Code catalog.

sidebar.ts (121)

Footer vitals: context meter · model · branch; recap feed entry at run end. Composes beside tok-meter (one segment per mod).

Network & access

keepalive.ts (274)

Resilience proxy (:20129) between harness and model router (:20128): connect retry/backoff so subagents survive router blips. Streams pipe verbatim once started.

anon-proxy.ts (68)

Auto-starts reversible anonymization proxy (:21331 → keepalive). HOME-relative paths; EADDRINUSE-tolerant (first binder serves). Needs companion map file (~/.commandcode/anon-proxy-map.json) and server script (~/.commandcode/anon-proxy.mjs) — not included here.

websearch.ts (461)

Own web-search tool + full Pieces MCP bridge (SSE handshake, JSON-RPC routing, poison-proof error handling — failed calls surface as ordinary errors, never crash the host). Tools: web search, memory ask/create, MCP passthrough. Needs Pieces LTM running locally.

github.ts (117)

GitHub PR search + triage-assign tools via gh CLI; single deduped helper.

Ops notes

  • Mods marked as needing companions will log-and-yield without them — enable deliberately.
  • The old zen-provider/zen-picker pair is intentionally absent: cmd.addProvider mods cannot serve --model (CLI resolves the flag before mods load); use BYOK providers.json.
  • Historical note: an early version of dream-gate's correlate joined grep flags into one argv token, voiding every exclusion and scanning node_modules — the argv-honest rewrite (v5) is what ships here, perf-certified (<2s cold over a 2700+ file repo, sub-second warm).