← Back to Pull requests

fix(codex): a seat's own topology folder is writable, so it keeps its LEARNED.md and recap #2018

Closed
unknown closed this pull request without merging on Oct 25, 2026 15:36 UTC
View on GitHub
unknown unknown commented on Oct 25, 2026 12:33 UTC
Author

What this changes

A Codex seat's own topology folder is now one of its writable roots. The folder is <topology root>/rigs/<rig>/seats/<seat>, the home of the seat's LEARNED.md and recap.

  • The problem it fixes: on the default workspace-write floor, that folder sits outside the seat's writable roots. So the seat can't keep its own LEARNED.md (lessons for its next occupant), and rig context recap-write fails with EPERM.

  • What the fix does: the folder is added as an --add-dir.

  • A missing rigs/<rig>/seats/<seat> is created for the selected canonical seat, including the rig's folder when the rig has none yet, because Codex can't create a folder outside its writable roots.
  • The same rules as the git metadata dirs


  • Fresh, resume and fork all add it, placed after the git dirs.

  • On resume and fork it comes after the conversation id, so the ps proofs still read the id when the path has a space.

  • None is added for a rebuild, whose observed envelope keeps the writable roots that ran, or under a provably read-only profile.

  • An in-place restart keeps the running process's own --add-dirs.

  • The restore path's resume (CodexResumeAdapter) adds it on the plain workspace-write floor. A named profile isn't checked for read-only there, and Codex refuses a writable root under a read-only sandbox, so it gets none.
  • Only that one folder


  • The name must be canonical (<seat>@<rig>) with safe segments.

  • Symlinks are refused: a symlinked rigs, <rig>, seats or <seat> segment gives no folder, with a warning, and nothing is created through the link.

  • No other seat's folder, and no wider topology access.
  • The recap store no longer writes through a link in the seat folder


    This is an intentional refusal of a layout that worked before.
  • What the store did: it followed a link at RECAP.md or recap-superseded/ (an archive folder linked elsewhere received the archived recap).

  • Why that changes now: the seat folder is newly writable by the seat itself, and the daemon writes there for the seat through the recap route with its own wider filesystem access.

  • What the store does now: an existing RECAP.md must be a regular file and recap-superseded/ a real folder, with dangling links counted too. Otherwise the recap write is refused with a clear message, and the current recap, the archive and the link's target keep their bytes.
  • Unchanged:

  • the direct write and the daemon fallback;

  • the existing error (recap_write_refused);

  • folder creation.
  • There's no launch refusal, no global symlink ban and no automatic unlink.

    The check runs before the write. A change made between the check and the write isn't covered.

    Unchanged

  • The recap's daemon fallback still covers seats already running and harnesses without --add-dir.

  • Claude seats don't have this wall:

  • - there's no OS sandbox, so rig context recap-write writes the file as an ordinary process;
    - an edit through Claude's Edit tool outside the working directory follows the seat's permission mode.

    Tests


  • Fresh, resume and fork add the seat folder after the git dirs, and the resume and fork proofs still find the process when the folder's path has a space.

  • The restore path adds it on the plain floor and not with a named profile.

  • Nothing is added under a read-only profile, or on a rebuild.

  • prepareCodexSeatFolder:

  • - it creates and reuses exactly the seat's folder;
    - malformed and unsafe names, and a relative root, give none and create nothing;
    - a symlinked seats segment gives none, and nothing is created at the link's target.
  • The recap route, through the store: a link at recap-superseded/ (to a private folder, or dangling) or at RECAP.md is refused, and the current recap, the archive and a private target sentinel are unchanged. The ordinary write-and-supersede case still passes.
  • 🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Writable Codex launches can now access their seat’s workspace folder, including fresh, resumed, and forked sessions.
    Bug Fixes
    Codex launches with named profiles, read-only access, or predecessor permissions do not receive the additional workspace folder.
    * Recap writes are refused when the recap file or archive folder is a symlink, helping prevent changes to linked files or folders.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 581 lines (+435 / -146) across 7 files Reviewer: openrig-review Review duration: 183m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 581 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.381
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2018"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.9% (MEDIUM) · Higher = larger blast radius
    49.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.7% · Safe to merge
    19.7%