Skip to content

test(org): stabilize the enrollment-close snapshot baseline - #553

Merged
SSFSKIM merged 1 commit into
masterfrom
org-close-flake
Nov 10, 2026
Merged

SSFSKIM merged 1 commit into
masterfrom
org-close-flake

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Diagnosis: test-baseline race, not a product defect

The outstanding write is the version-3 anchor saved to registration.json by signingRoot()'s root-add feed adoption (org-session.test.ts:1601–1619). followHub() observes the in-memory head; HeldOrg.#commit writes chain.json, updates that head, and only then awaits saveAnchor (held.ts:392–397). The session's writeAnchor sends the registration write through its commit queue (org-session.ts:841–847). Neither enrollStarted() nor postKey() starts this disk write.

close() already fences new work and joins the sync, held adoption queue, and commit tail (org-session.ts:2057–2097). The old pre-close snapshot could therefore include the temporary version-3 registration file and the old registration, even though the atomic rename completed before close resolved.

Change

Before the existing pre-close snapshot, wait until registration's on-disk anchor matches the held head and no atomic-write temporary remains. Keep the full name/inode/mtime/content equality assertion and the assertion that close waits for the held enrollment read. This still detects both writes caused by close and writes after it resolves; no product code or fixed delays changed.

Audited the neighboring enrollment cases and every other orgSnapshot() user: the other three baselines already follow an awaited close, so no parallel edits were needed.

Validation

  • Temporarily delayed the version-3 registration rename by 400 ms: the old test failed with the reported four-entry versus three-entry snapshot; the fixed test and the existing queued-anchor close test passed. The delay was removed before committing.
  • Single-file ESLint passed. The full org-session.test.ts file passed 20/20 sequential runs (160 tests each; 3,200 test executions). No local typecheck or multi-file lint/test run was performed.
  • Required offloaded static/unit/probes gate: 42799488129, success on attempt 1 (static, probes, and all four unit shards passed; no unrelated test failures). Command: ./scripts/ci-gate.sh . --gates static,unit,probes --class1a linux --runner macos --peer none --label org-close-flake.
  • Independent committed-range review: no material findings.

Do not merge as part of this task.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)

The root-add feed adoption updates the held head before its registration anchor write finishes. Wait for that anchor on disk and for atomic-write temporaries to disappear before the enrollment close baseline, retaining the complete snapshot equality assertion.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 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-10T10:31:26.010300Z bfeb9ad 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 7f3694f into master Nov 10, 2026
@SSFSKIM
SSFSKIM deleted the org-close-flake branch November 10, 2026 11:22
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