Skip to content

Audit findings: toolbox gates and text dispatch split out, decide_and_run as named steps - #96

Merged
blockmandev merged 1 commit into
mainfrom
refactor/audit-toolbox
Nov 15, 2026
Merged

blockmandev merged 1 commit into
mainfrom
refactor/audit-toolbox

Conversation

@blockmandev

Copy link
Copy Markdown
Member

Audit findings: toolbox gates and text dispatch split out, decide_and_run as named steps

The code auditor's four approved findings:

  • toolbox/mod.rs was 2680 lines (limit 2500); it is 2375. The permission
    gates (the rules, the mode, the person to ask, the memory engine) moved
    unchanged to toolbox/gates.rs, and the text tools' dispatch to
    toolbox/dispatch.rs.
  • decide_and_run was 266 lines. It is now the gate sequence alone, each
    gate a named step: admit (the free checks), guard_protected,
    announce_or_refuse, tell_guards_said_yes and with_guidance. The order
    is unchanged.
  • dispatch_text had a complexity of 38. It is now three tables by family
    (file, session, memory tools) and the modules that own the rest; the
    shell, document conversion and recorder arms are helpers of their own.
  • fake_agy_child (test) was 102 lines: its no-server answer, the server
    start and the JSON-RPC pipe are helpers.

cargo clippy --all-targets: clean. cargo test --lib: 2284 passed, 0 failed.

…_run as named steps

The code auditor's four approved findings:

- toolbox/mod.rs was 2680 lines (limit 2500); it is 2375. The permission
  gates (the rules, the mode, the person to ask, the memory engine) moved
  unchanged to toolbox/gates.rs, and the text tools' dispatch to
  toolbox/dispatch.rs.
- decide_and_run was 266 lines. It is now the gate sequence alone, each
  gate a named step: admit (the free checks), guard_protected,
  announce_or_refuse, tell_guards_said_yes and with_guidance. The order
  is unchanged.
- dispatch_text had a complexity of 38. It is now three tables by family
  (file, session, memory tools) and the modules that own the rest; the
  shell, document conversion and recorder arms are helpers of their own.
- fake_agy_child (test) was 102 lines: its no-server answer, the server
  start and the JSON-RPC pipe are helpers.

cargo clippy --all-targets: clean. cargo test --lib: 2284 passed, 0 failed.
@blockmandev
blockmandev merged commit 812013d into main Nov 15, 2026
12 checks passed
blockmandev added a commit that referenced this pull request Nov 15, 2026
…ls and PluginCall (#99)

* plugins: the memory engine's plugin tool servers offered as PluginTools and PluginCall

The second half of the Claude-plugins work (the first, reading plugins in
the .claude-plugin layout, is #83). The owner's decision of 2026-10-30:
build the incode side now, tested against a fake engine, and say plainly
when a plugin's server answers 401 (blocked on sign-in) instead of
failing silently.

- The memory engine runs plugin MCP servers for the owner. A session asks
  it once for the index (incord_describe) and offers two tools: PluginTools
  (one line per server; a server's tools on request) and PluginCall (run
  one). An index, not every tool, per the engine owner's decision: every
  plugin's tools in the context cost 8,029 tokens more.
- Both are Reach::Run, like every MCP tool: refused read-only, asked under
  prompt, refused when the engine cannot decide.
- A server a local plugin already runs is left out of the index, so no
  server is started twice. Plugin skills are read from the engine too.
- Not offered when the engine names no servers or does not answer.

This was left uncommitted on 2026-10-30 in the claude-plugins worktree;
it is ported onto current main (the one conflict was the module list in
toolbox/mod.rs after #96).

cargo clippy --all-targets: clean. cargo test --lib: 2290 passed, 0
failed, including the 5 engine_plugins tests against a fake engine. The
ignored live test against the real engine passed here: it described the
inbrowse server's 43 tools.

* plugins: engine_plugins_tests formatted with rustfmt
@blockmandev
blockmandev deleted the refactor/audit-toolbox branch November 15, 2026 20:29
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