Repository navigation
refactor(broker): delete duplicate broker core, unify governance floor onto exec-broker (reconciliation R4) - #311
Merged
Conversation
…r onto exec-broker (reconciliation R4)
Removes the parallel scope core (src/broker/{scope,decide,needs}.ts) that
shadowed the canonical src/exec-broker/. The governance-floor scope check
(withGovernance.scopeNeeds) now reads the SAME signed source as the PreToolUse
gates — profileBrokerPolicy — via the new exec-broker/scope-needs.ts, using the
shared pure decisions (checkEgress/checkFsWrite) and policyFsRoots. kit doctor's
exec-broker posture row is likewise sourced from profileBrokerPolicy, preserving
the honest warn(unsigned)/fail(invalid/revoked/malformed) split via
verifyProfileSignature.
Behavior preserved (same denial messages, same fail-closed semantics). Leaves one
broker: src/exec-broker/* (canonical decisions + signed profile-policy provider),
with the gates, governance-floor scope check, kit doctor row, and host-extractor
(src/broker/extract.ts, kept) as the surfaces on top. Full suite 2698 pass / 0 fail.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
|
✅ Docker image built successfully
|
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.
Reconciliation R4 — one broker
Deletes the parallel scope core (
src/broker/{scope,decide,needs}.ts+ their tests) that shadowed the canonicalsrc/exec-broker/, and routes the last consumers onto the canonical, signed provider.What changed
src/exec-broker/scope-needs.ts— the governance-floor scope check (withGovernance.scopeNeeds) reimplemented on the SAME signed source the PreToolUse gates use (profileBrokerPolicy) + the shared pure decisions (checkEgress/checkFsWrite) +policyFsRoots. Same signature, same denial messages, same fail-closed semantics (none → advisory unchanged; declared-but-unsigned/tampered → deny; verified → per-need check).governance-middleware.ts— importscheckScopeNeeds/ScopeNeedsfrom the new module instead ofbroker/needs.js.doctor.ts— theexec-broker scopeposture row now readsprofileBrokerPolicy, preserving the honest warn(unsigned)/fail(invalid·revoked·malformed) split via a guardedverifyProfileSignature.src/broker/scope.ts,src/broker/decide.ts,src/broker/needs.tsand their tests;broker/needs.test.ts→exec-broker/scope-needs.test.ts.src/broker/extract.ts(conservative host extraction) — still the gate's URL parser.Result
One broker:
src/exec-broker/*— canonical pure decisions + the signedprofile-policyprovider. On top of it sit the PreToolUse gates (R3), the governance-floor scope check, thekit doctorposture row, and the host-extractor. No behavior change for users.Verification
tsc --noEmitclean ·eslint src0 errors (pre-existing complexity warnings only) ·npm run buildcleanFollow-up: R5 updates
pillar3-exec-broker-5.0.md/ the North Star notes to describe the unified module.Still deferred (separate product decision, flagged in kit-research #32): whether
runBrokeredshould consume the signed profile scope for the MCP runtime — requires the governed MCP ops to declare their effects first, which would otherwise fail-closed-deny them (breaking).🤖 Generated with Claude Code
https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
Generated by Claude Code