Repository navigation
feat: add Codex snapshot migration slice - #2
Conversation
There was a problem hiding this comment.
💡 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".
| _HARD_EXCLUDED_SUPPORT_NAMES = {".env", "auth.json", "installation_id", "models_cache.json"} | ||
| _HARD_EXCLUDED_SUPPORT_SUFFIXES = (".jsonl", ".sqlite", ".db", ".wal", ".shm", "-wal", "-shm") |
There was a problem hiding this comment.
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 👍 / 👎.
| for path in sorted(source.path.rglob("*")): | ||
| if path.is_symlink() or not path.is_file() or path.name == "SKILL.md": | ||
| continue |
There was a problem hiding this comment.
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 👍 / 👎.
| heading=f"Codex instructions: {source.relative_path}", | ||
| content=source.content, | ||
| source=source.relative_path, | ||
| source_class="repository", | ||
| precedence=source.precedence, |
There was a problem hiding this comment.
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 👍 / 👎.
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:
AGENTS.mdpath and precedence preservation;MEMORY.mdplus opt-inmemory_summary.md;Tests
PROTOAGENT_SOURCE=<current protoAgent checkout> .venv/bin/pytest -q- 21 passed.venv/bin/ruff check .- passed.venv/bin/ruff format --check .- passedinspect_snapshotaccepted the fixture snapshot with zero plugins andruns_code=false.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.