Skip to content

Ignore untrusted project device trust; allowlist permission merge (O56) - #74

Merged
QiaolongLi1201 merged 1 commit into
mainfrom
fix/o56-untrusted-permissions-v2
Oct 11, 2026
Merged

QiaolongLi1201 merged 1 commit into
mainfrom
fix/o56-untrusted-permissions-v2

Conversation

@QiaolongLi1201

Copy link
Copy Markdown
Collaborator

Implements backlog O56. Depends on #69 (based on its head 5e91afae; diff vs main will shrink once #69 merges).

Problem

In an untrusted folder, project .moss/config.json permissions.deviceTrust: 'full' and permissions.trustedDevices passed through mergePermissionsConfig (which spread ...project), opening the device-trust gate.

Fix: allowlist merge — every PermissionsConfig field

mergePermissionsConfig no longer spreads the project; it builds the result from an explicit table checked with satisfies Record<keyof PermissionsConfig, unknown>, so a new field fails the build until it is handled. Unknown project keys are dropped.

Field Untrusted folder Trusted folder
defaultMode dropped (recorded in droppedProjectPermissions) user value wins when set; project used only when user unset (unchanged)
allow dropped when non-empty (recorded) union with user (unchanged)
ask union (only tightens) union
deny union (only tightens) union
deviceTrust any value dropped (recorded) project full never applies; project gated tightens user full
trustedDevices dropped (recorded) intersection with user's list; no user list ⇒ project list ignored

No changes under src/safety.

Note for review: trusted-folder defaultMode when the user has none set still takes the project value (pre-existing behaviour, not changed here). trustedTools union is handled separately in the O55 PR stacked on this one.

Tests

test/o56-untrusted-permissions.spec.mjs (adapted from QA repro qa-repro-o54-o56.spec.mjs, plus trusted-folder and allowlist cases), 10 cases.

  • On 5e91afae (src reverted, rebuilt): 7 FAIL (both QA O56 cases, recording, trusted deviceTrust ×2, trusted trustedDevices, allowlist); 3 PASS (O54 anti-regression ×2, gated-tightens).
  • With fix: 10/10 PASS.
  • Full npm run verify on macOS, Node 25.9, all MOSS_* / *_API_KEY unset, pyte layout ran ([tui-layout] 74/74 passed): exit 0.

Supersedes #70 (rebased onto b8a4e4b).

…ion merge (O56)

Untrusted folders drop project permissions.deviceTrust and
permissions.trustedDevices. mergePermissionsConfig no longer spreads the
project block: every PermissionsConfig field is handled explicitly and a
project may only tighten the user (deviceTrust full never comes from a
project; trustedDevices is intersected with the user's list).
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@QiaolongLi1201
QiaolongLi1201 merged commit cbde388 into main Oct 11, 2026
10 of 12 checks passed
@QiaolongLi1201
QiaolongLi1201 deleted the fix/o56-untrusted-permissions-v2 branch October 12, 2026 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant