Skip to content

Commit 75ed565

Browse files
committed
Mediate tool authority and subprocess execution
Completes M10 with exact attributable policy decisions, bounded credential-free command execution, durable redacted outcomes, immutable custom commands, and an out-of-process plugin contract. Change-Log: CL-20260730-056 Dev-Log: DL-20260730-057
1 parent 4c4afd0 commit 75ed565

21 files changed

Lines changed: 3226 additions & 63 deletions

CHANGELOG

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,29 @@ Dev-Log:
3030

3131
Entries
3232
-------
33+
Change-ID: CL-20260730-056
34+
Date: 2026-07-30
35+
Type: Mediated tools, permissions, and subprocess execution
36+
Request-or-TODO: M10-001 through M10-059 and M10-G01 through M10-G03
37+
Outcome: Added a versioned typed tool protocol, exact task authority policy,
38+
controlled subprocess runner, immutable permission/custom-command records,
39+
and durable command outcome/output storage
40+
Affected-behavior: Repository reads and confined edits have explicit policy
41+
classes; network, dependency, external, credential, destructive, privileged,
42+
and communication effects require exact attributable authority. Commands use
43+
argument arrays, confined working directories, credential-free allowlisted
44+
environments, bounded timeouts, process-tree cancellation, and redacted
45+
bounded output. Denials remain capability-scoped across tool substitution.
46+
Compatibility-or-migration: Adds migration 000007 for per-run tool schema,
47+
exact permission metadata and one-use consumption, immutable reviewed custom
48+
commands, and command execution outcome metadata; schema version advances to
49+
7. Arbitrary in-process plugins and a marketplace remain deliberately
50+
deferred.
51+
Verification: Migration and generation checks, lint, focused executor/storage
52+
suites, security suite, and full local test-all pass. Platform process-tree
53+
behavior is exercised by the public Windows, Ubuntu, and macOS CI matrix.
54+
Dev-Log: DL-20260730-057
55+
3356
Change-ID: CL-20260730-055
3457
Date: 2026-07-30
3558
Type: Cross-platform worktree path correction

DEVLOG

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,49 @@ Next-safe-step:
2424

2525
Entries
2626
-------
27+
Dev-Log: DL-20260730-057
28+
Date: 2026-07-30
29+
Status: Complete
30+
Change-ID: CL-20260730-056
31+
Request-or-TODO: M10-001 through M10-059 and M10-G01 through M10-G03
32+
Goal: Let workers inspect, edit, and validate repositories through typed tools
33+
without ambient or unattributed authority
34+
Assumptions: M10 owns policy and the subprocess boundary; M11 will wire these
35+
ports into authenticated worker lifecycle, and M16 will expose approval and
36+
progress state through the GWC interface
37+
Decisions: Derive authority from typed side effects and exact command arrays,
38+
never from untrusted descriptions or claimed class. Bind grants to task,
39+
working directory, arguments, and effects; bind denials to capability and
40+
scope so changing tool names cannot regain authority. Require an attribution
41+
identifier for every executable task-scoped classification. Launch direct
42+
argument arrays in canonical task directories, pass only allowlisted
43+
non-secret environment variables, terminate process trees on timeout or
44+
cancellation, and redact before bounded persistence/display. Store custom
45+
commands as immutable typed templates after repository-source first-use
46+
approval. Define future plugins only as separately launched JSON-RPC/MCP
47+
subprocesses; do not load arbitrary code or build a marketplace.
48+
Files-or-schemas: Executor tool protocol, policy, command runner, platform
49+
process-tree helpers, plugin boundary, and tests; storage repositories/tests
50+
for tool schemas, permission decisions, custom commands, command lifecycle,
51+
and redacted output; migration 000007; generated migration/build metadata;
52+
M10 checklist evidence and ledgers
53+
Validation: Focused executor/storage tests, migration-check, generate-check,
54+
lint, security tests, and full local test-all pass. Tests cover exact grants,
55+
expiry, isolation, denial substitution, malicious display descriptions,
56+
credential stripping, output bounds/redaction, timeout/cancel trees,
57+
reviewed immutable templates, idempotency, and optimistic lifecycle writes.
58+
Failures-or-discarded-approaches: Trusting the request's authority label,
59+
shell-concatenated commands, ambient coordinator environments, raw plugin
60+
secrets, repository-loaded code, mutable custom commands, and unbounded
61+
output were rejected. Effect classification was made order-independent so a
62+
reordered declaration cannot select weaker authority.
63+
Known-limitations: Workspace confinement is mediation, not a perfect OS
64+
sandbox. Live coordinator/worker wiring belongs to M11, provider calls to
65+
M12, and browser presentation/E2E to M16-M20.
66+
Next-safe-step: Implement M11 coordinator startup, single-instance ownership,
67+
authenticated worker protocol, heartbeats, scheduling, shutdown, and crash
68+
recovery without broadening the M10 authority boundary.
69+
2770
Dev-Log: DL-20260730-056
2871
Date: 2026-07-30
2972
Status: Complete

TODOS.md

Lines changed: 78 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,83 +1678,99 @@ Milestone output: a typed tool protocol, executable permission policy, controlle
16781678

16791679
## Tool Protocol
16801680

1681-
- [ ] `M10-001 BLOCKER` Define a typed internal tool request and result envelope.
1682-
- [ ] `M10-002` Include tool name, arguments, working directory, timeout, authority class, idempotency, and expected side effects.
1683-
- [ ] `M10-003` Define read-file and list-directory tools.
1684-
- [ ] `M10-004` Define symbol/search tools.
1685-
- [ ] `M10-005` Define structured edit tools.
1686-
- [ ] `M10-006` Define diff-inspection tools.
1687-
- [ ] `M10-007` Define command-execution tools.
1688-
- [ ] `M10-008` Define Git-status and history tools.
1689-
- [ ] `M10-009` Define test, build, format, and static-analysis wrappers.
1690-
- [ ] `M10-010` Define user-facing tool summaries.
1691-
- [ ] `M10-011` Version tool schemas and record the version per run.
1681+
- [x] `M10-001 BLOCKER` Define a typed internal tool request and result envelope.
1682+
- [x] `M10-002` Include tool name, arguments, working directory, timeout, authority class, idempotency, and expected side effects.
1683+
- [x] `M10-003` Define read-file and list-directory tools.
1684+
- [x] `M10-004` Define symbol/search tools.
1685+
- [x] `M10-005` Define structured edit tools.
1686+
- [x] `M10-006` Define diff-inspection tools.
1687+
- [x] `M10-007` Define command-execution tools.
1688+
- [x] `M10-008` Define Git-status and history tools.
1689+
- [x] `M10-009` Define test, build, format, and static-analysis wrappers.
1690+
- [x] `M10-010` Define user-facing tool summaries.
1691+
- [x] `M10-011` Version tool schemas and record the version per run.
16921692

16931693
## Permission Policy
16941694

1695-
- [ ] `M10-012 BLOCKER SECURITY` Define automatic read-only actions.
1696-
- [ ] `M10-013 BLOCKER SECURITY` Define task-scoped file-write actions.
1697-
- [ ] `M10-014 BLOCKER SECURITY` Define approval-required actions.
1698-
- [ ] `M10-015 SECURITY` Classify network access.
1699-
- [ ] `M10-016 SECURITY` Classify dependency installation.
1700-
- [ ] `M10-017 SECURITY` Classify writes outside the task worktree.
1701-
- [ ] `M10-018 SECURITY` Classify credential access.
1702-
- [ ] `M10-019 SECURITY` Classify destructive filesystem and Git actions.
1703-
- [ ] `M10-020 SECURITY` Classify privileged commands and process management.
1704-
- [ ] `M10-021 SECURITY` Classify external messaging, deployment, and publication.
1705-
- [ ] `M10-022 SECURITY` Refuse actions with unknown authority classes.
1706-
- [ ] `M10-023 SECURITY` Bind allow-for-task decisions to exact action patterns and scope.
1707-
- [ ] `M10-024 SECURITY` Expire task-scoped permissions when the task ends.
1708-
- [ ] `M10-025 SECURITY` Never infer permission from prior unrelated tasks.
1709-
- [ ] `M10-026 SECURITY` Record requester, reason, exact command/action, scope, decision, and time.
1695+
- [x] `M10-012 BLOCKER SECURITY` Define automatic read-only actions.
1696+
- [x] `M10-013 BLOCKER SECURITY` Define task-scoped file-write actions.
1697+
- [x] `M10-014 BLOCKER SECURITY` Define approval-required actions.
1698+
- [x] `M10-015 SECURITY` Classify network access.
1699+
- [x] `M10-016 SECURITY` Classify dependency installation.
1700+
- [x] `M10-017 SECURITY` Classify writes outside the task worktree.
1701+
- [x] `M10-018 SECURITY` Classify credential access.
1702+
- [x] `M10-019 SECURITY` Classify destructive filesystem and Git actions.
1703+
- [x] `M10-020 SECURITY` Classify privileged commands and process management.
1704+
- [x] `M10-021 SECURITY` Classify external messaging, deployment, and publication.
1705+
- [x] `M10-022 SECURITY` Refuse actions with unknown authority classes.
1706+
- [x] `M10-023 SECURITY` Bind allow-for-task decisions to exact action patterns and scope.
1707+
- [x] `M10-024 SECURITY` Expire task-scoped permissions when the task ends.
1708+
- [x] `M10-025 SECURITY` Never infer permission from prior unrelated tasks.
1709+
- [x] `M10-026 SECURITY` Record requester, reason, exact command/action, scope, decision, and time.
17101710

17111711
## Command Execution
17121712

1713-
- [ ] `M10-027 BLOCKER` Execute commands in the task worker, not the browser.
1714-
- [ ] `M10-028` Pass argument arrays instead of concatenated shell strings where possible.
1715-
- [ ] `M10-029` Set the task worktree as the default working directory.
1716-
- [ ] `M10-030` Validate working directories against task scope.
1717-
- [ ] `M10-031` Apply bounded timeouts.
1718-
- [ ] `M10-032` Support cooperative cancellation.
1719-
- [ ] `M10-033` Kill descendant processes on cancellation where the platform permits.
1720-
- [ ] `M10-034` Bound stdout and stderr capture.
1721-
- [ ] `M10-035` Stream redacted progress without persisting unbounded output.
1722-
- [ ] `M10-036` Preserve exit code, duration, timeout, cancellation, and truncation metadata.
1723-
- [ ] `M10-037` Separate environment allowlists from the coordinator environment.
1724-
- [ ] `M10-038` Remove provider credentials from worker environments.
1725-
- [ ] `M10-039` Record executable identity and resolved path.
1726-
- [ ] `M10-040` Detect commands that exceed approved scope.
1727-
- [ ] `M10-041` Provide a user-readable approval description.
1728-
- [ ] `M10-042` Provide allow-once, allow-for-task, and deny.
1729-
- [ ] `M10-043` Do not silently fall back after denial.
1713+
- [x] `M10-027 BLOCKER` Execute commands in the task worker, not the browser.
1714+
- [x] `M10-028` Pass argument arrays instead of concatenated shell strings where possible.
1715+
- [x] `M10-029` Set the task worktree as the default working directory.
1716+
- [x] `M10-030` Validate working directories against task scope.
1717+
- [x] `M10-031` Apply bounded timeouts.
1718+
- [x] `M10-032` Support cooperative cancellation.
1719+
- [x] `M10-033` Kill descendant processes on cancellation where the platform permits.
1720+
- [x] `M10-034` Bound stdout and stderr capture.
1721+
- [x] `M10-035` Stream redacted progress without persisting unbounded output.
1722+
- [x] `M10-036` Preserve exit code, duration, timeout, cancellation, and truncation metadata.
1723+
- [x] `M10-037` Separate environment allowlists from the coordinator environment.
1724+
- [x] `M10-038` Remove provider credentials from worker environments.
1725+
- [x] `M10-039` Record executable identity and resolved path.
1726+
- [x] `M10-040` Detect commands that exceed approved scope.
1727+
- [x] `M10-041` Provide a user-readable approval description.
1728+
- [x] `M10-042` Provide allow-once, allow-for-task, and deny.
1729+
- [x] `M10-043` Do not silently fall back after denial.
17301730

17311731
## Custom Commands and Plugins
17321732

1733-
- [ ] `M10-044` Store approved custom command definitions in SQLite.
1734-
- [ ] `M10-045` Represent custom command arguments as arrays with typed placeholders.
1735-
- [ ] `M10-046` Require first-use approval for repository-suggested commands.
1736-
- [ ] `M10-047` Record command version and source.
1737-
- [ ] `M10-048` Define the subprocess boundary for future MCP or JSON-RPC plugins.
1738-
- [ ] `M10-049 DEFER` Do not load arbitrary plugin code into the coordinator.
1739-
- [ ] `M10-050 DEFER` Do not implement a plugin marketplace in the prototype.
1733+
- [x] `M10-044` Store approved custom command definitions in SQLite.
1734+
- [x] `M10-045` Represent custom command arguments as arrays with typed placeholders.
1735+
- [x] `M10-046` Require first-use approval for repository-suggested commands.
1736+
- [x] `M10-047` Record command version and source.
1737+
- [x] `M10-048` Define the subprocess boundary for future MCP or JSON-RPC plugins.
1738+
- [x] `M10-049 DEFER` Do not load arbitrary plugin code into the coordinator.
1739+
- [x] `M10-050 DEFER` Do not implement a plugin marketplace in the prototype.
17401740

17411741
## Tests
17421742

1743-
- [ ] `M10-051 TEST` Test automatic read-only actions.
1744-
- [ ] `M10-052 TEST` Test task-scoped edits.
1745-
- [ ] `M10-053 TEST` Test network-command approval.
1746-
- [ ] `M10-054 TEST` Test dependency-install approval.
1747-
- [ ] `M10-055 TEST` Test destructive-command denial.
1748-
- [ ] `M10-056 TEST` Test allow-for-task scope expiration.
1749-
- [ ] `M10-057 TEST` Test timeout and process-tree cancellation.
1750-
- [ ] `M10-058 TEST` Test output truncation and redaction.
1751-
- [ ] `M10-059 TEST` Test a malicious command description cannot change the executed argument array.
1743+
- [x] `M10-051 TEST` Test automatic read-only actions.
1744+
- [x] `M10-052 TEST` Test task-scoped edits.
1745+
- [x] `M10-053 TEST` Test network-command approval.
1746+
- [x] `M10-054 TEST` Test dependency-install approval.
1747+
- [x] `M10-055 TEST` Test destructive-command denial.
1748+
- [x] `M10-056 TEST` Test allow-for-task scope expiration.
1749+
- [x] `M10-057 TEST` Test timeout and process-tree cancellation.
1750+
- [x] `M10-058 TEST` Test output truncation and redaction.
1751+
- [x] `M10-059 TEST` Test a malicious command description cannot change the executed argument array.
1752+
1753+
M10 test evidence:
1754+
1755+
- Typed-catalog and policy tests cover every tool family, unknown authority,
1756+
exact grants, one-use consumption, task expiry, cross-task isolation,
1757+
network/dependency/destructive classification, exact approved recipes, and
1758+
capability denial across tool substitution.
1759+
- Real subprocess tests cover absolute executable identity, array-only
1760+
arguments, confined working directories, minimal credential-free
1761+
environments, bounded redacted output/progress, cooperative cancellation,
1762+
timeouts, and representative descendant termination.
1763+
- SQLite tests cover immutable per-run schema bindings, attributable
1764+
permission facts, reviewed typed custom commands, optimistic command
1765+
lifecycle metadata, bounded redacted output, idempotency, and stale writes.
1766+
The plugin contract permits only versioned JSON-RPC or MCP subprocesses with
1767+
explicit filesystem, network, secret-reference, and side-effect scopes.
17521768

17531769
## Gate
17541770

1755-
- [ ] `M10-G01 GATE` Every non-automatic action has an attributable policy decision.
1756-
- [ ] `M10-G02 GATE` Denied authority cannot be regained through tool substitution.
1757-
- [ ] `M10-G03 GATE` Cancellation terminates representative child-process trees on every supported platform.
1771+
- [x] `M10-G01 GATE` Every non-automatic action has an attributable policy decision.
1772+
- [x] `M10-G02 GATE` Denied authority cannot be regained through tool substitution.
1773+
- [x] `M10-G03 GATE` Cancellation terminates representative child-process trees on every supported platform.
17581774

17591775
---
17601776

internal/buildinfo/versions_gen.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)