Skip to content

Add fail-closed plugin script resolver - #31853

Closed
kmbroai wants to merge 1 commit into
dev/kyleb/generic-process-lifecycle-hooks-v3from
dev/kyleb/plugin-script-command-resolver-v3
Closed

kmbroai wants to merge 1 commit into
dev/kyleb/generic-process-lifecycle-hooks-v3from
dev/kyleb/plugin-script-command-resolver-v3

Conversation

@kmbroai

@kmbroai kmbroai commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Add a fail-closed resolver for attributing exact script commands to active trusted plugin roots.
  • Normalize attributed script paths to plugin-relative paths.
  • Leave non-plugin, ambiguous, compound, or unsafe commands inert.
  • Include baseline tests for successful attribution and path-escape rejection.

Why

Phase 1 plugin lifecycle analytics needs safe script attribution without leaking absolute user paths or misattributing shell commands.

Enhancement design: Codex Plugin Metrics

Stacked on #31852.

How

  • Parse one command according to its shell type.
  • Resolve only direct scripts or narrowly supported script runners.
  • Canonicalize the candidate path and require it to live under an active trusted plugin root.
  • Attach enabled skill metadata when the script belongs to a plugin skill.
  • Reject shell expansion, compound commands, ambiguous runners, and unsafe Windows forms.

I tested this

  • just fmt — passed
  • just fix -p codex-core-plugins -p codex-plugin -p codex-analytics -p codex-core -p codex-features -p codex-app-server -p codex-windows-sandbox — passed (stack-wide scoped lint gate)
  • just argument-comment-lint — passed
  • just test -p codex-core plugin_script_resolver — passed (11/11)
  • just test — attempted; the local workspace build stopped before tests because the runner lacks system libcap for unrelated codex-bwrap. Exact-head CI provides the full Linux/macOS/Windows matrix.

@kmbroai
kmbroai force-pushed the dev/kyleb/generic-process-lifecycle-hooks-v3 branch from 3af7e95 to 933dfab Compare July 9, 2026 19:24
@kmbroai
kmbroai force-pushed the dev/kyleb/plugin-script-command-resolver-v3 branch from 2f56baf to 28e7928 Compare July 9, 2026 19:24
@kmbroai
kmbroai force-pushed the dev/kyleb/generic-process-lifecycle-hooks-v3 branch from 933dfab to d58e174 Compare July 9, 2026 22:28
@kmbroai
kmbroai force-pushed the dev/kyleb/plugin-script-command-resolver-v3 branch 2 times, most recently from 56aeb4a to aac3c74 Compare July 9, 2026 22:44
@kmbroai
kmbroai force-pushed the dev/kyleb/generic-process-lifecycle-hooks-v3 branch from d58e174 to 2e37597 Compare July 9, 2026 22:54
@kmbroai
kmbroai force-pushed the dev/kyleb/plugin-script-command-resolver-v3 branch from aac3c74 to 244fc49 Compare July 9, 2026 22:54
@kmbroai
kmbroai marked this pull request as ready for review July 9, 2026 23:14
@kmbroai
kmbroai requested a review from a team as a code owner July 9, 2026 23:14
@kmbroai
kmbroai force-pushed the dev/kyleb/generic-process-lifecycle-hooks-v3 branch from 2e37597 to 6bd7bd6 Compare July 10, 2026 01:10
@kmbroai
kmbroai force-pushed the dev/kyleb/plugin-script-command-resolver-v3 branch from 244fc49 to 31e7611 Compare July 10, 2026 01:10

kmbroai commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by openai/codex-internal#1388 after the Codex source-of-truth migration. The internal replacement preserves this stack position and carries the validated review fixes.

@kmbroai kmbroai closed this Jul 10, 2026
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.

1 participant