diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json
index 94a7eef3..9ed68807 100644
--- a/.codex-plugin/plugin.json
+++ b/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "codex-science",
- "version": "0.5.0+codex.20260802100417",
+ "version": "0.5.0+codex.20260803040515",
"description": "Audited scientific skills, public-source tools, reproducible artifacts, and evidence review for Codex.",
"author": {
"name": "eightmm"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1e14c179..0fda3a79 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -9,15 +9,36 @@ permissions:
contents: read
jobs:
+ release-gate:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
+ with:
+ fetch-depth: 0
+ - name: Verify runtime cachebuster against base commit
+ env:
+ BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
+ run: python3 scripts/validate_release.py --base-ref "$BASE_REF"
+
check:
+ needs: release-gate
+ # Keep the existing required matrix contexts authoritative. A skipped job can
+ # satisfy branch protection, so propagate a failed gate as a real matrix
+ # failure instead of skipping these jobs.
+ if: always()
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
+ - name: Require release gate
+ env:
+ RELEASE_GATE_RESULT: ${{ needs.release-gate.result }}
+ run: test "$RELEASE_GATE_RESULT" = success
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
+ fetch-depth: 0
submodules: recursive
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
diff --git a/.mcp.json b/.mcp.json
index e3990a34..e22ddb75 100644
--- a/.mcp.json
+++ b/.mcp.json
@@ -3,9 +3,7 @@
"codex-science": {
"command": "./scripts/python_runtime.sh",
"args": [
- "./scripts/science_mcp.py",
- "--inventory",
- "./catalog/inventory.json"
+ "./scripts/science_mcp_proxy.py"
]
}
}
diff --git a/PROJECT.md b/PROJECT.md
index 91b824d2..73df8234 100644
--- a/PROJECT.md
+++ b/PROJECT.md
@@ -53,6 +53,46 @@
- Outputs: project-local artifact bundles with stable metadata and links suitable for inspection in Codex.
Each completed run includes a generated Markdown index, optional offline HTML,
and direct Codex display of primary raster results.
+
+## Runtime Delivery and Human Output Contract
+
+- The installed plugin exposes a small, stable bootstrap. On a new task start or
+ first Codex Science activation, that bootstrap checks the official `main`
+ branch, stages and validates a fast-forward candidate, appends it to the
+ project-owned immutable runtime store, and dispatches the same hook event to
+ that receipt-verified runtime. Routine automatic updates never invoke Codex's
+ plugin marketplace or registration commands.
+- The verified runtime, coordinator instructions, and MCP implementation must be
+ usable in that same task. Codex's displayed plugin version identifies the
+ stable host bootstrap and can differ from the scientific runtime version;
+ user-facing text must not claim that host metadata was hot-reloaded.
+- First activation atomically pins one activation generation to an immutable,
+ receipt-verified private runtime. Later hook events, Stop checks, coordinator
+ instructions, and MCP tool calls stay on that pin even when another task
+ installs a newer release. The first MCP `tools/call` binds through Codex's
+ task metadata and replays the already-advertised protocol before handoff.
+- Every durable checkpoint and artifact-manifest write records the runtime
+ identity. `runtime_span` remains a defense-in-depth signal for legacy,
+ recovery, or explicit generation transitions; routine automatic updates do
+ not make an active run span releases.
+- Offline, busy, dirty, invalid, or failed candidates fall back to the last
+ verified runtime with a short actionable status. Automatic update must never
+ silently run a partially installed candidate or destroy the last known-good
+ release.
+- Existing installations need one explicit migration install when the stable
+ host bootstrap changes. Because Codex can retain that bootstrap in inactive
+ open tasks, the migration runs only after all Codex tasks and the app are
+ closed and the installer receives the documented migration acknowledgement.
+ Later runtime-only releases update automatically without plugin registration
+ or a second plain-language approval.
+- Human-facing output follows one order: **status, current step, next action,
+ evidence/result**. Hook notices stay to one concise line; progress appears only
+ at meaningful phase transitions; `index.md` is the canonical completed-run
+ view. Raw JSON, hashes, and complete logs remain machine contracts or linked
+ audit details rather than primary prose.
+- Markdown is the default ChatGPT/Codex presentation surface. Primary raster
+ results render inline, important local files use clickable absolute paths in
+ chat, and optional HTML remains a secondary offline audit view.
- Manuscript entry points:
- Create a new manuscript from a passed or explicitly qualified run bundle.
- Revise an existing manuscript against its evidence and target constraints.
@@ -133,7 +173,8 @@
## Paths
- Plugin manifest: `.codex-plugin/`
-- Registered task-scoped Codex skills: `skills/`
+- Registered stable bootstrap skills: `skills/`
+- Verified live core workflows: `runtime-skills/`
- Internal catalog skill wrappers: `catalog/codex-skills/`
- Imported upstream catalog: `vendor/scientific-agent-skills/`
- Activation policy and inventory: `catalog/`
@@ -179,6 +220,18 @@
- One fixture that produces Markdown, LaTeX/BibTeX, traceability sidecars, a
reporting checklist, and a reviewable submission package without network
credentials.
+ - One lifecycle fixture proving that an A-to-B automatic update dispatches
+ B's session runtime in the initiating task, while failed, offline, concurrent,
+ and interrupted updates continue on A or recover it.
+ - One MCP handoff fixture proving that discovery can hand off to the task's
+ pinned runtime, while external or explicit updates do not switch an active
+ generation.
+ - Human-output fixtures proving concise hook notices, suppressed successful
+ candidate logs, and a human-first Markdown index without changing machine
+ JSON or JSON-RPC stdout.
+ - CI must reject a runtime-affecting diff whose runtime version was not
+ changed relative to the pull-request base, and reject a bootstrap-affecting
+ diff whose host plugin version was not changed.
- Baseline/metric: 100% catalog inventory coverage; zero silently enabled blocked skills; all required checks pass; one reviewed end-to-end research run; three public-source smoke tests.
## References
diff --git a/README.ko.md b/README.ko.md
index a1283dd8..791c9f4c 100644
--- a/README.ko.md
+++ b/README.ko.md
@@ -12,7 +12,7 @@
-Codex Science는 하나의 Codex 작업을 옵트인 방식의 과학 워크벤치로 바꿉니다: 한 번 시작하면 이후 턴에서 연구 워크플로가 이어지고, 명시적으로 종료합니다. [K-Dense-AI](https://github.com/K-Dense-AI/scientific-agent-skills)에서 pin한 149개에, [Google DeepMind](https://github.com/google-deepmind/science-skills) 과학 스킬 전체, 공개 교재 기반 수학·물리 워크플로 28개, 에이전틱 생명과학 evidence synthesis, 실험 분광·분석화학, 로컬·원격 과학 컴퓨팅, Claude Science 공개 featured workflow, ESMFold2·ESMC·AlphaFold3·Protenix-v2·SimpleFold·RoseTTAFold All-Atom·RFdiffusion·BindCraft 같은 최신 공개 모델의 [Codex-native 저작본](authored-skills/)을 더한 **280개 감사된 에이전트 스킬** 카탈로그로 작업을 라우팅합니다. 공개 source 34개와 로컬 catalog 검색·research planner를 read-only MCP로 제공합니다.
+Codex Science는 하나의 Codex 작업을 옵트인 방식의 과학 워크벤치로 바꿉니다: 한 번 시작하면 이후 턴에서 연구 워크플로가 이어지고, 명시적으로 종료합니다. [K-Dense-AI](https://github.com/K-Dense-AI/scientific-agent-skills)에서 pin한 149개에, [Google DeepMind](https://github.com/google-deepmind/science-skills) 과학 스킬 전체, 공개 교재 기반 수학·물리 워크플로 28개, 에이전틱 생명과학 evidence synthesis, 실험 분광·분석화학, 로컬·원격 과학 컴퓨팅, Claude Science 공개 featured workflow, ESMFold2·ESMC·AlphaFold3·Protenix-v2·SimpleFold·RoseTTAFold All-Atom·RFdiffusion·BindCraft 같은 최신 공개 모델의 [Codex-native 저작본](authored-skills/)을 더한 **282개 감사된 에이전트 스킬** 카탈로그로 작업을 라우팅합니다. 공개 source 34개와 로컬 catalog 검색·research planner를 read-only MCP로 제공합니다.
Claude Science의 공개 워크플로에서 영감을 받은 독립 Codex 플러그인이며, 비공개 구현과의 동등성을 주장하지 않습니다.
@@ -28,13 +28,26 @@ curl -fsSL https://raw.githubusercontent.com/eightmm/codex-science/main/scripts/
installer가 관리형 Python 3.12를 준비하고 그 경로를 기록하며, 없으면 호환되는
`python3`를 사용합니다. Hook과 MCP는 매번 `uv`로 해석하거나 내려받지 않고 기록된
인터프리터를 직접 실행합니다. 런타임 자체는 Python 표준 라이브러리만 사용합니다.
-설치 스크립트는 `~/.codex-science`에 clone하고 플러그인을 전역 등록한 뒤 런타임
-self-check까지 수행하며, 업데이트하려면 다시 실행하면 됩니다. 시스템 기본값이
-Python 3.8이면 먼저 `uv`를 설치한 뒤 같은 명령을 실행하세요.
-최초 설치는 staging에서 검증한 뒤 활성화하며, 설치 스크립트를 다시 실행할 때도 hook과 같은 잠금·transactional updater를 사용합니다.
-관리 대상 checkout만 실제 설치 source로 사용합니다. 과거 개발 checkout이
-`codex-science` marketplace 이름으로 등록되어 있으면 installer가 이를
-`~/.codex-science`로 교체하며, 새 source 추가가 실패하면 기존 source를 복구합니다.
+설치 스크립트는 `~/.codex-science`에 clone하고 작고 안정적인 host bootstrap을
+전역 등록한 뒤, Codex Science의 private plugin data 아래에 receipt로 검증되는
+immutable 과학 runtime을 준비하고 self-check를 수행합니다. 시스템 기본값이 Python
+3.8이면 먼저 `uv`를 설치한 뒤 같은 명령을 실행하세요. 최초 설치는 staging에서
+검증한 뒤 활성화합니다.
+
+기존 설치의 host bootstrap을 바꿔야 한다면 한 번의 migration이 필요합니다. 먼저
+모든 Codex 작업을 닫고 Codex 앱도 완전히 종료한 뒤, 그 상태를 installer에
+명시적으로 확인하세요:
+
+```bash
+curl -fsSL https://raw.githubusercontent.com/eightmm/codex-science/main/scripts/install.sh | CODEX_SCIENCE_MIGRATION_ACK=all-codex-tasks-closed bash
+```
+
+Codex 작업이나 앱이 열려 있을 때 이 확인 값을 사용하면 안 됩니다. 등록 과정에서
+Codex가 이전 host cache를 정리할 수 있으므로 비활성 상태인 열린 작업도 먼저
+닫아야 합니다. 과거 개발 checkout 등록은 transaction 안에서 관리 대상
+`~/.codex-science`로 migration하며, 교체 실패 시 기존 source를 복구합니다. 이
+bootstrap migration 뒤의 일반 과학 runtime 업데이트는 자동이며 plugin을 다시
+등록하지 않습니다.
그다음 **아무** 프로젝트에서나 새 Codex 작업을 시작하고 `/hooks`를 열어 Codex Science의 `SessionStart`·`UserPromptSubmit`·`Stop` hook을 한 번 신뢰 처리하세요. `Start Codex Science`(또는 `Codex Science 시작`)라고 하면 이후 턴에서는 coordinator가 스스로 재호출됩니다. 프로젝트마다 재설치하지 않습니다.
@@ -42,8 +55,8 @@ Python 3.8이면 먼저 `uv`를 설치한 뒤 같은 명령을 실행하세요.
표시합니다. 같은 턴을 강제로 이어 가는 blocking 동작은 현재 기본적으로 꺼져
있습니다. 공개 Codex 버그 [openai/codex#20783](https://github.com/openai/codex/issues/20783)이
hook이 만든 로컬 UUID를 API message ID로 보내 다음 요청을 깨뜨릴 수 있기
-때문입니다. Hook 정의가 바뀌는 update 뒤에는 `/hooks`에서 Codex Science hook을
-다시 검토하고 신뢰해야 합니다.
+때문입니다. 일반 runtime 업데이트는 신뢰한 bootstrap 정의를 유지합니다.
+bootstrap hook 정의 자체가 바뀐 경우에만 `/hooks`에서 다시 검토하고 신뢰하세요.
`/hooks`는 사람이 확인하는 보안 경계입니다. Plugin command를 승인할 뿐
science mode를 시작하지는 않으므로, 이 승인은 사용자가 직접 처리하는 것이
@@ -181,50 +194,56 @@ Codex Science 종료
## 자동 업데이트
-기본 `notify` mode는 새 Codex Science 작업을 시작할 때 공식 GitHub `main`
-branch를 최대 24시간에 한 번 확인합니다. 새 버전이 있으면 평문으로
-설치합니다:
+이전 설치는 위의 확인된 bootstrap migration을 한 번 거쳐야 합니다. 이후 기본
+`apply` mode는 `SessionStart`와 최초 Codex Science 활성화 때 공식 GitHub `main`을
+확인합니다.
+
+공식 fast-forward 후보는 candidate code를 실행하기 전에 먼저 분류됩니다. 호환되는
+과학 runtime 변경은 `runtime_version`을 올리고, stable host bootstrap의 byte와
+policy를 보존하고, MCP discovery contract가 호환되며, 전체 candidate gate를
+통과해야 합니다. 통과한 runtime은
+`$CODEX_HOME/plugins/data/codex-science-codex-science/runtime-cache/`
+아래에 append-only로 설치됩니다. 이 프로젝트 소유 store는 Codex가 정리할 수 있는
+plugin cache와 독립적입니다. 자동 업데이트와 일반 명시적 runtime 업데이트는
+`codex plugin`을 호출하거나 plugin 등록을 수정하거나 host bootstrap을 교체하지
+않습니다.
+
+최초 활성화는 generation을 정확한 runtime commit과 receipt에 고정합니다. 이후
+hook, Stop, skill, MCP call은 다른 작업이 새 release를 설치해도 바뀌지 않습니다.
+첫 MCP tool call은 Codex task metadata로 같은 pin에 결합하고 이미 표시한 tool
+contract를 확인합니다. Checkpoint와 artifact manifest는 runtime identity를 계속
+기록하며, `runtime_span`은 정상 자동 업데이트가 아니라 legacy·recovery 전환을
+드러내는 방어적 경고입니다.
+
+후보가 bootstrap file, bootstrap policy, host `plugin_version`을 바꾸면 자동
+업데이트는 후보를 실행하기 전에 중단하고 위 curl migration을 안내합니다. Codex에
+표시되는 plugin version은 stable host bootstrap의 identity이며 과학
+`runtime_version`과 다릅니다. 새 runtime을 사용하려면 새 작업을 열고, bootstrap
+migration 뒤에는 새 작업에서 바뀐 hook 정의를 다시 검토하고 신뢰하세요.
+
+Codex를 실행하기 전에 mode를 선택할 수 있습니다:
+
+| `CODEX_SCIENCE_AUTO_UPDATE` | 작업 시작 / 최초 활성화 | 명시적 업데이트 요청 |
+| --- | --- | --- |
+| `apply` (기본값) | 호환 runtime을 검증해 최초 활성화용으로 설치 | 호환 runtime을 새 활성화용으로 설치, 진행 중 run은 기존 pin 유지 |
+| `notify` | 알림만 표시 | 호환 runtime을 새 활성화용으로 설치, 진행 중 run은 기존 pin 유지 |
+| `off` | 확인 생략 | 호환 runtime을 새 활성화용으로 설치, 진행 중 run은 기존 pin 유지 |
+
+다음 명시적 요청은 어느 mode에서나 동작합니다:
```text
Codex Science 업데이트
Update Codex Science
```
-관리 대상 `~/.codex-science` checkout은 변경사항이 없어야 하며 공식
-`eightmm/codex-science` repository를 가리켜야 합니다. Updater가 사용자에게
-표시한 정확한 commit을 staging에 clone하고 fast-forward ancestry와 runtime을
-검증한 뒤 관리 checkout을 원자적으로 교체하고 설치 cache를 확인합니다.
-실패하면 이전 checkout으로 rollback합니다. 현재 작업의 load된 cache는
-물론 기존 version cache도 모두 보존하므로 이미 열린 작업의 고정된 hook path가
-유지됩니다. 업데이트 적용본은 new Codex task를 열어 사용합니다.
-최근 update 알림이 없다면 첫 요청은 정확한 commit을 확인해 표시만 합니다.
-같은 요청을 한 번 더 보내야 표시된 commit 설치를 승인합니다.
-
-고급 mode는 Codex를 실행하기 전에 process environment로 설정합니다:
-
-```bash
-CODEX_SCIENCE_AUTO_UPDATE=notify # 기본값: 확인 후 알림
-CODEX_SCIENCE_AUTO_UPDATE=off # 자동 확인 중지
-```
-
-무인 apply mode는 없습니다. Update는 위 평문 요청으로 매번 명시적으로
-승인해야 합니다. Dirty checkout, fork, custom remote, 승인 후 branch 이동,
-non-fast-forward 변경, 동일 cachebuster, staging self-check 실패, plugin cache
-검증 실패에서는 업데이트를 거부합니다. 개발용 checkout을 자동으로
-덮어쓰지 않습니다.
-
-사용 예시:
-
-```text
-Codex Science 시작
-현재 고정된 plugin으로 이 데이터를 분석하고 run provenance를 저장해줘.
-Codex Science 업데이트
-# 새 Codex 작업을 열고 업데이트된 버전으로 계속 진행
-```
+네트워크 연결 실패, 다른 updater의 lock, dirty·비공식 checkout, diverged history,
+검증 실패가 발생하면 last-known-good runtime을 유지하고 짧은 이유를 표시합니다.
+개발용 checkout을 자동으로 덮어쓰지 않습니다. Migration 또는 repair가 필요하다는
+메시지가 나온 경우에만 curl installer를 다시 실행하면 됩니다.
## 설치 확인과 문제 해결
-Codex가 설치된 버전을 인식하는지 확인합니다:
+Codex가 stable host bootstrap을 인식하는지 확인합니다:
```bash
codex plugin list
@@ -233,8 +252,10 @@ codex plugin list
`codex-science@codex-science` 행이 `installed, enabled`여야 합니다. Mode가
활성화되지 않으면 **새** Codex 작업을 열고 `/hooks`에서 Codex Science hook 세
개를 모두 신뢰한 뒤 정확히 `Start Codex Science` 또는 `Codex Science 시작`을
-입력하세요. 업데이트 후에는 새 작업을 열어야 하며, hook 정의가 바뀌었다면 다시
-검토하고 신뢰해야 합니다.
+입력하세요. 아직 비활성인 작업은 최초 활성화 때 검증된 새 runtime을 사용할 수
+있고, 이미 활성인 작업은 재현성을 위해 기존 pin을 유지합니다. 설치된 과학
+runtime으로 새로 시작하려면 새 작업을 여세요. 확인된 bootstrap migration 뒤에는
+새 작업에서 바뀐 hook 정의를 다시 검토하고 신뢰해야 합니다.
개발 checkout에서는 다음을 실행합니다:
@@ -272,7 +293,7 @@ packet으로 제시합니다. 승인된 reversible 단계는 반복 확인 없
report·table·notebook·log·보조 figure는 클릭 가능한 절대경로 링크로
제공합니다. 별도 웹 배포는 필요하지 않습니다.
-새 작업에서 평범한 과학 질문만으로는 모드가 활성화되지 않습니다. Codex에 등록되는 코어 스킬은 3개뿐이며, 280개 카탈로그 wrapper는 내부 카탈로그에 남아 활성 coordinator가 선택할 때만 로드됩니다.
+새 작업에서 평범한 과학 질문만으로는 모드가 활성화되지 않습니다. Codex에 등록되는 코어 스킬은 3개뿐이며, 282개 카탈로그 wrapper는 내부 카탈로그에 남아 활성 coordinator가 선택할 때만 로드됩니다.
> 카탈로그에 있다고 실행 권한이 생기는 것은 아닙니다. 비활성 스킬은 audit 사유를 표시하고, upstream 지침을 열람하기 전에 확인을 요구합니다. 검증·설정·경계는 [docs/](docs/) 참고.
diff --git a/README.md b/README.md
index 8d2e26d9..00c6180c 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@
-Codex Science turns one Codex task into an opt-in scientific workbench: start it once, continue the research workflow across later turns, and stop it explicitly. It routes work to an audited catalog of **280 agent skills** — 149 pinned from [K-Dense-AI](https://github.com/K-Dense-AI/scientific-agent-skills), plus [Codex-native skills](authored-skills/) covering the entire [Google DeepMind](https://github.com/google-deepmind/science-skills) science set, 28 textbook-grounded mathematics and physics workflows, agentic life-science evidence synthesis, experimental spectroscopy and analytical chemistry, local and remote scientific compute, Claude Science's publicly documented featured workflows, and current open models such as ESMFold2, ESMC, AlphaFold3, Protenix-v2, SimpleFold, RoseTTAFold All-Atom, RFdiffusion, and BindCraft — adds 34 read-only public data connectors plus local catalog search and research planning, and records reproducible artifacts with independent evidence review.
+Codex Science turns one Codex task into an opt-in scientific workbench: start it once, continue the research workflow across later turns, and stop it explicitly. It routes work to an audited catalog of **282 agent skills** — 149 pinned from [K-Dense-AI](https://github.com/K-Dense-AI/scientific-agent-skills), plus [Codex-native skills](authored-skills/) covering the entire [Google DeepMind](https://github.com/google-deepmind/science-skills) science set, 28 textbook-grounded mathematics and physics workflows, agentic life-science evidence synthesis, experimental spectroscopy and analytical chemistry, local and remote scientific compute, Claude Science's publicly documented featured workflows, and current open models such as ESMFold2, ESMC, AlphaFold3, Protenix-v2, SimpleFold, RoseTTAFold All-Atom, RFdiffusion, and BindCraft — adds 34 read-only public data connectors plus local catalog search and research planning, and records reproducible artifacts with independent evidence review.
This is an independent Codex plugin inspired by the public workflow of Claude Science. It does not claim parity with any private implementation.
@@ -29,14 +29,26 @@ available, the installer provisions and records a managed Python 3.12 runtime;
otherwise it uses a compatible `python3`. The hooks and MCP server execute that
recorded interpreter directly, so they do not resolve or download Python on every
invocation. The runtime uses only the Python standard library. The installer
-clones into `~/.codex-science`, registers the plugin globally, runs a runtime
-self-check, and is safe to re-run to update. On a Python 3.8 system, install
-`uv` first and then run the same command.
-Fresh installs are validated in staging before activation; installer reruns use the same locked, transactional updater as the hook.
-The managed checkout is the only installation source. If an older development
-checkout is registered under the `codex-science` marketplace name, the installer
-replaces that registration with `~/.codex-science` and restores the previous
-source if the replacement cannot be added.
+clones into `~/.codex-science`, registers a small stable host bootstrap globally,
+prepares a receipt-verified immutable scientific runtime under Codex Science's
+private plugin data, and runs a runtime self-check. On a Python 3.8 system,
+install `uv` first and then run the same command. Fresh installs are validated in
+staging before activation.
+
+An existing installation whose host bootstrap must change needs a one-time
+migration. First close every Codex task and quit the Codex app, then explicitly
+acknowledge that condition to the installer:
+
+```bash
+curl -fsSL https://raw.githubusercontent.com/eightmm/codex-science/main/scripts/install.sh | CODEX_SCIENCE_MIGRATION_ACK=all-codex-tasks-closed bash
+```
+
+Do not use that acknowledgement while any Codex task or the app is still open.
+Codex can prune an old host cache during registration, so even an inactive open
+task must be closed. The installer migrates an older development-checkout
+registration transactionally and restores the previous source if replacement
+fails. After this bootstrap migration, routine scientific-runtime updates are
+automatic and do not re-register the plugin.
Then in **any** project, start a new Codex task, open `/hooks`, and trust the Codex Science `SessionStart`, `UserPromptSubmit`, and `Stop` hooks once. Say `Start Codex Science`; later turns self-invoke the coordinator without another skill mention. You do not re-install per project.
@@ -44,8 +56,9 @@ Trust the `Stop` hook too. It reports the saved next action when a run remains
active. Blocking same-turn continuation is temporarily disabled by default
because of the open Codex bug [openai/codex#20783](https://github.com/openai/codex/issues/20783),
which can send a hook-generated local UUID as an API message ID and break the
-next request. Hook trust is tied to the exact definition, so after an update
-that changes hooks, review the Codex Science hooks in `/hooks` again.
+next request. Hook trust is tied to the exact bootstrap definition. Ordinary
+live-runtime updates keep that definition stable; review `/hooks` again only
+when the bootstrap definition itself changes.
`/hooks` is the human security boundary: it approves the plugin command but does
not start the science mode. Keep that approval as a deliberate user action. Once
@@ -187,50 +200,59 @@ Codex Science 종료
## Updates
-The default `notify` mode checks the official GitHub `main` branch at most once
-every 24 hours when a new Codex Science task starts. If an update exists, install
-it with plain language:
+Older installations need the acknowledged bootstrap migration shown above.
+After that, the default `apply` mode checks the official GitHub `main` branch at
+`SessionStart` and again on the first Codex Science activation when needed.
+
+A clean, official fast-forward candidate is classified before any candidate code
+runs. A compatible scientific-runtime change must advance `runtime_version`,
+preserve the stable host-bootstrap bytes and policy, keep the MCP discovery
+contract compatible, and pass the complete candidate gate. It is then installed
+append-only under
+`$CODEX_HOME/plugins/data/codex-science-codex-science/runtime-cache/`;
+this project-owned store is independent of Codex's prunable plugin cache.
+Automatic and ordinary explicit runtime updates never call `codex plugin`, edit
+Codex plugin registration, or replace the host bootstrap.
+
+First activation pins the generation to an exact runtime commit and receipt.
+Later hooks, Stop checks, skills, and MCP calls do not switch when another task
+installs a release. The first MCP tool call uses Codex task metadata to bind the
+connection to the same pin after checking the advertised tool contract.
+Checkpoints and artifact manifests record that runtime identity; `runtime_span`
+is a defensive warning for legacy or recovery transitions rather than the normal
+update path.
+
+If a candidate changes bootstrap files, bootstrap policy, or the host
+`plugin_version`, automatic update stops before running it and asks for the
+acknowledged curl migration. The plugin version shown by Codex identifies this
+stable host bootstrap; it is not the scientific `runtime_version`. Open a new
+task to adopt a newly installed runtime or, after a bootstrap migration, to load
+and review the new hook definition.
+
+Choose the startup behavior before launching Codex:
+
+| `CODEX_SCIENCE_AUTO_UPDATE` | Session start / first activation | Explicit update request |
+| --- | --- | --- |
+| `apply` (default) | Verify and install a compatible runtime for activation | Install a compatible runtime for new activations; keep an active run pinned |
+| `notify` | Report only | Install a compatible runtime for new activations; keep an active run pinned |
+| `off` | Skip | Install a compatible runtime for new activations; keep an active run pinned |
+
+An explicit request works in every mode:
```text
Codex Science 업데이트
Update Codex Science
```
-The managed `~/.codex-science` checkout must be clean and point to the official
-`eightmm/codex-science` repository. The updater clones the exact commit that was
-shown to the user, verifies fast-forward ancestry and runtime behavior in staging,
-then atomically replaces the managed checkout and verifies the installed plugin
-cache. Failure rolls back to the previous checkout. The current task's loaded
-cache and every older version cache are preserved so already-open tasks keep
-their pinned hook paths; start a new Codex task to use the update.
-If there is no fresh update notice, the first update request checks and advertises
-the exact commit; repeat the request once to approve that advertised commit.
-
-Advanced modes are process environment variables set before launching Codex:
-
-```bash
-CODEX_SCIENCE_AUTO_UPDATE=notify # default: check and ask
-CODEX_SCIENCE_AUTO_UPDATE=off # no automatic check
-```
-
-There is no unattended apply mode. Updating always requires the explicit plain-
-language request above. Updates refuse dirty checkouts, forks, custom remotes,
-branch movement after approval, non-fast-forward changes, unchanged cachebuster,
-failed staging checks, and failed plugin-cache verification. A development
-checkout is never silently overwritten.
-
-Example workflow:
-
-```text
-Start Codex Science
-Analyze this dataset with the current pinned plugin and save the run provenance.
-Codex Science 업데이트
-# Open a new Codex task, then continue with the newly loaded version.
-```
+If the network is unavailable, another update owns the lock, the managed checkout
+is dirty or unofficial, ancestry diverges, or validation fails, Codex Science
+keeps the last-known-good verified runtime and reports the reason. It never
+silently overwrites a development checkout. Re-run the installer only when the
+message asks for migration or repair.
## Verify and troubleshoot
-Confirm that Codex sees the installed version:
+Confirm that Codex sees the stable host bootstrap:
```bash
codex plugin list
@@ -239,8 +261,10 @@ codex plugin list
The `codex-science@codex-science` row should say `installed, enabled`. If the
mode does not activate, open a **new** Codex task, inspect `/hooks`, trust all
three Codex Science hooks, and use exactly `Start Codex Science` or
-`Codex Science 시작`. After an update, open a new task; if a hook definition
-changed, review and trust it again.
+`Codex Science 시작`. An inactive task can use the verified update on first
+activation; an already active task deliberately keeps its prior pin. Open a new
+task to start on the installed scientific runtime. After an acknowledged
+bootstrap migration, open a new task and review and trust the new hook definition.
For a development checkout, run:
@@ -279,7 +303,7 @@ Each completed run also gets a local `index.md` and, when requested, an offline
Codex conversation; reports, tables, notebooks, logs, and secondary figures are
returned as clickable absolute-path links. No web deployment is required.
-An ordinary scientific question in a fresh task does **not** activate the mode. Only three core skills are registered with Codex; the 280 catalog wrappers stay in an internal catalog and load only when the active coordinator selects them.
+An ordinary scientific question in a fresh task does **not** activate the mode. Only three core skills are registered with Codex; the 282 catalog wrappers stay in an internal catalog and load only when the active coordinator selects them.
> Catalog presence is not execution permission. Inactive skills show their audit reasons and require acknowledgement before their upstream instructions can be inspected. See [docs/](docs/) for verification, configuration, and boundaries.
diff --git a/authored-skills/compute-environment/SKILL.md b/authored-skills/compute-environment/SKILL.md
index 60953f0a..50814288 100644
--- a/authored-skills/compute-environment/SKILL.md
+++ b/authored-skills/compute-environment/SKILL.md
@@ -17,7 +17,7 @@ schemas or review procedure are needed.
1. Resolve the project root from the current workspace or nearest version-control
root. Inspect relevant inputs and storage needs without copying sensitive data.
-2. Run `python3 /scripts/compute_probe.py`
+2. Run `"/scripts/python_runtime.sh" "/scripts/compute_probe.py"`
for a read-only capability report. Save it under the run directory with
`--output artifacts//compute-environment.json` once a run exists.
3. Select the smallest adequate backend:
diff --git a/authored-skills/dimensional-analysis-units/SKILL.md b/authored-skills/dimensional-analysis-units/SKILL.md
index 3eadba1b..1b5dfa79 100644
--- a/authored-skills/dimensional-analysis-units/SKILL.md
+++ b/authored-skills/dimensional-analysis-units/SKILL.md
@@ -22,7 +22,7 @@ Preserve unit mappings and receipts with `$science-provenance`; use `$science-re
1. Normalize quantities and source units without losing their original representation.
2. Check sums, equalities, derivatives, integrals, powers, logarithms, exponentials, and trigonometric arguments.
-3. Run `scripts/check_dimensions.py --require-clean` for equations and bounded conversions supported by the built-in registry.
+3. Run `"/scripts/python_runtime.sh" "/scripts/check_dimensions.py" --require-clean` for equations and bounded conversions supported by the built-in registry.
4. Choose characteristic scales, nondimensionalize the model, identify independent groups, and estimate their magnitudes before dropping terms.
5. Test zero, infinite, symmetric, and dominant-balance limits and rescale to recover the original equation.
6. Cross-check nontrivial conversions with an independent trusted source or quantity library.
diff --git a/authored-skills/dimensional-analysis-units/references/unit-dimension-runtime.md b/authored-skills/dimensional-analysis-units/references/unit-dimension-runtime.md
index 88535f22..96b32a1a 100644
--- a/authored-skills/dimensional-analysis-units/references/unit-dimension-runtime.md
+++ b/authored-skills/dimensional-analysis-units/references/unit-dimension-runtime.md
@@ -18,7 +18,7 @@ Unknown units fail loudly. Normalize domain-specific units explicitly rather tha
## Equation check
```bash
-uv run python scripts/check_dimensions.py dimensions.json \
+"/scripts/python_runtime.sh" "/scripts/check_dimensions.py" dimensions.json \
--output artifacts/run/dimension-check.json \
--require-clean
```
diff --git a/authored-skills/experimental-uncertainty-propagation/SKILL.md b/authored-skills/experimental-uncertainty-propagation/SKILL.md
index a29c6fc9..5a3d551c 100644
--- a/authored-skills/experimental-uncertainty-propagation/SKILL.md
+++ b/authored-skills/experimental-uncertainty-propagation/SKILL.md
@@ -24,7 +24,7 @@ Preserve inputs, calibration references, covariance, seed, and receipts with `$s
2. Build Type A and Type B components and convert them to standard uncertainties with explicit distributions.
3. Record covariance caused by shared calibration, environment, preprocessing, or common parameters.
4. Check dimensions, correlation bounds, and covariance positive semidefiniteness.
-5. Run `scripts/propagate_uncertainty.py`; use `both` when first-order linearization may be questionable.
+5. Run `"/scripts/python_runtime.sh" "/scripts/propagate_uncertainty.py"`; use `both` when first-order linearization may be questionable.
6. Verify linear and Monte Carlo means and standard uncertainties, inspect failed samples, and identify dominant sensitivity contributors.
7. Vary plausible Type B distributions, correlations, calibration values, and model forms.
8. Report value, unit, standard uncertainty, interval convention, assumptions, dominant contributors, and limitations.
diff --git a/authored-skills/experimental-uncertainty-propagation/references/uncertainty-runtime.md b/authored-skills/experimental-uncertainty-propagation/references/uncertainty-runtime.md
index a063b87b..a3389638 100644
--- a/authored-skills/experimental-uncertainty-propagation/references/uncertainty-runtime.md
+++ b/authored-skills/experimental-uncertainty-propagation/references/uncertainty-runtime.md
@@ -3,7 +3,7 @@
## Input
```bash
-uv run python scripts/propagate_uncertainty.py uncertainty.json \
+"/scripts/python_runtime.sh" "/scripts/propagate_uncertainty.py" uncertainty.json \
--output artifacts/run/uncertainty-propagation.json \
--require-clean
```
diff --git a/authored-skills/formal-theorem-proving/SKILL.md b/authored-skills/formal-theorem-proving/SKILL.md
index be716c88..d2454fbc 100644
--- a/authored-skills/formal-theorem-proving/SKILL.md
+++ b/authored-skills/formal-theorem-proving/SKILL.md
@@ -24,7 +24,7 @@ Record the reference and theorem hashes with `$science-provenance`. Use `$scienc
2. Search existing definitions and lemmas before introducing synonyms.
3. Create the smallest compiling theorem with explicit imports and helper lemmas that expose the mathematical invariants.
4. Prefer stable term or structured tactic proofs. Isolate automation and record its dependencies.
-5. Preview with `scripts/check_formal_proof.py --preview` before executing an unfamiliar workspace command.
+5. Preview with `"/scripts/python_runtime.sh" "/scripts/check_formal_proof.py" --preview` before executing an unfamiliar workspace command.
6. Execute the bounded checker in the existing approved workspace. Preserve stdout/stderr hashes, tool version, exit code, theorem hash, axioms, admitted constructs, and source-mutation check.
7. Verify informal/formal correspondence explicitly; create `proved-formal` only after a passed `formal-kernel` receipt and a separate correspondence review.
diff --git a/authored-skills/formal-theorem-proving/references/lean-proof-runtime.md b/authored-skills/formal-theorem-proving/references/lean-proof-runtime.md
index dced1d65..26aff0da 100644
--- a/authored-skills/formal-theorem-proving/references/lean-proof-runtime.md
+++ b/authored-skills/formal-theorem-proving/references/lean-proof-runtime.md
@@ -17,7 +17,7 @@ Record a new claim when any of these change. A theorem with a similar name or co
## Preview
```bash
-uv run python scripts/check_formal_proof.py proof.json \
+"/scripts/python_runtime.sh" "/scripts/check_formal_proof.py" proof.json \
--workspace path/to/existing/lean-project \
--output artifacts/run/formal-proof-preview.json \
--preview
@@ -46,7 +46,7 @@ Preview records the exact command, theorem SHA-256, statement SHA-256, timeout,
## Execute
```bash
-uv run python scripts/check_formal_proof.py proof.json \
+"/scripts/python_runtime.sh" "/scripts/check_formal_proof.py" proof.json \
--workspace path/to/existing/lean-project \
--output artifacts/run/formal-proof-check.json \
--require-passed
diff --git a/authored-skills/literature-review/SKILL.md b/authored-skills/literature-review/SKILL.md
index 4151b679..66c61b07 100644
--- a/authored-skills/literature-review/SKILL.md
+++ b/authored-skills/literature-review/SKILL.md
@@ -69,7 +69,7 @@ Do not infer an unreported method, denominator, result, or uncertainty from an a
Keep prior snapshots immutable. Save a new snapshot with the revised cutoff and run:
-`/scripts/diff_literature_review.py --output `
+`"/scripts/python_runtime.sh" "/scripts/diff_literature_review.py" --output `
Report added, removed, and changed queries, studies, eligibility decisions, and claims. Never replace a previous reviewed narrative without a diff and review invalidation.
diff --git a/authored-skills/literature-review/references/living-update.md b/authored-skills/literature-review/references/living-update.md
index 88415fa1..7676fd1b 100644
--- a/authored-skills/literature-review/references/living-update.md
+++ b/authored-skills/literature-review/references/living-update.md
@@ -21,7 +21,7 @@ Compare:
Use:
```bash
-python scripts/diff_literature_review.py previous.json current.json --output diff.json
+"/scripts/python_runtime.sh" "/scripts/diff_literature_review.py" previous.json current.json --output diff.json
```
## Invalidation
diff --git a/authored-skills/mathematical-problem-execution/references/problem-execution-runtime.md b/authored-skills/mathematical-problem-execution/references/problem-execution-runtime.md
index 216d39be..7030fbd5 100644
--- a/authored-skills/mathematical-problem-execution/references/problem-execution-runtime.md
+++ b/authored-skills/mathematical-problem-execution/references/problem-execution-runtime.md
@@ -5,11 +5,11 @@
| Problem class | Primary skill/runtime | Required caution |
| --- | --- | --- |
| theorem or refutation | `$cx-proof-and-counterexample`; optional formal checker | bounded tests are not general proof |
-| formal Lean theorem | `$cx-formal-theorem-proving`; `scripts/check_formal_proof.py` | compare formal and informal statements |
+| formal Lean theorem | `$cx-formal-theorem-proving`; `"/scripts/python_runtime.sh" "/scripts/check_formal_proof.py"` | compare formal and informal statements |
| experimental or observational contrast | `$cx-statistical-inference-experimental-design` | experimental unit and estimand first |
-| numerical approximation | `$cx-numerical-analysis-error-control`; `scripts/verify_numerical_result.py` | residual and tolerance are not total error |
-| physical equation or conversion | `$cx-dimensional-analysis-units`; `scripts/check_dimensions.py` | dimensional consistency is not physical validity |
-| propagated uncertainty | `$cx-experimental-uncertainty-propagation`; `scripts/propagate_uncertainty.py` | covariance and distribution are assumptions |
+| numerical approximation | `$cx-numerical-analysis-error-control`; `"/scripts/python_runtime.sh" "/scripts/verify_numerical_result.py"` | residual and tolerance are not total error |
+| physical equation or conversion | `$cx-dimensional-analysis-units`; `"/scripts/python_runtime.sh" "/scripts/check_dimensions.py"` | dimensional consistency is not physical validity |
+| propagated uncertainty | `$cx-experimental-uncertainty-propagation`; `"/scripts/python_runtime.sh" "/scripts/propagate_uncertainty.py"` | covariance and distribution are assumptions |
| symbolic algebra | `kdense-sympy` plus manual domain checks | branches and lost solutions must be audited |
| ODE/PDE or inverse problem | `$cx-ode-pde-solving` plus numerical verification | boundary conditions and identifiability control the claim |
diff --git a/authored-skills/numerical-analysis-error-control/SKILL.md b/authored-skills/numerical-analysis-error-control/SKILL.md
index ca991e68..cf3f1550 100644
--- a/authored-skills/numerical-analysis-error-control/SKILL.md
+++ b/authored-skills/numerical-analysis-error-control/SKILL.md
@@ -24,7 +24,7 @@ Preserve inputs, code, environment, refinements, and receipts with `$science-pro
2. Choose a reference from exact solutions, manufactured solutions, independent implementations, interval bounds, or a demonstrated higher-accuracy method.
3. Run at least three refinement levels for an order claim and retain failed levels.
4. Record errors or reference value, residuals, invariants, precision, absolute and relative tolerances, and cross-method estimates with uncertainties.
-5. Run `scripts/verify_numerical_result.py --require-clean`.
+5. Run `"/scripts/python_runtime.sh" "/scripts/verify_numerical_result.py" --require-clean`.
6. Perturb tolerances, precision, inputs, grids, and algorithm where the claim depends on them.
7. Report only digits and validity supported by the error budget and verification receipt.
diff --git a/authored-skills/numerical-analysis-error-control/references/numerical-verification-runtime.md b/authored-skills/numerical-analysis-error-control/references/numerical-verification-runtime.md
index f9b5300b..28055930 100644
--- a/authored-skills/numerical-analysis-error-control/references/numerical-verification-runtime.md
+++ b/authored-skills/numerical-analysis-error-control/references/numerical-verification-runtime.md
@@ -3,7 +3,7 @@
## Input schema
```bash
-uv run python scripts/verify_numerical_result.py verification.json \
+"/scripts/python_runtime.sh" "/scripts/verify_numerical_result.py" verification.json \
--output artifacts/run/numerical-verification.json \
--require-clean
```
diff --git a/authored-skills/proof-and-counterexample/SKILL.md b/authored-skills/proof-and-counterexample/SKILL.md
index 17f8f1fd..c0d7e0c9 100644
--- a/authored-skills/proof-and-counterexample/SKILL.md
+++ b/authored-skills/proof-and-counterexample/SKILL.md
@@ -22,7 +22,7 @@ Record material reference hashes. Preserve search and proof artifacts with `$sci
1. Normalize the statement and negation with explicit types and quantifiers.
2. Attack omitted hypotheses, zero and empty cases, boundaries, singularities, small finite objects, and low dimensions.
-3. When a bounded executable domain helps, run `scripts/search_counterexample.py`. A returned assignment must satisfy every hypothesis and violate the conclusion.
+3. When a bounded executable domain helps, run `"/scripts/python_runtime.sh" "/scripts/search_counterexample.py"`. A returned assignment must satisfy every hypothesis and violate the conclusion.
4. If no counterexample is found, keep the status `tested` unless an exact finite domain was completely exhausted.
5. For a proof, choose direct, contrapositive, contradiction, induction, construction, invariant, extremal, or equivalence routes and decompose every material dependency into a proof-obligation graph.
6. Produce an `informal-deductive`, `finite-exhaustion`, or `formal-kernel` proof receipt appropriate to the evidence.
diff --git a/authored-skills/proof-and-counterexample/references/proof-counterexample-runtime.md b/authored-skills/proof-and-counterexample/references/proof-counterexample-runtime.md
index 72b7b11b..9a794bb9 100644
--- a/authored-skills/proof-and-counterexample/references/proof-counterexample-runtime.md
+++ b/authored-skills/proof-and-counterexample/references/proof-counterexample-runtime.md
@@ -3,7 +3,7 @@
## Search input
```bash
-uv run python scripts/search_counterexample.py search.json \
+"/scripts/python_runtime.sh" "/scripts/search_counterexample.py" search.json \
--output artifacts/run/counterexample-search.json
```
diff --git a/authored-skills/quantitative-research/SKILL.md b/authored-skills/quantitative-research/SKILL.md
index c54dda66..b2b2414c 100644
--- a/authored-skills/quantitative-research/SKILL.md
+++ b/authored-skills/quantitative-research/SKILL.md
@@ -30,12 +30,12 @@ Inspect `references/index.json` and load only the entries required for the selec
- Read [formal proof execution](references/formal-proof-runtime.md) before executing Lean or accepting a kernel-check receipt.
- Read [artifact and review handoff](references/artifact-and-review.md) before packaging a claim-bearing quantitative run.
-For a material computation or claim, record the loaded reference hashes with `scripts/reference_lookup.py`. Do not infer CLI arguments, result schemas, evidence levels, or proof semantics from command names.
+For a material computation or claim, record the loaded reference hashes with `"/scripts/python_runtime.sh" "/scripts/reference_lookup.py"`. Do not infer CLI arguments, result schemas, evidence levels, or proof semantics from command names.
## Workflow
1. **Specify.** Normalize assumptions, quantifiers, variables, units, experimental units, outcomes, estimands, and claim status. Give each material claim an ID.
-2. **Preregister.** For empirical work, author a `research-design` input and run `scripts/validate_research_design.py --require-clean` before outcome-driven analysis.
+2. **Preregister.** For empirical work, author a `research-design` input and run `"/scripts/python_runtime.sh" "/scripts/validate_research_design.py" --require-clean` before outcome-driven analysis.
3. **Route evidence lanes.** Use `$cx-statistical-inference-experimental-design`, `$cx-proof-and-counterexample`, `$cx-formal-theorem-proving`, `$cx-numerical-analysis-error-control`, `$cx-dimensional-analysis-units`, and `$cx-experimental-uncertainty-propagation` as applicable.
4. **Execute.** Use only the bounded CLIs described in the selected references. Write results to files; never paste a large result stream into the conversation.
5. **Cross-check.** Require independent checks appropriate to the lane: exact randomization, sensitivity analysis, refinement order, residual, invariant, unit balance, covariance-aware propagation, counterexample verification, proof obligations, or kernel execution.
diff --git a/authored-skills/quantitative-research/references/artifact-and-review.md b/authored-skills/quantitative-research/references/artifact-and-review.md
index 81c73a27..3335cc9f 100644
--- a/authored-skills/quantitative-research/references/artifact-and-review.md
+++ b/authored-skills/quantitative-research/references/artifact-and-review.md
@@ -43,11 +43,11 @@ The manifest claim table remains a navigation layer. Mathematical truth status i
Run the deterministic end-to-end fixture:
```bash
-uv run python scripts/run_quantitative_acceptance.py \
+"/scripts/python_runtime.sh" "/scripts/run_quantitative_acceptance.py" \
examples/quantitative-research/input.json \
/tmp/quantitative-run
-uv run python scripts/validate_artifact.py \
+"/scripts/python_runtime.sh" "/scripts/validate_artifact.py" \
/tmp/quantitative-run/manifest.json \
--review-output /tmp/quantitative-review.json \
--require-passed-review
@@ -68,7 +68,7 @@ It is a software and contract acceptance fixture. It is not an empirical scienti
## Review procedure
-1. Validate every artifact hash and sidecar schema with `scripts/validate_artifact.py`.
+1. Validate every artifact hash and sidecar schema with `"/scripts/python_runtime.sh" "/scripts/validate_artifact.py"`.
2. Confirm that research-design fields were fixed before outcome inspection.
3. Recompute experimental-unit counts from raw rows or source data.
4. Inspect effect sizes, intervals, missingness, multiplicity family, and alternative analyses before p-values.
diff --git a/authored-skills/quantitative-research/references/formal-proof-runtime.md b/authored-skills/quantitative-research/references/formal-proof-runtime.md
index a3f1b5f1..fd9ea49f 100644
--- a/authored-skills/quantitative-research/references/formal-proof-runtime.md
+++ b/authored-skills/quantitative-research/references/formal-proof-runtime.md
@@ -27,7 +27,7 @@ The checker never creates a Lean project, installs Lean, downloads Mathlib, or c
Always preview an unfamiliar workspace before execution:
```bash
-uv run python scripts/check_formal_proof.py proof.input.json \
+"/scripts/python_runtime.sh" "/scripts/check_formal_proof.py" proof.input.json \
--workspace path/to/existing/project \
--output artifacts/run/formal-proof-preview.json \
--preview
@@ -47,7 +47,7 @@ Preview does not execute the checker and cannot support `proved-formal`.
## Execute
```bash
-uv run python scripts/check_formal_proof.py proof.input.json \
+"/scripts/python_runtime.sh" "/scripts/check_formal_proof.py" proof.input.json \
--workspace path/to/existing/project \
--output artifacts/run/formal-proof-check.json \
--require-passed
diff --git a/authored-skills/quantitative-research/references/mathematical-proof-and-counterexample.md b/authored-skills/quantitative-research/references/mathematical-proof-and-counterexample.md
index ec4b0f10..6c138687 100644
--- a/authored-skills/quantitative-research/references/mathematical-proof-and-counterexample.md
+++ b/authored-skills/quantitative-research/references/mathematical-proof-and-counterexample.md
@@ -44,7 +44,7 @@ The statement hash is part of every proof and counterexample linkage. Rephrasing
## Counterexample search
```bash
-uv run python scripts/search_counterexample.py search.input.json \
+"/scripts/python_runtime.sh" "/scripts/search_counterexample.py" search.input.json \
--output artifacts/run/counterexample-search.json
```
diff --git a/authored-skills/quantitative-research/references/numerical-units-uncertainty.md b/authored-skills/quantitative-research/references/numerical-units-uncertainty.md
index 86ca5906..1778ff33 100644
--- a/authored-skills/quantitative-research/references/numerical-units-uncertainty.md
+++ b/authored-skills/quantitative-research/references/numerical-units-uncertainty.md
@@ -5,7 +5,7 @@ Read the relevant section before invoking a numerical, dimensional, or uncertain
## Numerical verification
```bash
-uv run python scripts/verify_numerical_result.py numerical.input.json \
+"/scripts/python_runtime.sh" "/scripts/verify_numerical_result.py" numerical.input.json \
--output artifacts/run/numerical-verification.json \
--require-clean
```
@@ -74,7 +74,7 @@ Observed convergence on a finite range does not prove asymptotic convergence or
## Dimensional analysis
```bash
-uv run python scripts/check_dimensions.py dimensions.input.json \
+"/scripts/python_runtime.sh" "/scripts/check_dimensions.py" dimensions.input.json \
--output artifacts/run/dimension-check.json \
--require-clean
```
@@ -110,7 +110,7 @@ Dimensional consistency is only a necessary check. A dimensionally valid equatio
## Uncertainty propagation
```bash
-uv run python scripts/propagate_uncertainty.py uncertainty.input.json \
+"/scripts/python_runtime.sh" "/scripts/propagate_uncertainty.py" uncertainty.input.json \
--output artifacts/run/uncertainty-propagation.json \
--require-clean
```
diff --git a/authored-skills/quantitative-research/references/research-design-and-statistics.md b/authored-skills/quantitative-research/references/research-design-and-statistics.md
index 440ef553..ceab55d9 100644
--- a/authored-skills/quantitative-research/references/research-design-and-statistics.md
+++ b/authored-skills/quantitative-research/references/research-design-and-statistics.md
@@ -5,7 +5,7 @@ Read this file before `research-design-audit` or `statistical-analysis`. The com
## Research-design input
```bash
-uv run python scripts/validate_research_design.py design.input.json \
+"/scripts/python_runtime.sh" "/scripts/validate_research_design.py" design.input.json \
--output artifacts/run/research-design.json \
--require-clean
```
@@ -78,7 +78,7 @@ The audit detects:
The built-in dependency-free runtime is deliberately bounded to independent or paired two-group contrasts. Use a domain-specific model outside this runtime when censoring, complex hierarchy, longitudinal dependence, survey weights, generalized outcomes, or adaptive designs are material; still retain the same research-design and artifact contracts.
```bash
-uv run python scripts/run_statistical_analysis.py analysis.input.json \
+"/scripts/python_runtime.sh" "/scripts/run_statistical_analysis.py" analysis.input.json \
--output artifacts/run/statistical-analysis.json
```
diff --git a/authored-skills/remote-scientific-compute/references/job-runtime.md b/authored-skills/remote-scientific-compute/references/job-runtime.md
index 5249680b..b542b019 100644
--- a/authored-skills/remote-scientific-compute/references/job-runtime.md
+++ b/authored-skills/remote-scientific-compute/references/job-runtime.md
@@ -86,14 +86,14 @@ The spec fingerprint covers all fields, including command, environment values, r
## CLI overview
```bash
-python scripts/science_job.py --state-dir .science-jobs preflight ...
-python scripts/science_job.py --state-dir .science-jobs approve ...
-python scripts/science_job.py --state-dir .science-jobs render-slurm ...
-python scripts/science_job.py --state-dir .science-jobs submit ...
-python scripts/science_job.py --state-dir .science-jobs status ...
-python scripts/science_job.py --state-dir .science-jobs wait ...
-python scripts/science_job.py --state-dir .science-jobs cancel ...
-python scripts/science_job.py --state-dir .science-jobs collect ...
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir .science-jobs preflight ...
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir .science-jobs approve ...
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir .science-jobs render-slurm ...
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir .science-jobs submit ...
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir .science-jobs status ...
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir .science-jobs wait ...
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir .science-jobs cancel ...
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir .science-jobs collect ...
```
Every command writes a JSON receipt to `--output`.
@@ -103,7 +103,7 @@ Every command writes a JSON receipt to `--output`.
### Preflight
```bash
-python scripts/science_job.py \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" \
--state-dir artifacts/run-014/jobs \
preflight \
--spec artifacts/run-014/job-spec.json \
@@ -123,7 +123,7 @@ A successful preflight does not prove that imports, model weights, databases, in
### Submit
```bash
-python scripts/science_job.py \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" \
--state-dir artifacts/run-014/jobs \
submit \
--spec artifacts/run-014/job-spec.json \
@@ -161,14 +161,14 @@ jobs/jobs/local-.../
### Status and wait
```bash
-python scripts/science_job.py \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" \
--state-dir artifacts/run-014/jobs \
status \
--backend local \
--job-id local-... \
--output artifacts/run-014/job-status.json
-python scripts/science_job.py \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" \
--state-dir artifacts/run-014/jobs \
wait \
--backend local \
@@ -206,7 +206,7 @@ A process exit code of zero means only that the command completed according to t
### Cancel
```bash
-python scripts/science_job.py \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" \
--state-dir artifacts/run-014/jobs \
cancel \
--backend local \
@@ -219,7 +219,7 @@ Cancellation is idempotent for terminal jobs. The local backend sends `SIGTERM`
### Collect outputs
```bash
-python scripts/science_job.py \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" \
--state-dir artifacts/run-014/jobs \
collect \
--backend local \
@@ -240,7 +240,7 @@ Do not remove a missing output from the receipt to make a run appear complete.
Create approval for a spec only after reviewing target, resource, cost, transfer, cancellation, and scientific scope.
```bash
-python scripts/science_job.py \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" \
--state-dir artifacts/run-014/jobs \
approve \
--spec artifacts/run-014/slurm-job-spec.json \
@@ -270,7 +270,7 @@ Changing the job spec invalidates the approval. Approval authorizes execution bo
### Render before submitting
```bash
-python scripts/science_job.py \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" \
--state-dir artifacts/run-014/jobs \
render-slurm \
--spec artifacts/run-014/slurm-job-spec.json \
@@ -292,7 +292,7 @@ Rendering is safe and does not submit.
### Submit
```bash
-python scripts/science_job.py \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" \
--state-dir artifacts/run-014/jobs \
submit \
--spec artifacts/run-014/slurm-job-spec.json \
@@ -314,7 +314,7 @@ The backend does not copy data or credentials.
### Status
```bash
-python scripts/science_job.py \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" \
--state-dir artifacts/run-014/jobs \
status \
--backend slurm \
@@ -327,10 +327,10 @@ The adapter normalizes scheduler states while retaining the raw state in the mes
### Cancel and collect
```bash
-python scripts/science_job.py --state-dir artifacts/run-014/jobs cancel \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir artifacts/run-014/jobs cancel \
--backend slurm --job-id slurm-local-... --output cancelled.json
-python scripts/science_job.py --state-dir artifacts/run-014/jobs collect \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir artifacts/run-014/jobs collect \
--backend slurm --job-id slurm-local-... --output collected.json
```
diff --git a/authored-skills/statistical-inference-experimental-design/SKILL.md b/authored-skills/statistical-inference-experimental-design/SKILL.md
index d7258999..0f424ab9 100644
--- a/authored-skills/statistical-inference-experimental-design/SKILL.md
+++ b/authored-skills/statistical-inference-experimental-design/SKILL.md
@@ -16,13 +16,13 @@ Do not use the number of cells, images, technical repeats, time points, or model
Read [the design and inference runtime](references/design-and-inference-runtime.md) before `research-design-audit` or `statistical-analysis`. It contains the exact input fields, CLI arguments, supported bounded methods, and interpretation limits. Do not infer a model, p-value meaning, multiplicity family, or independent-unit count from an operation name.
-For material work, record the reference hash with `scripts/reference_lookup.py` and preserve the design and result files with `$science-provenance`.
+For material work, record the reference hash with `"/scripts/python_runtime.sh" "/scripts/reference_lookup.py"` and preserve the design and result files with `$science-provenance`.
## Workflow
-1. Author a `research-design` input and run `scripts/validate_research_design.py --require-clean` before outcome-dependent analysis.
+1. Author a `research-design` input and run `"/scripts/python_runtime.sh" "/scripts/validate_research_design.py" --require-clean` before outcome-dependent analysis.
2. Match the analysis to assignment and sampling. Use blocking, pairing, hierarchy, survey weights, censoring, or longitudinal dependence only with a method that represents them.
-3. For a bounded independent or paired two-group contrast, run `scripts/run_statistical_analysis.py`; for more complex models, use a suitable external implementation but emit equivalent design, effect, interval, diagnostic, seed, and environment records.
+3. For a bounded independent or paired two-group contrast, run `"/scripts/python_runtime.sh" "/scripts/run_statistical_analysis.py"`; for more complex models, use a suitable external implementation but emit equivalent design, effect, interval, diagnostic, seed, and environment records.
4. Report effect size, interval, independent-unit count, missingness, exclusions, and multiplicity handling before p-values.
5. Verify the unit counts, contrast direction, missingness, multiplicity family, randomization model, interval method, and prespecified sensitivity analyses.
6. Package the design and analysis sidecars, then run `$science-review`.
diff --git a/authored-skills/statistical-inference-experimental-design/references/design-and-inference-runtime.md b/authored-skills/statistical-inference-experimental-design/references/design-and-inference-runtime.md
index f59defb0..7a4d5ae8 100644
--- a/authored-skills/statistical-inference-experimental-design/references/design-and-inference-runtime.md
+++ b/authored-skills/statistical-inference-experimental-design/references/design-and-inference-runtime.md
@@ -5,7 +5,7 @@
Run before outcome-driven analysis:
```bash
-uv run python scripts/validate_research_design.py design.json \
+"/scripts/python_runtime.sh" "/scripts/validate_research_design.py" design.json \
--output artifacts/run/research-design.json \
--require-clean
```
@@ -21,7 +21,7 @@ A clean audit means the record is internally complete. It does not make the assu
The built-in runtime is limited to independent or paired two-group mean or median differences:
```bash
-uv run python scripts/run_statistical_analysis.py analysis.json \
+"/scripts/python_runtime.sh" "/scripts/run_statistical_analysis.py" analysis.json \
--output artifacts/run/statistical-analysis.json
```
diff --git a/authored-skills/write-scientific-manuscript/SKILL.md b/authored-skills/write-scientific-manuscript/SKILL.md
index 2f501fb3..4d34d349 100644
--- a/authored-skills/write-scientific-manuscript/SKILL.md
+++ b/authored-skills/write-scientific-manuscript/SKILL.md
@@ -44,7 +44,7 @@ Record any materially controlling reference in the run's `reference-use-ledger`.
7. **Prepare displays and supplements.** Reuse or regenerate figures and tables only from traceable artifacts. Do not require a graphical abstract or AI-generated figure unless the venue or user requests it and the separate tool action is approved.
8. **Apply reporting and venue constraints.** Complete `reporting-checklist.json` with the same guideline recorded in the contract; use `unresolved` for missing items. Do not infer ethics, funding, authorship, conflicts, or availability statements.
9. **Prepare requested formats.** Always write `manuscript.md`; add `manuscript.tex`, `references.bib`, `cover-letter.md`, `reviewer-response.md`, or supplement indexes when declared in the contract.
-10. **Package and validate.** Write `submission-package.json` with hashes for every included file. Run `uv run python scripts/validate_manuscript_package.py --require-clean`. Resolve findings or keep the package in `draft`.
+10. **Package and validate.** Write `submission-package.json` with hashes for every included file. Run `"/scripts/python_runtime.sh" "/scripts/validate_manuscript_package.py" --require-clean`. Resolve findings or keep the package in `draft`.
11. **Preserve provenance.** Register the contract, manuscript, claim-citation map, checklist, source record, and submission package with `$science-provenance`.
12. **Review independently.** Use `$science-review` in all three mandatory modes: `record`, `source`, and `method`. Set `submission-ready` only when a passed independent receipt states its limitations and covers those modes, every file listed in `submission-package.json` except the receipt itself, every material claim ID, and the current file hashes, with every material finding resolved. The root `submission-package.json` is deliberately self-excluded from its file list.
diff --git a/authored-skills/write-scientific-manuscript/references/manuscript-package.md b/authored-skills/write-scientific-manuscript/references/manuscript-package.md
index 58762b4c..ea28bd9d 100644
--- a/authored-skills/write-scientific-manuscript/references/manuscript-package.md
+++ b/authored-skills/write-scientific-manuscript/references/manuscript-package.md
@@ -65,7 +65,7 @@ relabel the old receipt.
Run:
```bash
-uv run python scripts/validate_manuscript_package.py artifacts//manuscript --require-clean
+"/scripts/python_runtime.sh" "/scripts/validate_manuscript_package.py" artifacts//manuscript --require-clean
```
Save JSON output with `--output ` when it must enter the artifact bundle.
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index a575d8cd..88f664cc 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -6,7 +6,8 @@
- The one-command installer now works when the system `python3` is 3.8 by provisioning a persistent managed Python 3.12 with `uv` (or falling back to an existing Python 3.11+). Hooks, MCP, bootstrap, and transactional candidate checks all reuse the recorded interpreter directly instead of depending on PATH or invoking `uv` for each event.
- Added a reviewed PheWAS life-science acceptance artifact, weekly/manual public API drift workflow, and local `.omc/` ignore rule. The acceptance result preserves missing-evidence and genome-build boundaries instead of overclaiming cross-cohort replication.
- Added an independently implemented agentic life-science research layer: 19 new read-only public API tools, a deterministic entity/evidence-lane planner, 12 source skills, and 13 cross-source workflows for normalization, variant/PheWAS synthesis, locus-to-gene, burden evidence, expression/cell context, public omics datasets, pharmacology, cancer genomics, multi-omics context, and conflict reconciliation. Proprietary OpenAI plugin code was not copied; unstable or terms-gated sources remain explicitly unavailable. Catalog: 279 (149 kdense + 3 gdm + 127 cx).
-- Added safe GitHub update lifecycle support. New tasks check the official `main` branch at most once per 24 hours in default `notify` mode; `Codex Science 업데이트` stages the exact advertised commit, verifies ancestry/runtime/the full tracked plugin cache, locks concurrent updates, atomically swaps the managed checkout, and retains the previous checkout if rollback cannot complete. `off` mode disables checks; unattended apply is intentionally unsupported. Dirty/custom/diverged checkouts are refused, the current task's loaded plugin cache is restored byte-for-byte, and fresh or repeated installer runs use staged/transactional validation.
+- Split the stable Codex host bootstrap from the scientific runtime. Verified compatible fast-forwards are installed append-only in a project-owned immutable runtime store, and automatic or ordinary explicit runtime updates never invoke the Codex plugin CLI. First activation pins the hook, coordinator, Stop guard, and MCP tools to one runtime version, commit, and receipt; MCP binds through Codex task metadata and rejects incompatible discovery handoffs. Bootstrap changes require all Codex tasks and the app to be closed plus the explicit migration acknowledgement. `notify` reports without automatic apply, `off` skips lifecycle checks, and failed candidates keep the last-known-good runtime.
+- Made hook and artifact output human-first: routine successful candidate logs stay quiet, actionable status and next steps remain visible, and artifact indexes prioritize primary results with compact provenance and integrity details.
- Added local artifact views for Codex: validated manifests now render a hash-checked `index.md` plus optional offline `index.html`, with primary raster results displayed in the conversation and other outputs linked by absolute path. Local compute now reuses each project's Python/uv, R/renv, Julia, Jupyter, or container environment contract instead of mixing global or cross-project environments.
- Expanded scientific computer use: `cx-compute-environment` now covers local shell, Python, R, Julia, Jupyter, containers, CPUs, and GPUs with a non-sensitive capability probe. Added `cx-remote-scientific-compute` for existing SSH, Slurm/HPC, cloud GPU, and private object-storage workflows with login-node protection, one explicit target/data/resource/cost/cancellation approval packet, checkpointed monitoring, retrieval, and cleanup records. Catalog: 254 (149 kdense + 3 gdm + 102 cx).
- Added task-scoped Codex Science persistence with plugin-bundled `UserPromptSubmit` and `SessionStart` hooks. One explicit `$codex-science`/start request stores only a hashed `session_id` marker under `PLUGIN_DATA`; later turns, resume, and context compaction inject coordinator context and self-invoke the skill. Explicit stop, `clear`, and new tasks remain inactive, and abandoned markers expire after 180 days. Starter prompts now activate the mode explicitly, and installer/tests cover hook trust, privacy, isolation, malformed input, and lifecycle behavior.
diff --git a/docs/CHECKPOINTS.md b/docs/CHECKPOINTS.md
index 6079595e..d1a2b671 100644
--- a/docs/CHECKPOINTS.md
+++ b/docs/CHECKPOINTS.md
@@ -6,6 +6,9 @@ contains the goal, plan state, next action, evidence references, review receipt,
and loop counters—not prompts, credentials, private inputs, or scientific
conclusions.
+`` below means the absolute activation-pinned runtime root injected
+by the hook, never a moving checkout path.
+
## Ownership and lifecycle
Activation creates a random generation in a private plugin-data marker. The
@@ -70,7 +73,7 @@ second generic or Ralph-style Stop loop on top of Codex Science.
## CLI
-Use `scripts/science_checkpoint.py --help` for all commands. The normal flow is
+Use `"/scripts/python_runtime.sh" "/scripts/science_checkpoint.py" --help` for all commands. The normal flow is
`init`, then `heartbeat`/`advance`/`attempt`; use `gate`, `wait`, or `block` only
for their corresponding pause condition. Use `criterion` and `review` before
`complete`. `claim` upgrades a compatible legacy run; changing a schema-v2/v3
diff --git a/docs/CONFIGS.md b/docs/CONFIGS.md
index da2d6665..fd743896 100644
--- a/docs/CONFIGS.md
+++ b/docs/CONFIGS.md
@@ -1,10 +1,19 @@
# Configuration
- `.codex-plugin/plugin.json`: plugin manifest.
-- `.mcp.json`: bundled read-only MCP server.
-- `hooks/hooks.json`: task-scoped activation hooks for later turns, resume, and context compaction.
-- `scripts/science_session_hook.py`: stores only a hashed session marker under `PLUGIN_DATA` and injects coordinator context.
-- `scripts/science_update_hook.py`: 24-hour cached official-GitHub update notification and opt-in next-task installation.
+- `.mcp.json`: read-only MCP entry through the task-pinned runtime proxy.
+- `hooks/hooks.json`: stable `SessionStart`, `UserPromptSubmit`, and `Stop` bootstrap definitions. Users trust these in `/hooks`; they do not run internal hook scripts directly.
+- `scripts/science_hook_dispatch.py`: verifies an eligible release, atomically claims an activation pin, and dispatches the event to that exact private immutable runtime.
+- `PLUGIN_DATA/science-sessions/`: hashed task keys containing only a random generation and public runtime pin identity; no raw session ID or prompt is stored.
+- `PLUGIN_DATA/runtime-cache//`: append-only, project-owned scientific runtimes that remain independent of Codex's prunable host plugin cache.
+- `PLUGIN_DATA/runtime-receipts/`: bounded tracked-file receipts used to verify private runtimes before hook or MCP execution.
+- `PLUGIN_DATA/runtime-cache.lock`: shared/exclusive barrier that prevents activation from racing a runtime install or acknowledged host-bootstrap migration.
+- `scripts/science_session_hook.py`: pinned handler that injects coordinator context and performs generation-CAS deactivation.
+- `scripts/science_mcp_proxy.py`: binds the first tool call to the activation's runtime pin using Codex task metadata and keeps that pin for the connection.
+- `scripts/science_update_hook.py`: transactional official-GitHub update policy. `CODEX_SCIENCE_AUTO_UPDATE=apply|notify|off` defaults to `apply`; compatible runtime updates never call the Codex plugin CLI, while a bootstrap change requires the acknowledged curl migration.
+- `skills/`: the three small, host-registered bootstrap skills.
+- `runtime-skills/`: the verified coordinator, provenance, and review workflows selected from the pinned private runtime.
+- Checkpoints and artifact manifests append `runtime_history`; `runtime_span=true` marks durable state written by more than one release.
- `src/codex_science/life_science.py`: deterministic life-science entity/evidence-lane planner.
- `docs/LIFE_SCIENCE_RESEARCH_SOURCES.md`: verified public API coverage, scientific boundaries, and gated-source status.
- `catalog/sources.json`: skill sources — repository, pinned commit, name prefix, kind, vendored `content_sha256`, and optional per-source `exclude`.
diff --git a/docs/DEBUGGING.md b/docs/DEBUGGING.md
index 6d4e4b0a..b39ea3a2 100644
--- a/docs/DEBUGGING.md
+++ b/docs/DEBUGGING.md
@@ -2,7 +2,14 @@
- Missing vendor skills: run `git submodule update --init --recursive`.
- Inventory mismatch: run `uv run python scripts/audit_skills.py`, inspect policy changes, then rerun tests.
-- Plugin not updated: reinstall with `codex plugin add codex-science@codex-science`, then start a new task.
+- Runtime not updated: read the update message first. Offline, busy, dirty,
+ unofficial, diverged, or invalid candidates intentionally keep the
+ last-known-good runtime. A bootstrap mismatch intentionally stops before
+ candidate execution. For a requested bootstrap migration, close every Codex
+ task and the app, then pipe the installer into
+ `CODEX_SCIENCE_MIGRATION_ACK=all-codex-tasks-closed bash`; do not register a
+ development checkout directly. The displayed plugin version identifies the
+ stable host bootstrap, not the current scientific runtime.
- MCP not visible: confirm the plugin is enabled, restart the Codex client, and inspect `/mcp`.
- Connector failure: run `./scripts/check.sh public`; distinguish remote API failure from deterministic test failure.
- Inactive skill: inspect its `reasons` in `catalog/inventory.json`; do not bypass the policy silently.
diff --git a/docs/EVALUATION.md b/docs/EVALUATION.md
index 408f5f35..3ae62665 100644
--- a/docs/EVALUATION.md
+++ b/docs/EVALUATION.md
@@ -2,16 +2,23 @@
## Acceptance
-- 279 skills (149 K-Dense + 3 DeepMind infra pointers + 127 Codex-native authored) appear in the deterministic inventory.
-- All 279 skills have deterministic, source-prefixed Codex-compatible wrappers.
+- 282 skills (149 K-Dense + 3 DeepMind infra pointers + 130 Codex-native authored) appear in the deterministic inventory.
+- All 282 skills have deterministic, source-prefixed Codex-compatible wrappers.
- Every active skill is returned in the first five results for its natural, source-prefix-free name.
- Inactive skills cannot be returned by default search.
- Only the three task-scoped core skills are registered with the plugin.
- One explicit activation self-invokes the coordinator on later turns and survives resume/context compaction for the same session.
- Explicit stop, `clear`, and a different session remain inactive; hook state never stores prompt text.
-- Update checks default to notify, cache only public commit IDs for 24 hours, and
- require an explicit prompt before staging an exact commit for a transactional update.
-- Plugin, three registered skills, and all 279 internal wrapper schemas validate.
+- After one acknowledged bootstrap migration, update checks default to `apply`
+ at `SessionStart` and first activation. Only a verified official fast-forward
+ with a monotonic runtime version, unchanged bootstrap, and compatible MCP
+ discovery contract is added to the private immutable runtime store. Automatic
+ update makes no Codex plugin CLI call. First activation pins the same task's
+ hook, skill, Stop, and MCP runtime to its commit and receipt. `notify` reports
+ only, `off` skips lifecycle checks, explicit requests install compatible
+ runtimes in every mode without switching an active generation, and any failed
+ check preserves the last-known-good runtime.
+- Plugin, three registered skills, and all 282 internal wrapper schemas validate.
- All 127 Codex-native source skills validate and include `agents/openai.yaml` UI metadata.
- The bundled read-only MCP exposes 34 public-source tools plus local catalog
search and deterministic life-science planning; new source families have
diff --git a/docs/LOGGING.md b/docs/LOGGING.md
index e58935f9..492858ca 100644
--- a/docs/LOGGING.md
+++ b/docs/LOGGING.md
@@ -2,7 +2,7 @@
Each research run uses `artifacts//manifest.json`. Record the approved plan, inputs, code, commands, exit codes, environment, output hashes, claims, evidence, and review.
-After validation, `scripts/render_artifact_index.py` generates a private local
+After validation, `"/scripts/python_runtime.sh" "/scripts/render_artifact_index.py"` generates a private local
`index.md` and optional offline `index.html`. These are reproducible navigation
views, not evidence records. Primary raster figures are displayed in Codex; all
files are linked by absolute local path in the final response.
diff --git a/docs/NATIVE_RUNTIME_QUICKSTART.md b/docs/NATIVE_RUNTIME_QUICKSTART.md
index 0e60b9e1..aef67cea 100644
--- a/docs/NATIVE_RUNTIME_QUICKSTART.md
+++ b/docs/NATIVE_RUNTIME_QUICKSTART.md
@@ -1,19 +1,19 @@
# Native runtime quickstart
-Codex Science 0.4 uses progressive references: keep the decision flow in `SKILL.md`, then load the exact command/schema reference only when the route is selected. Do not guess a command or output field from a skill summary.
+Codex Science uses progressive references: keep the decision flow in `SKILL.md`, then load the exact command/schema reference only when the route is selected. Do not guess a command or output field from a skill summary. In this document, `` means the absolute activation-pinned runtime root injected by the hook, not the managed checkout or a newly installed runtime.
## 1. Inspect and annotate an artifact
Read first:
```text
-skills/science-provenance/references/artifact-runtime.md
+/runtime-skills/science-provenance/references/artifact-runtime.md
```
Then:
```bash
-python scripts/render_artifact_runtime.py describe \
+"/scripts/python_runtime.sh" "/scripts/render_artifact_runtime.py" describe \
artifacts/run/receptor.pdb \
--artifact-path receptor.pdb \
--sha256 \
@@ -24,11 +24,11 @@ python scripts/render_artifact_runtime.py describe \
--max-records 200 \
--output artifacts/run/receptor.runtime.json
-python scripts/render_artifact_runtime.py render \
+"/scripts/python_runtime.sh" "/scripts/render_artifact_runtime.py" render \
artifacts/run/receptor.runtime.json \
--output artifacts/run/receptor.runtime.html
-python scripts/render_artifact_runtime.py select \
+"/scripts/python_runtime.sh" "/scripts/render_artifact_runtime.py" select \
artifacts/run/receptor.runtime.json \
--selector-type residue \
--selector '{"chain":"A","residue_number":145}' \
@@ -36,7 +36,7 @@ python scripts/render_artifact_runtime.py select \
--reason "Inspect receptor-state consistency." \
--output artifacts/run/residue-A145.selection.json
-python scripts/render_artifact_runtime.py propose \
+"/scripts/python_runtime.sh" "/scripts/render_artifact_runtime.py" propose \
artifacts/run/residue-A145.selection.json \
--operation exclude-alternate-conformation \
--parameters '{"altloc":"B"}' \
@@ -55,21 +55,21 @@ The proposal does not edit or rerun anything. Feed it into impact analysis, appr
Read first:
```text
-skills/codex-science/references/project-evidence-store.md
+/runtime-skills/codex-science/references/project-evidence-store.md
```
Then:
```bash
-python scripts/science_project.py --database project/evidence.sqlite init \
+"/scripts/python_runtime.sh" "/scripts/science_project.py" --database project/evidence.sqlite init \
--project-id project-1 --title "Project" --question "Question" \
--output project/created.json
-python scripts/science_project.py --database project/evidence.sqlite import-run \
+"/scripts/python_runtime.sh" "/scripts/science_project.py" --database project/evidence.sqlite import-run \
--project-id project-1 --manifest artifacts/run-001/manifest.json \
--branch main --output project/import-001.json
-python scripts/science_project.py --database project/evidence.sqlite fork \
+"/scripts/python_runtime.sh" "/scripts/science_project.py" --database project/evidence.sqlite fork \
--project-id project-1 --source-run run-001 \
--branch receptor-state-inactive --output project/fork.json
```
@@ -81,23 +81,23 @@ Import each later branch run as a new immutable run. Use `compare` and `merge-pl
Read first:
```text
-authored-skills/remote-scientific-compute/references/job-runtime.md
+/authored-skills/remote-scientific-compute/references/job-runtime.md
```
Then:
```bash
-python scripts/science_job.py --state-dir artifacts/run/jobs preflight \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir artifacts/run/jobs preflight \
--spec artifacts/run/job-spec.json --output artifacts/run/preflight.json
-python scripts/science_job.py --state-dir artifacts/run/jobs submit \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir artifacts/run/jobs submit \
--spec artifacts/run/job-spec.json --output artifacts/run/submitted.json
-python scripts/science_job.py --state-dir artifacts/run/jobs wait \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir artifacts/run/jobs wait \
--backend local --job-id --timeout 300 --poll 0.2 \
--output artifacts/run/terminal.json
-python scripts/science_job.py --state-dir artifacts/run/jobs collect \
+"/scripts/python_runtime.sh" "/scripts/science_job.py" --state-dir artifacts/run/jobs collect \
--backend local --job-id --output artifacts/run/collected.json
```
@@ -106,7 +106,7 @@ For Slurm, render the script and create an approval receipt before `submit --app
## 4. Audit skill maturity
```bash
-python scripts/audit_native_skill_maturity.py \
+"/scripts/python_runtime.sh" "/scripts/audit_native_skill_maturity.py" \
--output /tmp/native-skill-quality.json \
--markdown /tmp/native-skill-quality.md \
--require-clean
@@ -120,8 +120,8 @@ These runtime commands improve inspection, lineage, execution, and auditability.
## 6. Prepare an independent review packet
-Read `skills/science-review/references/independent-review-runtime.md`, then use `scripts/science_reviewer.py prepare` and `finalize`. A producer second pass is not independent, and reproduction requires a separate execution.
+Read `/runtime-skills/science-review/references/independent-review-runtime.md`, then use `"/scripts/python_runtime.sh" "/scripts/science_reviewer.py" prepare` and `finalize`. A producer second pass is not independent, and reproduction requires a separate execution.
## 7. Validate an authenticated connector action
-Read `skills/codex-science/references/authenticated-connector-packs.md`. Use `scripts/connector_action_contract.py` for spec, preview, and approval validation. Provider execution belongs to an optional adapter pack; credentials never enter the action JSON.
+Read `/runtime-skills/codex-science/references/authenticated-connector-packs.md`. Use `"/scripts/python_runtime.sh" "/scripts/connector_action_contract.py"` for spec, preview, and approval validation. Provider execution belongs to an optional adapter pack; credentials never enter the action JSON.
diff --git a/docs/NATIVE_SKILL_STANDARD.md b/docs/NATIVE_SKILL_STANDARD.md
index 5b4a0450..a987edab 100644
--- a/docs/NATIVE_SKILL_STANDARD.md
+++ b/docs/NATIVE_SKILL_STANDARD.md
@@ -1,6 +1,6 @@
# Codex-native scientific skill standard
-This standard defines the minimum contract for first-party skills under `authored-skills/` and the three registered core skills under `skills/`. It does not rewrite or relicense pinned upstream skills.
+This standard defines the minimum contract for first-party skills under `authored-skills/` and the three live core workflows under `runtime-skills/`. The host-registered skills under `skills/` are deliberately small bootstrap loaders. This standard does not rewrite or relicense pinned upstream skills.
A scientific skill is not complete because it names the right tools. It must constrain the scientific question, preserve evidence semantics, produce inspectable artifacts, state when it must stop, and make its claims reviewable.
diff --git a/docs/PLATFORM_CONTRACTS.md b/docs/PLATFORM_CONTRACTS.md
index 57a241f6..513cf3b8 100644
--- a/docs/PLATFORM_CONTRACTS.md
+++ b/docs/PLATFORM_CONTRACTS.md
@@ -8,7 +8,8 @@ Codex Science uses one release identity module: `src/codex_science/version.py`.
- Python package: `0.5.0`
- MCP server: `0.5.0`
-- Plugin cachebuster: `0.5.0+codex.20260802100417`
+- Stable host-bootstrap version: `0.5.0+codex.20260803040515`
+- Scientific runtime version: `0.5.0+codex.20260803040515`
- Machine-readable release record: `release/manifest.json`
Run:
@@ -17,9 +18,49 @@ Run:
python scripts/validate_release.py
```
-A runtime-affecting change under plugin, MCP, skills, catalog, connectors, hooks, models, scripts, or source code requires a different plugin cachebuster. Existing task caches are retained; a new Codex task loads the new release.
+A runtime-affecting change requires a monotonically newer `runtime_version`. A
+host-bootstrap file or bootstrap-policy change additionally requires a
+monotonically newer `plugin_version` and cannot be applied automatically.
+Cache-neutral changes need neither version bump. The stable dispatcher can use a
+verified compatible runtime on first activation in the initiating task. Once
+active, that generation stays on its immutable runtime commit and receipt; a new
+Codex task can start on the latest installed runtime without replacing the host
+bootstrap.
+
+Fresh installs call `scripts/bootstrap.sh`, initialize the pinned skill catalog,
+register the stable host bootstrap, and seed the project-owned runtime store.
+When a later release changes that bootstrap, every Codex task and the app must be
+closed before running the curl installer with
+`CODEX_SCIENCE_MIGRATION_ACK=all-codex-tasks-closed`. After that migration, the
+stable hook dispatcher and MCP proxy resolve a verified runtime from
+`$CODEX_HOME/plugins/data/codex-science-codex-science/runtime-cache/`;
+`scripts/science_update_entry.py` preserves the transactional candidate contract
+before activation without invoking Codex plugin registration.
+
+## Pinned runtime lifecycle
+
+```mermaid
+flowchart LR
+ A["Fresh install or acknowledged bootstrap migration"] --> B["Stable host bootstrap"]
+ B --> C["SessionStart or first activation"]
+ C --> D{"Compatible verified fast-forward?"}
+ D -->|Yes| E["Append immutable private runtime"]
+ D -->|Offline, dirty, busy, invalid, or bootstrap change| F["Keep last-known-good runtime"]
+ E --> G["First activation pins version, commit, and receipt"]
+ G --> H["Hooks, Stop, skills, and MCP stay pinned"]
+```
-Fresh installs call `scripts/bootstrap.sh`, which initializes the pinned skill catalog and runs the complete candidate contract. Managed update hooks use `scripts/science_update_entry.py`, which preserves the stable transactional updater and adds the same complete candidate contract before activation.
+`CODEX_SCIENCE_AUTO_UPDATE=apply` is the default. `notify` reports a candidate
+without applying it automatically, and `off` skips lifecycle checks. An explicit
+`Codex Science 업데이트` request verifies and installs a compatible runtime in
+every mode. Neither path calls `codex plugin`; bootstrap changes stop with an
+instruction to use the acknowledged curl migration. If a run is already active,
+the install is reserved for new activations and the current generation remains
+pinned. On the first MCP `tools/call`, Codex's session metadata selects that same
+pin; initialize and tool-list contracts are replayed before a handoff. Every
+checkpoint and artifact-manifest write appends the runtime identity.
+`runtime_span` remains a reviewable defense against legacy or recovery
+transitions, not routine automatic updating.
## Complete candidate gate
@@ -31,7 +72,7 @@ python scripts/candidate_contract_check.py
The gate verifies:
-1. synchronized release identities and cachebuster syntax;
+1. independent host-bootstrap and scientific-runtime identities, monotonic bumps, and cachebuster syntax;
2. Connector Contract v2 registry, legacy connector compatibility, snapshot replay, and typed parser fixtures;
3. Python compilation;
4. deterministic skill inventory and generated wrappers;
@@ -285,7 +326,7 @@ The workbench is a local offline HTML view of validated claims, findings, annota
- Reviewer success is a procedural control, not proof of scientific truth.
- A deterministic SBDD fixture is not an affinity experiment.
- Artifact or model changes invalidate covered receipts.
-- Fresh install and managed update activation require the complete candidate contract.
+- Fresh install and managed update promotion require the complete candidate contract; failed validation keeps the last-known-good verified runtime. Candidate promotion never repins an active activation generation.
## Progressive skill references
diff --git a/docs/QUANTITATIVE_RESEARCH_RUNTIME.md b/docs/QUANTITATIVE_RESEARCH_RUNTIME.md
index aebfde9c..e04934c9 100644
--- a/docs/QUANTITATIVE_RESEARCH_RUNTIME.md
+++ b/docs/QUANTITATIVE_RESEARCH_RUNTIME.md
@@ -1,6 +1,6 @@
# Quantitative and mathematical research runtime
-Codex Science 0.5 adds executable contracts for research questions whose central evidence is mathematical, statistical, or numerical. The goal is not to add a generic calculator. The goal is to prevent a plausible-looking computation from being promoted into a stronger scientific or mathematical claim than its design and receipts support.
+Codex Science 0.5 adds executable contracts for research questions whose central evidence is mathematical, statistical, or numerical. The goal is not to add a generic calculator. The goal is to prevent a plausible-looking computation from being promoted into a stronger scientific or mathematical claim than its design and receipts support. In the commands below, `` means the absolute activation-pinned runtime root injected by the hook.
## Functional gaps addressed
@@ -43,7 +43,7 @@ All artifacts remain ordinary manifest entries with SHA-256. Editing a result in
### Research design
```bash
-uv run python scripts/validate_research_design.py design.json \
+"/scripts/python_runtime.sh" "/scripts/validate_research_design.py" design.json \
--output artifacts/run/research-design.json \
--require-clean
```
@@ -51,7 +51,7 @@ uv run python scripts/validate_research_design.py design.json \
### Statistical analysis
```bash
-uv run python scripts/run_statistical_analysis.py analysis.json \
+"/scripts/python_runtime.sh" "/scripts/run_statistical_analysis.py" analysis.json \
--output artifacts/run/statistical-analysis.json
```
@@ -60,7 +60,7 @@ The built-in baseline supports bounded independent or paired two-group mean or m
### Counterexample search
```bash
-uv run python scripts/search_counterexample.py search.json \
+"/scripts/python_runtime.sh" "/scripts/search_counterexample.py" search.json \
--output artifacts/run/counterexample-search.json
```
@@ -69,12 +69,12 @@ The evaluator uses a deliberately small mathematical language and explicit finit
### Formal Lean check
```bash
-uv run python scripts/check_formal_proof.py proof.json \
+"/scripts/python_runtime.sh" "/scripts/check_formal_proof.py" proof.json \
--workspace existing/lean/project \
--output artifacts/run/formal-proof-preview.json \
--preview
-uv run python scripts/check_formal_proof.py proof.json \
+"/scripts/python_runtime.sh" "/scripts/check_formal_proof.py" proof.json \
--workspace existing/lean/project \
--output artifacts/run/formal-proof-check.json \
--require-passed
@@ -85,7 +85,7 @@ The runtime uses an existing workspace. It does not install Lean, create a proje
### Numerical verification
```bash
-uv run python scripts/verify_numerical_result.py numerical.json \
+"/scripts/python_runtime.sh" "/scripts/verify_numerical_result.py" numerical.json \
--output artifacts/run/numerical-verification.json \
--require-clean
```
@@ -95,7 +95,7 @@ The receipt records refinement sequence, reference or errors, observed order, re
### Dimensional analysis
```bash
-uv run python scripts/check_dimensions.py dimensions.json \
+"/scripts/python_runtime.sh" "/scripts/check_dimensions.py" dimensions.json \
--output artifacts/run/dimension-check.json \
--require-clean
```
@@ -105,7 +105,7 @@ The built-in unit registry covers common SI base and derived units, prefixes, li
### Uncertainty propagation
```bash
-uv run python scripts/propagate_uncertainty.py uncertainty.json \
+"/scripts/python_runtime.sh" "/scripts/propagate_uncertainty.py" uncertainty.json \
--output artifacts/run/uncertainty-propagation.json \
--require-clean
```
@@ -149,11 +149,11 @@ A clean audit means the record is internally complete. It is not a scientific en
## Deterministic acceptance
```bash
-uv run python scripts/run_quantitative_acceptance.py \
+"/scripts/python_runtime.sh" "/scripts/run_quantitative_acceptance.py" \
examples/quantitative-research/input.json \
/tmp/quantitative-run
-uv run python scripts/validate_artifact.py \
+"/scripts/python_runtime.sh" "/scripts/validate_artifact.py" \
/tmp/quantitative-run/manifest.json \
--review-output /tmp/quantitative-review.json \
--require-passed-review
diff --git a/docs/SETUP.md b/docs/SETUP.md
index 52ffca23..e99f3b5f 100644
--- a/docs/SETUP.md
+++ b/docs/SETUP.md
@@ -23,26 +23,41 @@ curl -fsSL https://raw.githubusercontent.com/eightmm/codex-science/main/scripts/
```
The installer validates a fresh clone in staging before moving it into
-`~/.codex-science`, runs the light bootstrap, and registers the plugin. Re-runs
-use the locked transactional updater. `CODEX_SCIENCE_HOME` overrides the path.
+`~/.codex-science`, runs the light bootstrap, registers the stable host plugin,
+and prepares an immutable scientific runtime in Codex Science's private plugin
+data. `CODEX_SCIENCE_HOME` overrides the managed-checkout path.
`CODEX_SCIENCE_PYTHON` can select an existing Python 3.11+ interpreter, and
`CODEX_SCIENCE_RUNTIME_FILE` can override the interpreter record path.
-This managed checkout is the only supported installation source. If the
-`codex-science` marketplace still points at an older local development checkout,
-the installer transactionally migrates it to the managed checkout.
+
+An existing installation requires an explicit migration only when its
+host-loaded bootstrap must change. Close every Codex task and quit the Codex app,
+then run:
+
+```bash
+curl -fsSL https://raw.githubusercontent.com/eightmm/codex-science/main/scripts/install.sh | CODEX_SCIENCE_MIGRATION_ACK=all-codex-tasks-closed bash
+```
+
+The acknowledgement is an assertion by the user, not a process-killing option;
+never set it while Codex is open. Codex registration can prune an old host cache,
+including one still referenced by an inactive open task. The installer also uses
+this guarded transaction to migrate a marketplace that points at an older local
+development checkout. Routine scientific-runtime updates are automatic after
+the host bootstrap is installed and do not use Codex's plugin CLI.
Then start a new Codex task in any project, open `/hooks`, and trust the Codex
Science `SessionStart`, `UserPromptSubmit`, and `Stop` hooks. Say
`Start Codex Science` or `Codex Science 시작`. You do not install per project —
the plugin is user-global in `~/.codex`. Hook definitions are the human security
-boundary; review them again after an update that changes them.
+boundary. Ordinary runtime updates keep the bootstrap definition stable; review
+them again only if that definition changes.
Verify registration with `codex plugin list`; the
`codex-science@codex-science` row should be `installed, enabled`.
The activation marker path is a SHA-256 hash of Codex's `session_id`, and the
-marker content is a random generation. The checkpoint owner key is derived from
-the session ID plus that generation. Raw session IDs, prompts, research inputs,
+marker contains a random generation plus the public version, commit, and receipt
+digest of its private immutable runtime pin. The checkpoint owner key is derived
+from the session ID plus that generation. Raw session IDs, prompts, research inputs,
credentials, and results are not stored in the marker. Later turns, resume, and
context compaction retain the generation. Explicit stop or `clear` abandons the
discoverable owned nonterminal run and removes the marker; reactivation rotates
@@ -77,15 +92,37 @@ Competing stop guards can keep each other alive.
Neither Goal nor the Stop hook runs after the Codex app or task is closed. They
do not bypass hook trust, permissions, approvals, or host availability.
-Update checks default to `CODEX_SCIENCE_AUTO_UPDATE=notify`. A `SessionStart`
-hook checks the official GitHub `main` branch at most once per 24 hours and stores
-only the check time and public commit IDs under `PLUGIN_DATA`. Say
-`Codex Science 업데이트` to stage and apply the exact advertised commit. There
-is no unattended apply mode. Updates affect only a new task; the current task's
-loaded cache and older version caches are preserved so open tasks retain their
-pinned hook paths. Set the mode to `off` to disable checks.
-Without a fresh notice, the first explicit request advertises the exact commit;
-repeat it once to approve that commit.
+Update checks default to `CODEX_SCIENCE_AUTO_UPDATE=apply`. The stable bootstrap
+checks the official GitHub `main` branch at `SessionStart` and on the first
+activation when needed. Before candidate code runs, the updater rejects a
+bootstrap-byte or bootstrap-policy change and a non-monotonic runtime version.
+It then performs only the bounded MCP discovery handshake, requires that
+contract to match the host, and runs the full candidate gate. A verified
+compatible candidate is installed append-only at
+`$CODEX_HOME/plugins/data/codex-science-codex-science/runtime-cache/`
+with a bounded receipt. This store belongs to Codex Science and is not a Codex
+host cache.
+
+Automatic and ordinary explicit runtime updates never call `codex plugin` or
+modify Codex plugin registration. First activation pins the runtime version,
+commit, and receipt across hook, Stop, skill, and MCP boundaries. An explicit
+update in an active task installs for new activations without switching the
+current run. Durable checkpoint and manifest writes record runtime identity;
+version-spanning state is a defensive legacy/recovery warning. A candidate that
+changes the host bootstrap is rejected with instructions for the acknowledged
+curl migration. Codex's displayed plugin version identifies the stable host
+bootstrap, not the independently advancing scientific runtime.
+
+| Mode | Automatic lifecycle check | `Codex Science 업데이트` |
+| --- | --- | --- |
+| `apply` (default) | Verify and apply | Verify and apply |
+| `notify` | Report only | Verify and apply |
+| `off` | Skip | Verify and apply |
+
+Offline access, a busy updater, a dirty or unofficial checkout, diverged history,
+or failed validation leaves the last-known-good verified runtime active. Re-run
+the curl installer only when a bootstrap migration or repair is requested, and
+use the acknowledgement only after closing every Codex task and the app.
## Development checkout
diff --git a/hooks/hooks.json b/hooks/hooks.json
index 16e5a3ca..bdc4a1ac 100644
--- a/hooks/hooks.json
+++ b/hooks/hooks.json
@@ -6,15 +6,9 @@
"hooks": [
{
"type": "command",
- "command": "\"$PLUGIN_ROOT/scripts/python_runtime.sh\" \"$PLUGIN_ROOT/scripts/science_session_hook.py\"",
- "timeout": 5,
- "statusMessage": "Restoring Codex Science session state"
- },
- {
- "type": "command",
- "command": "CODEX_SCIENCE_STABLE_UPDATER=\"$PLUGIN_ROOT/scripts/science_update_hook.py\" \"$PLUGIN_ROOT/scripts/python_runtime.sh\" \"$PLUGIN_ROOT/scripts/science_update_entry.py\"",
- "timeout": 360,
- "statusMessage": "Checking Codex Science updates"
+ "command": "\"$PLUGIN_ROOT/scripts/python_runtime.sh\" \"$PLUGIN_ROOT/scripts/science_hook_dispatch.py\"",
+ "timeout": 1800,
+ "statusMessage": "Codex Science · 최신 runtime 준비 중"
}
]
}
@@ -24,15 +18,9 @@
"hooks": [
{
"type": "command",
- "command": "\"$PLUGIN_ROOT/scripts/python_runtime.sh\" \"$PLUGIN_ROOT/scripts/science_session_hook.py\"",
- "timeout": 5,
- "statusMessage": "Checking Codex Science session state"
- },
- {
- "type": "command",
- "command": "CODEX_SCIENCE_STABLE_UPDATER=\"$PLUGIN_ROOT/scripts/science_update_hook.py\" \"$PLUGIN_ROOT/scripts/python_runtime.sh\" \"$PLUGIN_ROOT/scripts/science_update_entry.py\"",
- "timeout": 360,
- "statusMessage": "Updating Codex Science when explicitly requested"
+ "command": "\"$PLUGIN_ROOT/scripts/python_runtime.sh\" \"$PLUGIN_ROOT/scripts/science_hook_dispatch.py\"",
+ "timeout": 1800,
+ "statusMessage": "Codex Science · 작업 상태 불러오는 중"
}
]
}
@@ -42,9 +30,9 @@
"hooks": [
{
"type": "command",
- "command": "\"$PLUGIN_ROOT/scripts/python_runtime.sh\" \"$PLUGIN_ROOT/scripts/science_stop_hook.py\"",
- "timeout": 5,
- "statusMessage": "Checking Codex Science completion state"
+ "command": "\"$PLUGIN_ROOT/scripts/python_runtime.sh\" \"$PLUGIN_ROOT/scripts/science_hook_dispatch.py\"",
+ "timeout": 20,
+ "statusMessage": "Codex Science · 완료 상태 확인 중"
}
]
}
diff --git a/release/manifest.json b/release/manifest.json
index 156989ae..3812a66c 100644
--- a/release/manifest.json
+++ b/release/manifest.json
@@ -1,18 +1,61 @@
{
- "schema_version": 1,
+ "schema_version": 2,
"package_version": "0.5.0",
- "plugin_version": "0.5.0+codex.20260802100417",
+ "plugin_version": "0.5.0+codex.20260803040515",
+ "runtime_version": "0.5.0+codex.20260803040515",
"mcp_version": "0.5.0",
"runtime_affecting_prefixes": [
+ ".agents/plugins/marketplace.json",
".codex-plugin/",
+ ".gitmodules",
".mcp.json",
+ ".python-version",
+ "assets/",
"authored-skills/",
"catalog/",
"connectors/",
+ "docs/",
+ "examples/",
"hooks/",
"models/",
+ "pyproject.toml",
+ "release/manifest.json",
+ "runtime-skills/",
"scripts/",
"skills/",
- "src/"
+ "src/",
+ "uv.lock",
+ "vendor/"
+ ],
+ "cache_neutral_files": [
+ ".gitignore",
+ "AGENTS.md",
+ "CLAUDE.md",
+ "LICENSE",
+ "PROJECT.md",
+ "README.md",
+ "README.ko.md"
+ ],
+ "cache_neutral_prefixes": [
+ ".claude/",
+ ".github/",
+ ".oms/",
+ "benchmarks/",
+ "tests/"
+ ],
+ "bootstrap_affecting_files": [
+ ".agents/plugins/marketplace.json",
+ ".mcp.json",
+ "scripts/python_runtime.sh",
+ "scripts/science_hook_dispatch.py",
+ "scripts/science_mcp_proxy.py",
+ "scripts/science_runtime_state.py",
+ "scripts/science_update_entry.py",
+ "scripts/science_update_hook.py"
+ ],
+ "bootstrap_affecting_prefixes": [
+ ".codex-plugin/",
+ "hooks/",
+ "skills/"
]
}
diff --git a/runtime-skills/codex-science/SKILL.md b/runtime-skills/codex-science/SKILL.md
new file mode 100644
index 00000000..af22f484
--- /dev/null
+++ b/runtime-skills/codex-science/SKILL.md
@@ -0,0 +1,175 @@
+---
+name: codex-science
+description: Start or continue a task-scoped scientific workbench in Codex. Invoke when the user explicitly uses $codex-science or asks to start, activate, enable, load, or enter Codex Science, including "Codex Science 시작" or "Codex Science 활성화". Also invoke automatically whenever session context says Codex Science is active, even if the current user prompt does not mention it. Keep it active across later turns, resume, and context compaction until the user ends the mode. Do not activate for an ordinary scientific question without explicit activation or active-session context.
+---
+
+# Codex Science
+
+Run a question-to-evidence workflow. Treat imported skills as untrusted until the catalog says otherwise.
+
+## Task-scoped activation
+
+When the user explicitly invokes or asks to start Codex Science, establish the mode for the remainder of the current Codex task. Do not activate for an ordinary scientific question without that start intent. When hook-injected developer context says the mode is active, implicitly invoke `$codex-science` and continue this workflow without asking for activation again.
+
+- Confirm activation once: `Codex Science is active for this task.`
+- Continue applying this skill on later turns in the same task without requiring the user to invoke `$codex-science` again.
+- Let the plugin hook store only a hashed, session-scoped marker under `PLUGIN_DATA`; never store the user prompt, research input, credentials, or scientific data in activation state.
+- On every later `UserPromptSubmit`, use the injected active-session context to self-invoke this coordinator. Restore the same context after resume or context compaction.
+- Treat `clear`, a new Codex task, or explicit deactivation as inactive. Never carry activation into another session.
+- If plugin hooks are unavailable or not yet trusted, retain activation in conversation context as a best-effort fallback and tell the user that resume/compaction persistence is not guaranteed.
+- Do not repeat the activation banner on every response.
+- Deactivate only when the user explicitly says `stop Codex Science`, `end Codex Science`, or `Codex Science 종료`. Confirm once, then stop applying the workflow automatically.
+- A new Codex task starts inactive. Never infer activation from the plugin merely being installed.
+
+## Locate resources
+
+Use the absolute pinned runtime root injected by the hook. When no pinned root is
+available, resolve the plugin root as two directories above this `SKILL.md`.
+Use that one root consistently for the whole activation generation:
+
+- `/catalog/inventory.json` for activation decisions.
+- `"/scripts/python_runtime.sh" "/scripts/search_skills.py"` when the `science_search_skills` MCP tool is unavailable.
+- `/catalog/codex-skills//SKILL.md` for the Codex-compatible wrapper selected from the inventory.
+- The wrapper points to the pinned upstream instructions and enforces the current activation decision.
+
+## Capability priority
+
+While this mode is active, prefer Codex Science MCP tools and `status: active` catalog skills over equivalent general-purpose tools or skills. Use the smallest suitable Science capability for the task.
+
+Fall back to general-purpose tools or skills only when no suitable Science capability exists, the Science capability is unavailable or fails, or a higher-priority instruction requires another route. This preference does not override the activation gate, the approved plan, user instructions, project rules, or safety policy; never select an inactive skill silently.
+
+## Reference usage
+
+After selecting a skill, inspect its `references/index.json` when present and load only the entries required by the active route. Read [the reference-loading protocol](references/reference-loading.md) before any reference-controlled operation; do not infer arguments, output schemas, source semantics, thresholds, or licenses from names alone. Read [the catalog policy](references/catalog-policy.md) before selecting or inspecting an inactive catalog skill. Read [the Goal-loop contract](references/goal-loop-contract.md) before starting, resuming, or completing a native Goal run.
+
+Read [the project evidence store contract](references/project-evidence-store.md) before managing multi-run lineage, hypotheses, comparisons, or merge plans. Read [the pipeline promotion contract](references/pipeline-promotion.md) before generating a reusable draft from a reviewed run, and [the next-experiment planning contract](references/next-experiment-planning.md) before ranking a proposed batch. Read [the authenticated connector pack contract](references/authenticated-connector-packs.md) before designing, approving, or using a credentialed or write-capable provider action.
+
+When a reference materially controls a query, command, transformation, threshold, or claim, record its path, SHA-256, read reason, and affected claim or artifact in a `reference-use-ledger`. A reference explains procedure; the actual source record or computation remains the scientific evidence.
+
+## Research contract and evidence graph
+
+For every non-trivial run, create a compact contract before retrieval or execution:
+
+- **Decision:** the question, intended decision or deliverable, population or system, evidence cutoff, non-goals, and what would change the conclusion.
+- **Claims:** stable claim IDs with claim type, required support, falsifier, and permitted inference level. Do not write the conclusion first and search only for confirmation.
+- **Evidence lanes:** the smallest independent retrieval or execution tracks needed to discriminate the claims. Give each lane explicit source, query, inclusion, exclusion, and stop rules.
+- **Acceptance:** baseline, primary metric or evidence threshold, uncertainty rule, and objective done criteria fixed before outcome inspection.
+- **Risks:** approval boundaries, sensitive data, cost, licensing, source drift, model-training overlap, and other threats to validity.
+
+Represent support, contradiction, duplication, and dependency explicitly. Two portals that expose the same study are one evidence dependency, not two replications. A search-result list, successful process, model confidence score, or attractive figure is not by itself a scientific result, and final confidence cannot exceed the weakest essential evidence link.
+
+Read `/docs/NATIVE_SKILL_STANDARD.md` when composing or auditing a Codex-native workflow.
+
+## Workflow
+
+1. State the research question, expected deliverable, evidence boundary, and important non-goals.
+2. For an experiment, write a falsifiable hypothesis, prediction, baseline, success threshold, and the smallest run that could disprove it before executing anything.
+3. Search the audited catalog with `science_search_skills`. Select at most three relevant skills. Prefer `status: active` records, then open each selected `/catalog/codex-skills//SKILL.md` wrapper.
+4. Follow the wrapper activation gate. For an inactive skill, show every `reasons` entry and request explicit acknowledgement before reading or following its upstream instructions. Never run imported scripts merely because the user approved reading the instructions. Review each command separately.
+5. Draft a short working plan and start it immediately. Do not stop merely to ask whether the plan is acceptable; approval is required only for package installation, new network hosts, remote compute, credentials, write-capable services, destructive actions, expensive work, or another material scope boundary. For a systematic, scoping, rapid, living, or multi-source literature synthesis, load `$cx-literature-review`; freeze the protocol and evidence cutoff, save exact queries, deduplicate at the study level, and produce claim/evidence sidecars plus a reviewed snapshot diff. For a broad or multi-source life-science question, load `$cx-life-science-research-routing`, call `science_plan_life_science_research`, normalize entities first with `$cx-biomedical-entity-normalization`, then select only the smallest relevant evidence workflow (variant/PheWAS, locus-to-gene, expression/cell context, omics datasets, pharmacology, or cancer genomics). Reconcile conflicting lanes with `$cx-biomedical-evidence-reconciliation`; never equate association with causality or population evidence with patient-specific advice. For a concrete mathematics or physics problem, load `$cx-mathematical-problem-execution` with the narrow domain skill and continue through derivation, independent checks, edge cases, provenance, and review. For an experimental spectrum or analytical chemistry dataset, load the narrow modality skill with `$cx-experimental-uncertainty-propagation`; for an unknown molecular structure, use `$cx-chemical-structure-elucidation` as the conductor with at most two modality skills. When the user supplies a concrete modeling problem or usable scientific inputs, load `$cx-modeling-problem-execution` together with the specialized model skill. Obtain any required gate approval once, then continue through preflight, smoke test, full execution, downstream analysis, provenance, and review without stopping at setup instructions. Use `$cx-compute-environment` for local shell, Python, R, Julia, Jupyter, container, CPU, or GPU execution. Add `$cx-remote-scientific-compute` for SSH, Slurm/HPC, cloud GPU, or remote object storage; its target, data-transfer, resource, cost, and cancellation packet must be explicitly approved before remote writes or allocation.
+ For a new manuscript, revision, cover letter, or reviewer rebuttal, load
+ `$cx-write-scientific-manuscript`; require the reviewed source record,
+ preserve claim-citation and reported-value traceability, validate the
+ portable submission package, and send the exact package to `$science-review`.
+6. For every non-trivial multi-step run, initialize `artifacts//checkpoint.json` with `"/scripts/python_runtime.sh" "/scripts/science_checkpoint.py" init` and the hook-injected `--session-key`. Include the goal, deliverable, objective done criteria, planned steps, and immediate next action. Add the hook-injected `--outer-goal native --goal-task-key ` only when native Goal mode is active. Claim a legacy schema-v1/v2/v3 run with `claim`; rotating an owned v2/v3 run to the activation-generation key requires the exact hook-injected legacy key as `--previous-session-key`. Never infer that old criteria were satisfied. Do not create a second nonterminal run for the same activation generation or create a checkpoint for a one-step answer. The checkpoint is mutable control metadata, not scientific evidence; never put prompts, credentials, private data, or conclusions in it.
+7. Use public read-only MCP tools for discovery. Cite primary sources and preserve source identifiers and URLs in the run record.
+8. Apply the selected skill instructions, but keep the approved plan and this safety policy authoritative. Run the smallest useful analysis first and retain failures or null results.
+9. Use `$science-provenance` to save code, commands, environment, outputs, claims, and evidence under the current research project's `artifacts//` directory. Attach `claim-register`, `evidence-graph`, `query-ledger`, `study-table`, `lane-receipt`, and `model-receipt` sidecars as ordinary hashed artifacts when applicable; validate the complete bundle before review.
+10. Use `$science-review` after producing claims. Delegate review to a separate subagent when available; give it the approved plan, artifact manifest, execution record, and outputs, not the intended conclusion. Attach the passed JSON receipt with `"/scripts/python_runtime.sh" "/scripts/science_checkpoint.py" review --artifact-ref`; the receipt must name the reviewer and attest independence. The checkpoint hashes this statement but cannot authenticate reviewer identity; a self-review is not independent.
+11. Resolve findings or mark them open. Satisfy every objective criterion with `"/scripts/python_runtime.sh" "/scripts/science_checkpoint.py" criterion` and a run-local evidence reference. Complete the checkpoint only after every planned step, criterion, and independent review passes, then report conclusions, uncertainty, limitations, and exact artifact paths.
+
+## Human-facing progress
+
+Keep machine JSON, JSON-RPC, hashes, and full logs unchanged, but do not paste
+them into ordinary progress messages. Write in the user's language and report
+only when a meaningful phase changes, a real gate opens, a failure changes the
+plan, or the run completes. Use this compact Markdown order:
+
+```markdown
+### Codex Science ·
+
+- **Status:**
+- **Current:**
+- **Next:**
+- **Evidence:**
+```
+
+Omit a row only when it truly has no value. Do not expose continuation counters,
+internal issue IDs, raw checkpoint prompts, or repeated setup narration. At
+completion, lead with the scientific outcome and use the run's `index.md` as the
+canonical human view. Show primary raster results directly in chat, return
+important local files as clickable absolute-path links, and keep `manifest.json`,
+complete logs, and optional HTML as linked audit detail.
+
+## Lane delegation and synthesis
+
+Delegate only lanes that can be evaluated independently. Give every lane the normalized inputs, claim IDs, evidence boundary, exact output schema, and artifact directory; withhold the intended conclusion from reviewers and avoid having multiple agents repeat the same search.
+
+Each lane must return a lane receipt containing the question addressed, sources and releases, exact queries or commands, included and excluded records, artifact paths and hashes, supported and contradicted claim IDs, limitations, confidence, and unresolved next action. The coordinator owns entity normalization, source-dependency deduplication, contradiction resolution, and final synthesis.
+
+For literature synthesis, use `$cx-literature-review` rather than ad-hoc parallel searches. Define the protocol and eligibility criteria, search complementary primary-literature sources, preserve exact query strings and dates, deduplicate by persistent identifier and underlying study, distinguish peer-reviewed articles from preprints and registry records, save a study table and evidence graph, and use `"/scripts/python_runtime.sh" "/scripts/diff_literature_review.py"` for living updates.
+
+## Completion test
+
+Before declaring success, verify that the requested deliverable exists; every plan step and objective criterion has terminal evidence; every material claim maps to primary evidence or a saved computation; queries, commands, environments, model revisions, inputs, and output hashes are recorded; uncertainty and generalization boundaries are explicit; unresolved reviewer findings are visible; and a clean rerun path is documented.
+
+## Persistence and autonomy
+
+Once the mode is active, start the in-scope plan and work until completion, a genuine blocker, or an approval gate. Do not end a turn merely because setup finished, a plan was written, progress was made, context is tight, or the first method failed. Chain reversible steps and keep the checkpoint's `next_action` executable.
+
+When the user explicitly asks for long-running, automatic, or finish-to-completion behavior and native Goal mode is available, use native Goal mode as the outer completion contract. Call `get_goal` first; reuse the unfinished task Goal and call `create_goal` only when none exists. Do not create a native goal for an ordinary request without that explicit intent. Initialize the checkpoint with `--outer-goal native`; the checkpoint remains the detailed inner execution state.
+
+At the start of a resumed, compacted, or automatic Goal continuation, call `get_goal`, find the session-owned nonterminal run, then run `"/scripts/python_runtime.sh" "/scripts/science_checkpoint.py" show artifacts/` before taking the next action. Never silently recreate a missing, paused, cleared, or already completed Goal. After each completed step, use `advance`; after meaningful same-step work, save a progress artifact and use `heartbeat --progress-ref`; after each failed approach, use `attempt`; before asking, use `gate`; when waiting on an external job, use `wait`; and when genuinely blocked, use `block`. Resume a gated, waiting, or blocked run with `resume`. If no active checkpoint exists, infer the next safe action from the artifact record instead of inventing prior completion.
+
+Never rely on the plugin Stop guard to rescue a progress-only final response. By default it only warns with the saved next action and leaves an `active` checkpoint unchanged for the next prompt, resume, or native Goal continuation. Blocking is disabled because openai/codex#20783 can reattach a hook-generated local UUID as an API message ID and break the next request. `CODEX_SCIENCE_STOP_MODE=block` restores the legacy rejection path only for compatibility testing after the installed Codex includes the upstream fix; do not recommend or enable it while the bug remains reproducible. In that opt-in mode, three rejected stops without evidence-backed progress trigger an idle safety escape and the absolute continuation budget still applies.
+
+For a native Goal run, local completion enters `completion_pending` instead of final completion. Then call `get_goal`, call `update_goal(status=complete)`, save a run-local JSON receipt containing `status: complete` and the hook-provided Goal task key, and only after host success run `"/scripts/python_runtime.sh" "/scripts/science_checkpoint.py" confirm-goal-complete --receipt `. This receipt is an agent attestation derived from host tool output, not hook-authenticated proof. For `approval_required`, ask once and do not mark the Goal blocked. Mark the native Goal blocked only after the same genuine blocker has repeated for the host-required turns and no safe route remains. A hook or script cannot inspect or update native Goal state; never claim otherwise.
+
+Do not combine Codex Science with another active generic Stop-loop such as Ralph Loop. Matching Stop hooks run concurrently and cannot reliably coordinate. Keep native Goal as the outer lifecycle when automatic continuation was explicitly requested; the default Codex Science Stop hook is warning-only. Read [references/goal-loop-contract.md](references/goal-loop-contract.md) before operating a native Goal run or explaining its lifecycle.
+
+Default to acting, not asking:
+
+- Proceed autonomously on reversible, read-only, or in-scope work already covered by the approved plan; on error recovery, retries, and switching methods; and on routine discovery via read-only MCP tools and writing artifacts under `artifacts//`.
+- When a detail is unspecified, choose the sensible default, state the assumption, and continue rather than blocking.
+- Do not ask for non-blocking preferences. Record the default in the run artifacts and continue.
+- Retry with a materially different method and record the outcome. After three attempts in the same failure class, change the hypothesis or route; if neither is safe, open one decision gate or record a genuine blocker. Never repeat an unchanged failure.
+
+Stop and ask only when it genuinely matters, and batch all currently known questions into a single ask rather than a stream:
+
+- a safety gate already listed in the Workflow and Boundaries (package installation, new network hosts, credentials, remote compute, write-capable or paid services, destructive or irreversible actions, imported executable code);
+- a fork that materially changes the deliverable, scope, or interpretation and cannot be settled from context or a reasonable default;
+- acknowledgement required before inspecting an inactive skill.
+
+Persistence never overrides a safety gate or the audit policy. Declare the problem solved only after `$science-review`, verification, and successful checkpoint completion. An inconclusive result does not itself finish the run: execute the next planned discriminating experiment, revise the route, or record why no in-scope action remains.
+
+## Plugin updates
+
+The stable host bootstrap checks the official `main` branch at a new task's
+startup or the first explicit activation. A compatible verified fast-forward may
+replace the managed Codex Science checkout and append a project-owned immutable
+runtime automatically; it never changes the user's research-project worktree or
+calls the Codex plugin CLI. First activation atomically pins one generation to
+that runtime's version, commit, and receipt. Use the absolute pinned runtime and
+coordinator path injected by the hook on every turn. A runtime installed by this
+or another task does not switch an active generation; use a new activation to
+adopt it. Durable checkpoint and artifact-manifest writes automatically record
+runtime identities; if `runtime_span` is true, surface it as a legacy/recovery
+limitation and require the review to assess cross-version comparability.
+If verification, the network, or recovery fails, continue from the last verified
+private runtime pin and report the short recovery message. A candidate that
+changes bootstrap files or policy must stop and direct the user to close every
+Codex task and the app before the acknowledged curl migration. Do not claim that
+the Codex plugin version is the scientific runtime version: host metadata
+identifies the stable bootstrap, while a new task adopts the latest compatible
+private runtime.
+
+## Boundaries
+
+- Do not claim a private Claude Science connector or skill was copied when only its public capability was recreated.
+- Do not treat search results, model predictions, or reviewer output as clinical or diagnostic advice.
+- Do not install the whole upstream dependency set. Install only packages needed for the selected, approved workflow.
+- Do not silently upgrade an inactive skill to active. Update the catalog policy and tests through project maintenance.
+- Do not discard failed runs or move the success threshold after observing results.
+- Do not claim the Stop guard can continue after the Codex app or task is closed, a native goal is paused, permissions are required, or the host is unavailable. Record `waiting_external` instead of busy-polling; use a user-approved task heartbeat automation only when work must resume after an external wait.
+
+Read [references/catalog-policy.md](references/catalog-policy.md) when explaining activation decisions or enabling an inactive skill.
diff --git a/runtime-skills/codex-science/agents/openai.yaml b/runtime-skills/codex-science/agents/openai.yaml
new file mode 100644
index 00000000..de1fc8cb
--- /dev/null
+++ b/runtime-skills/codex-science/agents/openai.yaml
@@ -0,0 +1,6 @@
+interface:
+ display_name: "Codex Science"
+ short_description: "Start a task-scoped science workbench"
+ default_prompt: "Use $codex-science to start a science session for this task and keep it active until I end it."
+policy:
+ allow_implicit_invocation: true
diff --git a/skills/codex-science/quality.json b/runtime-skills/codex-science/quality.json
similarity index 100%
rename from skills/codex-science/quality.json
rename to runtime-skills/codex-science/quality.json
diff --git a/skills/codex-science/references/authenticated-connector-packs.md b/runtime-skills/codex-science/references/authenticated-connector-packs.md
similarity index 96%
rename from skills/codex-science/references/authenticated-connector-packs.md
rename to runtime-skills/codex-science/references/authenticated-connector-packs.md
index cd7fe664..a287d28d 100644
--- a/skills/codex-science/references/authenticated-connector-packs.md
+++ b/runtime-skills/codex-science/references/authenticated-connector-packs.md
@@ -67,7 +67,7 @@ The core validator rejects secret-like parameter keys such as token, password, s
## Validate a spec
```bash
-python scripts/connector_action_contract.py validate-spec \
+"/scripts/python_runtime.sh" "/scripts/connector_action_contract.py" validate-spec \
artifacts/run-014/action-spec.json \
--output artifacts/run-014/action-spec.validated.json
```
@@ -108,7 +108,7 @@ The adapter should minimize `before_state`; do not include full private records
Validate a provider-created preview:
```bash
-python scripts/connector_action_contract.py validate-preview \
+"/scripts/python_runtime.sh" "/scripts/connector_action_contract.py" validate-preview \
artifacts/run-014/action-preview.json \
--spec artifacts/run-014/action-spec.json \
--output artifacts/run-014/action-preview.validated.json
@@ -117,7 +117,7 @@ python scripts/connector_action_contract.py validate-preview \
## Approval
```bash
-python scripts/connector_action_contract.py approve \
+"/scripts/python_runtime.sh" "/scripts/connector_action_contract.py" approve \
artifacts/run-014/action-preview.json \
--approved-by jaemin \
--scope assay:read \
diff --git a/skills/codex-science/references/catalog-policy.md b/runtime-skills/codex-science/references/catalog-policy.md
similarity index 100%
rename from skills/codex-science/references/catalog-policy.md
rename to runtime-skills/codex-science/references/catalog-policy.md
diff --git a/skills/codex-science/references/goal-loop-contract.md b/runtime-skills/codex-science/references/goal-loop-contract.md
similarity index 95%
rename from skills/codex-science/references/goal-loop-contract.md
rename to runtime-skills/codex-science/references/goal-loop-contract.md
index 32cba6aa..ea39d928 100644
--- a/skills/codex-science/references/goal-loop-contract.md
+++ b/runtime-skills/codex-science/references/goal-loop-contract.md
@@ -7,7 +7,7 @@ Use native Goal only for explicit long-running or finish-to-completion intent. I
1. Call `get_goal`.
2. Reuse an unfinished Goal. Call `create_goal` only when no unfinished Goal exists.
3. Initialize or claim exactly one nonterminal checkpoint with the hook-provided activation-generation owner key plus `--outer-goal native --goal-task-key `.
-4. On every automatic continuation, resume, or compaction, call `get_goal` and `science_checkpoint.py show` before acting.
+4. On every automatic continuation, resume, or compaction, call `get_goal` and `"/scripts/python_runtime.sh" "/scripts/science_checkpoint.py" show` before acting.
5. If Goal state and checkpoint state disagree, preserve artifacts, open a blocker, and do not invent completion or create a replacement Goal.
## State mapping
diff --git a/skills/codex-science/references/index.json b/runtime-skills/codex-science/references/index.json
similarity index 93%
rename from skills/codex-science/references/index.json
rename to runtime-skills/codex-science/references/index.json
index 93bb4ff2..6ebf3e7b 100644
--- a/skills/codex-science/references/index.json
+++ b/runtime-skills/codex-science/references/index.json
@@ -82,7 +82,7 @@
"path": "references/next-experiment-planning.md",
"purpose": "Deterministic Pareto, uncertainty, control, diversity, budget, and batch planning for a non-executing experiment proposal.",
"read_when": ["before ranking candidates for a new experiment", "before using model uncertainty or multi-objective utility for selection"],
- "required_before": ["calling scripts/plan_next_experiment.py", "treating a selected batch as an approved experiment"],
+ "required_before": ["calling /scripts/plan_next_experiment.py", "treating a selected batch as an approved experiment"],
"search_patterns": ["## Input contract", "## Selection method", "## Output contract", "## Failure handling"],
"authority": "Codex Science first-party experiment proposal contract",
"version": "1",
@@ -93,7 +93,7 @@
"path": "references/pipeline-promotion.md",
"purpose": "Generate a non-active reusable skill draft from a currently passed run without transferring conclusions or review receipts.",
"read_when": ["before converting a reviewed run into a reusable workflow", "before generating a skill draft from artifacts"],
- "required_before": ["calling scripts/promote_run_to_skill.py", "adding a generated draft to authored-skills or a catalog"],
+ "required_before": ["calling /scripts/promote_run_to_skill.py", "adding a generated draft to authored-skills or a catalog"],
"search_patterns": ["## Preconditions", "## Generated draft", "## Promotion path", "## Failure handling"],
"authority": "Codex Science first-party promotion contract",
"version": "1",
@@ -104,7 +104,7 @@
"path": "references/project-evidence-store.md",
"purpose": "Project-level immutable run imports, evidence assertions, hypothesis forks, comparisons, and non-executing merge plans.",
"read_when": ["before importing more than one run into a project", "before creating a hypothesis or experiment branch", "before recording a quantitative evidence assertion", "before comparing or merging scientific branches"],
- "required_before": ["calling scripts/science_project.py", "treating project-level state as scientific lineage"],
+ "required_before": ["calling /scripts/science_project.py", "treating project-level state as scientific lineage"],
"search_patterns": ["## Import a reviewed run", "## Fork a hypothesis branch", "## Add a quantitative evidence assertion", "## Prepare a merge plan", "## Failure handling"],
"authority": "Codex Science first-party project lineage contract",
"version": "1",
diff --git a/skills/codex-science/references/next-experiment-planning.md b/runtime-skills/codex-science/references/next-experiment-planning.md
similarity index 98%
rename from skills/codex-science/references/next-experiment-planning.md
rename to runtime-skills/codex-science/references/next-experiment-planning.md
index 44beb28c..dfcea3cf 100644
--- a/skills/codex-science/references/next-experiment-planning.md
+++ b/runtime-skills/codex-science/references/next-experiment-planning.md
@@ -97,7 +97,7 @@ Required controls are selected before optimization. If they cannot fit the batch
## CLI
```bash
-python scripts/plan_next_experiment.py \
+"/scripts/python_runtime.sh" "/scripts/plan_next_experiment.py" \
artifacts/run-020/next-experiment-input.json \
--output artifacts/run-020/next-experiment.proposal.json
```
diff --git a/skills/codex-science/references/pipeline-promotion.md b/runtime-skills/codex-science/references/pipeline-promotion.md
similarity index 98%
rename from skills/codex-science/references/pipeline-promotion.md
rename to runtime-skills/codex-science/references/pipeline-promotion.md
index 408dc2e1..880da53d 100644
--- a/skills/codex-science/references/pipeline-promotion.md
+++ b/runtime-skills/codex-science/references/pipeline-promotion.md
@@ -19,7 +19,7 @@ A run with findings, blocked work, missing outputs, stale receipts, or incomplet
## CLI
```bash
-python scripts/promote_run_to_skill.py \
+"/scripts/python_runtime.sh" "/scripts/promote_run_to_skill.py" \
artifacts/run-014/manifest.json \
drafts/receptor-state-docking \
--name receptor-state-docking \
diff --git a/skills/codex-science/references/project-evidence-store.md b/runtime-skills/codex-science/references/project-evidence-store.md
similarity index 85%
rename from skills/codex-science/references/project-evidence-store.md
rename to runtime-skills/codex-science/references/project-evidence-store.md
index 9c7b5731..74e56ebe 100644
--- a/skills/codex-science/references/project-evidence-store.md
+++ b/runtime-skills/codex-science/references/project-evidence-store.md
@@ -33,13 +33,13 @@ The event chain detects accidental or unauthorized mutation of project-index his
## CLI overview
```bash
-python scripts/science_project.py --database project/evidence.sqlite init ...
-python scripts/science_project.py --database project/evidence.sqlite import-run ...
-python scripts/science_project.py --database project/evidence.sqlite fork ...
-python scripts/science_project.py --database project/evidence.sqlite assert ...
-python scripts/science_project.py --database project/evidence.sqlite compare ...
-python scripts/science_project.py --database project/evidence.sqlite merge-plan ...
-python scripts/science_project.py --database project/evidence.sqlite summary ...
+"/scripts/python_runtime.sh" "/scripts/science_project.py" --database project/evidence.sqlite init ...
+"/scripts/python_runtime.sh" "/scripts/science_project.py" --database project/evidence.sqlite import-run ...
+"/scripts/python_runtime.sh" "/scripts/science_project.py" --database project/evidence.sqlite fork ...
+"/scripts/python_runtime.sh" "/scripts/science_project.py" --database project/evidence.sqlite assert ...
+"