Codex - #229
Open
davidabram wants to merge 15 commits into
Open
Conversation
Extend hook normalization with idempotent `cx_` session IDs and `openai/` model IDs for Codex, with focused regression tests. Record T01's implementation and verification in the Codex CLI integration plan. Plan: codex-cli-integration (T01) Co-authored-by: SCE <sce@crocoder.dev>
Extend the canonical Pkl generation pipeline with a skills-only Codex target that reuses the shared workflow and decision-skill composition without adding command or prompt outputs. Update artifact inventories, metadata coverage, cross-target contracts, and durable context to cover the fourth target and its 133-file generated payload. Plan: codex-cli-integration.md (T02) Co-authored-by: SCE <sce@crocoder.dev>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Add canonical Pkl renders for `.codex/hooks.json` and the fail-open install-guidance hook so all registered Codex lifecycle events dispatch through `sce hooks codex`. Extend the generation mappings and exact artifact contract to include the two outputs, and document the resulting Codex surface and completed integration task. Plan: codex-cli-integration (T03) Co-authored-by: SCE <sce@crocoder.dev>
Expose Codex's dual `.agents/` and `.codex/` generated roots as a fourth setup target, including `--codex`, `--all` expansion, interactive selection, target persistence, and schema validation. Stage the two generated roots into a build-time manifest and install their prefixed asset paths at the repository root while preserving existing target behavior; add coverage for embedding, resolution, and installation. Ref: context/plans/codex-cli-integration.md (T04, T05) Co-authored-by: SCE <sce@crocoder.dev>
Add typed Codex hook-event parsing and route supported lifecycle/tool combinations to distinct stub arms while treating unsupported inputs as deterministic no-ops. Wire `sce hooks codex` through CLI parsing and runtime dispatch, log malformed payloads, and fail open so hook execution remains successful until later capture and policy tasks. Document the new hook surface and completed integration task. Plan: codex-cli-integration (T06) Co-authored-by: SCE <sce@crocoder.dev>
Implement UserPromptSubmit dispatch persistence with existing messages/parts helpers, storing idempotently prefixed cx_ sessions and deterministic cx:<turn_id>:user message IDs. Add injectable coverage for validation, prefixing, and parent-message deduplication. Document the completed runtime contract and update the Codex integration plan and related CLI/context references. Plan: codex-cli-integration (T07) Co-authored-by: SCE <sce@crocoder.dev>
Persist Codex Stop events as assistant messages and text parts through the existing Agent Trace database helpers, using deterministic IDs and idempotent session prefixing. Update the Codex dispatch contract and repository context to describe the completed capture behavior while retaining stubs for the remaining arms. Plan: codex-cli-integration (T08) Co-authored-by: SCE <sce@crocoder.dev>
Apply the existing Bash policy evaluator to Codex PreToolUse(Bash) events so policy behavior remains consistent without duplicating matching logic. Return silent output for allowed commands and Codex-native deny JSON containing the policy ID and blocking message for denied commands, without creating trace records. Update the Codex runtime and repository context to document the newly implemented dispatch arm and completed task. Plan: codex-cli-integration (T09) Co-authored-by: SCE <sce@crocoder.dev>
Extend doctor target detection and inventory inspection to cover Codex skills and hook assets, including trust and review guidance for unhealthy hooks. Add typed Codex problem mappings, deterministic rendering, and regression coverage while updating the operator-health contracts. Plan: codex-cli-integration (T13) Co-authored-by: SCE <sce@crocoder.dev>
Parse Codex apply_patch payloads, normalize provable Add/Update evidence into SCE patch text, and persist one diff-trace row with Codex session and model attribution. Register the PostToolUse hook while keeping Delete-only and malformed inputs fail-open without evidence, and preserve synthetic-line attribution through the existing post-commit intersection path. Plan: codex-cli-integration; Tasks: T10, T11, T12 Co-authored-by: SCE <sce@crocoder.dev>
Codex hook handling needed to accept current upstream apply_patch input while preserving silent fail-open behavior and conservative attribution boundaries. - Resolve patch paths from the event cwd against the real Git root and normalize supported outer wrappers before parsing. - Validate sessions, preserve truthful model IDs, and allocate event-scoped synthetic evidence identities without changing generic intersection behavior. - Make generated hook invocation root-aware and add end-to-end, parser, path, contract, and regression coverage. - Record the durable contracts and the remaining repeated-content attribution ambiguity. Plan: codex-cli-integration (T14-T19) Co-authored-by: SCE <sce@crocoder.dev>
Allow valid parent traversal and absolute paths when canonical resolution remains inside the Git worktree, while preserving symlink-escape protection for existing and missing targets. Add coverage and durable context for nested cwd, Add File, move, malformed, and outside-path behavior. Plan: `codex-cli-integration` (T20) Co-authored-by: SCE <sce@crocoder.dev>
Codex's user-owned hook registry must retain unrelated configuration while SCE refreshes its registrations. Add a shared structural merge service that validates hook documents, recognizes ownership by the helper path and `sce hooks codex` contract, and replaces stale or duplicate handlers with one current registration for each required event. Use the service during Codex setup and doctor inspection so malformed files are rejected before writes, repeated setup is idempotent, and user-added handlers do not create false drift. Record the completed T21 implementation and its architectural decision. Plan: `context/plans/codex-cli-integration.md` (T21) Co-authored-by: SCE <sce@crocoder.dev>
davidabram
added a commit
that referenced
this pull request
Aug 23, 2026
Reuse the shared Codex hook configuration service to classify each required registration independently, preserving unrelated user handlers and repairing only structural drift through the existing merge path. Add a read-only mirror of Codex's persisted hook-trust bookkeeping so doctor reports untrusted, modified, disabled, and unknown registrations without attempting to grant consent. Wire the new states through doctor health/problem rendering and document the per-registration contract, including the TOML dependency required to read Codex's config. Fix two correctness issues found in review (PR #229): - Structural diagnosis scanned only the first matcher group matching a registration's event, so an SCE-owned handler duplicated or misplaced in a second matcher group could be invisible to diagnosis while setup's merge (which scrubs owned handlers across every group for the event) would still rewrite the document, breaking the PresentAndCurrent-implies-no-op-merge invariant. Diagnosis now scans every matcher group for the event and requires exactly one owned handler, in the canonical group, matching the canonical handler, to report PresentAndCurrent. - Trust-state reading independently parsed `enabled`/`trusted_hash`, so a malformed `enabled` field next to a correct `trusted_hash` could still read Trusted. Upstream deserializes the whole state entry and discards it entirely on any error; the state entry type now derives Deserialize directly and is read the same way, so a malformed field drops the whole entry rather than being salvaged field-by-field. Plan: `context/plans/codex-cli-integration.md` (T22) Co-authored-by: SCE <sce@crocoder.dev>
Reuse the shared Codex hook configuration service to classify each required registration independently, preserving unrelated user handlers and repairing only structural drift through the existing merge path. Add a read-only mirror of Codex's persisted hook-trust bookkeeping so doctor reports untrusted, modified, disabled, and unknown registrations without attempting to grant consent. Wire the new states through doctor health/problem rendering and document the per-registration contract, including the TOML dependency required to read Codex's config. Fix three correctness issues found in review (PR #229): - Structural diagnosis scanned only the first matcher group matching a registration's event, so an SCE-owned handler duplicated or misplaced in a second matcher group could be invisible to diagnosis while setup's merge (which scrubs owned handlers across every group for the event) would still rewrite the document, breaking the PresentAndCurrent-implies-no-op-merge invariant. Diagnosis now scans every matcher group for the event and requires exactly one owned handler, in the canonical group, matching the canonical handler, to report PresentAndCurrent. - Trust-state reading independently parsed `enabled`/`trusted_hash`, so a malformed `enabled` field next to a correct `trusted_hash` could still read Trusted. Upstream deserializes the whole state entry and discards it entirely on any error; the state entry type now derives Deserialize directly and is read the same way, so a malformed field drops the whole entry rather than being salvaged field-by-field. - The merge itself still always relocated the canonical handler into the first matcher-matching group, so a document already diagnosed PresentAndCurrent with its canonical handler in a non-first matching group would still be rewritten by merge_or_create, a second violation of the same no-op invariant. merge_event_groups now scans every group the same way diagnosis does and returns the document completely untouched whenever it is already canonical wherever that handler lives, repairing only when it genuinely isn't. Plan: `context/plans/codex-cli-integration.md` (T22) Co-authored-by: SCE <sce@crocoder.dev>
Keep the shared workflow renderer target-neutral while replacing literal `$ARGUMENTS` in Codex skill prose with an explicit invocation-input phrase. Thread the target-specific reference through skill bodies and output documents, preserve command-mode substitution, and update architecture and plan records to describe the intentional cross-target divergence. Ref: context/plans/codex-cli-integration.md T23 Co-authored-by: SCE <sce@crocoder.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.