Repository navigation
feat(quota,doctor): cure production context-delivery starvation and session-subdir bloat #3370
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Package Smoke | |
| on: | |
| pull_request: | |
| paths: | |
| - ".github/workflows/package-smoke.yml" | |
| - "packages/**" | |
| - "apps/presentation/dashboard/**" | |
| - "scripts/chat_bundle.py" | |
| - "tests/test_core_distribution.py" | |
| - "tests/test_core_workspace_distribution.py" | |
| - "tests/test_core_benchmark_distribution.py" | |
| - "tests/test_core_recall_distribution.py" | |
| - "tests/test_core_pr_review_distribution.py" | |
| - "tests/test_core_issue_fix_distribution.py" | |
| - "tests/test_core_standard_distribution.py" | |
| - "tests/control_plane/test_installed_core_context.py" | |
| - "tests/test_core_research_distribution.py" | |
| - "tests/capabilities/test_external_evidence_cli.py" | |
| - "loopx/doctor.py" | |
| - "loopx/python_install_owner.py" | |
| - "loopx/extensions/runtime.py" | |
| - "loopx/capabilities/decision_context/extension_provider.py" | |
| - "pyproject.toml" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - ".github/workflows/package-smoke.yml" | |
| - "packages/**" | |
| - "apps/presentation/dashboard/**" | |
| - "scripts/chat_bundle.py" | |
| - "loopx/**" | |
| - "tests/test_core_distribution.py" | |
| - "tests/test_core_workspace_distribution.py" | |
| - "tests/test_core_benchmark_distribution.py" | |
| - "tests/test_core_recall_distribution.py" | |
| - "tests/test_core_pr_review_distribution.py" | |
| - "tests/test_core_issue_fix_distribution.py" | |
| - "tests/test_core_standard_distribution.py" | |
| - "tests/control_plane/test_installed_core_context.py" | |
| - "tests/test_core_research_distribution.py" | |
| - "tests/capabilities/test_external_evidence_cli.py" | |
| - "loopx/extensions/runtime.py" | |
| - "loopx/capabilities/decision_context/extension_provider.py" | |
| - "pyproject.toml" | |
| schedule: | |
| - cron: "47 20 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: package-smoke-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| core: | |
| name: loopx-core | |
| # Keep the existing check green only when both package suites finish successfully. | |
| if: always() | |
| needs: [core-execution, core-companions] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Require both Core package suites | |
| env: | |
| CORE_EXECUTION_RESULT: ${{ needs.core-execution.result }} | |
| CORE_COMPANIONS_RESULT: ${{ needs.core-companions.result }} | |
| run: | | |
| test "$CORE_EXECUTION_RESULT" = success | |
| test "$CORE_COMPANIONS_RESULT" = success | |
| core-execution: | |
| name: loopx-core-execution | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Prepare source validation environment | |
| run: uv sync --extra test | |
| - name: Build and separately install the standalone core | |
| run: | | |
| uv run --extra test python packages/loopx-core/prepare.py --output "$RUNNER_TEMP/core-source" | |
| uv build "$RUNNER_TEMP/core-source" --out-dir "$RUNNER_TEMP/core-dist" | |
| uv venv "$RUNNER_TEMP/core-env" --python .venv/bin/python | |
| uv pip install --python "$RUNNER_TEMP/core-env/bin/python" "$RUNNER_TEMP"/core-dist/loopx_core-*.whl | |
| echo "LOOPX_CORE_TEST_PYTHON=$RUNNER_TEMP/core-env/bin/python" >> "$GITHUB_ENV" | |
| - name: Qualify installed execution, context, recovery, replay and refusal | |
| env: | |
| LOOPX_USAGE_PING: "0" | |
| run: >- | |
| uv run --extra test python -m pytest -q | |
| tests/test_core_distribution.py | |
| tests/control_plane/test_installed_core_context.py | |
| core-companions: | |
| name: loopx-core-companions | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| cache: npm | |
| cache-dependency-path: apps/presentation/dashboard/package-lock.json | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Prepare source validation environment | |
| run: uv sync --extra test | |
| - name: Build and separately install the standalone core | |
| run: | | |
| uv run --extra test python packages/loopx-core/prepare.py --output "$RUNNER_TEMP/core-source" | |
| uv build "$RUNNER_TEMP/core-source" --out-dir "$RUNNER_TEMP/core-dist" | |
| uv venv "$RUNNER_TEMP/core-env" --python .venv/bin/python | |
| uv pip install --python "$RUNNER_TEMP/core-env/bin/python" "$RUNNER_TEMP"/core-dist/loopx_core-*.whl | |
| echo "LOOPX_CORE_TEST_PYTHON=$RUNNER_TEMP/core-env/bin/python" >> "$GITHUB_ENV" | |
| - name: Qualify matching Benchmark Toolkit installation and recovery | |
| env: | |
| LOOPX_USAGE_PING: "0" | |
| run: | | |
| uv run --extra test python packages/loopx-core/prepare.py \ | |
| --distribution loopx-capability-benchmark-toolkit --output "$RUNNER_TEMP/benchmark-source" | |
| uv build --wheel "$RUNNER_TEMP/benchmark-source" --out-dir "$RUNNER_TEMP/benchmark-dist" | |
| export LOOPX_CORE_TEST_WHEEL=$(printf '%s' "$RUNNER_TEMP"/core-dist/loopx_core-*.whl) | |
| export LOOPX_BENCHMARK_TEST_WHEEL=$(printf '%s' "$RUNNER_TEMP"/benchmark-dist/loopx_capability_benchmark_toolkit-*.whl) | |
| uv run --extra test python -m pytest -q tests/test_core_benchmark_distribution.py | |
| - name: Qualify matched recall installation, execution, and removal | |
| env: | |
| LOOPX_USAGE_PING: "0" | |
| run: | | |
| uv run --extra test python packages/loopx-core/prepare.py \ | |
| --distribution loopx-capability-agent-turn-recall --output "$RUNNER_TEMP/recall-source" | |
| uv build --wheel "$RUNNER_TEMP/recall-source" --out-dir "$RUNNER_TEMP/core-dist" | |
| uv pip install --python "$LOOPX_CORE_TEST_PYTHON" \ | |
| "$RUNNER_TEMP"/core-dist/loopx_capability_agent_turn_recall-*.whl | |
| LOOPX_RECALL_TEST_ENABLED=1 uv run --extra test python -m pytest -q tests/test_core_recall_distribution.py | |
| uv pip uninstall --python "$LOOPX_CORE_TEST_PYTHON" loopx-capability-agent-turn-recall | |
| uv run --extra test python -m pytest -q tests/test_core_distribution.py \ | |
| -k 'reports_optional_turn_recall or completes_turn_with_configured_optional_recall' | |
| - name: Qualify matched pull-request review installation, checkpoint and removal | |
| env: | |
| LOOPX_USAGE_PING: "0" | |
| run: | | |
| uv run --extra test python packages/loopx-core/prepare.py \ | |
| --distribution loopx-capability-pull-request-review --output "$RUNNER_TEMP/review-source" | |
| uv build --wheel "$RUNNER_TEMP/review-source" --out-dir "$RUNNER_TEMP/core-dist" | |
| uv pip install --python "$LOOPX_CORE_TEST_PYTHON" \ | |
| "$RUNNER_TEMP"/core-dist/loopx_capability_pull_request_review-*.whl | |
| LOOPX_REVIEW_TEST_ENABLED=1 uv run --extra test python -m pytest -q tests/test_core_pr_review_distribution.py | |
| uv pip uninstall --python "$LOOPX_CORE_TEST_PYTHON" loopx-capability-pull-request-review | |
| uv run --extra test python -m pytest -q tests/test_core_pr_review_distribution.py -k discovers | |
| - name: Qualify Issue Fix and the Standard CLI composition | |
| env: | |
| LOOPX_USAGE_PING: "0" | |
| run: | | |
| uv run --extra test python packages/loopx-core/prepare.py \ | |
| --distribution loopx-capability-issue-fix --output "$RUNNER_TEMP/issue-fix-source" | |
| uv build --wheel "$RUNNER_TEMP/issue-fix-source" --out-dir "$RUNNER_TEMP/core-dist" | |
| uv pip install --python "$LOOPX_CORE_TEST_PYTHON" \ | |
| "$RUNNER_TEMP"/core-dist/loopx_capability_issue_fix-*.whl | |
| LOOPX_ISSUE_FIX_TEST_ENABLED=1 uv run --extra test python -m pytest -q tests/test_core_issue_fix_distribution.py | |
| uv pip uninstall --python "$LOOPX_CORE_TEST_PYTHON" loopx-capability-issue-fix | |
| uv pip install --offline --no-index --find-links "$RUNNER_TEMP/core-dist" --reinstall-package loopx-core \ | |
| --python "$LOOPX_CORE_TEST_PYTHON" 'loopx-core[standard]' | |
| LOOPX_ISSUE_FIX_TEST_ENABLED=1 LOOPX_REVIEW_TEST_ENABLED=1 LOOPX_RECALL_TEST_ENABLED=1 \ | |
| uv run --extra test python -m pytest -q \ | |
| tests/test_core_issue_fix_distribution.py tests/test_core_pr_review_distribution.py \ | |
| tests/test_core_recall_distribution.py -k 'installed' | |
| uv pip uninstall --python "$LOOPX_CORE_TEST_PYTHON" \ | |
| loopx-capability-issue-fix loopx-capability-pull-request-review loopx-capability-agent-turn-recall | |
| uv run --extra test python -m pytest -q tests/test_core_issue_fix_distribution.py -k 'quiet or retains_bound' | |
| LOOPX_STANDARD_TEST_WHEELHOUSE="$RUNNER_TEMP/core-dist" uv run --extra test python -m pytest -q \ | |
| tests/test_core_standard_distribution.py | |
| - name: Qualify research availability, Explore primary workflow, ledger recovery and removal | |
| env: | |
| LOOPX_USAGE_PING: "0" | |
| run: | | |
| uv run --extra test python -m pytest -q tests/test_core_research_distribution.py | |
| uv run --extra test python packages/loopx-core/prepare.py --distribution loopx-capability-research --output "$RUNNER_TEMP/research-source" | |
| uv build --wheel "$RUNNER_TEMP/research-source" --out-dir "$RUNNER_TEMP/research-dist" | |
| LOOPX_CORE_TEST_WHEEL=$(printf '%s' "$RUNNER_TEMP"/core-dist/loopx_core-*.whl) \ | |
| LOOPX_RESEARCH_TEST_WHEEL=$(printf '%s' "$RUNNER_TEMP"/research-dist/loopx_capability_research-*.whl) \ | |
| uv run --extra test python -m pytest -q tests/test_core_research_distribution.py -k c1_explore_readback | |
| uv pip install --python "$LOOPX_CORE_TEST_PYTHON" "$RUNNER_TEMP"/research-dist/loopx_capability_research-*.whl | |
| LOOPX_RESEARCH_TEST_ENABLED=1 uv run --extra test python -m pytest -q tests/test_core_research_distribution.py | |
| LOOPX_RESEARCH_TEST_PYTHON="$LOOPX_CORE_TEST_PYTHON" uv run --extra test python -m pytest -q tests/capabilities/test_external_evidence_cli.py -k preserves_receipt_clocks_and_idempotent_ledger | |
| uv pip uninstall --python "$LOOPX_CORE_TEST_PYTHON" loopx-capability-research | |
| uv run --extra test python -m pytest -q tests/test_core_research_distribution.py | |
| LOOPX_CORE_TEST_PYTHON="$LOOPX_CORE_TEST_PYTHON" uv run --extra test python -m pytest -q tests/test_core_distribution.py -k 'identity_help_and_unavailable_workspace or defers_explore_evaluation' | |
| - name: Build the matching Workspace wheel | |
| run: | | |
| uv run --extra test python scripts/chat_bundle.py build --install | |
| uv run --extra test python packages/loopx-core/prepare.py --distribution loopx-workspace --output "$RUNNER_TEMP/workspace-source" | |
| uv build --wheel "$RUNNER_TEMP/workspace-source" --out-dir "$RUNNER_TEMP/workspace-dist" | |
| printf 'LOOPX_CORE_TEST_WHEEL=%s\n' "$RUNNER_TEMP"/core-dist/loopx_core-*.whl >> "$GITHUB_ENV" | |
| printf 'LOOPX_WORKSPACE_TEST_WHEEL=%s\n' "$RUNNER_TEMP"/workspace-dist/loopx_workspace-*.whl >> "$GITHUB_ENV" | |
| - name: Qualify Workspace readback and removal on File and SQLite | |
| run: uv run --extra test python -m pytest -q tests/test_core_workspace_distribution.py | |
| - name: Qualify a clean install of the matched split release | |
| shell: bash | |
| env: | |
| LOOPX_USAGE_PING: "0" | |
| run: | | |
| uv run --extra test python packages/loopx-core/prepare.py \ | |
| --distribution loopx --output "$RUNNER_TEMP/meta-source" | |
| uv build --wheel "$RUNNER_TEMP/meta-source" --out-dir "$RUNNER_TEMP/meta-dist" | |
| version_tag=$(python -I -S scripts/release_artifacts.py expected-tag) | |
| version=${version_tag#v} | |
| install_root="$RUNNER_TEMP/split-meta-env" | |
| python -m venv "$install_root" | |
| "$install_root/bin/python" -m pip install --disable-pip-version-check --no-index --only-binary=:all: \ | |
| --find-links "$RUNNER_TEMP/meta-dist" --find-links "$RUNNER_TEMP/core-dist" \ | |
| --find-links "$RUNNER_TEMP/workspace-dist" --find-links "$RUNNER_TEMP/benchmark-dist" \ | |
| --find-links "$RUNNER_TEMP/research-dist" "loopx==$version" | |
| "$install_root/bin/python" -m pip check | |
| ( | |
| cd "$RUNNER_TEMP" | |
| "$install_root/bin/loopx" --format json doctor --installation-only --deep | |
| ) | tee "$RUNNER_TEMP/split-meta-doctor.json" | |
| "$install_root/bin/python" -I - "$version" "$RUNNER_TEMP/split-meta-doctor.json" <<'PY' | |
| import json | |
| import sys | |
| from pathlib import Path | |
| version, receipt_path = sys.argv[1:] | |
| receipt = json.loads(Path(receipt_path).read_text(encoding="utf-8")) | |
| assert receipt["ok"] and receipt["service_runtime_identity"]["package_version"] == version, receipt | |
| companions = receipt["companion_distributions"] | |
| assert {companion["distribution"] for companion in companions} == { | |
| "loopx-workspace", | |
| "loopx-capability-agent-turn-recall", | |
| "loopx-capability-benchmark-toolkit", | |
| "loopx-capability-issue-fix", | |
| "loopx-capability-pull-request-review", | |
| "loopx-capability-research", | |
| }, companions | |
| assert all( | |
| companion["installed"] and companion["ready"] and companion["version"] == version | |
| for companion in companions | |
| ), companions | |
| PY | |
| codex-provider-routing: | |
| name: loopx-codex-provider-routing | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Install provider and schema validator | |
| run: python -m pip install packages/loopx-codex-provider-routing "jsonschema==4.26.0" | |
| - name: Validate recovery and existing operator contracts | |
| run: | | |
| python -m compileall -q packages/loopx-codex-provider-routing/src | |
| python packages/loopx-codex-provider-routing/smoke/native_host_smoke.py | |
| python packages/loopx-codex-provider-routing/smoke/native_host_clients_smoke.py | |
| python packages/loopx-codex-provider-routing/smoke/codex_provider_routing_smoke.py | |
| python packages/loopx-codex-provider-routing/smoke/recovery_contracts_smoke.py | |
| python packages/loopx-codex-provider-routing/smoke/operator_smoke.py | |
| - name: Validate installed entrypoint and example schemas | |
| run: | | |
| python - <<'PY' | |
| import json, subprocess | |
| from pathlib import Path | |
| from jsonschema import validate | |
| import tomllib | |
| from importlib.metadata import version | |
| from importlib.resources import files | |
| import loopx_codex_provider_routing as provider | |
| root = Path("packages/loopx-codex-provider-routing") | |
| release = version("loopx-codex-provider-routing") | |
| assert provider.__version__ == release | |
| for manifest in (root / "extension.toml", files(provider) / "native-extension.toml"): | |
| assert tomllib.loads(manifest.read_text(encoding="utf-8"))["version"] == release, manifest | |
| request_schema = json.loads((root / "schemas/request.schema.json").read_text()) | |
| response_schema = json.loads((root / "schemas/response.schema.json").read_text()) | |
| for example in sorted((root / "examples").glob("*.json")): | |
| request = json.loads(example.read_text()) | |
| validate(request, request_schema) | |
| result = subprocess.run(["loopx-codex-provider-routing"], input=json.dumps(request), text=True, capture_output=True, check=True) | |
| response = json.loads(result.stdout) | |
| validate(response, response_schema) | |
| assert response["ok"], example.name | |
| PY | |
| repo-health: | |
| name: loopx-repo-health | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Compile package modules | |
| run: >- | |
| python -m py_compile | |
| packages/loopx-repo-health/src/loopx_repo_health/*.py | |
| - name: Run offline contract smoke | |
| run: >- | |
| python | |
| packages/loopx-repo-health/smoke/repo_health_snapshot_smoke.py | |
| obelisk: | |
| name: loopx-obelisk | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Install contract validator | |
| run: python -m pip install --disable-pip-version-check "jsonschema==4.26.0" | |
| - name: Compile package modules | |
| run: >- | |
| python -m py_compile | |
| packages/loopx-obelisk/src/loopx_obelisk/*.py | |
| - name: Run offline contract smoke | |
| run: >- | |
| python | |
| packages/loopx-obelisk/smoke/obelisk_provider_smoke.py |