Skip to content

Navigation Menu

Sign in
Sign up

Phase III U2 Safety Envelope & Type-Verified Runner Surface #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
Copilot wants to merge 5 commits into master
base: master
Choose a base branch
Loading
from copilot/implement-u2-safety-envelope
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .github/workflows/u2-safety-gate.yml
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: U2 Safety Gate

on:
pull_request:
paths:
- 'experiments/u2/**'
- 'tests/test_u2*.py'
- 'pyproject.toml'
push:
branches:
- main
- 'copilot/**'

jobs:
type-check:
name: Type Safety Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
pip install mypy pytest pyyaml pydantic typing-extensions

- name: Run mypy on U2 modules
run: |
mypy experiments/u2/ --config-file pyproject.toml

- name: Fail if mypy errors
if: failure()
run: |
echo "::error::Type checking failed for U2 modules"
exit 1

safety-tests:
name: Safety & Performance Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
pip install pytest pyyaml pydantic typing-extensions

- name: Run U2 tests
run: |
pytest tests/test_u2*.py -v

- name: Check test results
if: failure()
run: |
echo "::error::U2 tests failed"
exit 1

- name: Run performance guardrail tests
run: |
pytest tests/test_u2_perf_guardrails.py -v

- name: Check safety envelope smoke test
run: |
python3 -c "
from experiments.u2.entrypoint import run_u2_experiment
from experiments.u2.runner import U2Config
from experiments.u2.safety_envelope import evaluate_safety_status

# Quick smoke test
config = U2Config(
experiment_id='ci_smoke',
slice_name='test',
mode='baseline',
total_cycles=5,
master_seed=42
)

def mock_exec(item, seed):
return True, {'ok': True}

results, envelope = run_u2_experiment(
config=config,
items=['a', 'b', 'c'],
execute_fn=mock_exec
)

if not evaluate_safety_status(envelope):
raise RuntimeError(f'Safety envelope BLOCKED: {envelope.warnings}')

print(f'✓ Safety status: {envelope.safety_status}')
print(f'✓ Completed {len(results)} cycles')
print(f'✓ Performance OK: {envelope.perf_ok}')
"
Loading

AltStyle によって変換されたページ (->オリジナル) /