Skip to content

Package the inactive Codex runtime and shared role instructions - #84

Merged
erickb336 merged 14 commits into
mainfrom
codex/codex-runtime
Oct 7, 2026
Merged

erickb336 merged 14 commits into
mainfrom
codex/codex-runtime

Conversation

@erickb336

@erickb336 erickb336 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Fifth lifecycle split from #75. #83 is merged, and this PR includes current main e69a5ad.

This split packages the existing Codex runtime for review. It joins native identity checks, task preparation, atomic admission, child binding, and instruction delivery. It does not install or activate automatic Sage hooks.

Both providers now build their role instructions from shared templates and explicit provider bindings. The generated Claude agent and report text is byte-identical to the preceding split, e69a5ad. The installed hook and plugin manifests are also unchanged.

The pre-tool boundary returns explicit native denials when policy or identity checks fail. A pass retains Codex's normal permission checks. The shared command, merge, push, file, mode, and admission policies retain the fixes from the earlier splits. Claude nested-spawn enforcement remains in #62.

Validation

TEST_BIN contains fake ps, pgrep, and kill tools. Every test below used it first on PATH.

  • npm ci --ignore-scripts: added 13 packages; audit reported one high-severity dependency finding, described below.
  • /usr/bin/caffeinate -i npm run build: built 212 files.
  • /usr/bin/caffeinate -i npm run check: all checks pass (1 timing bound carries "// timing-ok:").
  • PATH="$TEST_BIN:$PATH" env -u NODE_TEST_CONTEXT /usr/bin/caffeinate -i node --test scripts/providers.test.mjs scripts/codex-server.test.mjs packages/sage-codex/runtime/*.test.mjs: 182 tests; 182 pass; 0 fail.
  • git diff --check: passed.
  • PATH="$TEST_BIN:$PATH" caffeinate -i npm test: 643 tests; 643 pass; 0 fail.
  • Independent final review: no blocking findings.

The first focused run found an omitted test helper: 180 passed and two failed. Restoring the helper from the saved draft fixed those failures. No assertion changed.

For the red proof, git worktree add --detach "$PROOF" origin/main selected e69a5ad. Only the test files were copied into that checkout. node --test --test-reporter=tap --test-name-pattern="$NEW_TESTS" ran the exact new-test names under the same fake PATH and caffeinate. All 117 new cases failed individually: 26 provider cases, 60 runtime cases, and 31 server cases. The failure names exactly match the test inventory; none failed from an undefined test helper.

Existing test assertions remain unchanged. Tests that copy a source checkout now link its build dependencies into the fixture. The existing hook and launcher tests are unchanged. The public-data scan found no personal paths, token-shaped strings, or private keys.

Seen, not fixed

The preserved draft also validates command-policy setup paths and push-policy callbacks, validates branch-reader return values, and freezes those policy objects. Those API changes are not runtime dependencies and were not included in the behavior-preserving extractions. They remain in #75 for separate review. Its command-reader and mode-policy notes also remain there: the former predates merged T199, and the latter describes an earlier fixture-based mode probe. Current runtime contracts describe the extracted implementation.

The existing fast-uri 3.1.0 pin has high-severity advisories, including host confusion and path traversal. MCP SDK 2.3.1 also embeds that version in its published JavaScript. Updating only the root dependency cannot replace the embedded copy. This extraction preserves the existing pins and leaves that finding unresolved.

Not verified

This split does not verify installed automatic operation or a real-project pilot. The runtime still needs a complete command, path, role, and workflow policy callback; report acceptance; capacity release; recovery; and activation wiring. Child-start instruction delivery does not enforce tool permissions. The prepared chief instructions remain unloaded, unsupported routes remain inactive, and autopilot remains off.

…sh-policy

# Conflicts:
#	packages/sage-claude/hooks/command-policy.mjs
#	packages/sage-claude/hooks/sage-hook.mjs
#	packages/sage-core/command-policy.mjs
#	packages/sage-core/index.mjs
#	plugins/sage-codex/core/command-policy.mjs
#	plugins/sage-codex/core/index.mjs
#	plugins/sage/core/command-policy.mjs
#	plugins/sage/core/index.mjs
#	plugins/sage/hooks/command-policy.mjs
#	plugins/sage/hooks/sage-hook.mjs
#	scripts/providers.test.mjs
…e-policy

# Conflicts:
#	packages/sage-claude/hooks/sage-hook.mjs
#	packages/sage-core/index.mjs
#	plugins/sage-codex/core/index.mjs
#	plugins/sage/core/index.mjs
#	plugins/sage/hooks/sage-hook.mjs
#	scripts/providers.test.mjs
…o codex/codex-runtime

# Conflicts:
#	packages/sage-claude/agents/chief-of-staff.md
# Conflicts:
#	packages/sage-core/index.mjs
#	plugins/sage-codex/core/index.mjs
#	plugins/sage/core/index.mjs
#	scripts/providers.test.mjs

@erickb336 erickb336 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Codex review of 52bffab: no new findings in the final main integration. Independent review confirms the runtime tree matches the reviewed snapshot and retains #82 behavior. Generated Claude agents and the report skill remain byte-identical to the parent.

Build and check pass. Full suite: 643 tests, 643 pass, 0 fail. All 117 added cases fail individually on detached main 8897db5, with exact test-name comparison.

This is an inactive runtime extraction. The embedded fast-uri advisory remains unresolved, and complete enforcement, report acceptance, capacity release, recovery, activation, and a live project pilot are not verified. Those limits are documented in the PR; passing tests do not establish installed automatic Sage. Merge #83 before this dependent PR.

# Conflicts:
#	packages/sage-core/index.mjs
#	plugins/sage-codex/core/index.mjs
#	plugins/sage/core/index.mjs
#	scripts/providers.test.mjs
@erickb336
erickb336 changed the base branch from codex/shared-role-admission to main October 7, 2026 22:49

@erickb336 erickb336 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Codex review of 9ebbfc6: no new findings. Independent review confirms an identical tree to reviewed 52bffab; all role-admission source, docs, tests, and generated copies match merged main. Build/check pass; full suite: 643 tests, 643 pass, 0 fail. All 117 new runtime cases fail individually on detached main e69a5ad. #83 is merged and this PR now targets main.

The unresolved dependency advisory and inactive lifecycle limits in the PR body still apply. This review does not establish installed automatic operation.

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