Skip to content

Add: SecureState secret Keychain dogfood - #27

Merged
0xLeif merged 3 commits into
mainfrom
cursor/issue-16-secure-state
Jul 18, 2026
Merged

0xLeif merged 3 commits into
mainfrom
cursor/issue-16-secure-state

Conversation

@0xLeif

@0xLeif 0xLeif commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds fixed demo key secret backed by AppState SecureState (Keychain account dev.leif.aps/secret); reset deletes the item
  • Brings SecureState into 0.x scope in GOAL.md and documents macOS / Linux / headless CI Keychain availability in README
  • Updates specs, Darwin smoke coverage, and SpecSync change CHG-0007 (Closes SecureState (Keychain) dogfood key聽#16)

Test plan

  • fledge lanes run verify (build + test + smoke)
  • specsync check passes
  • macOS SecretState round-trip and reset-deletion tests
  • Linux CI: secret listed in keys; set secret fails with Keychain-unavailable (smoke branch)

Made with Cursor

@cursor

cursor Bot commented Jul 18, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@0xLeif 0xLeif mentioned this pull request Jul 18, 2026
4 tasks

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃挕 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ea3794f84

鈩癸笍 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".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/aps/DemoKey.swift
Comment thread Tests/apsTests/APSTests.swift Outdated

@0xLeif 0xLeif left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review from local verification (detached worktree at 9ea3794). Code is approve-worthy; merge is blocked on mechanics, not implementation.

What verified green locally

  • swift build clean, 30/30 tests (incl. real-Keychain round-trip/reset/persistence), smoke.sh pass (Darwin secret branch), fledge lanes run verify pass
  • specsync check --force (45/45 exports) and specsync change check (CHG-0007 evidence exact) pass
  • AppState API conformance verified against the checkout: secureState(initial:feature:id:), scope key dev.leif.aps/secret matches the read-back check, reset(secureState:) deletes the item, all Security symbols #if canImport(Security)-gated with APSError.keychainUnavailable on Linux. The Linux error path looks correct by inspection (set throws -> ValidationError -> non-zero; get/reset degrade cleanly).

Merge blockers (mechanics)

  1. CONFLICTING on 5 SpecSync artifacts vs current main: .specsync/change-sequence.json (branch seq 7 vs main seq 9+) and the CHG-0004 ceremony JSONs (approvals/state/verification/verification-attempts). Fix: rebase onto main; take main's change-sequence.json and CHG-0004 files as the resolution base, then re-run the ceremony to regenerate (renumber to the next free CHG id; do not hand-merge approval digests).
  2. No CI evidence: zero check-runs on the head commit. All three workflows must report green.

Risks and nits

  • Keychain on the self-hosted runner is unproven: the new smoke step set secret "smoke-secret" fails the whole job if the runner's login Keychain is locked/inaccessible (read-back persistenceFailed). Worth confirming the runner state before trusting the first green.
  • Test Keychain hygiene: Darwin tests write the real login Keychain item dev.leif.aps/secret; setUp resets but there is no tearDown, and the last secret test leaves "rotated" behind. Add a tearDown reset for symmetry with the UserDefaults isolation that just landed in #22.
  • Process: reopening CHG-0003/CHG-0004 to amend GOAL.md scope is what inflates this diff and guarantees conflicts; GOAL scope edits would have been cheaper inside CHG-0007 alone.

Once rebased with CI green, this merges.

0xLeif and others added 3 commits July 18, 2026 14:37
Wire demo key secret through AppState SecureState (Darwin Keychain),
document Linux keychainUnavailable, and land SpecSync CHG-0012.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@0xLeif
0xLeif force-pushed the cursor/issue-16-secure-state branch from 9ea3794 to 991352d Compare July 18, 2026 20:40
@0xLeif
0xLeif merged commit 3ced68a into main Jul 18, 2026
1 of 3 checks passed
@0xLeif
0xLeif deleted the cursor/issue-16-secure-state branch July 18, 2026 20:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃挕 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 991352df19

鈩癸笍 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".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Scripts/smoke.sh
Comment on lines +44 to +47
"$bin" set secret "smoke-secret" >/dev/null
test "$("$bin" get secret)" = "smoke-secret"
"$bin" get secret --json | grep -q '"storage" : "SecureState"'
"$bin" reset secret >/dev/null

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the existing Keychain item in smoke

When this smoke path runs on Darwin and the fixed dev.leif.aps/secret Keychain account already contains a real value, the script overwrites it with smoke-secret and then deletes it. The surrounding smoke setup isolates FileState with a temp APS_HOME, but SecureState ignores that directory and uses the global account, so running ./Scripts/smoke.sh or the macOS CI smoke can erase a developer/runner's existing aps set secret value; save and restore the prior item or use an isolated test account.

Useful? React with 馃憤聽/ 馃憥.

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.

SecureState (Keychain) dogfood key

1 participant