Repository navigation
feat(exec-broker): signed profile scope → BrokerPolicy bridge (reconciliation R2) - #309
Merged
Merged
Conversation
…iliation R2)
The exec-broker's original policy source is an UNSIGNED .kit-exec-broker.json. This adds the
canonical SIGNED source (design: pillar3-broker-reconciliation-5.0.md):
- exec-broker/profile-policy.ts: profileBrokerPolicy(cwd) → { regime, policy } mapping the
offline-verified profile [scope] (Pillar 4) onto a BrokerPolicy — egress.allow ← scope.egress,
fs roots ← scope.fs (resolved against cwd; default '.'), env.declared ← scope.secrets.
Fail-closed, mirroring the profile's own semantics: no [scope] → regime 'none' (imposes
nothing; caller may fall back to JSON or run unmediated); verified → 'active' with a governing
policy; declared-but-unsigned/tampered/malformed → 'active' with null (default-deny).
This is the shared signed provider the PreToolUse gates (R3) and kit doctor will consume, so the
one canonical broker can be driven by a cryptographically attributable source. Deliberately does
NOT change runBrokered's activation trigger — the MCP runtime picking up a signed scope interacts
with per-op effect-declaration (the 4 governed MCP ops declare none today) and is a separate
product decision, flagged in the reconciliation note. Never throws. 6 tests.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
|
✅ Docker image built successfully
|
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Reconciliation R2 (design:
kit-research/docs/research/pillar3-broker-reconciliation-5.0.md). The exec-broker's original policy source is an unsigned.kit-exec-broker.json. This adds the signed source: a bridge from the offline-verified profile[scope]/RoE (Pillar 4) to aBrokerPolicy, so the one canonical broker can be driven by a cryptographically attributable source. It's the shared provider the PreToolUse gates (R3) andkit doctorwill consume.Type of Change
Related Issues
Changes Made
src/exec-broker/profile-policy.ts—profileBrokerPolicy(cwd)→{ regime, policy, detail }:[scope]onto aBrokerPolicy(egress.allow ←scope.egress, fs roots ←scope.fsresolved against cwd, default.; env.declared ←scope.secrets);[scope]→ regimenone(imposes nothing — the caller may fall back to the JSON policy or run unmediated);[scope]verified → regimeactivewith a governing policy; declared-but-unsigned/tampered/malformed →activewith null policy (default-deny). Never throws.src/exec-broker/profile-policy.test.ts— 6 tests (none / no-scope / verified-mapping incl. multi-root fs / unsigned / tampered / fs-default-root), via a throwawayKIT_IDENTITY_DIR.Testing
Test Coverage
npm test) — full suite 2719 pass / 0 fail (2713 baseline + 6)Manual Testing
npx tsc --noEmit→ clean;npx eslint src→ 0 errors.npm run build && node scripts/test.mjs→ 2719 pass, 0 fail.Breaking Changes
None / N/A — new module; not yet wired into
runBrokered(see notes).Checklist
npm test)Performance Impact
Reviewer Notes
Deliberately does not change
runBrokered's activation trigger. The 4 governed MCP ops (tools.install/secrets.generate/fix/run) declare no effect contract today, so making a signed profile fliprunBrokeredto mediate would fail-closed-deny kit's own MCP tools under any signed scope — a real breaking interaction that's a separate product decision (flagged in the reconciliation note's open questions), not part of the dedup. R2 just provides the signed source; R3 points the PreToolUse gates at the canonicaldecisions.tsvia this bridge (removing the duplicate decision core), and R4 deletessrc/broker/scope.ts+needs.ts.🤖 Generated with Claude Code
https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
Generated by Claude Code