Skip to content

P5 O10 follow-up: the device's keys out of Time Machine, with a creation mark for O8 - #244

Merged
SSFSKIM merged 3 commits into
masterfrom
p5-o10-device-key-backup
Oct 28, 2026
Merged

SSFSKIM merged 3 commits into
masterfrom
p5-o10-device-key-backup

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 28, 2026

Copy link
Copy Markdown
Owner

A P5 O10 follow-up for O8. This keeps the device's key directory out of Time Machine, and records in keys.json whether the keys were created after that exclusion was in place.

Why

Under O8, the app's device becomes an org root. The org's recovery key is the root's backup (remote layer Decision Log 28), so the root key must not also be backed up by Time Machine. A key created before this change may already be in a backup. O8 makes such a key re-register before it can become a root, and it reads the mark added here to decide.

What it does

  • src/main/device/backup-exclusion.ts.
    • Sets NSURLIsExcludedFromBackupKey on <profile>/device/ through osascript's Objective-C bridge. This sends no Apple Event and raises no TCC or admin prompt.
    • osascript's argv is -l JavaScript -e <script> -- <absolute path>, so a path that starts with -e is passed as data, not as script.
    • Does nothing off macOS.
    • A failure, or a 5 s timeout, is logged in one line and the key load carries on.
  • loadDeviceKeys applies the exclusion on every load.
    • It runs after the directory passes its permission checks and before the first write.
    • It targets the directory rather than the file, because the key is written under a temporary name and then linked into place.
    • Running on every load also covers keys written before this change.
  • excludedFromBackupAtCreation: true is the field O8 reads.
    • It sits at the top level of keys.json and is returned as DeviceKeys.excludedFromBackupAtCreation.
    • It is written only when the file is created, and only if the exclusion reported success before the keys were generated. A timeout counts as not set.
    • It is never written as false, and an existing file never gains it.
    • version stays 1.
  • Why osascript and not tmutil addexclusion: tmutil addexclusion took 11 s per call on this Mac. osascript sets the same attribute in about 0.1 s.
  • Decision Log: the O10 spec has two entries for this change.

Validation Evidence

Residue

  • loadDeviceKeys has no production caller on master yet, so the app doesn't run this until the caller lands (M10 or O8).

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)

Every load sets NSURLIsExcludedFromBackupKey on the device directory, before a first load writes keys.json, through osascript's Objective-C bridge (no prompt; tmutil waits on backupd, 11 s a call here). macOS only; a failure is logged in one line and the load goes on. O10 Decision Log entry added.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…BackupAtCreation, for O8)

keys.json carries excludedFromBackupAtCreation: true only when the device/ exclusion was set before the keys were made; an older key, one made while the exclusion failed, or one made off macOS has no mark, and a later exclusion never adds it. DeviceKeys returns it for O8, which re-registers an unmarked key before it can be an org root. O10 Decision Log entry added.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…fter --

A relative path beginning -e was read as one more script, whose own run could answer true for a directory never excluded and so give new keys the creation mark (review finding).

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T01:58:58.231304Z 4a3e954 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SSFSKIM
SSFSKIM merged commit aa8fab7 into master Oct 28, 2026
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
…8 reads excludedFromBackupAtCreation

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)

# Conflicts:
#	docs/doperpowers/plans/2026-10-27-p5-o10-endpoint.md
SSFSKIM added a commit that referenced this pull request Oct 28, 2026
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
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