Skip to content

feat(codex): audit catalog writes with bounded private records - #6560

Merged
lidge-jun merged 3 commits into
devfrom
codex/next-release-261004-catalog-a3
Oct 4, 2026
Merged

lidge-jun merged 3 commits into
devfrom
codex/next-release-261004-catalog-a3

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

Record bounded, private catalog-write diagnostics. On Windows, a newly created blank audit file receives data only after required ACL hardening; existing files are skipped without ACL mutation. At most the successful new-file creation event is recorded; later events skip the existing file in the same process and after restart. Hardening failure may leave an empty file, and later events also skip it. This is an explicit deferral of continuous Windows auditing, not complete cross-platform audit-stream coverage; no native NTFS validation is claimed.

Manual dependent catalog series: #6553 → #6558 → #6560 → #6563. Carries #6530 (451bcd43e078d811b2bef0455000d48964bb06cd) once in A1 and #6537 (8e50608319dcd5180e43fa2b9377ed4b3702127b) across A2–A4. Each layer's diff is relative to its named parent.

The lane's planning documents were moved to ignored scratch and removed from rewritten reachable branch history. Prior public exposure is not erased by this cleanup. Public outcome and attribution remain here; source disposition and integration belong to the coordinator.

Co-authored-by: lcxhh521 [email protected]

Verification

Audit original28 retained; focused35/35 including7 new Windows privacy cases. First-event-only continuity test1/1 proves same-process and fresh-process skip. Typecheck, structure, privacy and ratchet pass. Native NTFS execution is not inferred from the injected platform tests; coordinator acceptance of the incomplete Windows stream remains explicit. Independent security/code review PASS. Fresh current-head hosted CI is running; earlier passing checks are historical. Full local/changed suites are omitted under the explicit concurrent-lane resource exception; focused behavior tests plus typecheck/structure/privacy/layout/ratchet are required. Native installed Desktop/live-provider acceptance remains separate. No merge or review-thread resolution performed.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

The public CLI diagnostic documentation states the limitation. cd docs-site && bun install --frozen-lockfile && bun run build passed: 561 pages, 77,947 internal links checked. The URL becomes available after the documented change is integrated/deployed; no deployment was performed by this lane.

Final repair head 43dd5e755f3788bd404c43fe9502dbf61755ada6: Cross-platform CI 37179255150 completed success (pull_request, attempt1). Earlier-head/cancelled runs are historical. All reviewed findings have verified repairs; review-thread resolution and integration remain with coordinator.

bun test tests/windows/windows-secret-acl.test.ts:173pass/0fail, including required-timeout/identity/permission negatives through injected runners. This is not nativeNTFS proof.

Current-dev integration refresh: rebased unchanged onto 33125e62d267345d8aaa2e32b993d5bbe8050ff3. Range-diff reports all10 catalog commits identical. All103 non-overlapping landed paths remain byte-identical and both test registries preserve the complete union. The six verified repairs, original source credit, absent security plans and explicit first-event-only Windows audit deferral are preserved. Independent integration review PASS.

Fresh combined local verification:316catalog tests,138landed-behavior tests,43layout/core-boundary tests passed; typecheck/structure/privacy/ratchet passed. Docs build:561pages and77,953 internal links passed. Full/changed local suites omitted under the recorded resource exception. New exact-head per-PR CI is pending; previous-head results are historical. No merge, retarget or settings changes performed.

Post-A1 integration refresh: coordinator merged #6553 as 9289396e5400db1d42012ef01b2444e4e29b8e13; A2 automatically targets dev and A3/A4 retain manual parents. The remaining eight commits rebased unchanged onto that actual merge. New head 57e45ed78787c8504bdcbbd4ed142b84db5805fa; all interdiffs equal, source tree unchanged, original credit and all fixes/Windows deferral preserved. Independent fresh interdiff review PASS. No prior CI is reused: new exact-head per-PR checks are required. No merge, review resolution, repository setting change, or deleted-parent recreation performed by this lane.

New A2 review follow-up carried into head 521176c62cb8244c6b636c8e262ff762baba6858: direct journal writers now enforce ownership; both foreign binding and exact recovery bytes are preserved. Catalog comparison/count reuses one Buffer while preserving read-error/no-op/clear behavior. RED4fail→GREEN34; adjacent145/layout18 and cascade140 tests pass, typecheck/structure/privacy/ratchet pass. Independent security and cascade review PASS. Fresh current-head CI is required; old results are historical.

Post-A2 integration refresh: coordinator merged #6558 as f74a3db92650bfd40fc6496b92a634f2265c7f93. A3 automatically targets dev; A4 remains on its manual A3 base. All six remaining commits rebased unchanged, with actual merge parents/ancestry checked. New head 9cc03571d6cb60d44318da02f0d6113417751345; independent fresh interdiff review PASS. Journal guards, single-buffer handling, earlier fixes, Windows audit deferral/public docs and original credit remain intact. New exact-head per-PR CI is required; no previous CI is reused. A4 still needs actual Service lifecycle verification after its later final dev-base integration refresh. No merge or review resolution performed by this lane.

Summary by CodeRabbit

  • New Features
    • Added bounded diagnostic records for catalog and cache writes, including successful changes and refused updates.
    • Identical writes produce no record, and audit failures do not affect the catalog operation.
    • On Windows, auditing records only the initial successful file creation; later writes are skipped.
  • Documentation
    • Documented audit behavior, platform-specific limitations, and cleanup considerations.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (2)
src/AGENTS.md — auto-discovered
structure/AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5242165c-838d-4e87-998a-f9da9aa04c08
📥 Commits

Reviewing files that changed from the base of the PR and between f74a3db and 9cc0357.

📒 Files selected for processing (11)
  • docs-site/src/content/docs/reference/cli/lifecycle.md
  • scripts/test-layout/layout.json
  • src/codex/catalog-write-serialization.ts
  • src/codex/catalog/retained-sync.ts
  • src/codex/catalog/write-audit-contract.ts
  • src/codex/catalog/write-audit.ts
  • src/codex/convergence.ts
  • src/codex/internal/catalog-writer.ts
  • structure/codex-home.md
  • tests/codex-integration/codex-catalog-write-audit.test.ts
  • tests/fixtures/test-layout-expected.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Adds bounded, best-effort catalog-write auditing for catalog and cache writes and selected admission refusals. Permit-based serialization connects audit events to write flows. Integration tests and documentation cover audit behavior, platform constraints, and cleanup boundaries.

Changes

Catalog Write Auditing

Layer / File(s) Summary
Audit contract and bounded writer
src/codex/catalog/write-audit-contract.ts, src/codex/catalog/write-audit.ts
Defines audit event fields and adds a best-effort JSONL writer. The adapter redacts paths, checks file safety, and enforces byte and record limits.
Permit validation and write-path auditing
src/codex/catalog-write-serialization.ts, src/codex/internal/catalog-writer.ts, src/codex/catalog/retained-sync.ts, src/codex/convergence.ts
Validates permits and audits completed catalog or cache writes and selected refusals. Audit failures do not change the write result.
Integration coverage and behavior documentation
tests/codex-integration/codex-catalog-write-audit.test.ts, tests/fixtures/test-layout-expected.json, scripts/test-layout/layout.json, structure/codex-home.md, docs-site/src/content/docs/reference/cli/lifecycle.md
Adds integration coverage for audit records, write outcomes, refusal paths, concurrency, and platform-specific file handling. Documents audit limits and cleanup behavior, and registers the test in both layout maps.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~40 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant CatalogWriter
  participant auditCatalogWriteWithPermit
  participant appendCatalogWriteAudit
  participant CatalogAuditFile
  CatalogWriter->>auditCatalogWriteWithPermit: pass permit and write details
  auditCatalogWriteWithPermit->>appendCatalogWriteAudit: pass event and creation option
  appendCatalogWriteAudit->>CatalogAuditFile: create or append bounded record
Loading

Merge Risk: ⚪ Minimal · up to 9cc03

This change adds bounded, privacy-filtered diagnostic records for catalog writes and refusals. If an audit record fails to write, catalog publication and refusal results stay the same. On Windows, recording is limited to a single event in a newly created file, and this limitation is documented. No merge-blocking issue was found.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 9cc03

The new diagnostics are bounded and isolated from catalog write decisions. Windows deliberately records only the successful file-creation event. Native Windows privacy behavior remains unvalidated, so the assessment is low risk rather than minimal.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The assessed exposure is local diagnostic metadata beneath the supplied Codex home, written with the process's filesystem authority. Exploiting the deferred recreation scenario would require influence over that filesystem path; no remote or cross-tenant entrypoint is established by the inspected sources.

Security Findings and Attack Paths

  • inferred — The deferred candidate remains uncertainty, not a verified vulnerability. The ACL helper can accept a cached device/inode/ctime observation; whether a recreated native NTFS file can match that observation is unresolved. The audit caller adds a reachable use of this helper, but exclusive creation, post-hardening identity checks, and retirement of mismatched cache entries constrain the hypothesized path.

Trust Boundaries and Controls

  • observed — Windows diagnostic bytes are written only after required ACL hardening succeeds and the opened file passes renewed identity, size, type, and link-count checks. ACL mutation grants the current user access before removing inheritance and broad grants. Native resulting ACL behavior remains outside the available validation.

Resilience and Maintainability Implications

  • observed — Audit and registration exceptions cannot replace the underlying publication result. Registration occurs only after successful creation for file-backed configuration; external-home diagnostics are explicitly not claimed for cleanup. The audit trail is consequently an optional observer, not an authorization or recovery prerequisite.

Hardening Proposals

  • proposed — Validate native NTFS ACL outcomes, interruption during hardening, and recreated-file cache observations before strengthening Windows privacy assurances or enabling continuous Windows appends. Preserve the documented first-event-only limitation until those controls are demonstrated.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.03% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 29 functions across 7 files. (4 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: bounded, private audit records for catalog writes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 31.03% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 29 functions across 7 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Oct 4, 2026
@lidge-jun
lidge-jun force-pushed the codex/next-release-261004-catalog-a2 branch from 1e3f4f6 to ff45590 Compare October 4, 2026 03:01
@lidge-jun
lidge-jun force-pushed the codex/next-release-261004-catalog-a3 branch from 0d13d9a to acba8c0 Compare October 4, 2026 03:01
@lidge-jun
lidge-jun marked this pull request as ready for review October 4, 2026 04:16
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 4, 2026 04:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 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-04T04:20:48.868371Z acba8c0 Draft marked ready
ℹ️ 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.

@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: acba8c095a

ℹ️ 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 src/codex/catalog/write-audit.ts Resolved
@lidge-jun
lidge-jun force-pushed the codex/next-release-261004-catalog-a3 branch from acba8c0 to ecc9ed3 Compare October 4, 2026 04:55
@lidge-jun
lidge-jun force-pushed the codex/next-release-261004-catalog-a2 branch from ff45590 to 6092b53 Compare October 4, 2026 04:55
@lidge-jun
lidge-jun force-pushed the codex/next-release-261004-catalog-a3 branch from 43dd5e7 to 7e82a01 Compare October 4, 2026 06:15
@lidge-jun
lidge-jun force-pushed the codex/next-release-261004-catalog-a2 branch from 6092b53 to 6f3500c Compare October 4, 2026 06:15
lidge-jun added a commit that referenced this pull request Oct 4, 2026
…alog-a1

Require saved configuration authority before removing routed provider or combo aliases. Bare and slashed OpenCodex-authored combo aliases use combo authority; foreign and trusted account-native rows retain their existing treatment.

Manual dependent catalog series: #6553 → #6558 → #6560 → #6563. Carries #6530 (`451bcd43e078d811b2bef0455000d48964bb06cd`) once in A1 and #6537 (`8e50608319dcd5180e43fa2b9377ed4b3702127b`) across A2–A4. Each layer's diff is relative to its named parent.

The lane's planning documents were moved to ignored scratch and removed from rewritten reachable branch history. Prior public exposure is not erased by this cleanup. Public outcome and attribution remain here; source disposition and integration belong to the coordinator.

Verified current head d5f9c39 with CI 37182275158 and scoped independent technical/security review.

Co-authored-by: lcxhh521 <[email protected]>
@lidge-jun
lidge-jun force-pushed the codex/next-release-261004-catalog-a3 branch from 7e82a01 to 57e45ed Compare October 4, 2026 06:35
@lidge-jun
lidge-jun force-pushed the codex/next-release-261004-catalog-a2 branch from 6f3500c to 3d8bc39 Compare October 4, 2026 06:35
@lidge-jun
lidge-jun force-pushed the codex/next-release-261004-catalog-a3 branch from 57e45ed to 521176c Compare October 4, 2026 07:08
lidge-jun added a commit that referenced this pull request Oct 4, 2026
…alog-a2

Bind catalog writes to the injecting OpenCodex home with explicit write intent and exact-byte no-op outcomes. Preserve deliberate native restore and refuse foreign or unavailable ownership evidence.

Manual dependent catalog series: #6553 → #6558 → #6560 → #6563. Carries #6530 (`451bcd43e078d811b2bef0455000d48964bb06cd`) once in A1 and #6537 (`8e50608319dcd5180e43fa2b9377ed4b3702127b`) across A2–A4. Each layer's diff is relative to its named parent.

The lane's planning documents were moved to ignored scratch and removed from rewritten reachable branch history. Prior public exposure is not erased by this cleanup. Public outcome and attribution remain here; source disposition and integration belong to the coordinator.

Verified current head 37d0a22 with CI 37184897609 and scoped independent technical/security review.

Co-authored-by: lcxhh521 <[email protected]>
Base automatically changed from codex/next-release-261004-catalog-a2 to dev October 4, 2026 07:24
lidge-jun and others added 3 commits October 4, 2026 16:26
Carry #6537 audit diagnostics with K-held append/retention, fixed metadata projection and honest external cleanup residuals.

Co-authored-by: lcxhh521 <[email protected]>
@lidge-jun
lidge-jun force-pushed the codex/next-release-261004-catalog-a3 branch from 521176c to 9cc0357 Compare October 4, 2026 07:29
@lidge-jun

Copy link
Copy Markdown
Owner Author

Owner-authorized maintainer integration into dev after the verified v2.77.0 release. Release workflow37170949169, tag/receipt/npm all agree at main06841165f884a9176d701310638b2112aca7a514; the downloaded npm package integrity was verified before integration.

Head 9cc03571d6cb60d44318da02f0d6113417751345; accepted base f74a3db92650bfd40fc6496b92a634f2265c7f93. Current-head Cross-platform CI run37185939122 attempt1 succeeded. Actual tested checkout 41089d6681729421bf0fb149676ae19cb785212a has exactly those base/head parents. All four test shards, required gates, structure and aggregate passed. Independent technical/security review and source coverage were verified separately; source attribution is retained. No unresolved review threads or maintainer objections were observed and the maintainer helper passed. Native/live limitations remain as recorded in this PR; no installed-runtime acceptance is implied.

This is the explicit maintainer-integration decision under MAINTAINERS.md, not self-approval or a substitute for independent review.

@lidge-jun
lidge-jun merged commit 8aff79e into dev Oct 4, 2026
39 checks passed
@lidge-jun
lidge-jun deleted the codex/next-release-261004-catalog-a3 branch October 4, 2026 07:46
lidge-jun added a commit that referenced this pull request Oct 4, 2026
…alog-a4

Heal lost routed catalog rows only from the idle owner. Establish observation immediately after successful Codex startup sync, before unrelated startup awaits. Use filesystem-equivalent path comparisons for baseline, target, publication, and restore fences.

Manual dependent catalog series: #6553 → #6558 → #6560 → #6563. Carries #6530 (`451bcd43e078d811b2bef0455000d48964bb06cd`) once in A1 and #6537 (`8e50608319dcd5180e43fa2b9377ed4b3702127b`) across A2–A4. Each layer's diff is relative to its named parent.

The lane's planning documents were moved to ignored scratch and removed from rewritten reachable branch history. Prior public exposure is not erased by this cleanup. Public outcome and attribution remain here; source disposition and integration belong to the coordinator.

Verified current head 89f5ef8 with CI 37188595240 and scoped independent technical/security review.

Co-authored-by: lcxhh521 <[email protected]>
lcxhh521 added a commit to lcxhh521/opencodex that referenced this pull request Oct 4, 2026
The tree is upstream dev plus the current heads of
feat/chatgpt-desktop-pac-fallback (which includes the ready-marker
watcher and the send-unblock intercept), feat/dsh-desktop-profile-patch
and fix/codex-home-test-guard. The earlier local commits on this branch
are replaced: the catalog safety work landed upstream through lidge-jun#6553,
lidge-jun#6558, lidge-jun#6560 and lidge-jun#6563, and the ChatGPT desktop work now follows the
maintainer's app-server shim structure. The previous dev stays as the
first parent so this is a fast-forward; it is also kept as
backup/dev-before-upstream-rebuild-20261005.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant