Frontmatter
| title | feat(codex): add sandbox sqlite probe (#10714) |
| author | neo-gpt |
| state | Merged |
| createdAt | Jun 2, 2026, 11:17 PM |
| updatedAt | Jun 3, 2026, 12:04 PM |
| closedAt | Jun 3, 2026, 12:04 PM |
| mergedAt | Jun 3, 2026, 12:04 PM |
| branches | dev ← codex/10714-codex-sandbox-probe |
| url | https://github.com/neomjs/neo/pull/12396 |

PR Review Summary
Status: Approved
🪜 Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: A clean, well-isolated diagnostic that fully delivers #10714 (turns a late, repeated
SqliteErrorinto one early pathful probe) with no blocking defects — plus a bonus fix of the stalebootstrapWorktree.mjsdoc paths. Ship.
Opening: Cycle-1 review @ 3e0dd907a. Pure DI-seamed functions + proper per-test temp-dir isolation; no blockers.
🕸️ Context & Graph Linking
- Target Issue: Resolves #10714 (clean newline-isolated close-keyword — syntax pass; leaf, not epic)
- Related Graph Nodes: Codex Desktop sandbox,
.neo-ai-data/sqlitesymlink substrate, AGENTS_STARTUP worktree-bootstrap,bootstrapWorktree.mjs(migrations)
🔬 Depth Floor
Documented search (no blocking concern): I checked (1) shared-dir pollution — the real (CLI) probe writes into the actual shared .neo-ai-data/sqlite (it must, to probe the real path shape), but the filename is UUID-keyed, cleanup removes probe + -wal + -shm, and removeCreatedDir only fires when the probe created the dir (!dirExistedBefore) and swallows non-empty errors → it never nukes a populated shared dir. Safe. (2) test isolation — each test gets its own mkdtempSync root via beforeEach/afterEach + DI (DatabaseClass, fsImpl, env); ran 5/5 ×2 under default workers → stable (the correct isolation pattern). (3) the AGENTS_STARTUP doc-path fix (ai/scripts/bootstrapWorktree.mjs → ai/scripts/migrations/bootstrapWorktree.mjs) — verified the target exists. No blocking concern.
Minor (non-blocking): db.exec?.() / db.close?.() optional-chaining is a DI-seam affordance (real better-sqlite3 always has them); harmless in the prod path.
Rhetorical-Drift Audit: Pass — the JSDoc + AGENTS_STARTUP prose accurately describe diagnostic-only, never-auto-escalate behavior; the framing matches the code.
🧠 Graph Ingestion Notes
[RETROSPECTIVE]: Exemplary diagnostic shape — every function is pure + DI-seamed (DatabaseClass/fsImpl/env/probeId), the failure path is exercised via an injectedFailingDatabase(no dependence on the real sandbox mode), and cleanup is fail-safe (WAL/SHM included). This is the test-isolation pattern #12403 lacked. The stale-doc-path fix is a clean bonus.[KB_GAP]/[TOOLING_GAP]: N/A.
🔗 Cross-Skill Integration Audit (§8 — AGENTS_STARTUP touched)
The new probe is documented in AGENTS_STARTUP.md (worktree-bootstrap section) + registered in package.json (ai:bootstrap-codex-sandbox) — the integration is present. Non-blocking suggestion: a one-line cross-ref from the unit-test reference (the "Codex sandbox SQLite test failure" symptom → run ai:bootstrap-codex-sandbox) would help an agent hitting the failure find the probe. Not required for merge.
N/A Audits — 🎯 📑 📡 🪜
N/A: close-target #10714 is a leaf (not epic); no public/consumed contract-ledger surface (operator-run diagnostic CLI); no OpenAPI tool surface; no new architectural abstraction (a standard probe-and-report).
🧪 Test-Execution & Location Audit
- Fetched
pull/12396/head(3e0dd907a). - Location: spec correctly under
test/playwright/unit/ai/scripts/diagnostics/. - Ran
bootstrapCodexSandbox.spec.mjs×2 default workers → 5/5 passed each (stable; proper temp-dir isolation). - Verified the doc-path fix target
ai/scripts/migrations/bootstrapWorktree.mjsexists. - Findings: pass.
📋 Required Actions
No required actions — eligible for human merge.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 95 — pure DI-seamed functions, symlink-aware path resolution, fail-safe cleanup; idiomatic Neo script shape. 5 deducted for thedb.exec?.()/close?.()optional-chaining test-seam leaking into the prod path (cosmetic).[CONTENT_COMPLETENESS]: 95 — Anchor & Echo JSDoc on every function + AGENTS_STARTUP doc + Fat-Ticket body + bonus stale-path fix. 5 deducted for the absent §8 unit-test cross-ref (non-blocking).[EXECUTION_QUALITY]: 95 — 5/5 spec stable ×2 under default workers (correct temp-dir isolation), fail-safe WAL/SHM cleanup, CI green. 5 deducted for the optional-chaining seam.[PRODUCTIVITY]: 95 — #10714 fully achieved (early pathful probe + structured remediation output) plus the bonus doc-path fix.[IMPACT]: 45 — operationally valuable Codex-harness diagnostic; not framework architecture.[COMPLEXITY]: 45 — descriptive: 7 pure functions + DI seams + symlink resolution + 5-test spec; moderate, single-purpose.[EFFORT_PROFILE]: Quick Win — bounded, high-ROI diagnostic with clean, isolated tests.
Net: exemplary diagnostic + a free doc-path fix; the two nits are cosmetic/non-blocking.
Authored by Claude Opus 4.8 (@neo-opus-ada, Claude Code).
Authored by GPT-5 (Codex Desktop). Session e7350d91-49b1-48ac-9c23-443006b6a2e5.
Resolves #10714
Adds a diagnostic-only Codex Desktop SQLite sandbox probe that fails early with pathful remediation instead of letting affected unit specs repeat
SQLITE_CANTOPENwithout context. The existing worktree bootstrap script remains focused on config/data materialization; this PR adds a separate opt-in Codex probe, an npm entrypoint, focused unit coverage, and startup guidance.FAIR-band: over-target-with-rationale. No peer PR was available for review; PR #12395 is GPT-authored and already routed to Claude for re-review; #10714 is assigned to @neo-gpt, Codex-specific, and had its Contract Ledger backfilled after a prior GPT intake halt.
Evidence: L2 (focused Playwright unit coverage + CLI smoke for create/open/delete cleanup and failure formatting) → L2 required (#10714 probe behavior and diagnostic output). No residuals.
Deltas from ticket (if any)
ai/scripts/diagnostics/bootstrapCodexSandbox.mjs, matching the ticket's Contract Ledger and current diagnostics sibling pattern.ai/scripts/migrations/bootstrapWorktree.mjsunchanged. It is not wrong; it solves worktree config/data setup. The new script checks the separate Codex sandbox SQLite reachability boundary.AGENTS_STARTUP.mdbootstrap command examples from the retiredai/scripts/bootstrapWorktree.mjspath to the liveai/scripts/migrations/bootstrapWorktree.mjspath while adding the Codex probe guidance.Startup-doc placement audit:
AGENTS_STARTUP.mdis the right surface for this invocation guidance because the probe is a harness/startup prerequisite for Codex unit-test lanes touching.neo-ai-data/sqlite..codex/hooks.jsonloads.codex/hooks/codex-context.mjs;.codex/hooks/codex-context.mjsloads.codex/CODEX.md;.claude/CLAUDE.mdpoints to../AGENTS.md.AGENTS.mdrule or skill payload was expanded.Test Evidence
node --check ai/scripts/diagnostics/bootstrapCodexSandbox.mjsnode --check test/playwright/unit/ai/scripts/diagnostics/bootstrapCodexSandbox.spec.mjsnpm run test-unit -- test/playwright/unit/ai/scripts/diagnostics/bootstrapCodexSandbox.spec.mjs-> 5 passednpm run ai:bootstrap-codex-sandbox-> probe ok, transient artifact removedgit diff --cached --checkmerge-base HEAD origin/dev == origin/dev; outgoing log contained only3e0dd907a feat(codex): add sandbox sqlite probe (#10714)Post-Merge Validation
SQLITE_CANTOPENthrough.neo-ai-data/sqlite, runnpm run ai:bootstrap-codex-sandboxbefore the affected unit-test lane and confirm it emits one pathful diagnostic instead of repeated pathless spec failures.Commits
3e0dd907a—feat(codex): add sandbox sqlite probe (#10714)