diff --git a/.codex/rules/development.rules b/.codex/rules/development.rules index 6f99fd49db..de5395b6d0 100644 --- a/.codex/rules/development.rules +++ b/.codex/rules/development.rules @@ -29,12 +29,14 @@ Safe: fixed non-publishing recipes only operate on the trusted checkout. """, ) +# Cargo accepts `--manifest-path`, so these rules may target manifests outside +# this checkout. That flexibility is an accepted tradeoff for development. prefix_rule( pattern = ["cargo", ["build", "check", "clippy", "test"]], decision = "allow", justification = """ Needed: Cargo uses host registry, Git, and cache state. -Safe: these commands only build, check, lint, or test the trusted workspace. +Safe: these non-installing subcommands are standard development operations. """, ) @@ -43,7 +45,7 @@ prefix_rule( decision = "allow", justification = """ Needed: Nextest needs host runtime and nested sandboxes. -Safe: it only runs tests built from the trusted workspace. +Safe: it only runs tests and does not install or publish artifacts. """, ) diff --git a/scripts/test_format.py b/scripts/codex_package/test_format_script.py similarity index 94% rename from scripts/test_format.py rename to scripts/codex_package/test_format_script.py index 6440cc0973..7d0958f3f2 100644 --- a/scripts/test_format.py +++ b/scripts/codex_package/test_format_script.py @@ -7,7 +7,7 @@ import unittest from unittest.mock import patch -FORMAT_SCRIPT_PATH = Path(__file__).with_name("format.py") +FORMAT_SCRIPT_PATH = Path(__file__).resolve().parent.parent / "format.py" FORMAT_SCRIPT_SPEC = importlib.util.spec_from_file_location( "codex_format_script", FORMAT_SCRIPT_PATH, diff --git a/scripts/test_setup_dev_execpolicy.py b/scripts/codex_package/test_setup_dev_execpolicy.py similarity index 97% rename from scripts/test_setup_dev_execpolicy.py rename to scripts/codex_package/test_setup_dev_execpolicy.py index 31beded8b3..dd6ae19098 100644 --- a/scripts/test_setup_dev_execpolicy.py +++ b/scripts/codex_package/test_setup_dev_execpolicy.py @@ -7,7 +7,7 @@ import sys import unittest from unittest.mock import patch -sys.path.insert(0, str(Path(__file__).resolve().parent)) +sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) import setup_dev_execpolicy