Conversation
One total function decides what happens to a tool: the permissive level, then blocks, then provenance, then the statement checks, then the filter level. Approval is read only from the trust bundle, never from the statement, and the APK hash is computed at most once and only when a rule actually needs it. DenyReason is closed and splits the approval failures apart, so a tool denied for the wrong reason fails the tests rather than passing them. Table-driven tests cover the milestone's unit threat rows and the boundaries the threat table does not name, including totality across every input combination.
brunoro
added this pull request to stack #221
September 23, 2026 08:50
brunoro
marked this pull request as ready for review
September 23, 2026 08:50
setup-android defaults its packages input to `tools platform-tools`. Google has removed the obsolete `tools` package, so sdkmanager cannot resolve it and the step fails before Gradle runs. Ask for platform-tools only.
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.
PR #188 added APK source stamps, establishing provenance from Light’s infrastructure. This PR adds signed JSON trust bundles, JVM code that verifies and stores them, and the policy that turns them into an install decision.
The trust bundle contains:
The store reconciles firmware-provided bundles, persisted bundles, and incoming updates supplied by callers. It keeps accepted state in memory; API integration follows later.
Changes
lightsigner bundle buildandbundle verify.:sdk:trust, rejecting duplicate keys, malformed fields, excessive nesting, and unsupported schema versions.LightTrustStoreand a persistence interface. Persist the signed bundle and its version floor as one record before changing in-memory state. Startup selects the highest verified stored/image version, with the image winning ties. Corrupt stored state is rejected rather than silently falling back.(imagePins ∪ trustedStampCerts) − revokedStampCerts. Revocation wins. Omitting an image pin cannot remove it; omitting a previously delegated certificate can remove its trust.LightInstallPolicy.decide, a total function over the stamp result, statement, platform-reported signer, APK hash, manifest version code, bundle and filter level. No clock, no filesystem, noContext, so the same function runs on device, in tests, and server-side."approved": truein a statement changes nothing.DenyReasonas a closed enum, splitting the approval failures intoNotApproved,BelowMinVersionandSignerNotApprovedForToolso a tool refused for the wrong reason fails its test.buildIdand identity-matched blocks are tried first, so a rule’s position in the bundle cannot decide whether the hash is paid for.ClientFilterLevelasLightTrustFilterLevel: a JVM module cannot depend on the Android:sdk:server, and subtask 07 would make the reverse edge a cycle.INSECURE-keys strictly for tests.Validation
uv run --with pytest python -m pytest signer/tests -q./gradlew :sdk:trust:check— 26 tests, covering the milestone’s unit threat rows, the boundaries the threat table does not name, the APK-hash laziness, and totality across every input combination../gradlew checkFollow-up
checkCert, the tool inbox, and the platform stamp verifier.ClientFilterLevelandLightTrustFilterLevelinto one enum in:sdk:sharedblockentry should win when several match the same APK (today it is bundle order, then identity matches over hash matches).