Repository navigation
test(backend): pin the legacy internal trust passthrough when no mode is declared (TASK-111) - #1837
Merged
Merged
Conversation
samxu01
force-pushed
the
kai/broker-legacy-trust-no-mode
branch
from
September 23, 2026 09:12
ea04efb to
1a0424d
Compare
…de is declared (TASK-111)
The confinement predicate's legacy mapping (`internal` -> `public`) was only
ever exercised beside a declared mode, so in every existing case a mode check
could carry the assertion on its own. With no mode declared the mapping is the
ONLY gate on the record: `{ sandbox: { trust: 'internal' } }` must let the
broker through, because the daemon derives the mode per host. That makes it the
easiest part of the predicate to break silently.
Adds the table row, plus a focused test that asserts the passthrough AND the
neighbouring `private` refusal, so the case cannot be satisfied by dropping the
trust check altogether.
It is also the regression guard TASK-111's fix has to preserve: refusing an
absent sandbox on a non-daemon seat must not start refusing a legacy record
that a daemon will confine.
Mutation-proved 3/3 (/tmp/kai111-ledger.py): mapping removed; absent mode made
a refusal; trust check dropped. Clean tree: 0 failure lines, 43/43. Full
backend suite 421 suites / 3853 passed; lint:ts 0 errors.
lilyshen0722
force-pushed
the
kai/broker-legacy-trust-no-mode
branch
from
September 23, 2026 09:33
1a0424d to
ea3c42b
Compare
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.
A test-only addition, requested in the pod, closing a real coverage gap in the grant-broker confinement predicate.
The gap.
effectiveSandboxTrustmaps the legacyinternaltrust topublicviaLEGACY_SANDBOX_TRUST. Every existing case that exercises it pairs it with a declared mode ({ mode: 'workspace', trust: 'internal' }in both the table and the binding test), so the mode check carries those assertions on its own. With no mode declared, the mapping is the only gate on the record — and{ trust: 'internal' }must pass the broker through, because an absent mode is the daemon's input: it derives the mode per host. Remove or misread the mapping and a seat the daemon will confine silently loses the broker.What this adds.
a legacy internal trust with no declared mode — the mapping is the only gate, expecting no refusal;{ trust: 'internal' }passes, and the neighbouring{ trust: 'private' }still refuses assandbox_trust_not_public, so the passthrough cannot be satisfied by dropping the trust check altogether.Why it belongs beside TASK-111. That row's fix has to refuse an absent sandbox on a seat with no daemon guaranteeing confinement. This case is the boundary it must not cross while doing so: an absent mode on a legacy record is not an absent sandbox, and refusing it would take the broker away from seats a daemon will confine anyway.
Verification. Mutation-proved 3/3 (
/tmp/kai111-ledger.py): the mapping removed; an absent mode made a refusal; the trust check dropped — each reddens the test that owns it. Clean-tree baseline: 0 failure lines, 43/43 passed, exit 0. Full backend suite 421 suites passed (6 skipped), 3853 passed, 3877 total, exit 0;lint:ts0 errors (1210 warnings, the standing count). Backend-only, so no version slot.