Commit graph

156 commits

Author SHA1 Message Date
72bf31ba7a refactor(installer): v0.49 — extract kei-prompt cube as interactivity SSoT
Constructor Pattern fix replacing v0.47-v0.48 patch series. The "is the
user interactive?" logic was previously duplicated across 15+ places:

  bootstrap.sh        x4  ([ -t 0 ] gates on profile/onboard/launch/etc)
  install.sh          x1  (PATH wiring decision)
  install/lib-hooks.sh        (activate-hooks prompt)
  install/lib-plan.sh         (auto-confirm gate)
  install/lib-menu.sh         (skip-menu gate)
  install/lib-wizard.sh       (sleep-wizard gate)
  install/lib-onboarding.sh  x2  (onboarding_should_run + preflight retry)
  install/lib-preflight.sh    (install-tool prompt)

Every duplicated check was a chance to get curl|bash semantics wrong.
v0.47 used `[ -t 1 ]` (broke under tee'd stdout). v0.48 used `[ -t 0 ]`
(broke under curl pipe stdin). Each fix was a patch on top of the same
architectural defect: scattered truth.

ARCHITECTURAL FIX (Rule Zero — 1 cube = 1 responsibility):

  scripts/kei-prompt.sh  (NEW, ~110 LOC, public API):
    kei_is_interactive          → 0 if user is at a terminal, 1 if headless
    kei_prompt    Q [DEFAULT]   → answer or default to stdout
    kei_prompt_yn Q [Y|N]       → exit 0=yes, 1=no, with [Y/n] hint
    kei_prompt_secret Q         → no-echo input (tokens, keys)

  Truth signal: /dev/tty accessibility, with [ -t 0 ] as second-choice
  fallback. KEI_NONINTERACTIVE=1 for CI override. Same contract as the
  inline rules — now in ONE place.

  bootstrap.sh + install.sh: source the cube at the top, with self-
  contained inline fallback (mirrors the kei_is_interactive contract
  only) so they remain self-bootable even if scripts/ is missing.

  All 15+ inline gates replaced with `kei_is_interactive` calls.
  All 3 `read -r -p` prompts in installer cubes replaced with
  `kei_prompt` / `kei_prompt_yn`.

  Existing copy_pet_scripts() in lib-scaffold.sh installs scripts/*.sh
  into ~/.claude/scripts/ automatically — no install logic change needed.

WHAT THIS PREVENTS:

- Next time someone writes a prompt in installer code, the only path
  is `kei_prompt`. They CANNOT accidentally type `[ -t 0 ]` because
  there is no `[ -t 0 ]` to copy-paste anymore (except inside the
  cube itself).

- The v2 tty-interactivity-gate-guard.sh hook (added 2026-05-27)
  becomes a regression net rather than the first line of defence.

- Two real install incidents this month (May 2026, 7 prompts each)
  do not happen a third time.

VERIFIED:
- Syntax check passes on all 9 modified files + new cube.
- Primitive functions smoke-tested across 8 cases: headless,
  KEI_NONINTERACTIVE override, default fallback, yn convenience,
  re-source guard, /dev/tty available, /dev/tty open() fails.
- 2 remaining [ -t 0 ] in tree: BOTH inside kei_is_interactive
  fallback in bootstrap.sh + install.sh (single-source contract,
  not patches).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 16:05:44 +08:00
3bc351ec03 fix(bootstrap): v0.48 — reattach stdin to /dev/tty so curl|bash prompts fire
INCIDENT: user installed via curl|bash and reported "kei did not auto-launch".
Root cause: under curl|bash, stdin is the pipe from curl. Every interactive
gate `[ -t 0 ]` returned FALSE, silently skipping FIVE places:

  install/lib-i18n.sh         language picker
  install/lib-preflight.sh    preflight checks
  install/lib-hooks.sh        hook activation prompt
  install/lib-wizard.sh       sleep wizard
  install.sh:270              PATH wiring
  bootstrap.sh kei-onboard    primary CLI picker
  bootstrap.sh launch prompt  "запустить kei сейчас?"

Per rules/tty-interactivity-gate.md the rule is "gate on stdin, never stdout"
— and we did. But under curl|bash BOTH are non-tty. /dev/tty is the only
reliable signal that the user is interactive.

FIX: in bootstrap.sh, ONCE, before invoking install.sh:

    if [ -r /dev/tty ] && [ -w /dev/tty ]; then
        exec </dev/tty
    fi

This redirects bootstrap.sh's OWN stdin to /dev/tty. Every child process
inherits it via fork — install.sh, lib-*.sh, kei-onboard.sh, kei-pick.sh,
kei-mcp-wire.sh — and their `[ -t 0 ]` gates now correctly report true.
Headless / CI / nohup (no /dev/tty) → skipped, gates stay false, no prompts.

Simplified the v0.47 onboarding + launch-prompt blocks: they no longer
need have_tty() or explicit </dev/tty redirects on read — the global
reattach handles it cascadally.

Smoke-tested 2 of 3 paths (curl|bash via `echo "" | bash script.sh` ✓;
plain bash needs real TTY which Claude Code sandbox doesn't provide;
headless needs setsid which is Linux-only). Logic verified.

Version bump v0.47 → v0.48 because behaviour materially changes for every
curl|bash user (5 prompts now fire that were silently skipped).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 15:08:09 +08:00
82c4542090 docs: Windows native port is demand-driven, not "never"
User feedback: "if there's a lot of requests, we'll make a native Windows
version". Soften the "not on the roadmap" framing in both README Platforms
section and bootstrap.sh's bare-Windows guidance.

- README: rephrase to "demand-driven. WSL gives 100% coverage today with
  0 code duplication. If you want a native .ps1 port, open / 👍 an issue.
  Once demand is real, we'll build it."
- bootstrap.sh: same softening — point users to the issues tracker so
  Windows-native demand becomes visible. WSL still recommended as the
  no-wait path that works today.

No version bump (docs-only, behaviour unchanged for all OS paths).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 14:46:33 +08:00
887e209abc feat(installer): friendly Windows + WSL2 detection — no more silent death
Two related changes to make Windows users hit a useful message instead of
"unsupported OS: MINGW64_NT-10.0...; exit 1":

1. bootstrap.sh — WSL2 detection + Git Bash guidance:
   - If uname=Linux + /proc/version contains "Microsoft" or "WSL" → mark
     as WSL2, log it, continue as Linux. Full substrate works.
   - If uname matches MINGW*/MSYS*/CYGWIN* (Git Bash on bare Windows) →
     print step-by-step WSL2 setup guide:
       * PowerShell admin: wsl --install -d Ubuntu
       * Reboot, launch Ubuntu, re-run bootstrap.sh inside it
     + MCP-only fallback mention (kei-mcp-server-windows-x64.exe in releases).
     + Best-effort: copy "wsl --install -d Ubuntu" to Windows clipboard
       via clip.exe (Git Bash has it), so user can paste into PowerShell.
   - Anything else → friendly "supported: Darwin / Linux / WSL2" message.

2. install.sh — same 3-way OS guard added at top, before any lib-*.sh
   sourcing. Catches users who skip bootstrap.sh and run ./install.sh
   directly on Git Bash; gives them the same WSL guidance.

Smoke-tested all 5 OS branches (Darwin / Linux / WSL2 / MINGW64 / Haiku):
each takes the right path. Zero behavioural change on macOS / Linux.

This complements the v0.47 README Platforms section — UX side of the
honest answer "Windows works via WSL2; native PowerShell port not on
roadmap".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 14:34:48 +08:00
a3b6eda991 feat(splash+install): v0.47 — yellow drop-shadow + post-install launch prompt + Windows guidance
1. Splash (bin/kei) — благородная насыщенная жёлто-бронзовая drop-shadow
   on the KEISEI ASCII art:
   - New CS color: \033[1;38;5;130m (noble saturated bronze-gold).
   - Shadow block printed FIRST (6 lines, offset +2 cols right).
   - \e[7A cursor-up returns to start; blue art overwrites where they overlap.
   - Visible shadow: right-edge 2-col tail on blue rows 2-6 + full
     shadow row 6 standalone (offset down-right).
   - TTY-gated: no terminal → no shadow, no colors (existing fallback).

2. bootstrap.sh — post-install launch prompt:
   "Запустить kei сейчас? [Y/n]" at the very end, after all install +
   onboarding + next-steps text. Default Y on Enter.
   - Stdin-TTY gate only (rule: tty-interactivity-gate.md — `-t 1` would
     falsely skip under curl|bash because the bootstrap log tees stdout).
   - Reads from /dev/tty explicitly so curl|bash piped install still works.
   - KEI_NO_AUTORUN=1 env opt-out for CI / scripts.

3. README — Platforms section: honest Windows status.
   - macOS + Linux: fully supported.
   - Windows: substrate is Bash-only; WSL2 recommended path; MCP-server
     binary (.exe) ships in releases for MCP-only mode; native PowerShell
     port NOT on roadmap (WSL gives 100% coverage with 0 code duplication).

4. v0.47 version bumps: plugin.json + bin/kei splash + README counts header.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 14:30:49 +08:00
155d187699 refactor(kei-mcp): v0.46 — decompose safe_tools + fix CRITICAL Grok bypass
ARCHITECTURAL FIXES (Constructor Pattern — file >200 LOC):

1. safe_tools.rs (738 LOC god-object) → safe_tools/ module (5 files):
   - mod.rs       (99 LOC) — descriptors + dispatch
   - env_guard.rs (79 LOC) — KillPgGuard RAII + apply_safe_env
   - path_guard.rs (166 LOC) — validate_path + canonicalize walk-up
   - chain_runner.rs (159 LOC) — hook chain loader/runner
   - exec.rs (222 LOC) — handle_bash/edit/write with O_NOFOLLOW

2. CRITICAL Grok bypass closed (Claude critic finding):
   - REMOVED env-based chain skip (CLAUDECODE / GROKCODE checks)
   - The skip assumed native PreToolUse would catch the call, but
     PreToolUse matchers fire on tool_name="Bash"|"Edit"|"Write" while
     MCP tools are named kei_bash/kei_edit/kei_write — so native hooks
     NEVER fire on MCP tool calls. The skip created an auth-bypass hole.
   - Chain now ALWAYS runs for kei_bash/kei_edit/kei_write.
   - Wire scripts (kei-mcp-wire-claude.sh + -grok.sh) updated: empty
     env block + comment explaining v0.46 rationale.

3. Fail-closed defaults (architecturally correct, not bandaid):
   - validate_path: empty allowed_roots() → ERROR (was silent disable)
   - load_chain: missing/empty section → ERROR unless KEI_POLICY_CHAIN_OPTIONAL=1

4. RAII guard for process-group cleanup:
   - KillPgGuard fires killpg on ANY exit path (success, error, timeout,
     panic) until explicitly disarmed. Replaces error-path-only killpg.

5. validate_path moved off tokio worker via spawn_blocking — was blocking
   syscalls in async context.

VERIFIED:
- cargo build --release → clean
- cargo test -p kei-mcp --release → 2 passed
- MCP smoke: chain fires under CLAUDECODE=1, GROKCODE=1, and no env
  (all three previously skipped; all three now block kei_bash on
  forbidden git push patterns).
- Safe commands still pass (kei_bash echo HELLO → HELLO returned).

README: substrate counts refreshed (105→110 Rust crates, v0.45→v0.46).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 14:00:16 +08:00
b54b84ad45 docs(readme): rewrite intro — multi-LLM + sub-agents + sleep + token streaming
Old intro talked about 'MCP bridges generate context for Cursor/Continue/...'
which was outdated and missed everything shipped in v0.40–v0.45:
- 5 LLM CLIs unified (Claude / Grok / Gemini / Copilot / Kimi)
- Sub-agents on any backend via spawn_agent MCP tool
- 3-tier policy enforcement (TIER 1/2/3)
- Three-phase sleep (A/B/C)
- Native token streaming pass-through

Also removed [REAL: shell-cmd] hygiene markers from user-facing text
(those belong in author tooling, not the README).

Author & collaboration section emptied to a TODO comment so the user
can write their own annotation (per their explicit request).
2026-05-27 13:06:51 +08:00
cf0daf1131 fix(security): scrub residual EC2 ID from _generated/ — manifest was already scrubbed but generated docs weren't re-built post-scrub 2026-05-27 11:49:54 +08:00
9bf575f94e docs: catch up README + CHANGELOG + encyclopedia to v0.45 (mirror of keigit fdb84f24) 2026-05-27 00:49:37 +08:00
4db1e1f370 feat(v0.45): onboarding wizard + 5 prod-install bugs (mirror of keigit 4bc40e8e) 2026-05-26 23:20:24 +08:00
8cadcaadf3 feat(v0.44): pre-release audit — 1 CRITICAL + 4 HIGH + 4 MEDIUM patched (mirror of keigit 3b54f0b5) 2026-05-26 23:02:26 +08:00
b77ead0ce3 fix(prod): restore exec bit on 14 scripts via git Data API (gh api PUT loses mode) 2026-05-26 22:05:32 +08:00
b4dc1f770d fix(prod): restore exec bit on 14 scripts (gh api PUT loses mode); bootstrap defensive bash 2026-05-26 22:04:37 +08:00
625a5fa46f fix(limits): 4 audit fixes — atomic cache, jq guard, key argv leak, tonumber 2026-05-26 21:53:14 +08:00
932ec51b67 feat(limits): NEW kei-limits.sh 2026-05-26 21:44:20 +08:00
d7b48603c6 feat(limits): honest kei limits + pet cache integration 2026-05-26 21:44:18 +08:00
529d78612a feat(limits): honest kei limits + pet cache integration 2026-05-26 21:44:17 +08:00
06f19c629f v0.42 from keigit 65d17007 2026-05-26 21:35:16 +08:00
7f7fdb68d2 v0.42 from keigit 65d17007 2026-05-26 21:35:14 +08:00
07598510cd v0.42 from keigit 65d17007 2026-05-26 21:35:12 +08:00
a1d33a7175 v0.42 from keigit 65d17007 2026-05-26 21:35:09 +08:00
a76ebcdd4a feat(v0.41): 5 audit fixes + doc + claude/grok perms (#49)
Mirror of keigit 8086bec4.
2026-05-26 18:52:40 +07:00
31710d4bcf fix(agent-event-done): root-cause fix from keigit 75325aaf 2026-05-26 18:53:40 +08:00
def26ebb0e fix(lib-hooks): root-cause fix from keigit 75325aaf 2026-05-26 18:53:39 +08:00
879d8359d3 feat(pet): compact summary — sess + agents count + global tokens/cost 2026-05-26 18:42:34 +08:00
3099a58dd9 feat(phase-C): cross-CLI hook enforcement + v0.40.0 release (#48)
Mirror of keigit 596e0b20. Phase C cross-CLI hook enforcement (kei_bash/kei_edit/kei_write MCP tools + 3-tier model). Release v0.40.0.
2026-05-26 17:10:14 +07:00
1e3e7d1ee7 feat(orchestrator): kei pick + spawn_agent MCP tool — true multi-LLM shell (#47)
Mirror of keigit 3fec43ea. Orchestrator picker + cross-CLI sub-agent spawn via MCP.
2026-05-26 15:49:43 +07:00
a6a540a45f feat(dna): provider+model agent DNA; kei primary; smoke 4/5 + RULE 0.14 hang fix (#46)
Mirror of keigit e4980f6a. Multi-LLM DNA + Recombobulating async fix.
2026-05-26 15:22:41 +07:00
ef7e695227 feat(multi-cli): kei run-via <backend> — agents over external LLM CLIs (#45)
Mirror of keigit 3be9a8bf. Uniform launcher: claude/grok/agy/copilot/kimi/codex backends, reads ~/.claude/agents/<n>.md + composes with task.
2026-05-26 14:10:29 +07:00
742822a499 feat: opt-in hook packs + stack profiles + public-prep repoint (#44)
Mirror of keigit main — Phase 2 (abae256c) + public-prep repoint (518d95df).

Phase 2: safety on by default, discipline packs opt-in; stack profiles
(minimal/web/ml/systems/mobile) pull packs + agent sets; SSoT in
_primitives/hook-packs.toml; filter+prune via lib-hooks.sh; re-runnable
via `kei configure`; 8 hooks gated via _lib/gate.sh.

Public-prep: .gitmodules + README clone + plugin homepage + web-install.sh
repointed to github.com/KeiSeiLab. ADR in DECISIONS.md 2026-05-25.
2026-05-26 13:26:09 +07:00
98d30e352f chore(public-prep): scrub author identity + private-IP references (#43)
Pre-public Phase 1. Remove personal/IP traces that should not ship in a
general-purpose kit; keep only intended author attribution.

- no-github-push.sh + hooks-and-blocks.md + ci-scaffold: drop "KeiTech
  unfiled patent IP / trade secrets / priority date" wording; reword as a
  generic opt-in guard for keeping code on a private remote.
- check-error-patterns.sh: remove author-local absolute path from the
  tombstone comment.
- graph-export-watcher.sh: default viz dir to ~/.local/share/kei/graph-viz
  (was a personal project path).
- agent manifests (cost-guardian, modal-runner, infra/ml/code-implementer)
  + ci.yml: strip private memory references and dated personal incidents;
  keep the generic cost/ops lessons. Snapshots regenerated; golden 3/3.

Kept intentionally: author attribution (NOTICE / README / Cargo / plugin).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:31:19 +07:00
48b2f5cc1c feat(msg): /msg skill — read/write cross-session mailbox by @id (#42)
Thin skill over the kei-message jsonl mailbox: /msg reads inbox, /msg @name text sends (identity = cwd basename), /msg all broadcasts, /msg list|who. send now accepts leading @name. Mirror of keigit 7b453aac.
2026-05-24 14:38:26 +07:00
a299427367 fix: pre-public audit — critical install regression + 7 blockers (#41)
Mirror of keigit 3aff0029. lib-hooks.sh apostrophe-in-jq closed the bash single-quote and broke every install (fixed). cortex-ui removed from profiles+menu; forgejo/zoekt source lib-launchd; portable kei-message id (BSD date fallback); non-TTY default minimal; install stamps .kei-profile; README hook count 54; web-install warns before discarding local edits in the managed clone.
2026-05-24 10:42:16 +07:00
4dbe6fd159 feat(kei message): persistent inter-session mailbox + pull-inbox hook (#40)
Any Claude Code session can message any other (not just Agent-Teams teammates),
no tmux. Append-only jsonl bus + UserPromptSubmit hook pulling unread per turn.
kei-message.sh (send/inbox/list, address by cwd-basename or "all"),
mailbox-inject.sh (cursor dedup, first-turn baseline, no self-echo), bin/kei
`message` dispatch, lib-scaffold copies all scripts/*.sh, snippet wires the hook.
Bypass KEI_MAILBOX_BYPASS=1. Verified by 2-session simulation.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 14:06:27 +07:00
b24f1ba9cd feat(install): first-run is a full guided onboarding (agents + sleep + cortex) (#39)
SessionStart first-run hook now injects an ordered post-install checklist Claude
walks the user through: (1) /onboard projects → per-project agents,
(2) /sleep-setup → nightly REM (recommend local-only), (3) /cortex-setup (only
if cortex daemon installed). Confirm + run each, skippable. Fires once.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 12:30:23 +07:00
3e0be312f8 feat(install): first-run /onboard nudge + normalize null hook matchers (#38)
1. SessionStart hook first-run-onboard.sh: on first Claude Code session after
   install, nudges user/Claude to run `/onboard ~/Projects/*` (scan stack +
   create a project-specialist agent per project; delegates to /new-agent).
   Fires once (marker), then silent. Wired in settings-snippet under SessionStart.
2. lib-summary next-steps: lead with /onboard ~/Projects/*, then /new-agent.
3. lib-hooks merge: normalize null/absent matcher → "" (Claude Code /doctor
   rejects null; pre-kit hooks often lack a matcher field).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 19:38:22 +08:00
83c21327f0 style(install): KeiSei brand colors + ASCII banner in installer output (#37)
KEISEI ASCII logo (голубой) at install start; [install] prefix тёмно-жёлтый
(38;5;178); primitive names + language codes голубой (38;5;39); language names
тёмно-жёлтый. lib-log COLOR now enables under curl|bash (detect terminal via
[ -t 1 ] || /dev/tty — web-install tees stdout so -t 1 was false → colors off).
Color detection, not an interactivity gate. Verified piped-under-pty.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 16:06:17 +08:00
ea03b48463 fix(install): wire PATH in curl|bash — gate pathway on stdin, not stdout (#36)
PATH-wiring (~/.claude/bin, home of the `kei` entry-point) was gated on
`[ -t 0 ] && [ -t 1 ]`; curl|bash tees stdout so -t 1 is false → pathway skipped
→ `kei: command not found`. Same tee/-t1 trap as onboarding (this one in the
top-level install.sh). Eradicated across tree: install.sh, lib-menu.sh,
lib-wizard.sh all gate on [ -t 0 ]. Verified piped-under-pty.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 14:14:55 +08:00
1bde36548e style(kei): brand splash colors (голубой logo + жёлтый values), bump v0.16→v0.38 (#35)
Splash was cyan; rebrand to blue/yellow: sky-blue (38;5;39) logo + dim-blue
separators, gold (38;5;220) brand line + field values. Version v0.16→v0.38.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 13:52:54 +08:00
54aee697cf fix(onboarding): no crash on text input, Claude Code default, explanations (#34)
1. CRASH on word input (e.g. "claude") at any menu: $((ans-1)) under set -u →
   "unbound variable" → install died. Added _onb_read_choice validation (all 4 menus).
2. Claude Code default: added claude-code subscription provider (kei-registries
   submodule c559065→b904993), subscription default transport, claude-code default
   provider — Enter,Enter,Enter → Claude Code, no API key.
3. install died at line 178 for no-key providers (claude-code/codex/local):
   onboarding_run ended on a false `&&` → returned 1 → set -e. Added `return 0`.
Plus en+ru explanations and auto-select single-option steps. Verified piped-under-pty.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 13:00:59 +08:00
f79f28e68a fix(web-install): don't hang after 'delegating' in interactive curl|bash (#33)
curl|bash reads this script byte-by-byte from the pipe; a bare `exec < /dev/tty`
then made bash read the NEXT line (the bootstrap exec) from the keyboard →
infinite hang after "delegating", bootstrap never started. Fix: merge the
redirect into the bootstrap exec (one command). Verified piped-under-pty:
buggy=HANG, fixed=full install completes.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 11:29:30 +08:00
37d249caad fix(install): run onboarding + profile wizard in curl|bash (gate on stdin, not stdout) (#32)
web-install.sh tees stdout to a logfile, so -t 1 is false even in an interactive
curl|bash; the /dev/tty fix reattached only stdin. Wizard gates required BOTH
-t 0 and -t 1, so onboarding (language select) and bootstrap's profile wizard
were silently skipped on the primary install path. Prompts go to stderr and read
from stdin — interactive stdin is the only real requirement.

Gates: bootstrap.sh, lib-onboarding.sh (×2), lib-preflight.sh, lib-hooks.sh.
Non-interactive (CI / </dev/null) still skips — verified.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 10:25:27 +08:00
73fef645a5 feat(pet): comprehensive reflection — 60+ langs, all agents, errors (#31) 2026-05-22 02:43:21 +08:00
2b1e1698f8 feat(pet): show session tokens + context% from statusLine stdin (#30) 2026-05-22 01:52:04 +08:00
c480a330d5 refactor(pet): read kit agent tracking (SSoT) + agent-event-done total_tokens (#29) 2026-05-22 01:41:50 +08:00
f41afa56ce feat(pet): agent emojis, multi-agent display, plan emoji, language icons (#28) 2026-05-21 20:33:16 +08:00
126783d84d fix(web-install): tolerate missing /dev/tty in non-interactive curl|bash
E2E (curl install.keisei.app | bash, no controlling terminal) died at
`exec < /dev/tty` — "No such device or address". `[ -r /dev/tty ]` stat's
the path readable but the device can't be opened without a controlling
terminal (CI/cron/ssh non-interactive) — the documented `| bash -s -- --yes`
CI path. Now probes a real open via `{ : < /dev/tty; }` and reattaches only
on success; else proceeds non-interactively. Verified RC=0 end-to-end.
2026-05-21 19:13:51 +08:00
1dd4bad97a fix(install): make fresh install actually complete + ship tamagotchi (#26)
Root causes found by reproducing a clean install from keigit:

1. PROFILE_PRIMS resolved only inside check_prereqs → unbound for
   --no-execute (plan showed 0 prims for every profile) and silently
   empty for --skip-prereqs. Now resolved unconditionally in install.sh
   before any reader (SSoT).

2. Every profile (even minimal, advertised "no Rust compile") fell back
   to a 5-15 min `cargo build --workspace` because no prebuilt release
   binaries exist. Auto-set KEI_SKIP_RUST for profiles with no rust
   primitives → minimal installs in ~18s (assembler only). cargo stays a
   hard prereq because the agent assembler always compiles.

3. The assembler aborted the WHOLE install on any single bad manifest
   (set -e). generate_agents is now tolerant: bad manifests print FAIL
   but hooks/skills/settings still land. Commit-time validate stays strict.

4. Data bugs that broke the assembler:
   - duplicate [taxonomy] table in _roles/{auditor,merger}.toml
   - fal-ai-runner handoff → keimd-expert (not shipped in kit)
   - infra-implementer-cicd forbidden_domain literal `${{ secrets.NAME }}`
     collided with assembler ${{ }} placeholder detection

5. Metadata: KeiSei84 (nonexistent GitHub org) → KeiSeiLab/KeiSeiKit-1.0
   across plugin manifests, bootstrap, README, docs, Cargo/npm metadata.
   .claude-plugin/{plugin,marketplace}.json 0.16.0 → 0.38.0. SECURITY.md
   supported version 0.14.x → 0.38.x.

feat: ship KeiSei tamagotchi statusline into the kit
   - scripts/keisei-pet{,-update}.sh (portable, state under ~/.claude/pet/)
   - install copies them to ~/.claude/scripts/
   - settings-snippet adds statusLine (set-if-absent, never clobbers an
     existing one) + 4 pet-update hooks (prompt/rust_write/github_block/sleep)

Verified: clean minimal install RC=0, zero FAIL, 38 agents + 52 hooks +
68 skills, settings valid, statusLine wired, pet renders, idempotent re-run.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 01:40:50 +08:00
7bcda396fd fix(install): backup_file mv→cp -a, install --activate-hooks больше не падает
gx10 fail при первой установке (фото юзера 2026-05-18):
  jq: error: Could not open file /home/keisei/.claude/settings.json
  [error] jq-merge produced invalid output; ... unchanged
  [error] install failed at line 126; rolled back

Root cause:
  backup_file() (install/lib-backup.sh:56) делал `mv target backup`,
  затем activate_hooks() → _jq_merge_hooks() пыталась читать оригинал
  target'а через jq — но оригинал уже унесён mv'ом, открыть нечего.
  jq fail → rollback всей установки.

Fix: cp -a вместо mv (как уже сделано в backup_path() для директорий).
Атомарный безопасный бэкап; оригинал остаётся для jq, потом
_jq_merge_hooks атомарно переписывает его mv tmp → target.
2026-05-18 14:33:22 +08:00
c4e43f3637 chore: версия 0.38.0 единая + warning-fixes + mold для release-job
1. Версии npm-пакетов приведены к 0.38.0 (был зоопарк 0.14.0/0.14.6):
   _ts_packages/{,packages/{gmail,grok,mcp-server,recall,telegram,youtube}-adapter}

2. Rust warnings (cargo check workspace):
   - kei-cortex: deprecated validate_path → validate_path_lexical,
     удалён orphan-wrapper в read.rs, struct Input → pub(crate)
   - frustration-matrix: #[allow(dead_code)] на confusion_* поля
     EvalReport + train_from_dir (будущий CLI)

3. CI release.yml job 'release' падал на Build kei-changelog:
   clang invalid linker '-fuse-ld=mold' — в .cargo/config.toml
   жёстко прописан mold для linux. Добавлен Install mold шаг
   (как уже сделано в build-release matrix).
2026-05-18 13:41:37 +08:00