Skip to content

feat: add Codex snapshot migration slice - #2

Merged
RomeoRaven merged 1 commit into
mainfrom
feat/codex-snapshot-vertical-slice
Aug 23, 2026
Merged

RomeoRaven merged 1 commit into
mainfrom
feat/codex-snapshot-vertical-slice

Conversation

@RomeoRaven

Copy link
Copy Markdown
Owner

Problem

Codex Bridge had a source contract but no migration behavior. Codex state spans user-level current and legacy skill roots plus explicit repository roots, while the same Codex home also contains credentials, sessions, databases, logs, caches, downloaded plugins, and raw history that must never enter a migration.

Solution

Implements the first write-nothing vertical slice:

  • explicit Codex home, current/legacy skill roots, and repository roots;
  • fenced source discovery with symlink/traversal refusal;
  • current-user, legacy-user, repository, and system-skill classification;
  • collision refusal instead of silent name merging;
  • repository AGENTS.md path and precedence preservation;
  • curated MEMORY.md plus opt-in memory_summary.md;
  • secret-free Codex TOML MCP translation and required-value inventory;
  • report-only policy/config field identifiers without values;
  • human and JSON review output bound to one plan SHA-256;
  • dry-run-first protoAgent snapshot export;
  • hard refusal to export plans with unresolved problems.

Tests

  • PROTOAGENT_SOURCE=<current protoAgent checkout> .venv/bin/pytest -q - 21 passed
  • .venv/bin/ruff check . - passed
  • .venv/bin/ruff format --check . - passed
  • Current protoAgent host-free inspect_snapshot accepted the fixture snapshot with zero plugins and runs_code=false.
  • Exclusion instrumentation proves auth, sessions, JSONL, SQLite/WAL, logs, plugin cache, raw memories, rollout summaries, and rule bodies are never opened.

Real-source observation

A read-only scan of the current local Codex user source found 13 migratable skills and one curated memory domain while leaving source hashes unchanged. Six legacy skill symlinks point outside the declared root and were refused by name, so the real-source plan correctly remains non-exportable until those external roots receive an explicit future disposition. This does not affect the accepted host-free vertical slice.

Scope

No fresh-agent apply, persona migration, Codex plugin migration, provider/model or sandbox/approval transfer, stable installation, release, PC1 work, or active primary/development pA runtime use.

Closes #1

Prepared by Hermes with AI assistance.

@RomeoRaven
RomeoRaven merged commit e8eb10f into main Aug 23, 2026
1 check passed
@RomeoRaven
RomeoRaven deleted the feat/codex-snapshot-vertical-slice branch August 23, 2026 02:34

@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: 9ce9a03617

ℹ️ 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 migration.py
Comment on lines +33 to +34
_HARD_EXCLUDED_SUPPORT_NAMES = {".env", "auth.json", "installation_id", "models_cache.json"}
_HARD_EXCLUDED_SUPPORT_SUFFIXES = (".jsonl", ".sqlite", ".db", ".wal", ".shm", "-wal", "-shm")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Exclude credential-like files before bundling skill contents

When a selected skill contains a common credential file such as .env.local, .npmrc, or credentials.json, this denylist does not recognize it, so _translate_skill reads the file and writes its raw contents into the supposedly secret-free snapshot. Since all non-denied supporting files are copied without content inspection, either use a safe-file allowlist or comprehensively refuse credential-like paths before reading them.

Useful? React with 👍 / 👎.

Comment thread migration.py
Comment on lines +217 to +219
for path in sorted(source.path.rglob("*")):
if path.is_symlink() or not path.is_file() or path.name == "SKILL.md":
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Report escaped supporting-file symlinks

When a skill contains a supporting-file symlink, including one that resolves outside the declared skill root, this unconditional skip neither names the refused path nor adds a migration problem. The resulting plan remains exportable while silently omitting part of the selected skill, unlike escaped skill-root and AGENTS.md symlinks; resolve each link through the fence and record an unresolved refusal when it escapes.

Useful? React with 👍 / 👎.

Comment thread migration.py
Comment on lines +258 to +262
heading=f"Codex instructions: {source.relative_path}",
content=source.content,
source=source.relative_path,
source_class="repository",
precedence=source.precedence,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve repository identity in instruction provenance

When more than one project root is selected, root-level instruction files from different repositories are all recorded as AGENTS.md with the same repository source class and precedence. The generated knowledge document therefore cannot identify which repository supplied each instruction, making duplicate headings and conflicting instruction chains impossible to review reliably; include the project index or another non-secret project identifier in this provenance.

Useful? React with 👍 / 👎.

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.

Implement the first Codex source inventory and snapshot vertical slice

1 participant