Repository navigation
feat(broker): fail-closed scope source + honest kit doctor line (Pillar 3 steps 2–3) - #304
Merged
Merged
Conversation
…ar 3 steps 2-3)
The broker's SCOPE comes from exactly one place: the profile's signed [scope]/RoE via
verifiedScope (Pillar 4). This adds the enforcement-facing wrapper + status surface
(design: pillar3-exec-broker-5.0.md §3.2):
- broker/decide.ts:
- brokerScope(cwd): never-throws — any error along the trust path (malformed profile,
unreadable sig, forged/revoked signature) resolves to null, and a null scope GRANTS
NOTHING. An exception in the trust path is a deny, not a bypass.
- brokerStatus(cwd): honest posture — verified (scope governs) / unsigned (declared but
not attributable — grants nothing) / invalid (tampered/revoked/malformed — grants
nothing) / none (no RoE declared).
- doctor.ts: 'exec-broker scope' check — pass (verified), skip (none, with how-to-arm hint),
warn (unsigned; run kit profile sign), fail (invalid). 'Enforced' must never silently mean
'no-op'; degradation is surfaced, never swallowed — same posture as the identity-keystore row.
8 tests via a throwaway KIT_IDENTITY_DIR (none/no-scope/unsigned/verified/tampered/malformed
for status; fail-closed null across absent/unsigned/tampered/malformed for brokerScope).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
|
✅ Docker image built successfully
|
This was referenced Jul 10, 2026
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
Steps 2–3 of the Pillar 3 exec-broker (design:
kit-research/docs/research/pillar3-exec-broker-5.0.md§3.2). The broker's SCOPE comes from exactly one place — the profile's signed[scope]/RoE — and this PR adds the enforcement-facing wrapper plus its honestkit doctorsurface. Still no enforcement (that's step 4, the PreToolUse gates).Type of Change
Related Issues
verifiedScope)Changes Made
src/broker/decide.ts:brokerScope(cwd)— never-throws: any error along the trust path (malformed profile, unreadable sig, forged/revoked signature) resolves tonull, and anullscope grants nothing. An exception in the trust path is a deny, not a bypass.brokerStatus(cwd)— honest posture:verified(scope governs) /unsigned(declared but not attributable — grants nothing) /invalid(tampered / revoked / malformed — grants nothing) /none(no RoE declared).src/doctor.ts—exec-broker scopecheck: pass (verified, with scope summary), skip (none, with a how-to-arm hint), warn (unsigned;run kit profile sign), fail (invalid). Same honest-degradation posture as the identity-keystore row: "enforced" must never silently mean "no-op".src/broker/decide.test.ts— 8 tests via a throwawayKIT_IDENTITY_DIR(status across none / no-scope / unsigned / verified / tampered / malformed;brokerScopefail-closednullacross absent / unsigned / tampered / malformed).Testing
Test Coverage
npm test) — full suite 2685 pass / 0 fail (2677 baseline + 8); doctor tests unaffected (name-based assertions)Manual Testing
npx tsc --noEmit→ clean.npx eslint src→ 0 errors.npm run build && node scripts/test.mjs→ 2685 pass, 0 fail.npx prettier --check→ formatted.Breaking Changes
None / N/A — new module + one additive doctor row.
Checklist
npm test)Performance Impact
kit doctorReviewer Notes
The distinction worth checking is
unsigned(warn) vsinvalid(fail) in doctor: a declared-but-unsigned scope is an incomplete setup (warn + actionable hint), while a tampered/revoked signature or malformed profile is a broken trust artifact (fail). Both grant nothing at enforcement time — the doctor severity only differentiates operator action. Next step (4): the PreToolUse enforcers (gate-egress/fs/secret) consumingbrokerScope+ the pure predicates from #303.🤖 Generated with Claude Code
https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
Generated by Claude Code