Governed shell binary — human + machine modes (Rust)
Find a file
Tyler J King 63a6c0c520 feat: gsh human mode — interactive governed shell with reedline
Phase 3 / Sprint 2 finish line.

Human mode: reedline REPL with governed prompt.
  [governed] tyler@gsh:~$

Mode detection:
  --exec "cmd"              → machine mode (unchanged)
  --ungoverned --exec "cmd" → ungoverned machine (unchanged)
  (no --exec, TTY attached) → human mode (NEW)
  (no --exec, no TTY)       → error

Command classification per-keystroke (libgsh/classifier.rs):
  Free:       ls, cat, grep, echo, cd, git, ssh, curl — zero overhead
  Governed:   binaries in corpus dir — via org-ops wrapper, CR posted
  Ungoverned: not in corpus but on PATH — warn + execute
  Denied:     corpus manifest but removed — killswitch active

Session lifecycle:
  Start:  validate AC, post SESSION_STARTED CR, print banner
  Active: classify each command, governed ops post lightweight CRs
  End:    print summary (governed/free/denied/ungoverned), post SESSION_ENDED CR

Banner: principal, corpus, session ID, expiry, risk level
Prompt coloring from risk level:
  Baseline/Standard: green [governed]
  Elevated:          yellow [elevated]
  High/Critical:     red [HIGH]

New modules:
  libgsh/classifier.rs — command classification against corpus (4 tests)
  libgsh/session.rs    — session state tracking
  gsh/human.rs         — reedline REPL, prompt, banner, summary

Machine mode: zero changes (regression tested).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 15:44:34 -04:00
gsh feat: gsh human mode — interactive governed shell with reedline 2026-04-02 15:44:34 -04:00
libgsh feat: gsh human mode — interactive governed shell with reedline 2026-04-02 15:44:34 -04:00
scripts feat: gsh human mode — interactive governed shell with reedline 2026-04-02 15:44:34 -04:00
.gitignore feat: gsh machine mode — first governed shell execution 2026-04-01 19:01:22 -04:00
Cargo.lock feat: gsh human mode — interactive governed shell with reedline 2026-04-02 15:44:34 -04:00
Cargo.toml feat: gsh human mode — interactive governed shell with reedline 2026-04-02 15:44:34 -04:00
DESIGN.md feat: gsh governed shell — design exploration 2026-03-30 23:20:27 -04:00
README.md Initial commit 2026-03-31 03:15:52 +00:00

gsh

gsh — the GCAP governed shell. Human and machine modes. Chronicle-attributed execution.