refactor(settings): derive the permission vocabulary from one declaration - #2625
Merged
Merged
Conversation
Size Report
Startup median (7 runs, lower is better):
|
Member
Author
|
Reviewed at ac6fc28. The code looks good: the permission vocabulary comes from one declaration, and the parsers, help fragments and client types derive from it without changing accepted names or errors. Smoke Tests runs Typecheck & Package fails with TS2353 on |
…tion packages/contracts/src/settings.ts now declares the settings permission actions, modes, app-scoped targets and macOS targets once, and the two parsers, the settings help fragments and its invalid-args message, the public client permission types, and the CLI's membership sets are built from those collections. Accepted names, normalization, error strings, help ordering and daemon positionals are unchanged; no surface widened what it accepts. The macOS action list stays a literal because it is a support fact owned by platform-apple. Part of #2614.
#2619 copied the snapshot helper manifest fixture after #2618 deleted `installArgs` from AndroidSnapshotHelperManifest, so the new fixture failed typecheck on main: the field is parsed by no one and the leniency case is already covered in snapshot-helper.test.ts. Repair for the breakage on main (2cafab3), unrelated to the settings vocabulary refactor it blocks here.
thymikee
force-pushed
the
t3code/implement-issue-2614
branch
2 times, most recently
from
September 15, 2026 09:52
ac6fc28 to
3aa6b46
Compare
|
This was referenced Sep 15, 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.
Summary
packages/contracts/src/settings.tsdeclares thesettings permissionvocabulary once — actions, modes, app-scoped targets, macOS targets — and the two parsers, the permission fragments ofsettingshelp and its invalid-args message, the public client permission types (viaimport type, soAppErrorstays off the client's runtime path) and the CLI's membership sets are built from it.Deleted: two
PermissionTargetunions, a module-local target array, 16 parser comparisons, two hand-written usage fragments, the CLI's 19 literal permission names, a duplicatedPermissionStatealias, and the macOS fragment restated incliDetail. Accepted names, case and whitespace normalization, error strings, help ordering and daemon positionals are unchanged; the mobile parser still refuses the macOS-only names, so nothing widened. Actions and modes are derived too — same duplication class, same owned files. The macOS<grant|reset>stays a literal: which actions macOS serves is a support fact owned byplatform-apple.Part of #2614. #2363 is still open, so this adds no
all; when it lands,allis one name inMOBILE_PERMISSION_TARGETSplus the fixed test literals.Validation
3aa6b46fa0:pnpm check:affected --rungreen — 3017 tests, with format, lint, typecheck, layering, fallow and build.check:production-exportsandcheck:command-docsreport nothing in the changed files.Characterization landed first, from fixed literals duplicated per test file so one edit cannot silence every witness. Issue replay: adding
face-timetoMOBILE_PERMISSION_TARGETSalone moved the parser, CLI membership, help fragment,cliDetailand the client type, and the fixed pins then failed (three runtime, twotoEqualTypeOf) rather than accepting it silently. Removed before the commit. A planted value import of./settings.tsinclient-settings.tsfails its canary.Coverage, Integration and the device replay lanes stay CI-authoritative on this head; no device evidence is claimed, as no platform or runner code changed.
Rebased onto main, which is itself red at
2cafab3ad0:installArgsinsnapshot-helper-install.test.ts:29no longer exists onAndroidSnapshotHelperManifest(#2619 copied the fixture after #2618 deleted the field). The second commit drops that stale field — nothing parses it, and the leniency case stays covered insnapshot-helper.test.ts:913. It is outside the #2614 family and can be split out; without it the typecheck gate here cannot run.