Skip to content

feat(shell): one advisory line names the c3_* call when the shell was used as a reader or searcher (S4) - #155

Merged
drknowhow merged 3 commits into
mainfrom
feat/shell-s4
Sep 4, 2026
Merged

drknowhow merged 3 commits into
mainfrom
feat/shell-s4

Conversation

@drknowhow

Copy link
Copy Markdown
Owner

Why

48% of c3_shell commands were cat, head, tail, sed, grep, rg, find and ls over project files (7,278 events measured 2026-09-04) — reads and searches the code-intelligence tools answer within budget, indexed, and with the index's exclusions. Cod's ruling: advisory only; refusing on size pushes agents to the native shell and loses every control. S4, the last phase of the shell remediation (campaign c3-shell-remediation).

What

  • cli/tools/shell_nudge.py: bypass_hint(cmd, project_path) — at most ONE [c3_shell:hint] line naming the equivalent call: c3_read(file_path, lines=[a,b]) for cat/head/sed -n 'a,bp', c3_compress(mode='map') then c3_read for tail, c3_search(action='code'|'exact', query, path, ignore_case) for grep/rg (identifier → code, otherwise exact), c3_search(action='files', query) for find -name / recursive ls. Never for paths outside the project, ~/$VAR paths, node_modules/dist/build/.git/.c3; a plain ls is not a search. The command is never rewritten or refused.
  • render_shell_response appends the line after the hint section; telemetry detail.hint records the kind so the follow rate and the false-positive rate can be measured from .c3/tool_telemetry.jsonl before anything is promoted.

Verification

15 tests (reads, sed ranges, grep identifier vs regex vs -e, pipes, outside-project and variable paths, finds, silence for everything else, wiring + telemetry kind); shell suites 82 green; harness 26/26 unchanged; ruff clean; full suite in CI.

https://claude.ai/code/session_018VQLfSMFw9Lfd9mGntt19H

@drknowhow
drknowhow merged commit f727a1e into main Sep 4, 2026
12 checks passed
@drknowhow
drknowhow deleted the feat/shell-s4 branch September 4, 2026 15:55
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