Skip to content

Merge Context Engine and documentation updates - #322

Merged
raiseCatError merged 281 commits into
masterfrom
feature/305-context-engine
Oct 5, 2026
Merged

raiseCatError merged 281 commits into
masterfrom
feature/305-context-engine

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

Brings the checkpointed Context Engine work and the documentation/reel integration from feature/305-context-engine into master.

Latest checkpoint: 96825afb7f43d59add8eb19544ce5f59ae8dc67b.

v0.17 polish: shell environment, screensavers, known-tool discovery
…d host semantics

- Prompt provider None: composer only (no prompt row, modules, right prompt
  or marker); promptless history snapshots; /prompt and Setup previews.
- Historical prompt presentation Full / Compact / Minimal / Off over the
  unchanged stored snapshot.
- Native theme library: stable-id assets (Custom/Imported by provenance),
  bounded, migrated from the single customTheme (kept as a deterministic
  mirror of the active asset), stable theme references and one pure
  semantic palette resolver.
- Theme Studio with Built-in | Imported | Custom | Import tabs over one
  editor and the real Native preview; import parses and previews first.
- Importers: NMSh JSON, Base16, Base24, Windows Terminal, Oh My Posh
  (JSON/YAML/TOML, static colors only), Kitty, Ghostty (allowlist), iTerm2
  (bounded plist, no entities), WezTerm TOML (Lua rejected). Data-only
  parsers: yaml, smol-toml, fast-xml-parser.
- Theme Bridge: per-target Independent / Follow NMSh / Choose theme with a
  master switch (default Off); fzf launch colors, less/man termcap and
  LS_COLORS through one validated shell-environment sink applied by the
  zsh/Bash/Fish adapters, tmux/Neovim/Vim managed artifacts with an
  ownership ledger, staged validated writes and exact reviewed includes;
  bat/delta reported as unsupported rather than faked.
- /theme-bridge, /appearance destinations, Setup and Settings selection.
- OSC 7 and OSC 133 projected from the OSC 777 lifecycle on capable hosts;
  NMSh-authored OSC 8 links kept distinct from raw PTY links.
… tests; docs

- Tests: library migration/actions/export/deletion, every importer with
  malformed, oversized, unsafe and lossy fixtures, Theme Bridge modes,
  mappers, environment sink in real zsh/Bash/Fish, ownership ledger,
  exact includes, tmux/Vim artifacts loaded by real tmux/Vim, Prompt None
  layouts and history, historical prompt levels, OSC 7/133/8, Theme Studio
  and /theme-bridge UI, Setup rows, and live end-to-end NMSh sessions.
- Fixes found by them: Prompt None framed as the one-line composer in the
  two-line layout, include planning on a symlinked home, Setup/Settings
  action rows keep "Open ›".
- Docs: help, README, CHANGELOG and docs/design/theme-bridge.md.
…irmed activation

Generated nmsh-bridge.toml in Helix's themes directory (syntax, markup,
diff, diagnostic and editor UI scopes over a named palette), ownership
ledger and staged validated writes, one confirmed theme assignment placed
before the first table of config.toml, never replacing a user-selected
theme, exact removal, factual status, tests and docs.
…ng colors, preview Chroma, /motion

- Theme Bridge switch plus Apply themes policy (Manual / Follow NMSh /
  Choose theme with one global theme); per-target settings stay the Manual
  state and come back exactly; capability classes (direct, managed,
  detected); delta shown but never editable or inherited.
- /theme-bridge is one panel: grouped table, inline expansion, Esc collapses
  first, view-only rows under global policies, Remove managed setup vs Set
  Independent, Review all / Apply all with a combined review defaulting No.
- bat: generated data-only .tmTheme in bat's themes directory, reviewed
  bat cache --build with typed argv verified by bat --list-themes, BAT_THEME
  only when ready, automatic rebuilds only after that approval, Duplicate
  source to Custom.
- File listing colors: GNU ls/gls get LS_COLORS and a session-only
  color-auto wrapper (never shadowing user aliases/functions); macOS/BSD ls
  gets CLICOLOR and LSCOLORS.
- Integrations health planner; Helix activation state detection.
- Theme Studio: local Preview Chroma (default Off) and Duplicate current
  theme to Custom; Setup Prompt/Appearance preview switch; Chroma row in
  Setup Prompt.
- /motion opens the existing Motion screen.
…registry, integrations, dotfiles import, command surface cleanup
…against the detached retention cap

- Dotfiles: exact-copy is an explicit, fail-closed registry capability
  (exactCopy validator). Parseable is not safe: Starship, Helix and bat
  configs can run commands, so they are inspect-only with a stated reason.
  Apply re-checks authority, so a forced copy mode writes nothing.
- tmux: the pane frontend is a fixed /bin/sh program; the NMSh path is
  passed as shell-quoted argv data ("$1"), never as program text. Any
  absolute path without control characters works literally; the validator
  accepts only that exact form.
- Detached output: prompt metadata (alias/function lists) no longer
  consumes the output retention budget, which made in-limit output look
  truncated on Ubuntu (global compinit). The output cap is unchanged.
- Shell switch test reports shell state on timeout.
- Remove a stray committed .swp; ignore *.swp.
…t-literal regression tests

Bash alias-expands `ls()` while parsing, so with ls already an alias
(Ubuntu's default bashrc) the generated bootstrap failed to parse and the
managed Bash never became ready. Use the `function ls { ... }` form; zsh
and fish were unaffected.

- Real bash/zsh/fish tests of the listing wrappers: parse with ls/gls
  aliased, --color=auto before user argv, existing alias/function kept,
  missing executables not wrapped, Off removes only NMSh's wrapper.
- Live managed Bash with an aliased ls in ~/.bashrc reaches ready.
- Native prompt: hostile Git branch names, repository names and context
  values (zsh % escapes, $()/backtick/${}, quotes, ANSI/OSC/C1) render
  literally and inertly in live, snapshot and historical prompts; no
  canary runs. No renderer change was needed.
…l provenance

Shell frameworks and prompt engines
- /tools detects tools by an explicit strategy (executable or a registered
  filesystem detector). Oh My Zsh, Powerlevel10k, Prezto, Zim, zinit and
  Antidote are found by documented layouts only; detection grants no
  install, uninstall, configuration or provider authority. Zsh-only tools
  stay visible under Bash/Fish ("used by Zsh only").
- Oh My Zsh: guided install that never runs the installer. NMSh backs up
  and fingerprints .zshrc, shows the official source and the documented
  KEEP_ZSHRC=yes CHSH=no RUNZSH=no (REPO/REMOTE/BRANCH pinned) steps, and
  verifies afterwards; an unexpected .zshrc change is reported, never
  silently restored. .zshrc.pre-oh-my-zsh comparison with a reviewed
  restore (default No, backup first, atomic replace, no merge).
- Powerlevel10k in /tools routes to the existing detector, provider and
  p10k configurator.
- Oh My Posh: new Prompt provider (oh-my-posh print primary, argv only,
  no TTY, bounded, timed out, cancellable, Native fallback) and a curated
  homebrew/core install; Theme Studio import of its config stays static.
- Ask: typed routes for these requests; dotfiles treats .p10k.zsh, Oh My
  Zsh themes/plugins and Oh My Posh configs as inspect-only.

Keep Awake (/caffeinate, /awake, /zoomies)
- One controller over the OS mechanism: /usr/bin/caffeinate,
  systemd-inhibit (idle/sleep only, Display reported unsupported) and
  SetThreadExecutionState from a fixed PowerShell helper (no away mode,
  no powercfg). Detached so it outlives the window; ownership is a token
  plus the exact command line, so unverifiable records are cleared and
  nothing is killed. Strict timeouts, status, idempotent stop, confirmed
  mode changes that start the new assertion first.

Homebrew
- A Homebrew keg is recognized from the Cellar layout and Homebrew's
  INSTALL_RECEIPT; /update, /version, /status and doctor say so and point
  to brew upgrade nmsh instead of touching the Cellar.
- Release workflow proposes the raiseCatError/homebrew-tap formula update
  as a pull request for stable releases only.
…h; Keep Awake ownership check uses absolute PowerShell

- The guided install's file lived at a predictable /tmp name another local
  user could replace between download, inspection and running.
- On Windows the ownership check resolved powershell.exe through PATH; it
  now uses the System32 path like the backend itself.
…ser chrome; /tools selection is a real band

Keep Awake
- /caffeinate, /awake and /zoomies with no argument opened a panel that was
  never drawn (it was missing from the active-panel set), so the composer
  looked frozen, keys went to the hidden panel, Enter quietly started an
  assertion and only Ctrl+C (the panel's close key) gave the prompt back.
  The panel is registered (the Mise panel had the same omission), and a
  start, an accepted mode change or a stop now closes it and records one
  line under the command that opened it. The assertion was always an
  NMSh-owned detached process; nothing ran through the shell, and a typed
  shell caffeinate stays an ordinary foreground command.
- Presentation: while active, "Awake · <mode>" is NMSh composer chrome,
  never prompt or provider output. Placement Composer edge (default) takes
  a plain top divider, else the bottom divider when a header prompt owns
  the top edge, else one row next to the composer; Above composer and
  Input row (only when the edit is single-line with room to spare; the
  editor's wrapping, caret, selection and hit testing use the narrowed
  width) are explicit choices. The decision is made with the screen plan
  each frame and never rewrites the saved setting.
- Both composer edges render through one exact-width edge renderer, also
  used by the Chroma repaint, so an animated divider never erases the
  accessory and transition tints stay off it.
- Status Strip: an active Keep Awake is always in an enabled strip (no
  per-item switch); it narrows (label, Awake, glyph) before anything would
  drop it, and a disabled strip stays disabled.
- Idle reminder (default On, 30 s without NMSh input): adds the time and a
  muted /zoomies stop on the edge when it fits, else one muted row; the
  next input collapses it. Screensaver status (default On, Bottom left, six
  positions) is a small separate element; the saver and Vespyr are
  untouched.
- Display Text / Icon / Icon + text through the semantic icon set (Safe
  mode keeps text). Colors are theme roles: accent while active, muted for
  the reminder. Off renders nothing anywhere.
- The panel gains Duration and Presentation, Screensaver and Status Strip
  sections. Ask answers status questions and plans start, change, timed and
  stop requests through the same controller, deterministically.
- A deterministic-only inert backend (NMSH_DETERMINISTIC=1 with
  NMSH_KEEP_AWAKE_BACKEND=inert) runs the real slash, controller, ownership
  and presentation paths for tests and recorded demos without keeping a
  machine awake.

/tools
- The selected row uses the shared selected band (the active tab's
  treatment): full width, bold label, quiet text lifted onto the band, and
  reverse video without color.

README art
- scripts/demos/vespyr-svg.ts renders a small transparent divider from
  Vespyr's real sprite pixels and blink pose.
…TECTURE.md

Docs
- README rewritten for a first visit: what NMSh is and is not, highlights,
  a short hero clip, a visual tour, source install (no Homebrew command
  until the tap exists), core commands, Keep Awake, shells/frameworks/
  providers, terminals, accessibility, safety and ownership, limitations.
  Stale zsh-only, fixed-bottom, bat/Theme Bridge and badge claims fixed.
- AGENTS.md: current shell model, composer edges and the screen plan,
  safety boundaries, current unreleased surfaces, PR #315, no-attribution
  rule, demo command. SECURITY.md: supported versions and the boundaries
  NMSh keeps. SUPPORT.md: nmsh doctor. CONTRIBUTING, ROADMAP (PR #315 in
  development; OSC 0/2 still deferred), llms.txt and the Theme Bridge doc
  updated; new docs/design/keep-awake.md and docs/demos.md.
- ARCHITECTURE.md is linked as the high-level overview from README,
  CONTRIBUTING, AGENTS and llms.txt.
- Prompt None: help, the prompt picker and Setup said "no marker"; the
  input marker has always stayed, and the wording now says so.

Demos
- npm run demos records every scripts/demos/*.tape with VHS against a
  disposable demo home (fixture repo ~/Projects/demo, neutral identity, no
  network, update checks and npm's notifier off), encodes GIFs and stills
  from VHS frames with ffmpeg, then stops everything still holding files in
  the demo home and fails if anything survives. Keep Awake is recorded with
  the inert backend; sessions detach with SIGHUP as a closing window does.
- Clips: hero, composer and prompts, Theme Studio, Theme Bridge,
  providers and tools, live sessions, screensavers with Vespyr, Keep Awake;
  three stills; a Vespyr divider generated from the real sprite.
- The old asciinema/tmux recorder, which recorded the real home directory,
  is removed; dev/tapes stays for development captures.
- tests/docsAssets.test.ts checks local doc links and images, that every
  published clip has its tape, and that docs, tapes and vector art name no
  real home path or secret.
Add policy-bearing context facts, trusted collection, module routing and shared Rail geometry. Preserve persistent shell state, prompt anchors, raw output and transcript boundaries.

Expose shared transcript presentation and shell indicator controls, preserve Hidden while changing sides, and keep /btw canonical with /ask compatibility. Include regression coverage, physical QA handoff and exact-base readiness evidence.
@raiseCatError
raiseCatError merged commit eaf9cb5 into master Oct 5, 2026
20 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant