CC-46: Option-C tool-isolation knobs (strict MCP, mcp-config path, setting-sources, DontAsk) #48

Merged
mprihoda merged 12 commits from CC-46 into main 2026-04-22 06:44:55 +00:00
mprihoda commented 2026-04-21 20:39:32 +00:00 (Migrated from github.com)

Summary

Adds four CLI isolation knobs to the SDK so consumers (notably PROC-401) can spawn Claude Code subprocesses with a hard, non-inheritable tool allow-list:

  • QueryOptions.strictMcpConfig / SessionOptions.strictMcpConfig--strict-mcp-config
  • QueryOptions.mcpConfigPath / SessionOptions.mcpConfigPath--mcp-config <path> --
  • QueryOptions.settingSources / SessionOptions.settingSources--setting-sources <csv>
  • PermissionMode.DontAsk--permission-mode dontAsk

Each knob is purely additive: defaults preserve existing behaviour (no flag emitted). direct and effectful pick up the new fields automatically via type/val re-exports — no source edits required there.

Linked issue: #46

Changes

  • core/.../model/PermissionMode.scala — new DontAsk enum case with Scaladoc.
  • core/.../model/QueryOptions.scala / SessionOptions.scala — three new fields, Scaladoc, fluent with* helpers.
  • core/.../cli/CLIArgumentBuilder.scala — new branch + three translation blocks in both buildArgs and buildSessionArgs; argv order locked (permissionMode → strictMcpConfig → mcpConfigPath → settingSources).
  • core/test/.../cli/CLIArgumentBuilderTest.scala & SessionOptionsArgsTest.scala — 19 new unit tests (presence, absence, Some(false) non-emission, CSV join, -- terminator, deterministic ordering).

Testing

  • ./mill __.test — all tests pass (19 new unit tests for this feature)
  • ./mill core.compile / ./mill direct.compile / ./mill effectful.compile — clean, no warnings
  • Phase 01 passed code review after 2 iterations (0 critical remaining)

Review Artifacts

  • Review packet: project-management/issues/CC-46/review-packet.md
  • Implementation log: project-management/issues/CC-46/implementation-log.md
  • Phase 01 code review: project-management/issues/CC-46/review-phase-01-20260421-221853.md

Release Notes (CZ)

Viz project-management/issues/CC-46/release-notes.md — rozšiřuje SDK o čtyři volby pro plně izolovaný běh Claude Code s pevným allow-listem nástrojů. Výchozí chování se nemění; stávající volající nemusí nic upravovat.

🤖 Generated with Claude Code

## Summary Adds four CLI isolation knobs to the SDK so consumers (notably PROC-401) can spawn Claude Code subprocesses with a hard, non-inheritable tool allow-list: - `QueryOptions.strictMcpConfig` / `SessionOptions.strictMcpConfig` → `--strict-mcp-config` - `QueryOptions.mcpConfigPath` / `SessionOptions.mcpConfigPath` → `--mcp-config <path> --` - `QueryOptions.settingSources` / `SessionOptions.settingSources` → `--setting-sources <csv>` - `PermissionMode.DontAsk` → `--permission-mode dontAsk` Each knob is purely additive: defaults preserve existing behaviour (no flag emitted). `direct` and `effectful` pick up the new fields automatically via `type`/`val` re-exports — no source edits required there. Linked issue: #46 ## Changes - `core/.../model/PermissionMode.scala` — new `DontAsk` enum case with Scaladoc. - `core/.../model/QueryOptions.scala` / `SessionOptions.scala` — three new fields, Scaladoc, fluent `with*` helpers. - `core/.../cli/CLIArgumentBuilder.scala` — new branch + three translation blocks in both `buildArgs` and `buildSessionArgs`; argv order locked (`permissionMode → strictMcpConfig → mcpConfigPath → settingSources`). - `core/test/.../cli/CLIArgumentBuilderTest.scala` & `SessionOptionsArgsTest.scala` — 19 new unit tests (presence, absence, `Some(false)` non-emission, CSV join, `--` terminator, deterministic ordering). ## Testing - [x] `./mill __.test` — all tests pass (19 new unit tests for this feature) - [x] `./mill core.compile` / `./mill direct.compile` / `./mill effectful.compile` — clean, no warnings - [x] Phase 01 passed code review after 2 iterations (0 critical remaining) ## Review Artifacts - Review packet: `project-management/issues/CC-46/review-packet.md` - Implementation log: `project-management/issues/CC-46/implementation-log.md` - Phase 01 code review: `project-management/issues/CC-46/review-phase-01-20260421-221853.md` ## Release Notes (CZ) Viz `project-management/issues/CC-46/release-notes.md` — rozšiřuje SDK o čtyři volby pro plně izolovaný běh Claude Code s pevným allow-listem nástrojů. Výchozí chování se nemění; stávající volající nemusí nic upravovat. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/claude-code-query!48
No description provided.