Skip to content

#31/#13: round-3 promotion advice (denials at the cap, kept revocations, fixture isolation, busy on draft DB failure) - #41

Merged
lseongjoo merged 6 commits into
integration/issue-31from
claude/project-thread-snd6be
Nov 28, 2026
Merged

lseongjoo merged 6 commits into
integration/issue-31from
claude/project-thread-snd6be

Conversation

@lseongjoo

Copy link
Copy Markdown
Contributor

Addresses the round-3 promotion advice from #33 (P2-01..06, Claude P2-01/02, P-02, P-06) on top of integration/issue-31 6262d82.

Changes

  • AgentTrustStore near the size limit (16 MiB default):
    • Writes that are not denials (approval, key rotation, lastSeen, receipt on) past limit − 8 KiB keep only the revocations the file holds and are refused if they would grow it.
    • Denials fit only past limit − 1 KiB. Order: rows of the last intact file, then that file's own revocations, then the revocations this run saw saved earlier (both up to the limit), then user-asked revocations and others (up to limit − 1 KiB). Per-entry cost is now exact.
    • Revocations have no count cap, and known revocations are written back over restored copies.
  • P-02: if drafts.sqlite cannot be opened, agent drafts are answered busy and the tab says so. SQLite is closed once on a failed open.
  • Fixtures: TTS_FIXTURE_HOME isolated home and identifier. All fixtures run under sandbox-exec with stat snapshots. The speech log check never passes silently.
  • Logs: [AGENT-DRAFT] receipt … and [AGENT-SPEECH] request … (lengths only, no body or key IDs).

Evidence (Mac, HEAD 888eac7)

  • ./build.sh build and ./build.sh test exit 0 ("agent trust store tests passed", "All tests passed").
  • Fixtures under sandbox-exec: agent_app_connections 20/20 and persistent_pairing 15/15 at 888eac7. All others passed at 53e055f and are unchanged since.
  • Snapshot diffs 0, sandbox denials on our paths 0, no new files in ~/Library. [AGENT-DRAFT] lines contain no key, client or UUID.

Reviews (round 29)

  • Antigravity: agree.
  • Codex: disagree. It found one remaining near-limit path: merging two app-written backups can bring the file to exactly the hard limit, and a later per-app receipt-off then drops the oldest saved row-less revocation.
    • At a full file, one denial and one saved revocation compete for the same bytes. Earlier fixes moved this boundary but could not remove it.
    • It needs about 240k revocations at the default limit plus a backup restore, so it is recorded as a follow-up in #31 후속: 승인 파일 경계 사례와 UX 정리 #35.
    • Merging under the no-deadlock rule (another agent's agreement plus Mac evidence, after the final advice round).

Generated by Claude Code

claude and others added 6 commits November 28, 2026 18:23
… draft database (#31, #4)

Answers the #33 promotion round-2 findings:
- P2-01/P2-02: the approvals file limit is 16 MiB (about 240,000
  revocations; tests use a 256 KiB store). Past it a denial is still saved:
  revocations that remove a row of the last intact file are kept, then that
  file's own, then the others, newest first; only the oldest revocations of
  apps without a row are left out, and they stay in effect for the run.
  Test: a file exactly at the limit, one app's receipt off and then revoke.
- P-02 (reversible, pending the user's choice): when drafts.sqlite cannot be
  opened, agent drafts get busy instead of being accepted into memory, and
  the tab says so.
- Claude P2-02: a speech request whose main-queue block did not run is
  logged as unconfirmed, not busy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015LJG7KnMPqFcfTZ8A1C2qh
…passes silently (#31)

Round-2 promotion findings on the manual fixtures:

- P2-03: --real-idle asserted clicks == 1 after idle, but since per-app
  approval (#13) the first pairing is two user actions (receipt on, then
  approve); 38b3953 added the second count without updating the idle check.
  The first pairing now asserts exactly two, and the idle check compares
  against the count before the idle and also asserts that no approval request
  is waiting and the same single app is still trusted.
- P2-04: the SIGKILL restart scenario killed the registered host (the
  launcher). It now finds the host's one child, checks that the app's
  connection carries that PID (the probe's "clients" reports it), kills that
  helper, confirms the host reaped it as a signalled child (exit 71) and that
  the PID is gone, and reconnects through a new helper.
- P2-05: approvals pick the request whose helper PID is the client's own
  helper (the launcher's child, or the process itself when started directly).
  The "only one request" fallback is gone, in fs.approve too.
- Claude P2-01: run_speech_socket_log.py exits 3 (SKIPPED) when `log` cannot
  run under a sandbox, printing the requesting PID; --check-log FILE PID checks a
  captured `log stream` file outside the sandbox (read only) and requires the
  lines to carry that PID.
- Codex P2-06: the log section says the draft and speech lines cover requests
  that reached the handler, and which earlier refusals are not logged.

Agent: Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ved revocation; close SQLite once on a failed open (#31, #4)

Answers the round-26 Codex finding: new revocations without a row are saved
only up to the limit less an 8 KiB reserve, and a saved revocation is never
pushed out by this app's own writes. Receipt and row changes use the
reserve, so they always save. Revocations that remove a row are always
written. Test: a revocation saved at normal size survives revocations piling
up to the soft limit and another app's receipt off.
Also: SQLiteDraftStore no longer closes its handle twice when setup fails
(deinit runs for a failed init).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015LJG7KnMPqFcfTZ8A1C2qh
…t stays (#31)

- AgentCatalogTests: a file that exists but is not SQLite (the handle is
  opened, setup SQL fails) and a path under a regular file both return nil
  from SQLiteDraftStore, 50 times each, with no crash and the file left
  byte-identical. Stated in the test: this does not prove the handle is closed
  once; SQLite rejects a second close quietly here, and the run also passes
  with `db = nil` removed.
- docs P-06: quitting drops helper connections, receipt proofs, this-run
  approvals of unidentified hosts, the instruction share selection and the
  closed-draft key memory; drafts stay in drafts.sqlite and registered apps'
  approvals, revocations and receipt choices in agent-approvals.json. The old
  line said open drafts and approval records were lost on quit.

Agent: Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the file; revocations without a row fill to 1 KiB short of it; exact fit cost (#31)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015LJG7KnMPqFcfTZ8A1C2qh
…near the limit (#31)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015LJG7KnMPqFcfTZ8A1C2qh
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T19:32:17.014695Z 888eac7 PR opened
🔒 Security Review ✅ Completed 2026-11-28T19:33:13.294176Z 888eac7 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.

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.

2 participants