Commit graph

5 commits

Author SHA1 Message Date
Brooklyn Nicholson
e2b6f6885c feat(agent): prune non-coding skill categories from the prompt index in coding posture
Unlike toolsets (where stripping fought explicit user opt-ins), pruning
the skill index is discovery-only: skills_list still returns the full
catalog and skill_view loads anything. Hiding cooking/social-media/
smart-home/etc. from the manifest while pairing on code reduces prompt
bloat and attention dilution without removing any capability.

- ContextProfile.hidden_skill_categories: deny-list on the profile
  (unknown/custom categories stay visible); coding profile hides the
  clearly-non-coding set, keeps coding-adjacent ones (github, devops,
  data-science, diagramming, research, security, ...).
- build_skills_system_prompt(hidden_categories=...): filters whole
  top-level categories (nested ones via their parent), participates in
  the LRU cache key, and appends a disclosure note so the model knows
  the full catalog exists.
- system_prompt wires it through coding_hidden_skill_categories();
  applies in every coding-posture mode (auto/focus/on), no-op otherwise.
2026-06-10 02:50:03 -05:00
Brooklyn Nicholson
9d8763dd26 refactor(agent): make the default coding posture prompt-only; add focus mode
The toolset collapse was subtractive against explicit user intent: the
strippable toolsets (messaging, smart-home, music, computer-use, …) are
off-by-default for everyone, so collapsing did nothing for the median
user while silently disabling tools that opted-in users deliberately
enabled — and image-gen is genuinely useful in frontend/game-dev coding.

- auto (default) and on are now prompt-only: operating brief + workspace
  snapshot, configured toolsets untouched.
- focus (new, explicit opt-in; aliases: strict, lean) keeps the previous
  behavior — collapse to the coding toolset + enabled MCP servers.
- RuntimeMode carries config_mode; toolset_selection() returns None
  unless mode is focus. cli/tui call sites unchanged (None falls through
  to normal platform resolution).
2026-06-10 02:37:50 -05:00
Brooklyn Nicholson
2667bb83f2 test(agent): assert coding_selection non-None before subscripting 2026-06-10 02:01:20 -05:00
Brooklyn Nicholson
76858f5c3e refactor(agent): model coding-context as a frozen RuntimeMode seam
Evolve coding-context from a pair of loose functions into one resolved-once
posture object so the coding/general distinction is decided in a single place
and read by every domain, rather than re-probed ad hoc.

- ContextProfile registry (coding/general): declarative posture data — toolset
  to collapse to, operating brief, plus model_hint/memory_policy seams for
  future routing/memory consumers.
- RuntimeMode: immutable, resolved once via resolve_runtime_mode(); exposes
  toolset_selection() and system_blocks(). Detection is not memoized so a
  long-lived gateway/TUI process can't pin a stale posture.
- Detection now fires on a git repo OR a recognised project root (pyproject,
  package.json, Cargo.toml, go.mod, AGENTS.md, …), walking up to the workspace
  root — additive, so a non-git project dir also counts.
- Enriched operating brief with Cursor-grade patterns: trace symbols before
  editing, never substitute chat code blocks for tool edits, re-read a file
  before retrying a failed patch, cap linter-fix loops (~3) before asking,
  verify deps against the manifest.
- system_prompt routes through coding_system_blocks(); cli/tui keep calling
  coding_selection() (now thin wrappers). Subagents inherit the posture for
  free via existing toolset inheritance + the shared prompt builder.

Back-compat: is_coding_context / coding_selection / build_coding_workspace_block
/ CODING_AGENT_GUIDANCE all preserved.
2026-06-10 00:44:31 -05:00
Brooklyn Nicholson
9b200c3b68 feat(agent): coding-context posture across CLI/TUI/desktop
When Hermes runs on an interactive coding surface (CLI, TUI, desktop app,
ACP) inside a git repo, it now shifts into a coding posture:

- Tool restriction: the toolset collapses to a new `coding` set (files,
  terminal, search, web docs, skills, todo, delegate, vision, browser) plus
  the user's enabled MCP servers. Messaging / TTS / image-gen / smart-home /
  music / cron / computer-use fall away.
- Operating brief: a Cursor-style system block (gather context before
  editing, focused diffs, verify, never fabricate, git is the user's).
- Live workspace snapshot: git root, branch + upstream (ahead/behind),
  worktree, dirty/staged counts, recent commits — built once per session
  (cache-safe; never re-probed per turn).

Activation via `agent.coding_context` (auto|on|off, default auto). `auto`
fires only on interactive surfaces in a git repo; messaging platforms are
never affected. A `--toolsets` flag or `HERMES_TUI_TOOLSETS` pin always wins.
2026-06-10 00:07:26 -05:00