Skip to content

tracekit audit: malformed shell commands, one agent name, clearer errors; README version test; release checklist - #754

Merged
LoopGlitch26 merged 5 commits into
mainfrom
agent/rel170-fixes
Nov 12, 2026
Merged

LoopGlitch26 merged 5 commits into
mainfrom
agent/rel170-fixes

Conversation

@LoopGlitch26

Copy link
Copy Markdown
Member

The should-fix items from the 1.7.0 pre-release review of tracekit audit, the README version lines and the release checklist. No version moves here; the release PR does that.

What changed and why

  1. tracekit audit --calls F --agent codex crashed (traceback, exit 1) on a line such as {"tool":"shell","args":{"command":["ls",1]}}: agent_hooks.tool joined Codex's argv without checking each item is a string.
    • agent_hooks.tool now joins an argv only when every item is a string, and leaves anything else as sent.
    • audit counts a mapped Bash call whose command is neither text nor absent as malformed (no agent's shell tool sends one; Codex sends an argv of strings). No except was widened.
    • Fuzzing every agent's mapping (each tool name x 45 argument keys x 28 odd values: non-string items, nested lists, nulls, huge ints, NaN, lone surrogates) found one more crash: Kilo's generate_image with an image and no path raised KeyError ([ti["path"]] * False still reads ti["path"]). It is now decided as the Read of the image.
    • After the fix, the fuzz ran 0 crashes over the mapping and _blocked, 69,281 distinct mapped calls through the decision and the --show text, and 179 odd reader fields (time, session, tool, args) through audit() and its three printers, for each agent.
  2. One agent name. audit --agent took claude-code where init, uninstall and the plugin skill take claude. The reader is now claude (in --help, the read: line, --json and docs/audit.md); --agent claude-code still works and reads the same.
  3. Error messages.
    • --calls ., --calls /dev/null and the like no longer say to send a pipe to --calls -. Audit says what the path is: a directory, a pipe (only then the --calls - hint), a symlink (audit follows none), or not a regular file.
    • --agent codex with no ROOT asked for "a ROOT or --calls FILE", but a ROOT then failed. An agent with no reader now gets one message, with or without ROOT: no reader for codex's sessions yet; turn them into a calls file and use --calls FILE --agent codex. --agent claude still asks for a ROOT or --calls FILE.
  4. README version test. tests/test_version.py checks that the README's licence line ("Version X.Y.Z") and its CI example (uses: Cygnux-Labs/Tracekit@vX.Y.Z) both name tracekit.__version__. It passes today, and it fails when the version moves without the README.
  5. docs/RELEASING.md step 1 names the README's "Version " line (it said "This is "), the uses: …@v<version> line, and the upper bound of tracekit-ai in integrations/hermes/plugin.yaml.

Tests

  • tests/test_audit.py: a Codex argv with an int, a null, a nested list or a huge int is malformed, and a good argv beside them is decided. A number or an object as the command is malformed for Gemini CLI, OpenCode and goose. Kilo's generate_image without a path is decided as a Read. --agent claude and --agent claude-code read the same, and --help lists claude only. The calls-path messages cover a directory, /dev/null, a FIFO and a dangling symlink. Both no-reader cases, with and without ROOT, are covered.
  • tests/test_agent_hooks.py: the Codex join and Kilo's generate_image mapping, directly.
  • tests/test_version.py: the README version lines.

Gates in the worktree (PATH=<repo>/.venv/bin:$PATH PYTHONPATH=$PWD make test-ts lint build test PY=<repo>/.venv/bin/python):

  • test-ts: ℹ tests 162, ℹ pass 152, ℹ fail 0, ℹ skipped 10
  • lint: pyflakes clean
  • build: twine check PASSED for the wheel and the sdist
  • test: 1 failed, 4963 passed, 394 skipped, 10 xfailed, 18 warnings, 64157 subtests passed in 1736.12s (0:28:56). The one failure is tests/test_policy2.py::Speed::test_every_pack_pattern_searches_64_kib_within_budget (TK-A054's pattern took 174 ms). It is a timing budget on the policy packs, which this PR doesn't touch, and it passed when run alone. The full run took 29 minutes against the usual 15, so the machine was loaded.
  • After a last docs edit: tests/test_docs.py, tests/test_audit.py, tests/test_version.py and tests/test_readme.py: 55 passed.

…ames Claude Code's reader

- agent_hooks.tool joins a Codex argv only when each item is a string, and maps
  Kilo's generate_image with an image and no path; audit --agent codex and
  --agent kilo crashed on such lines (TypeError, KeyError).
- audit counts a mapped Bash call whose command is neither text nor absent as
  malformed.
- audit --agent takes claude, as init and uninstall do; claude-code still works.
- --calls on a directory, pipe, symlink or other non-regular file says which;
  --agent with no reader asks for --calls FILE only.
- tests/test_version.py ties the README's version line and CI example to
  __version__.
- docs/RELEASING.md: the README's version lines and the Hermes plugin's
  tracekit-ai upper bound.
…t the whole list (Cline joined it on main)

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
…udit holds it from every source

- v1 hook (agent_hooks.run): a mapped Bash call whose command isn't text (an argv with an item that isn't a
  string) is denied before the pipeline, naming the value; the v1 policy matched its repr, so a force push came
  back allow. The v2 signer already holds it (TK-SHELL-PARSE); both paths are tested through the hook.
- audit: no malformed skip for such a line under --agent; every source decides it as the signer does (held,
  TK-SHELL-PARSE), and docs/audit.md says so.
- audit(): takes claude-code as claude itself, not only on the command line.
- audit: a symlink to a directory is named a symlink, not a directory.
- Hermes plugin: tracekit-ai bound raised to <1.8; tests/test_version.py checks it admits __version__.
- docs/limits.md: audit's memory per call matches the code's lean note (about 1 KB, 2 KB with --json).

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
…k blocks it (TK-HOOK-BLOCKED), not the end of the replay

Signed-off-by: LoopGlitch26 <53336715+LoopGlitch26@users.noreply.github.com>
@LoopGlitch26
LoopGlitch26 merged commit 5d88184 into main Nov 12, 2026
59 of 60 checks passed
@LoopGlitch26
LoopGlitch26 deleted the agent/rel170-fixes branch November 12, 2026 16:56
samueladebisi-dev added a commit to samueladebisi-dev/Tracekit that referenced this pull request Nov 12, 2026
Takes Cygnux-Labs#754's agent name (claude, with claude-code still accepted) and its
no-reader message; the Gemini CLI reader is keyed gemini, as init names it.

Signed-off-by: samueladebisi-dev <218522909+samueladebisi-dev@users.noreply.github.com>
samueladebisi-dev added a commit to samueladebisi-dev/Tracekit that referenced this pull request Nov 12, 2026
A project folder named chats is read as a project, not as a subagent's
session. Tests: a $set line holding the whole history, a project named
chats, GEMINI_CLI_HOME cleared for every test (SHELL_ENV), and Cygnux-Labs#754's
no-reader test on opencode. Docs: the --agent bullet, the macOS Seatbelt
sandbox's folder and the 30-day retention (with a limits row), and Gemini
CLI in the field-report and support pages.

Signed-off-by: samueladebisi-dev <218522909+samueladebisi-dev@users.noreply.github.com>
LoopGlitch26 pushed a commit that referenced this pull request Nov 13, 2026
* tracekit audit: read Gemini CLI's chat files (#715)

A reader for Gemini CLI's sessions under $GEMINI_CLI_HOME/.gemini/tmp (else
~/.gemini/tmp): each project's chats/session-*.jsonl, the one-object
session-*.json written before 0.39, and a subagent's
chats/<parent session id>/<id>.jsonl, counted under its parent's session.
A message written again on each update counts its calls once, by id, as
the last copy has them; a call stays counted after a $rewindTo. The
calls of a reader whose agent has a Tracekit hook are decided as that
hook decides them, so run_shell_command is decided as Bash.

Signed-off-by: samueladebisi-dev <218522909+samueladebisi-dev@users.noreply.github.com>

* tracekit audit: Gemini CLI review fixes (#764)

A project folder named chats is read as a project, not as a subagent's
session. Tests: a $set line holding the whole history, a project named
chats, GEMINI_CLI_HOME cleared for every test (SHELL_ENV), and #754's
no-reader test on opencode. Docs: the --agent bullet, the macOS Seatbelt
sandbox's folder and the 30-day retention (with a limits row), and Gemini
CLI in the field-report and support pages.

Signed-off-by: samueladebisi-dev <218522909+samueladebisi-dev@users.noreply.github.com>

* audit: Gemini CLI reader review fixes: duplicate Cline code, subagent .json, depth-based session files, malformed shapes, tests, docs

Signed-off-by: samueladebisi-dev <218522909+samueladebisi-dev@users.noreply.github.com>

* audit: Gemini CLI reader takes its tmp, a project's or its chats folder as ROOT, and refuses any other

Signed-off-by: samueladebisi-dev <218522909+samueladebisi-dev@users.noreply.github.com>

---------

Signed-off-by: samueladebisi-dev <218522909+samueladebisi-dev@users.noreply.github.com>
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