cyberine
History

CLAUDE.md rulings history

Dated operator rulings, task ids and removal notes that used to live in CLAUDE.md. They moved here verbatim (line wrapping removed) when task kps52 slimmed CLAUDE.md down to what the code does not show. CLAUDE.md states the current fact; this file keeps the why and the when, so grep <task id> finds a ruling here.

This file is history, not authority: re-verify any path, status or count against the source before acting on it.

Test and CI policy history

The paragraph below is the former "no test framework / CI / sweep / smokes" block of the Commands section. The current rules are in .claude/rules/ci.md and .claude/rules/push-gates.md.

There is no test framework. The TUI has a behavioural e2e suite, npm run tui:e2e (tmux-driven, not a snapshot suite, not a selftest, not in the sweep or the promotion check; procedure in the cyberine-project-tui-e2e skill). Since 2026-10-02 there is NO automatic CI and nothing is a precondition of an ordinary push (operator decision, dev phase, no customers yet: .claude/rules/ci.md, .claude/rules/push-gates.md). .github/workflows/ci.yml and .githooks/pre-push were deleted; what the CI ran — typecheck, lint, the static drift smokes, the dependency audits and the docs/site builds, nothing that spawns a CLI, a sandbox or a provider — is now npm run promote:check, which runs it locally in a throwaway worktree, logs every step under .local/promote-check/<host>/<runId>/, and runs only when the operator is preparing to promote to main. The full selftest sweep runs on the developer machine, also only on the operator's word, and it needs no provider key and no logged-in CLI: measured against the smoke sources (2026-10-10), every smoke drives a fake claude / codex / muse shim, a stub server or a loopback port, and the one that does reach a real provider is the live arm of selftest:deepseek-thinking-tools (scripts/t692-smoke.ts), which POSTs a few small requests to api.deepseek.com when DEEPSEEK_API_KEY resolves (shell env, repo .env or ~/.cyberine/.env), reports its live checks as skipped and still passes when the key is absent, and exits 78 (an undeclared skip, so a sweep failure) when the provider refuses the call (bad key, no balance). What a sweep does need is the local toolchain: git, tsx, and for some smokes bun, the npm registry, a host sandbox (Seatbelt or bubblewrap) or typescript-language-server; one that is missing exits 78. npm run sweep writes a per-host, per-SHA stamp under .local/selftest-stamp/. A skip is MEASURED rather than trusted (T707): a smoke that cannot run exits 78 (scripts/selftestSkip.ts), the sweep counts PASS/SKIP/FAIL separately, and it FAILS on any skip not declared in scripts/selftest-manifest.json. That manifest also declares the security/data-integrity smoke set; npm run selftest:gate-list-drift (which the promotion check runs) fails when .claude/rules/push-gates.md disagrees with it, when a runtime smoke creeps into the promotion check's step list, or when a workflow with a push / pull_request / schedule trigger reappears. eslint.config.mjs explains its own severity split — error for defect classes already at zero, warn reserved for a real smell with a measured backlog (none is warn today: every rule is error), and no stylistic rules at all. Everything else is verified by hand: run the relevant command / TUI and observe. (A brittle PTY snapshot suite was removed 2026-06-12 — it tested exact glyph/border/layout strings and drifted false-red on every cosmetic change. Do not reintroduce snapshot-style TUI assertions.) A much larger set of narrow, on-demand-only selftest:* smokes remains (npm run | grep 'selftest:' for the live, current list; don't hardcode a count or a name list here, it drifts — npm run selftest:claude-md-drift fails this section on any hardcoded count). They span two shapes: plain engine/TUI smokes (selftest:bus, selftest:engine, selftest:opencode-parse, selftest:setup) and security/data-integrity regression smokes guarding specific hardening fixes (selftest:mcp-auth-gate, selftest:trust-gate / selftest:trust-regression, selftest:registry-durability / -tombstone / -resurrection-guard, selftest:spend-cap, selftest:config-perms-env-scoping, selftest:control-runsdir-guard, selftest:websessions, selftest:queue, selftest:opencode-auth-gate) — run any of them individually as npm run selftest:<name>.

Provider client factory history

Former tail of the "Core ports" bullet, about makeOpenAIClient.

Historical note: through 2026-09-03 this factory forced httpAgent: { keepAlive: false } to dodge a deterministic ERR_STREAM_PREMATURE_CLOSE the openai SDK 4.x (node-fetch@2 + agentkeepalive) threw on keep-alive socket reuse under Node 24.17+/26 (.local/research/deepseek-premature-close-rca.md). The openai SDK is now on ^7.x (task kwed4, OPENAI-SDK-7-MIGRATION), which migrated its transport to Node's builtin fetch and dropped node-fetch@2/agentkeepalive entirely — the bug no longer reproduces (verified live: 0/17 failures on 7.9.0 vs 10/10 on 4.104.0, same Node binary, same endpoint) — so the no-keepalive workaround was removed; the factory now passes options straight through to new OpenAI(...).

Adapters bullet, including the OpenCode retirement

Former "Adapters" bullet of the architecture map.

  • Adapters (src/adapters/): LoopAgentAdapter — model-level tool-calling loop against any OpenAI-compatible endpoint (LiteLLM gateway, DeepSeek direct, OpenRouter); CliAgentAdapter — spawns a headless CLI agent (Claude/Codex/Muse/Gemini/Command Code and further factories, plus the OpenCode ones, which are retired since 2026-09-07 — ks4sf — and stay as the CLI-worker reference); ClaudeBgAdapter (a claude --bg worker lane) and the model-level AnthropicAgentAdapter / BedrockAdapter / VertexAdapter sit beside them. CLI workers run with auto-approve flags, wrapped in a host sandbox when available (hostSandbox.ts: Seatbelt/bubblewrap; CYBERINE_TASK_TRUSTED=false makes a sandbox mandatory).

Retired workflow module

Former parenthetical in the "Other src/ modules" bullet.

(the former src/workflows/dream-consolidate.ts was retired 2026-09-09, k0wf7 -- Cyberine's memory is its own ~/.cyberine/memory/, never a port of Claude Code's)

Project rules and skills history

Former first two bullets of "Project conventions".

  • .claude/rules/ carries the binding workflow rules: user-vibe-coding.md (A-Z autonomy + pre-authorized commit/push/merge + fan-out + worktree hygiene), feature-docs.md (USAGE.md recipe per shipped feature). They auto-load; read them there rather than duplicating here. feature-docs.md is tracked; user-vibe-coding.md is machine-local (the **/.claude/**/user-* ignore pattern, untracked since 2026-06-15), so a fresh clone or a git worktree does not have it.
  • Project skills (.claude/skills/cyberine-*) encode the standing protocols: cyberine-project-provider-docs (read docs/providers/ before any provider/adapter/model work — pre-crawled, fact-checked API reference), cyberine-project-devstack (gateway docker on demand), cyberine-project-docs (the Next.js + Fumadocs site under site/; VitePress was retired 2026-09-25, T670), cyberine-project-investigate (spike one unknown under .local/, or run the 4-phase RCA; merged from the former cyberine-spike + cyberine-systematic-debug on 2026-09-08 — cyberine-subagent-dev was retired the same day, its fan-out pattern lives in user-vibe-coding.md and the Agent tool's worktree isolation), the operator's own test and CI policy skills (untracked since 2026-11-02; on 2026-10-14 they replaced cyberine-project-selftest, cyberine-project-ci and .claude/rules/selftest-gate.md, and they say which test or check runs when; the promotion-check gate is .claude/rules/ci.md), cyberine-project-tui-e2e (the procedure for npm run tui:e2e: review its report and colour captures, add a case per fixed defect; behind the operator gate for end-to-end runs, so a finished src/tui/ change is a reason to ask, never to run; --live is metered; added 2026-09-26). cyberine-project-orchestrate was RETIRED 2026-09-12 (kvxva): the operator ruled it reference material rather than a verb, so a one-task-many-providers run is now plain cyberine run [--mode compete|swarm|deep|smart|rush|harvest], and its mode table + verdict-reading notes live in plugin/skills/run/references/scenarios.md.

Plugin surface history: hooks, panel, skills

Former "GLOBAL vs project surface" bullet. Current boundary: the plugin ships the task-board banner and board-write guard, the handoff pointer, the compaction pair and the /cy panel module, nothing else; scripts/plugin-check.sh enforces it.

  • GLOBAL vs project surface (don't confuse them): the cyberine CLI is a globally-installed shim (/opt/homebrew/bin/cyberine) with a cross-project registry at ~/.cyberine. The plugin cyberine lives under plugin/ in the repo root: plugin/.claude-plugin/plugin.json (manifest), plugin/skills/<dir> (eleven skills), plugin/.mcp.json (bundled MCP server), and plugin/.codex-plugin/plugin.json (the Codex manifest: the same skills and MCP server, registered by cyberine plugin install --harness codex). Its only hooks are the task-board banner (SessionStart) and board-write guard (PreToolUse) in plugin/hooks/ (hooks.json + board-hooks.mjs), shipped since 2026-09-29 to replace the author's former nf-tasks banner, plus the handoff pointer (SessionStart), added 2026-09-30 to replace amemoria, in every git repo. A SessionEnd capture shipped the same day and was dropped the same day: Claude Code bounds SessionEnd hooks at 1.5s, a plugin cannot raise that, and SessionEnd does not fire on kill or a closed terminal (knrp5). Operator ruling 2026-10-19 (kgahg, D1-B + D2-B) added the compaction pair, also in every git repo: a PreCompact hook (cyberine handoff compact: a model-free checkpoint under .cyberine/handoffs/compaction/, the long handoff writer on every compaction, a <1 KB block for the summary) and a SessionStart(compact) reload (cyberine handoff reload); CYBERINE_COMPACT_HANDOFF=long|short|off. The board hooks: both are inert in a repo without a board, both always run (they never read enabledPlugins; the standalone cyberine-taskboard plugin is the one that yields to this plugin, once its own update ships, so until then a machine with both gets a harmless double banner and guard), and the guard filters in-process so it only boots the CLI for a payload that names a board file. Operator ruling 2026-10-03 (kx8sy) added ONE mod beside them, plugin/hooks/fleet-pane.tsx (listed under modules in hooks.json, its state declared in plugin/types/index.d.ts): Claude Code function hooks that register /cy and draw the Cyberine panel (tabs Commands, Fleet, Board, Handoffs, Cockpit, keys 1-5: Commands lists the session's /cyberine:* skills with no CLI call, Fleet, Board and Handoffs read cyberine agents --pane, cyberine next --json and cyberine handoff list --json, and the cross-repo Cockpit tab reads cyberine cockpit --json, only while that tab is shown, kmp8k; k9s23 replaced /cyberine-fleet with it, no alias), nothing until the command is typed and no CLI call while it is closed, except the opt-in /cy nudge on chip (kdcg2: one line above the prompt, off by default, cyberine pulse every 180 s while on and the panel is shut); the lift covers this panel only. It loads on the installed skills-dir symlink as well as under --plugin-dir (kx5r2, 2.1.288): what decides is Claude Code's server-side rollout flag tengu_plugin_hooks_modules, cached on disk, which gates every non-built-in load path alike; the earlier "skills-dir does not load it" reading was that flag served off. scripts/plugin-check.sh FAILS on any other file, command or module there. The 2026-09-21 ruling that removed the [sender] SendMessage trailer module (a personal convention that rewrote the user's message and sent their absolute paths and session id to the receiver) still stands: no other hook ships in the plugin beyond those three, the compaction pair and the /cy panel. Running cyberine plugin install creates ONE symlink ~/.claude/skills/cyberine -> <repo>/plugin, exposing the skills as /cyberine:go, /cyberine:init, /cyberine:run, /cyberine:autopilot, /cyberine:plan, /cyberine:ask, /cyberine:tasks, /cyberine:research, /cyberine:handoff, /cyberine:end (the A-Z flow, formerly /cyberine:az, is a recipe inside go since kg45c, 2026-10-16). Since operator ruling 2026-10-09 (k2v5h, D1-A) every one of the then-eleven skills is model-invocable: Claude Code 2.1.294 refuses a model's Skill call on a disable-model-invocation skill and forbids replicating it by other means, which broke go's read-and-follow hand-off, so init, plan, ask, run, autopilot, research (and az, retired since) now carry disable-model-invocation: false and a when_to_use that fires only when the operator's own message names Cyberine together with that leaf's intent (a bare "plan" or "research" is out of scope), each keeping its own consent step; go stays the front door and its Step 3 invokes cyberine:<leaf> through the Skill tool, falling back to Reading the leaf's SKILL.md only if that call fails. Older wording below that calls a leaf slash-only or reachable only through go is superseded by this ruling. The eleven skills under plugin/skills/ are: go (the "start here" front door, renamed from help 2026-10-04, k8mbk; free and model-invocable: maps plain language anchored on "cyberine" onto the right leaf skill above, prints a -> <leaf>: <what you get back>, <scope> receipt with a "khong, dung " override line before handing off, asks one question only on a genuine tie, a missing detail or a vague "continue" (one task, or the whole board unattended?), and asks no cost question (operator ruling 2026-10-04: the operator's own Cyberine-named message is the go-ahead) — never spends itself; added 2026-09-18 as help, k7dad), init (renamed from setup 2026-09-13 to match cyberine init and Claude Code's own /init; is this repo ready for Cyberine — git, .local/ gitignored, node + claude CLI, an authed provider or seat, the Cyberine rules (rules.applied in .cyberine/config.local.json, or .cyberine/config.json under --track, written by cyberine init --rules only after the session has read the repo's existing rules and found no conflict — kfctv, 2026-09-14), .cyberine/config.json + fleet.json, the board, the handoff writer (builtin since k73tg, the only writer since k7wzq), the Claude Code wiring in ONE pass, each gap named with its fix and whether the operator or the session runs it; added 2026-09-12, kvxva), run (renamed from seat 2026-09-17, kzaqn; map a plain-language request onto an explicit Claude-subscription-seat dispatch — discover, run, watch, apply — never guessing a seat name; added 2026-09-11, k7z7p), autopilot (hand the board to cyberine autopilot and review afterwards), ask (renamed from decide 2026-09-17, kzaqn; settle a blocking decision — advisors with no repo access, then a repo-context adjudication that may overrule them all, then one batched ask; added 2026-09-11, k7eay), plan (renamed from brainstorm 2026-09-17, kzaqn; INVENT a task list rather than improve one — the fleet proposes competing full lists, the default text-task judge panel's adversarial skeptics refute them, surviving tasks land as backlog; for a greenfield repo or a goal/standard-driven plan, added 2026-09-11), tasks (the LLM-judgement half over cyberine tasks's deterministic writer — dedupe against cyberine tasks corpus, split, dependency-order and brief a conversation into one converge-apply batch, pick what is next, close with OBSERVED evidence, block and unblock, tidy, and wrap the board; never edits the manifest or overlay itself, and never rewrites existing bare note:/ledger: lines to silence the warning-only lint (a new free-form field uses the x- prefix, which lints clean on both sides); converges what is known where plan invents what is not; added 2026-09-13, k7h49; model-invocable since 2026-09-29 (kfp69) on plain talk about this repo's task board — "what's next", "task nao tiep", "xong roi cai X", "save these as tasks" — with no "cyberine" needed, but only in a repo that has a board, reversing k8qqq's 2026-09-18 slash-only ruling because this plugin replaces the standalone cyberine-taskboard plugin and must answer the same phrases), research (front door to cyberine research's plan -> search -> verify -> synthesize web-research fleet, for the operator's daily "spawn agents and find out X" habit; web-only by design, so a question about this repo's own code stays with Claude Code's own agents; preflights the web-search backend (a Claude subscription seat's own WebSearch by default, Perplexity selectable; kx1bv) via cyberine doctor's Web search: line and refuses before spending when none is usable, since a missing backend does not fail the CLI outright — it silently empties the report; added 2026-09-18, k9v99), handoff (compose a Where/Decisions/Open/Next seed from the live session and pipe it to cyberine handoff write for a free per-session breadcrumb; model-invocable, anchored on "cyberine"; added 2026-09-27, k24g6), vibe (added 2026-11-13, kv8yt; maps "cyberine vibe on/off/status" onto cyberine delivery main|pr --quote and cyberine delivery status, model-invocable only on an operator message that names Cyberine, never writes a rule file itself), end (cyberine tasks end --handoff long, the board wrap plus a background claude -p that writes the full handoff; split out of handoff 2026-09-27; model-invocable on its own "cyberine end" phrase since 2026-09-29 (kxdcc), running to completion with no question whenever the operator's own message carries it (bare, or inside an instruction, since 2026-10-01) and asking one cost question on every other way in; together they replace the author's private amemoria). az (added 2026-10-04, k56tt) was RETIRED 2026-10-16 (kg45c, operator ruling D6-A): its reasoning moved into the engine as cyberine draft (k0gq0), and the A-Z flow is now a recipe in go (init, cyberine draft, review the inbox and tasks save, then autopilot). dispatch was RETIRED 2026-09-13 (operator ruling): its whole value was cyberine run --cheap behind a bash guard, 0 of 2755 recorded runs used it, and the run skill now covers discover -> run -> digest -> apply; the cheap lane itself stays a plain cyberine run --cheap, led since kvbc9 (2026-09-25) by the Command Code free lane. The legacy skills/cyberine-<x> rollback symlinks were deleted 2026-09-25 (k5pnj); plugin/skills/ is the only source, and cyberine skill install <id> copies one of them as a fallback. So cyberine fan-out works from any project.

Fleet design principle

Former "Design principle" bullet.

  • Design principle (operator ruling 2026-10-10): Cyberine is N agents working together to solve tasks fast, using WHATEVER workers are active (subscription seats, CLI agents, key-billed loop workers alike) and never caring whether a worker bills a subscription or credits. No step may hard-require one worker kind or billing class (a loop-only search step, a CLI-only lane, a default fleet that is empty unless an env var pins workers); such a lock is an architecture defect to fix, not a config the user must work around. DeepSeek was the old default only because it had credit at the time.

Docs, local folder and env vars bullets

Former bullets of "Project conventions" that carried no ruling; kept for completeness.

  • USAGE.md is the user-facing recipe book — every shipped feature needs its recipe there (verify documented commands against source first).
  • .local/ (gitignored): runs/ run history, dogfood/ workflow defs + backlogs, vibe/ goal files. Dogfood prompts and extracted outputs stay under .local/dogfood/.
  • Key env vars (full table in USAGE.md): CYBERINE_TASK, CYBERINE_BUILD_FLEET, CYBERINE_HOME, LOOP_MAX_TOOL_ROUNDS, LOOP_MAX_TOKENS, OPENCODE_MODEL/OPENCODE_AGENT, HOST_SANDBOX_MODE, CYBERINE_TASK_TRUSTED, CYBERINE_NEW_SESSION_CMD, CYBERINE_ALTSCREEN.

TUI branding and rendering stack history

Former "TUI branding" and "TUI rendering stack" bullets.

  • TUI branding: the default theme is Plasma (operator pick 2026-09-26, superseding the 2026-06-23 Claude-orange decision): a violet accent (#c77dff dark, #7a2bd1 light, magentaBright in ansi) and mint verdict tone (#4ff0c0) on Claude Code's dark-daltonized semantic colours. The web dashboard does NOT use Plasma: since k1fm1 (2026-09-20) it wears the site's earlier locked palette, Sulfur on dark and Mineral on light (src/web/public/app.css), which the site itself left on 2026-10-01; operator ruling 2026-10-10 (kh6h1) keeps it as is. The website left Plasma on 2026-10-01 for its own "run record" palettes (docs/design/website-master.md) and draws the same mark SHAPE in ink and stamp blue. That split is deliberate (operator ruling 2026-10-02, knvqm): the TUI, dashboard and site share the mark's SHAPE, not its colours, so never align one surface to another's palette (the TUI to the site, the dashboard to Plasma or to the current site palette, or the site back to Plasma) without a new ruling. The mark SHAPE stays Cyberine's own (src/tui/brand/), ring in the accent. Still off-limits: copying Claude's actual mascot/crab art or the "Claude Code" wordmark/assets. The palette is data: src/tui/theme.ts resolves the active scheme at load through the cyberine-scheme/1 registry (src/tui/themes/: built-in JSON under src/tui/themes/builtin/, with plasma.json and plasma-light.json as the default pair, then $CYBERINE_HOME/themes and the repo's .cyberine/themes), picked by CYBERINE_THEME or cyberine theme use.
  • TUI rendering stack (read before any TUI/mascot/brand-art work — measure in CELLS, never pixels):
    • Framework: Ink 5 + React 18 (type: module, run via tsx). The TUI is React components rendered to terminal <Text> / <Box> — there is no canvas/raster surface. Sizing is in character cells (cols x rows), and a monospace cell is ~1:2 (w:h), so visually-square art needs ~2x as many columns as rows.
    • Mascot/brand art technique (src/tui/brand/): BrailleCanvas (brailleCanvas.ts) is a sub-cell raster — each cell = a 2x4 Braille dot grid (U+2800-28FF), so a cols x rows area addresses a (cols*2) x (rows*4) sub-pixel grid (~8x glyph resolution). It is monochrome by construction: a Braille cell carries dots, not color — the caller wraps the whole frame in ONE <Text color={ACCENT}>. Existing mascots (mascotDnaInfinity/mascotInfinityWave/mascotInfinity3d, composed in mascot.ts) are all single-accent ∞/DNA marks on this canvas.
    • Hard contracts: every row in a frame is the EXACT same display width (equal-width contract -> no layout jitter); BMP-only glyphs, NEVER emoji; static by default, animate only on CYBERINE_MASCOT_ANIMATE=1 (variant via CYBERINE_MASCOT=<name>).
    • Two-tone art uses HalfBlockCanvas (src/tui/brand/halfBlockCanvas.ts), added 2026-06-25. Braille is still one color per <Text>; for a mark that needs TWO tones, the half-block canvas splits each cell into an upper/lower pixel via ▀/▄ and carries a per-cell fg+bg color. The confluence ring (mascotConfluence.ts, the welcome brand mark since 2026-09-25, same geometry as the site mark) is built on it and rendered by HalfBlockMascot (src/tui/components/HalfBlockMascot.tsx), which emits per-cell colored <Text> runs (NOT a single wrapping <Text>). It is monochrome-per-cell, not full truecolor raster: 2 tones per cell max. A richer creature (many colors, smooth gradients) would still need a further technique. The Braille canvas remains the right tool for single-accent ∞/DNA art.
    • Render perf rules (from the T355-T362 smoothness wave): use <Static> for append-only logs, isolate the useNow clock so it doesn't re-render the whole tree, and memo heavy rows -- a naive root clock + zero memo recomputes the entire tree ~12x/sec. Verify TUI changes on a REAL TTY: npm run tui:e2e drives chat and the hub through tmux and asserts behaviour (operator-gated), and npm run tui is the hand check for what it cannot drive. Snapshot tests were removed 2026-06-12; do not reintroduce them, and never make a tui-e2e case compare exact glyphs.

Removed Copilot device flow

Former parenthetical in the "Other src/ modules" bullet.

src/auth/ (authCommand.ts — cyberine auth login/list/status/logout against the global ~/.cyberine/.env; copilotAuth.ts — refusing stubs only since kn16x removed the GitHub Copilot device flow, see src/core/copilotRemoval.ts)