From 05893ab23421beac43e37727de7b3c1f01276472 Mon Sep 17 00:00:00 2001 From: PureStream108 <1262364207@qq.com> Date: Wed, 14 Oct 2026 09:49:06 +0000 Subject: [PATCH 01/21] Fix competition closeout, scheduling, Ops workflow and acceptance gates --- .dockerignore | 9 +- .github/workflows/ci.yml | 56 +- .gitignore | 3 +- Dockerfile | 16 +- README.md | 15 +- backend/agent/compaction.py | 9 +- backend/agent/job_service.py | 9 +- backend/agent/runtime.py | 66 +- backend/agent/watchdog.py | 1 - backend/api/agent.py | 31 +- backend/api/auth.py | 12 +- backend/api/competition.py | 67 +- backend/api/config.py | 41 +- backend/api/flags.py | 10 +- backend/api/graph.py | 13 +- backend/api/logs.py | 16 +- backend/api/memory.py | 22 +- backend/api/ops_agent.py | 73 +- backend/api/platform.py | 8 +- backend/api/project.py | 41 +- backend/api/questions.py | 11 +- backend/api/skills.py | 20 +- backend/api/solve.py | 24 +- backend/api/wp.py | 12 +- backend/auth/manager.py | 6 +- backend/blackboard/db.py | 3 +- backend/blackboard/edge_store.py | 1 - backend/blackboard/node_store.py | 1 - backend/competition/conversation.py | 13 +- backend/competition/fixture.py | 2 + backend/competition/platform.py | 8 +- backend/competition/policy.py | 24 +- backend/competition/proto/pair_pb2.py | 2 +- backend/competition/runtime.py | 5 +- backend/competition/schema.py | 2 + backend/competition/service.py | 400 +++++++++-- backend/competition/store.py | 170 ++++- backend/competition/transport.py | 16 +- backend/core/diamond.py | 5 + backend/core/engine_lease.py | 3 +- backend/core/ipc.py | 4 +- backend/core/logging_util.py | 3 +- backend/core/orchestrator.py | 168 ++++- backend/core/postprocess_store.py | 1 - backend/core/resource_manager.py | 4 + backend/core/state.py | 18 +- backend/core/validation.py | 5 + backend/core/wp_writer.py | 4 + backend/mcp/mcp_client.py | 16 +- backend/mcp/mcp_server.py | 8 +- backend/mcp/reverse_mcp.py | 16 +- backend/mcp/reverse_worker.py | 5 + backend/mcp/shared.py | 35 +- backend/members/adapters.py | 12 +- backend/members/base_member.py | 94 ++- backend/members/member_tools.py | 8 +- backend/memory/memory_mcp.py | 3 +- backend/memory/memory_store.py | 1 - backend/ops/attachments.py | 1 - backend/ops/ipc_mcp.py | 8 +- backend/ops/models.py | 13 +- backend/ops/network.py | 5 +- backend/ops/questions.py | 10 +- backend/ops/service.py | 54 +- backend/ops/store.py | 101 ++- backend/ops/tools.py | 8 +- backend/persistence/database.py | 5 +- .../20260807_0002_goal_intent_uniqueness.py | 1 - .../20260920_0004_competition_runtime.py | 1 - .../20260920_0005_competition_artifacts.py | 1 - ...921_0006_redact_competition_credentials.py | 1 - .../20260923_0007_engine_observations.py | 1 - .../20260925_0008_run_scoped_challenges.py | 1 - .../versions/20260929_0009_agent_sessions.py | 1 - .../versions/20261008_0010_agent_jobs.py | 1 - .../20261013_0011_ops_workflow_limits.py | 35 + backend/persistence/schema.py | 6 +- backend/platform/README.md | 32 + backend/platform/__init__.py | 2 +- backend/platform/_common.py | 1 - backend/platform/adapter.py | 12 +- backend/platform/downloads.py | 2 +- backend/platform/factory.py | 8 +- backend/platform/gzctf/adapter.py | 21 +- backend/platform/mapping.py | 3 +- backend/platform/ret2shell/adapter.py | 6 +- backend/platform/ret2shell/mcp.py | 10 +- backend/sandbox/container_pool.py | 2 +- backend/sandbox/docker_manager.py | 1 - backend/sandbox/network_manager.py | 7 +- backend/sandbox/resource_limiter.py | 31 +- backend/sandbox/task_sandbox.py | 11 +- backend/server/app.py | 11 +- backend/tools/catalog.py | 2 +- backend/tools/tool_inventory.py | 1 - backend/tools/tool_mcp.py | 3 +- backend/tools/tool_registry.py | 2 +- coverage-baseline.json | 12 + docker-compose.e2e.yml | 68 ++ docker-compose.yml | 4 + docker/e2e/app.py | 64 ++ docker/e2e/config/config.yaml | 17 + docker/e2e/fake_platform.py | 46 ++ docker/e2e/probe.py | 67 ++ docker/e2e/runner.Dockerfile | 8 + docker/tests/postgres.Dockerfile | 10 + frontend/index.html | 96 ++- image/ipc.png | Bin 0 -> 279222 bytes plan.md | 153 +++++ pyproject.toml | 14 +- scripts/c5_task_acceptance.sh | 4 + scripts/check_coverage.py | 47 ++ scripts/isctf_ipc_smoke.py | 3 +- scripts/isctf_real_ipc_resume.py | 7 +- scripts/isctf_real_ipc_run.py | 7 +- scripts/migrate_legacy_data.py | 5 + scripts/monitor_real_competition.py | 642 ++++++++++++++++++ scripts/p3_docker_e2e_probe.py | 2 +- scripts/p4_docker_e2e_probe.py | 10 + scripts/p5_docker_e2e_probe.py | 13 +- scripts/playwright_e2e.py | 168 +++++ scripts/real_competition_acceptance.py | 14 + scripts/standalone_solve.py | 4 +- tests/conftest.py | 192 ++++-- tests/test_agent_context.py | 4 +- tests/test_agent_jobs.py | 87 ++- tests/test_agent_runtime.py | 99 ++- tests/test_agent_session_store.py | 22 +- tests/test_agent_watchdog.py | 23 +- tests/test_api.py | 3 +- tests/test_browser_integration.py | 3 +- tests/test_competition_api.py | 7 +- tests/test_competition_collab.py | 5 +- tests/test_competition_migration_smoke.py | 3 +- tests/test_competition_monitor.py | 180 +++++ tests/test_competition_policy.py | 6 +- tests/test_competition_restart.py | 7 +- tests/test_competition_runtime.py | 37 +- tests/test_competition_service_fixture.py | 261 ++++++- tests/test_competition_service_guards.py | 147 +++- tests/test_competition_store.py | 176 ++++- tests/test_competition_transport.py | 202 +++++- tests/test_competition_uds.py | 1 - tests/test_config.py | 31 +- tests/test_coverage_gate.py | 33 + tests/test_frontend.py | 5 +- tests/test_goal_intent_postgres.py | 12 +- tests/test_gzctf_adapter.py | 134 +++- tests/test_legacy_migration.py | 2 +- tests/test_lifecycle.py | 30 +- tests/test_member_driver.py | 4 +- tests/test_member_edges.py | 160 +++++ tests/test_member_tools.py | 2 +- tests/test_members.py | 68 +- tests/test_ops_agent.py | 12 +- tests/test_ops_stream.py | 1 - tests/test_optional_startup.py | 2 +- tests/test_orchestration.py | 150 +++- tests/test_persistence_schema.py | 1 - tests/test_platform.py | 2 +- tests/test_postgres_isolation.py | 85 +++ tests/test_provider_adapters.py | 81 ++- tests/test_ret2shell.py | 19 +- tests/test_sandbox.py | 9 +- tests/test_sandbox_containment.py | 4 +- tests/test_sandbox_jobs.py | 30 +- tests/test_shared_member_config.py | 9 +- tests/test_streaming_mock.py | 1 - tests/test_tools_mcp.py | 2 +- 169 files changed, 5155 insertions(+), 757 deletions(-) create mode 100644 backend/core/validation.py create mode 100644 backend/persistence/migrations/versions/20261013_0011_ops_workflow_limits.py create mode 100644 backend/platform/README.md create mode 100644 coverage-baseline.json create mode 100644 docker-compose.e2e.yml create mode 100644 docker/e2e/app.py create mode 100644 docker/e2e/config/config.yaml create mode 100644 docker/e2e/fake_platform.py create mode 100644 docker/e2e/probe.py create mode 100644 docker/e2e/runner.Dockerfile create mode 100644 docker/tests/postgres.Dockerfile create mode 100644 image/ipc.png create mode 100644 plan.md create mode 100644 scripts/check_coverage.py mode change 100644 => 100755 scripts/migrate_legacy_data.py create mode 100644 scripts/monitor_real_competition.py create mode 100644 scripts/playwright_e2e.py create mode 100644 scripts/real_competition_acceptance.py create mode 100644 tests/test_competition_monitor.py create mode 100644 tests/test_coverage_gate.py create mode 100644 tests/test_member_edges.py create mode 100644 tests/test_postgres_isolation.py diff --git a/.dockerignore b/.dockerignore index d3740d9..0867290 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,7 +5,14 @@ **/__pycache__ **/*.pyc .pytest_cache +.ruff_cache +coverage.json .venv +.env +.env.* +.qa-artifacts/ +testconfigkey.txt +backend/config/config.yaml tools/ data/ logs/ @@ -15,4 +22,4 @@ projects/ memory/ exports/ ipc_check.js -log.txt \ No newline at end of file +log.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad93ff3..6ff1133 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,15 +48,35 @@ jobs: python -m pip install --upgrade pip python -m pip install -e ".[dev,docker]" - - name: Run tests - run: python -m pytest -q + - name: Run tests with branch coverage + run: python -m pytest -q --require-postgres --cov=backend --cov-branch --cov-report=term-missing --cov-report=json --junitxml=data/exports/pytest-ci.xml - - name: Static and deployment checks + - name: Enforce architectural coverage floors + run: python scripts/check_coverage.py + + - name: Verify temporary PostgreSQL isolation + run: | + native_postgres_ctl="$(pg_config --bindir)/pg_ctl" + test -x "$native_postgres_ctl" + env -u IPC_TEST_DATABASE_URL -u IPC_DATABASE_URL IPC_TEST_POSTGRES_EXECUTABLE="$native_postgres_ctl" \ + python -m pytest -q --require-postgres tests/test_postgres_isolation.py tests/test_goal_intent_postgres.py tests/test_ops_stream.py tests/test_competition_monitor.py tests/test_competition_migration_smoke.py + + - name: Full lint and deployment checks run: | + python -m ruff check backend scripts tests python -m compileall -q backend scripts tests python -m alembic upgrade head --sql > /tmp/ipc-migration.sql docker compose config --quiet + - name: Upload test and coverage diagnostics + if: always() + uses: actions/upload-artifact@v4 + with: + name: ipc-tests-coverage + path: | + coverage.json + data/exports/pytest-ci.xml + task-image: runs-on: ubuntu-latest timeout-minutes: 60 @@ -82,3 +102,33 @@ jobs: - name: Run AI CPU smoke run: docker run --rm -v "$PWD/scripts:/acceptance:ro" ipc-task:ci python3 /acceptance/ai_smoke.py + + e2e: + runs-on: ubuntu-latest + timeout-minutes: 30 + env: + IPC_INSTALL_WSRX: "0" + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Start deterministic E2E stack + run: | + docker compose build ipc-app + docker compose -f docker-compose.e2e.yml up -d e2e-postgres e2e-platform e2e-app + + - name: Run Playwright competition acceptance + run: docker compose -f docker-compose.e2e.yml run --rm e2e-runner + + - name: Upload E2E diagnostics + # All three CI jobs must be required by the repository's branch rules; + # declaring a job here alone does not configure branch protection. + if: always() + uses: actions/upload-artifact@v4 + with: + name: ipc-e2e-diagnostics + path: data/exports/e2e + + - name: Stop E2E stack + if: always() + run: docker compose -f docker-compose.e2e.yml down -v diff --git a/.gitignore b/.gitignore index 8c11a30..3229d73 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ backend/config/config.yaml logs/ data/ .ipc/ -memory/ +/memory/ projects/ Wp/ docs/ @@ -64,6 +64,7 @@ htmlcov/ .cache nosetests.xml coverage.xml +coverage.json *.cover *.py.cover .hypothesis/ diff --git a/Dockerfile b/Dockerfile index 4fe6f2d..12a464b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,11 +33,17 @@ RUN python -c "from pathlib import Path; from backend.skills.store import SkillS # subprocesses are owned by the backend process (Members just connect to # ipc-app:). ARG WSRX_VERSION=0.6.1 -RUN python -c "import urllib.request; urllib.request.urlretrieve('https://github.com/XDSEC/WebSocketReflectorX/releases/download/${WSRX_VERSION}/wsrx-cli-${WSRX_VERSION}-linux-musl-x86_64.tar.gz', '/tmp/wsrx.tar.gz')" \ - && tar -xzf /tmp/wsrx.tar.gz -C /tmp \ - && install -m 0755 /tmp/wsrx /usr/local/bin/wsrx \ - && rm -f /tmp/wsrx /tmp/wsrx.tar.gz \ - && wsrx --version +ARG INSTALL_WSRX=1 +RUN if [ "$INSTALL_WSRX" = "1" ]; then \ + python -c "import urllib.request; urllib.request.urlretrieve('https://github.com/XDSEC/WebSocketReflectorX/releases/download/${WSRX_VERSION}/wsrx-cli-${WSRX_VERSION}-linux-musl-x86_64.tar.gz', '/tmp/wsrx.tar.gz')" \ + && tar -xzf /tmp/wsrx.tar.gz -C /tmp \ + && install -m 0755 /tmp/wsrx /usr/local/bin/wsrx \ + && rm -f /tmp/wsrx /tmp/wsrx.tar.gz \ + && wsrx --version; \ + else \ + printf '#!/bin/sh\necho wsrx disabled in this image\nexit 127\n' > /usr/local/bin/wsrx \ + && chmod +x /usr/local/bin/wsrx; \ + fi # /app/data is bind-mounted by docker-compose.yml. PostgreSQL owns runtime # facts; filesystem workspaces and generated files share one Artifact tree. diff --git a/README.md b/README.md index b612f31..c89da6a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,6 @@
- [![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](LICENSE) [![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-3776AB.svg?logo=python&logoColor=white)](https://www.python.org/) [![FastAPI](https://img.shields.io/badge/API-FastAPI-009688.svg?logo=fastapi&logoColor=white)](https://fastapi.tiangolo.com/) @@ -17,11 +16,6 @@
-
-[🚀 快速开始](#quick-start) • [✨ 核心设计](#core-innovations) • [🖥️ 控制台](#agent-workbench) • [🏗️ 系统架构](#system-architecture) • [🧰 工具运行时](#tool-runtime) • [🧪 开发](#development) - -
- ## Current Reward - 第九届西湖论剑·中国杭州网络安全技能大赛 Agent 17th @@ -151,7 +145,6 @@ Docker Compose 将数据库放入命名卷,将需要人工访问或跨容器 | `data/artifacts/logs/` | 项目、LLM、工具与 Memory JSONL | | `data/artifacts/exports/` | Writeup、日志和 Obsidian/Markdown Memory 导出快照 | | `data/ops-agent/` | IPC 模型配置和工作流密钥等文件型机密 | -| `ipc_claude_home` Docker 卷 | `claudecode` 运行器的原生 JSONL 会话 | 导出采用无损编号命名;同名文件存在时会创建 `名称01`、`名称02` 等新文件,不覆盖历史导出。 @@ -165,7 +158,7 @@ Docker Compose 将数据库放入命名卷,将需要人工访问或跨容器 | Docker Compose v2 | 必需 | 标准部署与服务编排 | | Docker Socket | 必需 | App 需要创建题目容器;IPC Runner 同样依赖 Socket | | Linux Docker 主机 | 推荐/已验证 | Compose 会挂载 Docker Socket 与 Compose 插件 | -| LLM 端点 | 开始解题时需要 | Diamond 与已启用 Member 使用 OpenAI、Anthropic、Claude Code、DeepSeek、Pi 或 Mock 适配器 | +| LLM 端点 | 开始解题时需要 | Diamond 与已启用 Member 使用 OpenAI、Anthropic、DeepSeek、Pi 或 Mock 适配器 | | 浏览器 | 可选 | 只保留 Playwright Python 包;浏览器二进制不在任务镜像内,由部署环境显式提供路径 | > [!WARNING] @@ -199,7 +192,7 @@ docker compose logs -f ipc-app docker compose down ``` -此命令不会删除 `./data`、`ipc_postgres_data` 或 `ipc_claude_home`。只有主动删除它们或执行 `docker compose down -v` 才会清理命名卷。 +此命令不会删除 `./data` 或 `ipc_postgres_data`。只有主动删除它们或执行 `docker compose down -v` 才会清理命名卷。 ### 2. Configure the LLM runtime @@ -258,7 +251,7 @@ UI 运行在操作者可信的 Docker 网络边界内,默认不增加浏览器 IPC 是面向操作者的持续对话代理,可诊断运行环境、辅助题目沙箱、操作项目生命周期,并生成声明式平台工作流。工作流必须经人工确认才能执行。其对话、运行事件和工作流元数据存入 PostgreSQL,文件型密钥保存在 `data/ops-agent/`。 -`claudecode` 运行器会持久化原生会话,以便在容器替换后通过 `--resume` 延续上下文。无论使用哪种 Runner,内部 MCP 请求都应通过 `IPC_RUNNER_TOKEN` 鉴权。 +IPC 与比赛 Member 共用 `backend/agent/` 中的统一运行时:会话记录在 `agent_sessions` / `agent_events`,因此容器替换后可以从持久事件重建上下文,无需外部 Runner。 --- @@ -275,7 +268,7 @@ flowchart TB subgraph OPS["IPC 行动代理层"] IPC["IPC 对话代理"] - RUNNER["Claude Code Runner\n或 OpenAI-compatible API"] + RUNNER["统一 Agent 运行时\nagent_sessions / agent_events"] IMCP["内部 IPC MCP\n项目生命周期与诊断工具"] IPC <--> RUNNER RUNNER --> IMCP diff --git a/backend/agent/compaction.py b/backend/agent/compaction.py index 7367d33..29ab4f6 100644 --- a/backend/agent/compaction.py +++ b/backend/agent/compaction.py @@ -13,8 +13,12 @@ from __future__ import annotations import json +import logging from typing import Any +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + SUMMARY_SCHEMA_HINT = { "verified_facts": [{"claim": "...", "evidence": "file:offset | command | artifact_id"}], "failed_paths": [{"approach": "...", "why_failed": "...", "do_not_retry": True}], @@ -96,8 +100,8 @@ def deterministic_summary( summary = empty_summary() if dropped: summary["open_questions"] = [ - "The earlier transcript was compacted without a semantic summary; " - "re-derive any detail you need instead of assuming it." + ("The earlier transcript was compacted without a semantic summary; " + "re-derive any detail you need instead of assuming it.") ] if signatures: seen: list[str] = [] @@ -176,6 +180,7 @@ def summarize( raw = request(_PROMPT, dropped) summary = normalize_summary(_parse_json(raw)) except Exception: + _recovery_logger.debug('Error handled in summarize', exc_info=True) return fallback_summary, retained if is_empty(summary): return fallback_summary, retained diff --git a/backend/agent/job_service.py b/backend/agent/job_service.py index c394dfb..53c575a 100644 --- a/backend/agent/job_service.py +++ b/backend/agent/job_service.py @@ -12,11 +12,14 @@ """ from __future__ import annotations +import logging from typing import Any from backend.agent.jobs import INLINE_LIMIT, AgentJobStore, JobConflict, new_job_id from backend.sandbox.command_policy import host_path_violation +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) class JobService: """Bind a job store to one session's sandbox.""" @@ -49,6 +52,7 @@ def start(self, command: str, *, kind: str = "bash") -> dict[str, Any]: try: pid = self.sandbox.exec_detached(job_id, command) except Exception as exc: + _recovery_logger.debug('Error handled in start', exc_info=True) self.store.finish(job_id, "lost") return { "ok": False, @@ -85,6 +89,7 @@ def _reconcile(self, row: dict) -> dict: try: observed = self.sandbox.job_state(row["id"]) except Exception: + _recovery_logger.debug('Error handled in _reconcile', exc_info=True) return row state = observed.get("state") if state == "running": @@ -133,6 +138,7 @@ def logs( job_id, stream, offset=start, limit=capped ) except Exception as exc: + _recovery_logger.debug('Error handled in logs', exc_info=True) return { "ok": False, "job_id": job_id, @@ -166,6 +172,7 @@ def cancel(self, job_id: str) -> dict[str, Any]: try: self.sandbox.job_cancel(job_id) except Exception as exc: + _recovery_logger.debug('Error handled in cancel', exc_info=True) return { "ok": False, "job_id": job_id, @@ -194,4 +201,4 @@ def _view(row: dict) -> dict[str, Any]: return view -__all__ = ["JobService", "JobConflict", "AgentJobStore"] +__all__ = ["AgentJobStore", "JobConflict", "JobService"] diff --git a/backend/agent/runtime.py b/backend/agent/runtime.py index 58a6231..25719b6 100644 --- a/backend/agent/runtime.py +++ b/backend/agent/runtime.py @@ -22,9 +22,12 @@ import asyncio import hashlib import json +import logging import threading +import time +from collections.abc import Callable from dataclasses import dataclass -from typing import Any, Callable, Protocol +from typing import Any, Protocol from backend.agent.compaction import deterministic_summary from backend.agent.context import ( @@ -42,6 +45,9 @@ ) from backend.competition.store import CompetitionConflict +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + _EVENT_KEY_REUSE_MESSAGE = "event key reused with different content" @@ -198,6 +204,16 @@ def save_calibration(self, calibration: float) -> None: budget["calibration_ratio"] = calibration self.store.save_token_budget(self.session_id, budget) + def record_provider_progress(self, turn: int, status: str, seconds: float) -> None: + if not getattr(self.store, "provider_progress_events", False): + return + if status == "provider.started": + self.store.record_turn(self.assignment, turn, "running") + self.append( + f"provider-progress:{turn}:{time.monotonic_ns()}", "status", + {"status": status, "turn": turn, "latency_seconds": round(seconds, 6)}, + ) + class AgentRuntime: """One provider-native tool loop, independent of who owns the session.""" @@ -421,6 +437,7 @@ def _compact(self, messages: list[dict[str, Any]], turn: int) -> list[dict[str, if not compacted: raise ValueError("context compressor returned no provider messages") except Exception as exc: + _recovery_logger.debug('Error handled in _compact', exc_info=True) summary, compacted = deterministic_summary( messages, keep_recent=self.keep_recent_messages ) @@ -731,6 +748,29 @@ def _turn_args(self, messages: list[dict[str, Any]], on_delta, on_reasoning): args.append(on_reasoning) return args + def _provider_callbacks(self, turn: int): + recorder = getattr(self.writer, "record_provider_progress", None) + if callable(recorder): + recorder(turn, "provider.started", 0.0) + started = time.monotonic() + responded = False + + def first_response(): + nonlocal responded + if not responded: + responded = True + if callable(recorder): + recorder(turn, "provider.first_response", time.monotonic() - started) + + def completed(): + first_response() + if callable(recorder): + recorder(turn, "provider.completed", time.monotonic() - started) + + if hasattr(self.adapter, "on_first_response"): + self.adapter.on_first_response = first_response + return first_response, completed + def _record_tool_call(self, call: ToolCall) -> None: self._append( f"tool-call:{call.id}", "tool_call", @@ -845,14 +885,20 @@ def run(self, initial_message: str | None = None) -> SessionResult: messages.extend(self.before_turn(self)) messages = self._compact(messages, turn_number) deltas: list[str] = [] + first_response, provider_completed = self._provider_callbacks(turn_number) - def on_delta(text: str) -> None: + def on_delta(text: str, deltas=deltas, first_response=first_response) -> None: + first_response() deltas.append(text) self.emit(text) + def on_reasoning(text: str, first_response=first_response) -> None: + first_response() + self.emit_reasoning(text) + try: turn = self.adapter.turn( - *self._turn_args(messages, on_delta, self.emit_reasoning) + *self._turn_args(messages, on_delta, on_reasoning) ) except TurnTruncated as exc: truncated_attempts += 1 @@ -865,6 +911,7 @@ def on_delta(text: str) -> None: last_text = exc.turn.text or last_text continue except Exception as exc: + _recovery_logger.debug('Error handled in run', exc_info=True) messages = self._handle_turn_failure( exc, messages, turn_number, repaired_turn ) @@ -872,6 +919,7 @@ def on_delta(text: str) -> None: turn_number -= 1 continue repaired_turn = -1 + provider_completed() truncated_attempts = 0 last_text = turn.text self._append( @@ -934,15 +982,21 @@ async def run_async(self, initial_message: str | None = None) -> SessionResult: messages.extend(self.before_turn(self)) messages = self._compact(messages, turn_number) deltas: list[str] = [] + first_response, provider_completed = self._provider_callbacks(turn_number) - def on_delta(text: str) -> None: + def on_delta(text: str, deltas=deltas, first_response=first_response) -> None: + first_response() deltas.append(text) self.emit(text) + def on_reasoning(text: str, first_response=first_response) -> None: + first_response() + self.emit_reasoning(text) + try: turn = await asyncio.to_thread( self.adapter.turn, - *self._turn_args(messages, on_delta, self.emit_reasoning), + *self._turn_args(messages, on_delta, on_reasoning), ) except TurnTruncated as exc: truncated_attempts += 1 @@ -955,6 +1009,7 @@ def on_delta(text: str) -> None: last_text = exc.turn.text or last_text continue except Exception as exc: + _recovery_logger.debug('Error handled in run_async', exc_info=True) messages = self._handle_turn_failure( exc, messages, turn_number, repaired_turn ) @@ -962,6 +1017,7 @@ def on_delta(text: str) -> None: turn_number -= 1 continue repaired_turn = -1 + provider_completed() truncated_attempts = 0 last_text = turn.text self._append( diff --git a/backend/agent/watchdog.py b/backend/agent/watchdog.py index 06167e1..d47c18d 100644 --- a/backend/agent/watchdog.py +++ b/backend/agent/watchdog.py @@ -26,7 +26,6 @@ from dataclasses import dataclass - DIAGNOSE_AFTER = 300 CANCEL_AFTER = 900 HANDOFF_AFTER = 1800 diff --git a/backend/api/agent.py b/backend/api/agent.py index a080761..09e5291 100644 --- a/backend/api/agent.py +++ b/backend/api/agent.py @@ -23,15 +23,18 @@ from backend.api.deps import get_state from backend.core.state import AppState - router = APIRouter(prefix="/api/agent", tags=["agent"]) -def get_sessions(state: AppState = Depends(get_state)) -> AgentSessionStore: + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + +def get_sessions(state: AppState = _GET_STATE_DEPENDENCY) -> AgentSessionStore: return AgentSessionStore(state.db) -def get_jobs(state: AppState = Depends(get_state)) -> AgentJobStore: +def get_jobs(state: AppState = _GET_STATE_DEPENDENCY) -> AgentJobStore: return AgentJobStore(state.db) @@ -49,13 +52,17 @@ def _view(row: dict) -> dict: } + +# FastAPI resolves request values from these reusable declaration markers. +_GET_SESSIONS_DEPENDENCY = Depends(get_sessions) + @router.get("/sessions") def list_sessions( kind: str | None = Query(default=None), task_key: str | None = Query(default=None), state_filter: str | None = Query(default="active", alias="state"), limit: int = Query(default=100, ge=1, le=500), - sessions: AgentSessionStore = Depends(get_sessions), + sessions: AgentSessionStore = _GET_SESSIONS_DEPENDENCY, ): states: tuple[str, ...] = () if state_filter and state_filter != "all": @@ -68,11 +75,15 @@ def list_sessions( return {"sessions": [_view(row) for row in rows]} + +# FastAPI resolves request values from these reusable declaration markers. +_GET_JOBS_DEPENDENCY = Depends(get_jobs) + @router.get("/sessions/{session_id}") def get_session( session_id: str, - sessions: AgentSessionStore = Depends(get_sessions), - jobs: AgentJobStore = Depends(get_jobs), + sessions: AgentSessionStore = _GET_SESSIONS_DEPENDENCY, + jobs: AgentJobStore = _GET_JOBS_DEPENDENCY, ): try: session = sessions.session(session_id) @@ -91,7 +102,7 @@ def get_session( def session_jobs( session_id: str, active_only: bool = Query(default=False), - jobs: AgentJobStore = Depends(get_jobs), + jobs: AgentJobStore = _GET_JOBS_DEPENDENCY, ): return {"jobs": jobs.jobs(session_id, active_only=active_only, limit=100)} @@ -101,8 +112,8 @@ def session_events( session_id: str, after: int = Query(default=0, ge=0), last_event_id: str | None = Header(default=None, alias="Last-Event-ID"), - sessions: AgentSessionStore = Depends(get_sessions), - state: AppState = Depends(get_state), + sessions: AgentSessionStore = _GET_SESSIONS_DEPENDENCY, + state: AppState = _GET_STATE_DEPENDENCY, ): """Stream one session's transcript, resumable by ``event_id``. @@ -157,7 +168,7 @@ def scope_events( task_key: str | None = Query(default=None), after: int = Query(default=0, ge=0), last_event_id: str | None = Header(default=None, alias="Last-Event-ID"), - sessions: AgentSessionStore = Depends(get_sessions), + sessions: AgentSessionStore = _GET_SESSIONS_DEPENDENCY, ): """Stream every session in a scope through one connection. diff --git a/backend/api/auth.py b/backend/api/auth.py index e99e564..8998d79 100644 --- a/backend/api/auth.py +++ b/backend/api/auth.py @@ -59,8 +59,12 @@ def _client_key(request: Request) -> str: return request.client.host if request.client else "unknown" + +# FastAPI resolves request values from these reusable declaration markers. +_GET_AUTH_MANAGER_DEPENDENCY = Depends(get_auth_manager) + @router.get("/status") -def auth_status(request: Request, manager: AuthManager = Depends(get_auth_manager)) -> dict: +def auth_status(request: Request, manager: AuthManager = _GET_AUTH_MANAGER_DEPENDENCY) -> dict: return { "setup_required": False, "authenticated": True, @@ -73,7 +77,7 @@ def setup( payload: SetupRequest, request: Request, response: Response, - manager: AuthManager = Depends(get_auth_manager), + manager: AuthManager = _GET_AUTH_MANAGER_DEPENDENCY, ) -> dict: if manager.configuration_error: raise HTTPException( @@ -95,7 +99,7 @@ def login( payload: LoginRequest, request: Request, response: Response, - manager: AuthManager = Depends(get_auth_manager), + manager: AuthManager = _GET_AUTH_MANAGER_DEPENDENCY, ) -> dict: if manager.configuration_error: raise HTTPException( @@ -138,7 +142,7 @@ def login( def logout( request: Request, response: Response, - manager: AuthManager = Depends(get_auth_manager), + manager: AuthManager = _GET_AUTH_MANAGER_DEPENDENCY, ) -> None: manager.revoke_session(request.cookies.get(SESSION_COOKIE_NAME)) response.delete_cookie( diff --git a/backend/api/competition.py b/backend/api/competition.py index 098b9d3..d0b1948 100644 --- a/backend/api/competition.py +++ b/backend/api/competition.py @@ -12,7 +12,7 @@ from backend.competition.service import CompetitionService from backend.competition.store import CompetitionConflict from backend.core.state import AppState - +from backend.core.validation import InputValidationError router = APIRouter(prefix="/api", tags=["competition"]) @@ -30,7 +30,7 @@ def validate_select(cls, value: list[str] | None) -> list[str] | None: cleaned: list[str] = [] for item in value: if not isinstance(item, str): - raise ValueError("challenge ids must be strings") + raise InputValidationError("challenge ids must be strings") item = item.strip() if not item or len(item) > 256: raise ValueError("challenge ids must be 1 to 256 characters") @@ -46,6 +46,15 @@ class ControlRequest(BaseModel): revision: int = Field(ge=1) +class LimitsRequest(BaseModel): + model_config = ConfigDict(extra="forbid") + revision: int = Field(ge=1) + limits: dict[str, int] = Field(default_factory=dict) + max_concurrent_tasks: int | None = None + total_cpu: int | None = None + remote_concurrency: int | None = None + + class CandidateRequest(BaseModel): model_config = ConfigDict(extra="forbid") run_id: str = Field(min_length=1, max_length=128) @@ -55,7 +64,11 @@ class CandidateRequest(BaseModel): instance_generation: int = Field(ge=0) -def get_competition(state: AppState = Depends(get_state)) -> CompetitionService: + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + +def get_competition(state: AppState = _GET_STATE_DEPENDENCY) -> CompetitionService: service = getattr(state, "competition", None) if service is None: service = CompetitionService(state) @@ -72,15 +85,23 @@ def _call(function, *args, **kwargs): except PermissionError as exc: raise HTTPException(403, str(exc)) from exc except CompetitionConflict as exc: - raise HTTPException(409, str(exc)) from exc + headers = {} + retry_after = getattr(exc, "retry_after", None) + if retry_after is not None: + headers["Retry-After"] = str(retry_after) + raise HTTPException(409, str(exc), headers=headers) from exc except ValueError as exc: raise HTTPException(400, str(exc)) from exc + +# FastAPI resolves request values from these reusable declaration markers. +_GET_COMPETITION_DEPENDENCY = Depends(get_competition) + @router.post("/workflows/{workflow_id}/preflight") def preflight( workflow_id: str, - service: CompetitionService = Depends(get_competition), + service: CompetitionService = _GET_COMPETITION_DEPENDENCY, ): return _call(service.preflight, workflow_id) @@ -89,7 +110,7 @@ def preflight( def start( workflow_id: str, body: StartRequest, - service: CompetitionService = Depends(get_competition), + service: CompetitionService = _GET_COMPETITION_DEPENDENCY, ): return _call(service.start, workflow_id, body.idempotency_key, body.select) @@ -97,18 +118,18 @@ def start( @router.get("/runs") def list_runs( limit: int = Query(default=50, ge=1, le=200), - service: CompetitionService = Depends(get_competition), + service: CompetitionService = _GET_COMPETITION_DEPENDENCY, ): return {"runs": service.store.list_runs(limit)} @router.get("/runs/{run_id}") -def get_run(run_id: str, service: CompetitionService = Depends(get_competition)): +def get_run(run_id: str, service: CompetitionService = _GET_COMPETITION_DEPENDENCY): return _call(service.store.run_snapshot, run_id) @router.get("/runs/{run_id}/members") -def get_members(run_id: str, service: CompetitionService = Depends(get_competition)): +def get_members(run_id: str, service: CompetitionService = _GET_COMPETITION_DEPENDENCY): return {"members": _call(service.store.member_snapshot, run_id)} @@ -117,17 +138,31 @@ def control_run( run_id: str, action: Literal["pause", "resume", "stop", "refresh"], body: ControlRequest, - service: CompetitionService = Depends(get_competition), + service: CompetitionService = _GET_COMPETITION_DEPENDENCY, ): return _call(service.control, run_id, action, body.revision) +@router.patch("/runs/{run_id}/limits") +def patch_run_limits( + run_id: str, + body: LimitsRequest, + service: CompetitionService = _GET_COMPETITION_DEPENDENCY, +): + limits = {**body.limits} + for key in ("max_concurrent_tasks", "total_cpu", "remote_concurrency"): + value = getattr(body, key) + if value is not None: + limits[key] = value + return _call(service.update_limits, run_id, limits, body.revision) + + @router.get("/runs/{run_id}/events") def run_events( run_id: str, after: int = Query(default=0, ge=0), last_event_id: str | None = Header(default=None, alias="Last-Event-ID"), - service: CompetitionService = Depends(get_competition), + service: CompetitionService = _GET_COMPETITION_DEPENDENCY, ): cursor = after if last_event_id: @@ -170,7 +205,7 @@ def stream(): def run_observations( run_id: str, limit: int = Query(default=100, ge=1, le=1000), - service: CompetitionService = Depends(get_competition), + service: CompetitionService = _GET_COMPETITION_DEPENDENCY, ): return {"observations": _call(service.store.observations, run_id, limit=limit)} @@ -180,7 +215,7 @@ def session_events( session_id: str, after: int = Query(default=0, ge=0), limit: int = Query(default=200, ge=1, le=500), - service: CompetitionService = Depends(get_competition), + service: CompetitionService = _GET_COMPETITION_DEPENDENCY, ): _call(service.store.session, session_id) return {"events": service.store.events(session_id, after, limit)} @@ -190,7 +225,7 @@ def session_events( def submit_candidate( challenge_id: str, body: CandidateRequest, - service: CompetitionService = Depends(get_competition), + service: CompetitionService = _GET_COMPETITION_DEPENDENCY, ): return _call( service.submit_candidate, @@ -206,11 +241,11 @@ def submit_candidate( @router.get("/submissions/{submission_id}") def get_submission( submission_id: str, - service: CompetitionService = Depends(get_competition), + service: CompetitionService = _GET_COMPETITION_DEPENDENCY, ): return _call(service.store.submission, submission_id) @router.post("/wp-jobs/{job_id}/retry") -def retry_wp(job_id: str, service: CompetitionService = Depends(get_competition)): +def retry_wp(job_id: str, service: CompetitionService = _GET_COMPETITION_DEPENDENCY): return _call(service.retry_wp, job_id) diff --git a/backend/api/config.py b/backend/api/config.py index 3c75530..a4f4ef7 100644 --- a/backend/api/config.py +++ b/backend/api/config.py @@ -5,13 +5,13 @@ from backend.api.deps import get_state from backend.core.config import ( - AppConfig, - LLMConfig, + CATEGORIES, ApiFormat, ApiSurface, - CATEGORIES, - SelectedReasoningEffort, + AppConfig, + LLMConfig, RuntimeConfig, + SelectedReasoningEffort, ) from backend.core.state import AppState @@ -38,6 +38,12 @@ class RuntimeUpdate(BaseModel): browser_artifact_max_bytes: int | None = None +class LimitsUpdate(BaseModel): + model_config = ConfigDict(extra="forbid") + max_concurrent_tasks: int | None = None + total_cpu: int | None = None + + class ConfigUpdate(BaseModel): model_config = ConfigDict(extra="forbid") @@ -48,6 +54,7 @@ class ConfigUpdate(BaseModel): members: dict[str, LLMUpdate] | None = None remove_members: list[str] | None = None runtime: RuntimeUpdate | None = None + limits: LimitsUpdate | None = None def _redact(value: str) -> str: @@ -101,18 +108,23 @@ def _config_view(state: AppState) -> dict: "browser_allowed_origins": cfg.runtime.browser_allowed_origins, "browser_artifact_max_bytes": cfg.runtime.browser_artifact_max_bytes, }, + "limits": cfg.limits.model_dump(), "startup_errors": cfg.startup_errors(), "startup_warnings": cfg.startup_warnings(), } + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + @router.get("/config") -def get_config(state: AppState = Depends(get_state)): +def get_config(state: AppState = _GET_STATE_DEPENDENCY): return _config_view(state) @router.get("/config/runtime") -def get_runtime_config(state: AppState = Depends(get_state)): +def get_runtime_config(state: AppState = _GET_STATE_DEPENDENCY): orchestrator = state.orchestrator active_members: dict[str, list[str]] = {} running_tasks: list[dict[str, str]] = [] @@ -161,7 +173,7 @@ def _apply(llm, upd: LLMUpdate) -> None: @router.put("/config") -def update_config(body: ConfigUpdate, state: AppState = Depends(get_state)): +def update_config(body: ConfigUpdate, state: AppState = _GET_STATE_DEPENDENCY): cfg = state.config.model_copy(deep=True) if body.remove_members: raise HTTPException(400, "The ten Member identities are fixed.") @@ -197,13 +209,26 @@ def update_config(body: ConfigUpdate, state: AppState = Depends(get_state)): for error in exc.errors(include_input=False, include_context=False, include_url=False) ) raise HTTPException(400, detail) from exc + if body.limits is not None: + limit_values = { + **cfg.limits.model_dump(), + **body.limits.model_dump(exclude_none=True), + } + try: + cfg.limits = type(cfg.limits).model_validate(limit_values) + except ValidationError as exc: + detail = "; ".join( + f"{'.'.join(str(part) for part in error['loc'])}: {error['msg']}" + for error in exc.errors(include_input=False, include_context=False, include_url=False) + ) + raise HTTPException(400, detail) from exc state.config = AppConfig.model_validate(cfg.model_dump()) state.save_config() return _config_view(state) @router.post("/config/health") -def health_check(state: AppState = Depends(get_state)): +def health_check(state: AppState = _GET_STATE_DEPENDENCY): """Validate each configured LLM endpoint (Seed.md 启动时需要校验每个 LLM 的 health).""" from backend.members.adapters import health_check as adapter_health diff --git a/backend/api/flags.py b/backend/api/flags.py index 58e260f..ee96562 100644 --- a/backend/api/flags.py +++ b/backend/api/flags.py @@ -4,8 +4,8 @@ from pydantic import BaseModel from backend.api.deps import get_state -from backend.core.state import AppState from backend.core.redaction import redact_flag +from backend.core.state import AppState router = APIRouter(prefix="/api/flags", tags=["flags"]) @@ -38,10 +38,14 @@ def _record(row, *, reveal: bool = False) -> FlagRecord: ) + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + @router.get("", response_model=list[FlagRecord]) def list_flags( reveal: bool = Query(default=False), - state: AppState = Depends(get_state), + state: AppState = _GET_STATE_DEPENDENCY, ): with state.db.connect() as conn: rows = conn.execute( @@ -59,7 +63,7 @@ def list_flags( def get_flag( project_id: str, reveal: bool = Query(default=False), - state: AppState = Depends(get_state), + state: AppState = _GET_STATE_DEPENDENCY, ): with state.db.connect() as conn: row = conn.execute( diff --git a/backend/api/graph.py b/backend/api/graph.py index 0b8ace0..8fda565 100644 --- a/backend/api/graph.py +++ b/backend/api/graph.py @@ -1,20 +1,23 @@ from __future__ import annotations - from fastapi import APIRouter, Depends, HTTPException from fastapi.responses import Response from backend.api.deps import get_state from backend.blackboard import graph_store -from backend.core.state import AppState -from backend.core.replay import build_timeline, export_yaml from backend.core.redaction import redact_object +from backend.core.replay import build_timeline, export_yaml +from backend.core.state import AppState router = APIRouter(tags=["graph"]) + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + @router.get("/projects/{project_id}/export") -def export_project(project_id: str, format: str = "yaml", state: AppState = Depends(get_state)): +def export_project(project_id: str, format: str = "yaml", state: AppState = _GET_STATE_DEPENDENCY): if format not in ("yaml", "timeline"): raise HTTPException(400, "format must be yaml or timeline") with state.db.connect() as conn: @@ -39,7 +42,7 @@ def _timeline_text(detail) -> str: @router.get("/projects/{project_id}/replay") -def replay_timeline(project_id: str, state: AppState = Depends(get_state)): +def replay_timeline(project_id: str, state: AppState = _GET_STATE_DEPENDENCY): """Ordered event frames for the UI replay (Seed.md 重放).""" with state.db.connect() as conn: detail = graph_store.project_detail(conn, project_id) diff --git a/backend/api/logs.py b/backend/api/logs.py index d73545f..031e1cf 100644 --- a/backend/api/logs.py +++ b/backend/api/logs.py @@ -6,8 +6,8 @@ from backend.api.deps import get_state from backend.blackboard import graph_store from backend.core.archive import list_archived_projects, project_archive_id -from backend.core.state import AppState from backend.core.redaction import redact_object +from backend.core.state import AppState from backend.filename_util import numbered_filename router = APIRouter(tags=["logs"]) @@ -23,13 +23,17 @@ class LogToggle(BaseModel): enabled: bool + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + @router.get("/logs/status") -def log_status(state: AppState = Depends(get_state)): +def log_status(state: AppState = _GET_STATE_DEPENDENCY): return {"enabled": state.logger.enabled} @router.put("/logs/status") -def set_log_status(body: LogToggle, state: AppState = Depends(get_state)): +def set_log_status(body: LogToggle, state: AppState = _GET_STATE_DEPENDENCY): state.logger.set_enabled(body.enabled) state.config.log_enabled = body.enabled state.save_config() @@ -37,7 +41,7 @@ def set_log_status(body: LogToggle, state: AppState = Depends(get_state)): @router.get("/logs/projects") -def read_project_logs(limit: int = 500, state: AppState = Depends(get_state)): +def read_project_logs(limit: int = 500, state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: projects = graph_store.project_summaries(conn) logs = [] @@ -86,7 +90,7 @@ def read_project_logs(limit: int = 500, state: AppState = Depends(get_state)): @router.post("/logs/derive") -def derive_project_logs(state: AppState = Depends(get_state)): +def derive_project_logs(state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: projects = graph_store.project_summaries(conn) target = state.log_export_dir @@ -143,7 +147,7 @@ def derive_project_logs(state: AppState = Depends(get_state)): @router.get("/logs/{project_id}") -def read_logs(project_id: str, kind: str = "project", limit: int = 500, state: AppState = Depends(get_state)): +def read_logs(project_id: str, kind: str = "project", limit: int = 500, state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: row = graph_store.get_project_row(conn, project_id) secret = row["flag"] if row else None diff --git a/backend/api/memory.py b/backend/api/memory.py index b31e667..890c12d 100644 --- a/backend/api/memory.py +++ b/backend/api/memory.py @@ -5,8 +5,8 @@ from pydantic import BaseModel, Field from backend.api.deps import get_state -from backend.core.state import AppState from backend.core.redaction import redact_object +from backend.core.state import AppState from backend.memory.exporter.obsidian import export_obsidian from backend.memory.memory_search import search as mem_search from backend.memory.memory_store import CATEGORIES, Memory @@ -21,8 +21,12 @@ class AddMemoryRequest(BaseModel): tags: list[str] = Field(default_factory=list) + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + @router.get("/memory", response_model=list[Memory]) -def list_memory(category: str | None = None, state: AppState = Depends(get_state)): +def list_memory(category: str | None = None, state: AppState = _GET_STATE_DEPENDENCY): memories = state.memory.list(category) with state.db.connect() as conn: flags = { @@ -36,7 +40,7 @@ def list_memory(category: str | None = None, state: AppState = Depends(get_state @router.post("/memory", response_model=Memory, status_code=201) -def add_memory(body: AddMemoryRequest, state: AppState = Depends(get_state)): +def add_memory(body: AddMemoryRequest, state: AppState = _GET_STATE_DEPENDENCY): if body.category not in CATEGORIES: raise HTTPException(400, f"category must be one of {CATEGORIES}") mem = state.memory.add(body.category, body.title, body.content, body.tags, source="human") @@ -45,13 +49,13 @@ def add_memory(body: AddMemoryRequest, state: AppState = Depends(get_state)): @router.delete("/memory/{memory_id}", status_code=204) -def delete_memory(memory_id: str, state: AppState = Depends(get_state)): +def delete_memory(memory_id: str, state: AppState = _GET_STATE_DEPENDENCY): if not state.memory.delete(memory_id): raise HTTPException(404, "Memory not found") @router.get("/memory/search") -def search_memory(q: str, category: str | None = None, limit: int = 5, state: AppState = Depends(get_state)): +def search_memory(q: str, category: str | None = None, limit: int = 5, state: AppState = _GET_STATE_DEPENDENCY): results = mem_search(state.memory, q, category=category, limit=limit) with state.db.connect() as conn: flags = { @@ -65,12 +69,12 @@ def search_memory(q: str, category: str | None = None, limit: int = 5, state: Ap @router.get("/memory/catalog") -def memory_catalog(state: AppState = Depends(get_state)): +def memory_catalog(state: AppState = _GET_STATE_DEPENDENCY): return {"children": state.catalog.tree()} @router.get("/memory/catalog/{entry_id}") -def memory_catalog_entry(entry_id: str, state: AppState = Depends(get_state)): +def memory_catalog_entry(entry_id: str, state: AppState = _GET_STATE_DEPENDENCY): entry = state.catalog.get(entry_id) if entry is None: raise HTTPException(404, "Catalog document not found") @@ -84,7 +88,7 @@ def memory_catalog_entry(entry_id: str, state: AppState = Depends(get_state)): @router.get("/memory/catalog/{entry_id}/document") def memory_catalog_document( entry_id: str, - state: AppState = Depends(get_state), + state: AppState = _GET_STATE_DEPENDENCY, ): entry = state.catalog.get(entry_id) if entry is None: @@ -99,6 +103,6 @@ def memory_catalog_document( @router.post("/memory/derive") -def derive_memory(state: AppState = Depends(get_state)): +def derive_memory(state: AppState = _GET_STATE_DEPENDENCY): vault = export_obsidian(state.memory, state.memory_export_dir / "vault") return {"vault": str(vault)} diff --git a/backend/api/ops_agent.py b/backend/api/ops_agent.py index e8192e6..8e2daf5 100644 --- a/backend/api/ops_agent.py +++ b/backend/api/ops_agent.py @@ -5,20 +5,29 @@ from typing import Any, Literal import requests -from fastapi import APIRouter, Depends, File, HTTPException, Response, UploadFile, status +from fastapi import ( + APIRouter, + Depends, + File, + HTTPException, + Response, + UploadFile, + status, +) from fastapi.responses import StreamingResponse from pydantic import BaseModel, ConfigDict, Field, field_validator from backend.api.deps import get_state from backend.core.config import ApiFormat, ApiSurface, SelectedReasoningEffort from backend.core.state import AppState -from backend.ops.network import NetworkPolicyError from backend.ops.attachments import MAX_UPLOAD_BYTES, OpsAttachmentStore +from backend.ops.network import NetworkPolicyError from backend.ops.service import ( OpsAgentNotConfigured, OpsAgentService, OpsAgentUpstreamError, WorkflowConfirmationError, + WorkflowSessionError, ) from backend.ops.store import WorkflowInUse @@ -98,7 +107,11 @@ def validate_select(cls, value: list[str] | None) -> list[str] | None: return value -def get_ops_service(state: AppState = Depends(get_state)) -> OpsAgentService: + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + +def get_ops_service(state: AppState = _GET_STATE_DEPENDENCY) -> OpsAgentService: service = getattr(state, "ops_agent_service", None) if service is not None: return service @@ -110,38 +123,42 @@ def get_ops_service(state: AppState = Depends(get_state)) -> OpsAgentService: return service + +# FastAPI resolves request values from these reusable declaration markers. +_GET_OPS_SERVICE_DEPENDENCY = Depends(get_ops_service) + @router.get("/config") -def get_config(service: OpsAgentService = Depends(get_ops_service)): +def get_config(service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return service.config_view() @router.put("/config") -def update_config(body: OpsConfigUpdate, service: OpsAgentService = Depends(get_ops_service)): +def update_config(body: OpsConfigUpdate, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return _call(service.update_config, **body.model_dump(exclude_unset=True)) @router.post("/config/health") -def health(service: OpsAgentService = Depends(get_ops_service)): +def health(service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return _call(service.health) @router.get("/tools") -def tools(service: OpsAgentService = Depends(get_ops_service)): +def tools(service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return {"tools": service.tool_catalog()} @router.get("/sessions") -def list_sessions(service: OpsAgentService = Depends(get_ops_service)): +def list_sessions(service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return {"sessions": service.list_sessions()} @router.get("/sessions/{session_id}") -def get_session(session_id: str, service: OpsAgentService = Depends(get_ops_service)): +def get_session(session_id: str, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return _call(service.session_view, session_id) @router.delete("/sessions/{session_id}", status_code=status.HTTP_204_NO_CONTENT) -def delete_session(session_id: str, service: OpsAgentService = Depends(get_ops_service)): +def delete_session(session_id: str, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): try: deleted = service.delete_session(session_id) except ValueError as exc: @@ -152,7 +169,7 @@ def delete_session(session_id: str, service: OpsAgentService = Depends(get_ops_s @router.post("/chat") -def chat(body: ChatRequest, service: OpsAgentService = Depends(get_ops_service)): +def chat(body: ChatRequest, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return _call( service.chat, message=body.message, @@ -164,7 +181,7 @@ def chat(body: ChatRequest, service: OpsAgentService = Depends(get_ops_service)) @router.post("/chat/stream") -def chat_stream(body: ChatRequest, service: OpsAgentService = Depends(get_ops_service)): +def chat_stream(body: ChatRequest, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): def events(): for event in service.chat_stream( message=body.message, @@ -182,10 +199,14 @@ def events(): ) + +# FastAPI resolves request values from these reusable declaration markers. +_REQUIRED_UPLOAD_FILE = File(...) + @router.post("/uploads") async def upload_attachment( - file: UploadFile = File(...), - service: OpsAgentService = Depends(get_ops_service), + file: UploadFile = _REQUIRED_UPLOAD_FILE, + service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY, ): """Upload platform API documentation for the next IPC message.""" @@ -205,17 +226,17 @@ async def upload_attachment( @router.post("/chat/interrupt") -def interrupt_chat(body: ChatInterruptRequest, service: OpsAgentService = Depends(get_ops_service)): +def interrupt_chat(body: ChatInterruptRequest, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return _call(service.interrupt_chat, session_id=body.session_id, run_id=body.run_id) @router.get("/workflows") -def list_workflows(service: OpsAgentService = Depends(get_ops_service)): +def list_workflows(service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return {"workflows": service.list_workflows()} @router.post("/workflows", status_code=status.HTTP_201_CREATED) -def create_workflow(body: WorkflowDraftRequest, service: OpsAgentService = Depends(get_ops_service)): +def create_workflow(body: WorkflowDraftRequest, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return _call( service.create_workflow, body.workflow, @@ -224,7 +245,7 @@ def create_workflow(body: WorkflowDraftRequest, service: OpsAgentService = Depen @router.get("/workflows/{workflow_id}") -def get_workflow(workflow_id: str, service: OpsAgentService = Depends(get_ops_service)): +def get_workflow(workflow_id: str, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return _call(service.get_workflow, workflow_id) @@ -232,7 +253,7 @@ def get_workflow(workflow_id: str, service: OpsAgentService = Depends(get_ops_se def update_workflow( workflow_id: str, body: WorkflowDraftRequest, - service: OpsAgentService = Depends(get_ops_service), + service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY, ): return _call( service.update_workflow, @@ -243,7 +264,7 @@ def update_workflow( @router.delete("/workflows/{workflow_id}", status_code=status.HTTP_204_NO_CONTENT) -def delete_workflow(workflow_id: str, service: OpsAgentService = Depends(get_ops_service)): +def delete_workflow(workflow_id: str, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): try: deleted = service.delete_workflow(workflow_id) except WorkflowInUse as exc: @@ -257,13 +278,13 @@ def delete_workflow(workflow_id: str, service: OpsAgentService = Depends(get_ops def update_workflow_secrets( workflow_id: str, body: WorkflowSecretsUpdate, - service: OpsAgentService = Depends(get_ops_service), + service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY, ): return _call(service.set_workflow_secrets, workflow_id, body.secrets) @router.get("/workflows/{workflow_id}/confirmation") -def confirmation_preview(workflow_id: str, service: OpsAgentService = Depends(get_ops_service)): +def confirmation_preview(workflow_id: str, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return _call(service.confirmation_preview, workflow_id) @@ -271,13 +292,13 @@ def confirmation_preview(workflow_id: str, service: OpsAgentService = Depends(ge def confirm_workflow( workflow_id: str, body: WorkflowConfirmRequest, - service: OpsAgentService = Depends(get_ops_service), + service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY, ): return _call(service.confirm_workflow, workflow_id, body.confirmation_phrase) @router.post("/workflows/{workflow_id}/revoke") -def revoke_workflow(workflow_id: str, service: OpsAgentService = Depends(get_ops_service)): +def revoke_workflow(workflow_id: str, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return _call(service.revoke_workflow, workflow_id) @@ -285,7 +306,7 @@ def revoke_workflow(workflow_id: str, service: OpsAgentService = Depends(get_ops def execute_workflow( workflow_id: str, body: WorkflowExecuteRequest, - service: OpsAgentService = Depends(get_ops_service), + service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY, ): return _call( service.execute, @@ -312,6 +333,8 @@ def _call(function, *args: Any, **kwargs: Any): raise HTTPException(502, str(exc)) from exc except WorkflowConfirmationError as exc: raise HTTPException(409, str(exc)) from exc + except WorkflowSessionError as exc: + raise HTTPException(409, str(exc)) from exc except NetworkPolicyError as exc: raise HTTPException(400, str(exc)) from exc except requests.RequestException as exc: diff --git a/backend/api/platform.py b/backend/api/platform.py index ec3de07..e5c779d 100644 --- a/backend/api/platform.py +++ b/backend/api/platform.py @@ -14,9 +14,9 @@ from backend.core.state import AppState from backend.platform.adapter import PlatformAdapter from backend.platform.factory import build_adapter +from backend.platform.gzctf import GZCTFError from backend.platform.mapping import FieldMapping, PlatformChallenge from backend.platform.ret2shell import Ret2ShellAdapter, Ret2ShellClient, Ret2ShellError -from backend.platform.gzctf import GZCTFError router = APIRouter(prefix="/api/platform", tags=["platform"]) @@ -69,8 +69,12 @@ def preview_challenges(body: ChallengeRequest): return {"challenges": [challenge.model_dump() for challenge in challenges]} + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + @router.post("/import", status_code=201) -def import_challenges(body: ImportRequest, state: AppState = Depends(get_state)): +def import_challenges(body: ImportRequest, state: AppState = _GET_STATE_DEPENDENCY): adapter, challenges = _fetch(body.mapping) by_id = {challenge.external_id: challenge for challenge in challenges} if body.select is None: diff --git a/backend/api/project.py b/backend/api/project.py index fe00817..ccb659b 100644 --- a/backend/api/project.py +++ b/backend/api/project.py @@ -1,10 +1,11 @@ from __future__ import annotations -from fastapi import APIRouter, Depends, File, HTTPException, UploadFile +from collections.abc import Callable from pathlib import Path -from typing import Any, Callable, TypeVar +from typing import TypeVar import psycopg.errors +from fastapi import APIRouter, Depends, File, HTTPException, UploadFile from backend.api.deps import get_state from backend.blackboard import edge_store, graph_store, node_store @@ -22,8 +23,8 @@ ReasonClaimRequest, ) from backend.core.config import CATEGORIES -from backend.core.state import AppState from backend.core.redaction import redact_object +from backend.core.state import AppState router = APIRouter(tags=["projects"]) MAX_PROJECT_ATTACHMENT_BYTES = 100 * 1024 * 1024 @@ -62,8 +63,12 @@ def _public_detail(detail): return detail.__class__.model_validate(redact_object(detail.model_dump(mode="json"), secret)) + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + @router.get("/projects", response_model=list[ProjectSummary]) -def list_projects(state: AppState = Depends(get_state)): +def list_projects(state: AppState = _GET_STATE_DEPENDENCY): def read() -> list[ProjectSummary]: with state.db.connect() as conn: _expire(state, conn) @@ -80,7 +85,7 @@ def read() -> list[ProjectSummary]: @router.post("/projects", response_model=ProjectDetail, status_code=201) -def create_project(body: CreateProjectRequest, state: AppState = Depends(get_state)): +def create_project(body: CreateProjectRequest, state: AppState = _GET_STATE_DEPENDENCY): if body.category not in CATEGORIES: raise HTTPException(400, f"category must be one of {CATEGORIES}") hints = [(h.content, h.creator) for h in (body.hints or [])] @@ -92,7 +97,7 @@ def create_project(body: CreateProjectRequest, state: AppState = Depends(get_sta @router.get("/projects/{project_id}", response_model=ProjectDetail) -def get_project(project_id: str, state: AppState = Depends(get_state)): +def get_project(project_id: str, state: AppState = _GET_STATE_DEPENDENCY): def read(): with state.db.connect() as conn: _expire(state, conn, project_id) @@ -113,7 +118,7 @@ def read(): @router.delete("/projects/{project_id}", status_code=204) -def delete_project(project_id: str, state: AppState = Depends(get_state)): +def delete_project(project_id: str, state: AppState = _GET_STATE_DEPENDENCY): state.pool.stop_project(project_id) state.network.stop(project_id) with state.db.connect() as conn: @@ -124,9 +129,13 @@ def delete_project(project_id: str, state: AppState = Depends(get_state)): graph_store.delete_project(conn, project_id) + +# FastAPI resolves request values from these reusable declaration markers. +_REQUIRED_UPLOAD_FILE = File(...) + @router.post("/projects/{project_id}/attachments") async def upload_attachment( - project_id: str, file: UploadFile = File(...), state: AppState = Depends(get_state) + project_id: str, file: UploadFile = _REQUIRED_UPLOAD_FILE, state: AppState = _GET_STATE_DEPENDENCY ): with state.db.connect() as conn: if graph_store.get_project_row(conn, project_id) is None: @@ -165,7 +174,7 @@ async def upload_attachment( @router.post("/projects/{project_id}/hints", response_model=Hint, status_code=201) -def create_hint(project_id: str, body: CreateHintRequest, state: AppState = Depends(get_state)): +def create_hint(project_id: str, body: CreateHintRequest, state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: if graph_store.get_project_row(conn, project_id) is None: raise HTTPException(404, "Project not found") @@ -184,7 +193,7 @@ def _require_active(conn, project_id: str): @router.post("/projects/{project_id}/intents", response_model=Intent, status_code=201) -def create_intent(project_id: str, body: CreateIntentRequest, state: AppState = Depends(get_state)): +def create_intent(project_id: str, body: CreateIntentRequest, state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: _require_active(conn, project_id) for fid in body.from_: @@ -199,7 +208,7 @@ def create_intent(project_id: str, body: CreateIntentRequest, state: AppState = @router.post("/projects/{project_id}/intents/{intent_id}/heartbeat", response_model=Intent) def heartbeat_intent( - project_id: str, intent_id: str, body: HeartbeatRequest, state: AppState = Depends(get_state) + project_id: str, intent_id: str, body: HeartbeatRequest, state: AppState = _GET_STATE_DEPENDENCY ): with state.db.connect() as conn: _require_active(conn, project_id) @@ -226,7 +235,7 @@ def heartbeat_intent( @router.post("/projects/{project_id}/intents/{intent_id}/release", response_model=Intent) def release_intent( - project_id: str, intent_id: str, body: HeartbeatRequest, state: AppState = Depends(get_state) + project_id: str, intent_id: str, body: HeartbeatRequest, state: AppState = _GET_STATE_DEPENDENCY ): with state.db.connect() as conn: _require_active(conn, project_id) @@ -254,7 +263,7 @@ def release_intent( @router.post("/projects/{project_id}/reason/claim") -def claim_reason(project_id: str, body: ReasonClaimRequest, state: AppState = Depends(get_state)): +def claim_reason(project_id: str, body: ReasonClaimRequest, state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: _require_active(conn, project_id) _, reason_timeout = graph_store.get_timeouts(conn) @@ -266,7 +275,7 @@ def claim_reason(project_id: str, body: ReasonClaimRequest, state: AppState = De @router.post("/projects/{project_id}/reason/heartbeat") -def heartbeat_reason(project_id: str, body: HeartbeatRequest, state: AppState = Depends(get_state)): +def heartbeat_reason(project_id: str, body: HeartbeatRequest, state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: _require_active(conn, project_id) _, reason_timeout = graph_store.get_timeouts(conn) @@ -281,7 +290,7 @@ def heartbeat_reason(project_id: str, body: HeartbeatRequest, state: AppState = @router.post("/projects/{project_id}/reason/release") -def release_reason(project_id: str, body: HeartbeatRequest, state: AppState = Depends(get_state)): +def release_reason(project_id: str, body: HeartbeatRequest, state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: _require_active(conn, project_id) current = graph_store.reason_holder(conn, project_id) @@ -293,7 +302,7 @@ def release_reason(project_id: str, body: HeartbeatRequest, state: AppState = De @router.post("/projects/{project_id}/intents/{intent_id}/conclude", response_model=ConcludeResponse) def conclude_intent( - project_id: str, intent_id: str, body: ConcludeRequest, state: AppState = Depends(get_state) + project_id: str, intent_id: str, body: ConcludeRequest, state: AppState = _GET_STATE_DEPENDENCY ): with state.db.connect() as conn: _require_active(conn, project_id) diff --git a/backend/api/questions.py b/backend/api/questions.py index d688e15..9c40770 100644 --- a/backend/api/questions.py +++ b/backend/api/questions.py @@ -4,6 +4,7 @@ from backend.api.deps import get_state from backend.competition.store import CompetitionConflict from backend.ops.questions import QuestionStore +from backend.ops.store import WorkflowSessionConflict router = APIRouter(prefix="/questions", tags=["questions"]) @@ -13,18 +14,24 @@ class Answer(BaseModel): value: str = Field(min_length=1, max_length=16384) + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + @router.get("") -def pending_questions(session_id: str, state=Depends(get_state)): +def pending_questions(session_id: str, state=_GET_STATE_DEPENDENCY): return {"questions": QuestionStore(state).list(session_id)} @router.post("/{question_id}/answer") -def answer_question(question_id: str, body: Answer, state=Depends(get_state)): +def answer_question(question_id: str, body: Answer, state=_GET_STATE_DEPENDENCY): try: return QuestionStore(state).answer(question_id, body.session_id, body.value) except KeyError as exc: raise HTTPException(404, "Question not found") from exc except CompetitionConflict as exc: raise HTTPException(409, str(exc)) from exc + except WorkflowSessionConflict as exc: + raise HTTPException(409, str(exc)) from exc except ValueError as exc: raise HTTPException(400, str(exc)) from exc diff --git a/backend/api/skills.py b/backend/api/skills.py index 00dc462..eb5c9af 100644 --- a/backend/api/skills.py +++ b/backend/api/skills.py @@ -44,13 +44,17 @@ def _view(state): } + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + @router.get("") -def list_skills(state=Depends(get_state)): +def list_skills(state=_GET_STATE_DEPENDENCY): return _view(state) @router.post("") -def install_skill(body: InstallSkill, state=Depends(get_state)): +def install_skill(body: InstallSkill, state=_GET_STATE_DEPENDENCY): try: state.skills.install(body.repository, body.revision) except ValueError as exc: @@ -61,7 +65,7 @@ def install_skill(body: InstallSkill, state=Depends(get_state)): @router.post("/add") -def add_skill(body: AddSkill, state=Depends(get_state)): +def add_skill(body: AddSkill, state=_GET_STATE_DEPENDENCY): """Install a skill package with the ``skills`` CLI.""" try: result = state.skills.install_with_npx(body.spec) @@ -72,8 +76,12 @@ def add_skill(body: AddSkill, state=Depends(get_state)): return {**_view(state), "output": result["output"], "spec": result["spec"]} + +# FastAPI resolves request values from these reusable declaration markers. +_REQUIRED_UPLOAD_FILE = File(...) + @router.post("/upload") -async def upload_skill(file: UploadFile = File(...), state=Depends(get_state)): +async def upload_skill(file: UploadFile = _REQUIRED_UPLOAD_FILE, state=_GET_STATE_DEPENDENCY): """Accept an operator-provided SKILL.md into the Custom folder.""" if not file.filename: raise HTTPException(400, "a SKILL.md filename is required") @@ -95,7 +103,7 @@ async def upload_skill(file: UploadFile = File(...), state=Depends(get_state)): @router.post("/move") -def move_skill(body: MoveSkill, state=Depends(get_state)): +def move_skill(body: MoveSkill, state=_GET_STATE_DEPENDENCY): """Reassign a skill to another folder (drag-and-drop in the UI).""" try: state.skills.move(body.repository, body.path, body.folder) @@ -107,7 +115,7 @@ def move_skill(body: MoveSkill, state=Depends(get_state)): @router.patch("") -def enable_skill(body: EnableSkill, state=Depends(get_state)): +def enable_skill(body: EnableSkill, state=_GET_STATE_DEPENDENCY): try: state.skills.enable(body.repository, body.enabled) except KeyError as exc: diff --git a/backend/api/solve.py b/backend/api/solve.py index ad872cc..57398de 100644 --- a/backend/api/solve.py +++ b/backend/api/solve.py @@ -11,16 +11,20 @@ Report, ReportRequest, ) -from backend.core.state import AppState -from backend.core.redaction import redact_flag from backend.core.ipc import FlagConflictError, submit_flag_candidate from backend.core.postprocess_store import enqueue_postprocess +from backend.core.redaction import redact_flag +from backend.core.state import AppState router = APIRouter(tags=["solve"]) + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + @router.post("/projects/{project_id}/start") -def start_solving(project_id: str, state: AppState = Depends(get_state)): +def start_solving(project_id: str, state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: row = graph_store.get_project_row(conn, project_id) if row is None: @@ -39,7 +43,7 @@ def start_solving(project_id: str, state: AppState = Depends(get_state)): @router.post("/projects/{project_id}/reopen") -def reopen_project(project_id: str, state: AppState = Depends(get_state)): +def reopen_project(project_id: str, state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: row = graph_store.get_project_row(conn, project_id) if row is None: @@ -50,7 +54,7 @@ def reopen_project(project_id: str, state: AppState = Depends(get_state)): @router.post("/projects/{project_id}/stop") -def stop_solving(project_id: str, state: AppState = Depends(get_state)): +def stop_solving(project_id: str, state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: row = graph_store.get_project_row(conn, project_id) if row is None: @@ -72,7 +76,7 @@ def stop_solving(project_id: str, state: AppState = Depends(get_state)): @router.post("/projects/stop-all") -def stop_all(state: AppState = Depends(get_state)): +def stop_all(state: AppState = _GET_STATE_DEPENDENCY): stopped = [] with state.db.connect() as conn: rows = conn.execute( @@ -89,7 +93,7 @@ def stop_all(state: AppState = Depends(get_state)): @router.post("/projects/{project_id}/resume") -def resume_solving(project_id: str, state: AppState = Depends(get_state)): +def resume_solving(project_id: str, state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: row = graph_store.get_project_row(conn, project_id) if row is None: @@ -110,7 +114,7 @@ def resume_solving(project_id: str, state: AppState = Depends(get_state)): @router.post("/projects/{project_id}/reports", response_model=Report, status_code=201) -def submit_report(project_id: str, body: ReportRequest, state: AppState = Depends(get_state)): +def submit_report(project_id: str, body: ReportRequest, state: AppState = _GET_STATE_DEPENDENCY): """A Member submits a difficulty report to Diamond (Seed.md 角色联动).""" with state.db.connect() as conn: if graph_store.get_project_row(conn, project_id) is None: @@ -130,7 +134,7 @@ def submit_report(project_id: str, body: ReportRequest, state: AppState = Depend @router.post("/projects/{project_id}/complete", response_model=Intent) -def complete_project(project_id: str, body: CompleteRequest, state: AppState = Depends(get_state)): +def complete_project(project_id: str, body: CompleteRequest, state: AppState = _GET_STATE_DEPENDENCY): """Mark a flag found (IPC verification entry). Creates the goal edge.""" with state.db.connect() as conn: row = graph_store.get_project_row(conn, project_id) @@ -170,7 +174,7 @@ def complete_project(project_id: str, body: CompleteRequest, state: AppState = D @router.get("/broadcasts", response_model=list[Broadcast]) -def list_broadcasts(state: AppState = Depends(get_state)): +def list_broadcasts(state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: rows = graph_store.list_broadcasts(conn) return [item.model_copy(update={"flag": redact_flag(item.flag) or ""}) for item in rows] diff --git a/backend/api/wp.py b/backend/api/wp.py index fac8bfb..dba94c1 100644 --- a/backend/api/wp.py +++ b/backend/api/wp.py @@ -65,8 +65,12 @@ def _completed_writeups(state: AppState) -> list[dict]: return out + +# FastAPI resolves request values from these reusable declaration markers. +_GET_STATE_DEPENDENCY = Depends(get_state) + @router.get("/projects/{project_id}/wp") -def get_wp(project_id: str, state: AppState = Depends(get_state)): +def get_wp(project_id: str, state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: row = graph_store.get_project_row(conn, project_id) if row is None: @@ -81,12 +85,12 @@ def get_wp(project_id: str, state: AppState = Depends(get_state)): @router.get("/wp/completed") -def completed_wp(state: AppState = Depends(get_state)): +def completed_wp(state: AppState = _GET_STATE_DEPENDENCY): return {"writeups": _completed_writeups(state)} @router.post("/wp/derive") -def derive_wp(state: AppState = Depends(get_state)): +def derive_wp(state: AppState = _GET_STATE_DEPENDENCY): target = state.wp_export_dir target.mkdir(parents=True, exist_ok=True) writeups = _completed_writeups(state) @@ -111,6 +115,6 @@ def derive_wp(state: AppState = Depends(get_state)): @router.get("/wp") -def list_wp(state: AppState = Depends(get_state)): +def list_wp(state: AppState = _GET_STATE_DEPENDENCY): files = sorted(state.wp_dir.glob("*.md")) return {"writeups": [f.name for f in files]} diff --git a/backend/auth/manager.py b/backend/auth/manager.py index 98375a4..92cebef 100644 --- a/backend/auth/manager.py +++ b/backend/auth/manager.py @@ -9,12 +9,14 @@ import threading import time from collections import OrderedDict +from collections.abc import Callable from dataclasses import dataclass from datetime import datetime, timezone from pathlib import Path -from typing import Any, Callable +from typing import Any from backend.auth.session_store import ActiveSessionStore +from backend.core.validation import InputValidationError AUTH_FILE_ENV = "IPC_AUTH_FILE" SESSION_COOKIE_NAME = "ipc_session" @@ -328,7 +330,7 @@ def _restrict_permissions(self) -> None: @staticmethod def _validate_new_password(password: str) -> None: if not isinstance(password, str): - raise ValueError("password must be a string") + raise InputValidationError("password must be a string") if len(password) < _MIN_PASSWORD_LENGTH: raise ValueError(f"password must contain at least {_MIN_PASSWORD_LENGTH} characters") if len(password) > _MAX_PASSWORD_LENGTH: diff --git a/backend/blackboard/db.py b/backend/blackboard/db.py index cfc2fb6..78c22b2 100644 --- a/backend/blackboard/db.py +++ b/backend/blackboard/db.py @@ -2,7 +2,6 @@ from backend.persistence.database import Database, PostgresDatabase - PROJECT_STATES = ( "created", "running", @@ -14,4 +13,4 @@ "stopped", ) -__all__ = ["Database", "PostgresDatabase", "PROJECT_STATES"] +__all__ = ["PROJECT_STATES", "Database", "PostgresDatabase"] diff --git a/backend/blackboard/edge_store.py b/backend/blackboard/edge_store.py index 308f19f..2736e19 100644 --- a/backend/blackboard/edge_store.py +++ b/backend/blackboard/edge_store.py @@ -8,7 +8,6 @@ from backend.blackboard.ids import next_intent_id, utcnow from backend.blackboard.models import Intent - _WS_RE = re.compile(r"\s+") _PUNCT_RE = re.compile(r"[^a-z0-9_./:-]+") diff --git a/backend/blackboard/node_store.py b/backend/blackboard/node_store.py index 69d4c03..e04e697 100644 --- a/backend/blackboard/node_store.py +++ b/backend/blackboard/node_store.py @@ -6,7 +6,6 @@ from backend.blackboard.ids import next_fact_id, utcnow from backend.blackboard.models import Fact - _FINDING_RE = re.compile( r"(?P[A-Za-z0-9_./-]+\.(?:c|cc|cpp|cxx|h|hpp|py|js|ts|java))" r"(?::|\s+lines?\s+)(?P\d+(?:-\d+)?)" diff --git a/backend/competition/conversation.py b/backend/competition/conversation.py index b3240fb..c5b95ed 100644 --- a/backend/competition/conversation.py +++ b/backend/competition/conversation.py @@ -6,10 +6,12 @@ from __future__ import annotations import json +import logging import threading import uuid +from collections.abc import Callable from dataclasses import dataclass, field -from typing import Any, Callable +from typing import Any import requests @@ -19,6 +21,8 @@ opencode_provider_headers, ) +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) @dataclass class ToolCall: @@ -169,6 +173,7 @@ def __init__( ) self._provider_session = provider_session_id or f"ipc-session-{uuid.uuid4().hex[:16]}" self._stream_usage_supported = True + self.on_first_response: Callable[[], None] | None = None @property def provider_session_id(self) -> str: @@ -254,6 +259,7 @@ def _should_drop_stream_options(exc: requests.HTTPError, body: dict) -> bool: try: detail = response.text or "" except Exception: + _recovery_logger.debug('Error handled in _should_drop_stream_options', exc_info=True) detail = "" return "stream_options" in detail or "include_usage" in detail @@ -266,7 +272,12 @@ def _read(self, response, emit, cancel, emit_reasoning=None): complete = False truncated: str | None = None usage: dict | None = None + first_event = True for event in sse(response): + if first_event: + first_event = False + if self.on_first_response is not None: + self.on_first_response() if cancel.is_set(): raise InterruptedError("session cancelled") delta_text = "" diff --git a/backend/competition/fixture.py b/backend/competition/fixture.py index ceef374..c3a8135 100644 --- a/backend/competition/fixture.py +++ b/backend/competition/fixture.py @@ -90,6 +90,7 @@ def start_instance(self, external_id: str) -> dict: "state": "ready", "generation": 1, "renewals": 0, + "entry": f"http://{external_id}.fixture.invalid/instance/1", } self._instances[external_id] = instance return deepcopy(instance) @@ -118,6 +119,7 @@ def rebuild_instance(self, external_id: str) -> dict: "generation": generation, "renewals": 0, "renew_after": 300, + "entry": f"http://{external_id}.fixture.invalid/instance/{generation}", } self._instances[external_id] = replacement self.rebuilds.append(external_id) diff --git a/backend/competition/platform.py b/backend/competition/platform.py index 974e318..eef0ee2 100644 --- a/backend/competition/platform.py +++ b/backend/competition/platform.py @@ -1,5 +1,6 @@ from __future__ import annotations +import logging from urllib.parse import quote, urlsplit from backend.ops.models import PlatformWorkflowSpec @@ -7,6 +8,8 @@ from backend.platform.adapter import PlatformAdapter from backend.platform.verdict import interpret_response +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) class CompetitionPlatform: """Freeze one Workflow revision; refresh only its referenced credentials.""" @@ -23,9 +26,7 @@ def identity(self): base = str(adapter_identity).rstrip("/") team = quote(str(self.spec.team_id), safe="") team_marker = f"/team/{team}" - if base.endswith(f"/{team}") or base.endswith(team_marker) or ( - team_marker in base and "/account/" in base - ): + if base.endswith((f"/{team}", team_marker)) or team_marker in base and "/account/" in base: return base return f"{base}/{quote(str(self.spec.competition_id), safe='')}/{team}" base = self.spec.challenges.list_url @@ -58,6 +59,7 @@ def instance_limit(self) -> int | None: try: limit = method() except Exception: + _recovery_logger.debug('Error handled in instance_limit', exc_info=True) return None try: limit = int(limit) if limit is not None else None diff --git a/backend/competition/policy.py b/backend/competition/policy.py index 6648a4a..574b671 100644 --- a/backend/competition/policy.py +++ b/backend/competition/policy.py @@ -1,8 +1,8 @@ from __future__ import annotations +from collections.abc import Iterable from dataclasses import dataclass from datetime import datetime, timedelta -from collections.abc import Iterable from backend.core.config import MEMBER_NAMES @@ -64,8 +64,10 @@ def plan_assignments( free = [name for name in member_order if name not in occupied] eligible = [c for c in challenges if c.state in {"ready", "solving"} and (c.deadline_at is None or c.deadline_at > now)] - running = sum(bool(c.members) for c in challenges) - available_local = max(0, local_capacity - running) + running_local = sum(bool(c.members) and not c.remote for c in challenges) + running_remote = sum(bool(c.members) and c.remote for c in challenges) + available_local = max(0, local_capacity - running_local) + available_remote = max(0, remote_capacity - running_remote) candidates = [c for c in eligible if not c.members] candidates.sort(key=lambda c: ( -(c.solve_count if c.solve_count is not None else -1), @@ -76,16 +78,20 @@ def plan_assignments( result: list[Assignment] = [] assigned: set[str] = set() for challenge in candidates: - if not free or not available_local: + if not free: break needs_instance = challenge.remote and not challenge.instance_ready - if needs_instance and remote_capacity == 0: - continue + if challenge.remote: + if available_remote <= 0: + continue + elif available_local <= 0: + break result.append(Assignment(free.pop(0), challenge.id, "primary", needs_instance)) assigned.add(challenge.id) - available_local -= 1 - if needs_instance: - remote_capacity -= 1 + if challenge.remote: + available_remote -= 1 + else: + available_local -= 1 if len(eligible) < 10: helpers = [c for c in eligible if len(c.members) == 1 and c.id not in assigned] helpers.sort(key=lambda c: (c.first_assigned_at or c.ready_at, c.id)) diff --git a/backend/competition/proto/pair_pb2.py b/backend/competition/proto/pair_pb2.py index a1b1424..9fee7ad 100644 --- a/backend/competition/proto/pair_pb2.py +++ b/backend/competition/proto/pair_pb2.py @@ -1,10 +1,10 @@ -# -*- coding: utf-8 -*- """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder + _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, 6, diff --git a/backend/competition/runtime.py b/backend/competition/runtime.py index d75e420..6db47b3 100644 --- a/backend/competition/runtime.py +++ b/backend/competition/runtime.py @@ -8,7 +8,8 @@ from __future__ import annotations import threading -from typing import Any, Callable +from collections.abc import Callable +from typing import Any from backend.agent.runtime import ( AgentRuntime, @@ -36,7 +37,7 @@ def __init__( cancel: threading.Event | None = None, emit: Callable[[str], None] | None = None, compressor: Callable[[list[dict[str, Any]]], tuple[str, list[dict[str, Any]]]] | None = None, - before_turn: Callable[["SessionRunner"], list[dict[str, Any]]] | None = None, + before_turn: Callable[[SessionRunner], list[dict[str, Any]]] | None = None, context_bytes: int = 1_000_000, repeated_batch_limit: int = 8, truncation_retry_limit: int = 3, diff --git a/backend/competition/schema.py b/backend/competition/schema.py index 63da861..c7fbe2b 100644 --- a/backend/competition/schema.py +++ b/backend/competition/schema.py @@ -15,6 +15,7 @@ status TEXT NOT NULL DEFAULT 'preflight' CHECK (status IN ('preflight','importing','running','paused','blocked','draining','finished','stopped')), config_snapshot JSONB NOT NULL, + limits JSONB NOT NULL DEFAULT '{}'::jsonb, revision BIGINT NOT NULL DEFAULT 1, created_at TIMESTAMPTZ NOT NULL DEFAULT now(), updated_at TIMESTAMPTZ NOT NULL DEFAULT now() @@ -125,6 +126,7 @@ "ALTER TABLE competition_runs ADD COLUMN IF NOT EXISTS last_error TEXT", "ALTER TABLE competition_runs ADD COLUMN IF NOT EXISTS lease_owner TEXT", "ALTER TABLE competition_runs ADD COLUMN IF NOT EXISTS lease_expires_at TIMESTAMPTZ", + "ALTER TABLE competition_runs ADD COLUMN IF NOT EXISTS limits JSONB NOT NULL DEFAULT '{}'::jsonb", "ALTER TABLE competition_session_events ADD COLUMN IF NOT EXISTS event_id BIGSERIAL", "CREATE UNIQUE INDEX IF NOT EXISTS uq_competition_event_id ON competition_session_events(event_id)", """CREATE TABLE IF NOT EXISTS competition_run_events ( diff --git a/backend/competition/service.py b/backend/competition/service.py index 96d4fbc..ace1a50 100644 --- a/backend/competition/service.py +++ b/backend/competition/service.py @@ -1,24 +1,30 @@ from __future__ import annotations -import os -import json import hashlib import inspect +import json +import logging +import os import sys import threading import time +from collections.abc import Callable from concurrent.futures import ThreadPoolExecutor from contextlib import suppress from datetime import datetime, timedelta, timezone -from typing import Any, Callable +from typing import Any from psycopg.errors import UndefinedColumn, UndefinedTable - from psycopg.types.json import Jsonb +from backend.blackboard import edge_store, node_store from backend.competition.platform import CompetitionPlatform from backend.competition.policy import Challenge, plan_assignments -from backend.competition.store import SERVICE_MEMBER_ID, CompetitionConflict, CompetitionStore +from backend.competition.store import ( + SERVICE_MEMBER_ID, + CompetitionConflict, + CompetitionStore, +) from backend.competition.transport import Envelope, PairCoordinator, ReconPublisher from backend.core.ipc import accept_verified_flag from backend.core.wp_writer import ( @@ -30,6 +36,8 @@ from backend.ops.models import PlatformWorkflowSpec from backend.ops.service import OpsAgentService +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) TERMINAL_RUN_STATES = {"finished", "stopped"} @@ -130,7 +138,7 @@ def __init__( self._wp_pool = ThreadPoolExecutor(max_workers=2, thread_name_prefix="ipc-wp") self._wp_futures: dict[str, Any] = {} self._instance_capability_warnings: set[tuple[str, str]] = set() - self._published_instance_entries: set[tuple[str, str, str]] = set() + self._published_instance_entries: set[tuple[str, str, str, int]] = set() self._engine_conflicts: set[tuple[str, str]] = set() self._engine_epochs: dict[str, int] = {} self.observation_interval = 10.0 @@ -141,6 +149,7 @@ def __init__( self._undelivered_injected: set[int] = set() self._receiver_cursors: dict[str, int] = {} self._stale_job_seconds = 1800 + self._resource_capacity: dict[str, dict] = {} @property def ops(self) -> OpsAgentService: @@ -184,6 +193,7 @@ def start_worker(self) -> None: ) self._recon_endpoint = endpoint except Exception: + _recovery_logger.debug('Error handled in start_worker', exc_info=True) self._recon = None self._recon_endpoint = None @@ -215,6 +225,7 @@ def _supervise(self) -> None: try: self._start_loop_thread() except Exception as exc: + _recovery_logger.debug('Error handled in _supervise', exc_info=True) print( f"[ipc-competition] supervisor restart failed:" f" {type(exc).__name__}: {exc}", @@ -326,11 +337,30 @@ def preflight(self, workflow_id: str) -> dict: supports_instances = getattr(platform, "client", None) is not None elif callable(supports_instances): supports_instances = supports_instances() + preflight_remote_limit, remote_source = self._resolve_remote_limit( + workflow["spec"].model_dump(mode="json"), platform, + ) return { "workflow_id": workflow_id, "identity_key": platform.identity, "challenge_count": len(challenges), "remote_count": sum(bool(item.remote) for item in challenges), + "ordinary_count": sum(not bool(item.remote) for item in challenges), + "challenges": [ + { + "external_id": str(item.external_id), + "title": item.title, + "category": item.category, + "remote": bool(item.remote), + "solved": bool(item.solved), + } + for item in challenges + ], + "limits": { + "local_concurrency": self.state.config.limits.max_concurrent_tasks, + "remote_concurrency": preflight_remote_limit, + "source": remote_source, + }, "capabilities": { "submit": bool(supports_submit), "instances": bool(supports_instances), @@ -367,11 +397,20 @@ def start( raise CompetitionConflict("idempotency key belongs to another run request") return self.store.run_snapshot(existing["id"]) discovered = _select_discovered(platform.preflight(), select) + snapshot_limits = { + "max_concurrent_tasks": self.state.config.limits.max_concurrent_tasks, + "total_cpu": getattr(self.state.config.limits, "total_cpu", 0), + } + snapshot_limits["remote_concurrency"], snapshot_limits["remote_source"] = self._resolve_remote_limit( + workflow["spec"].model_dump(mode="json"), platform, + ) snapshot = { "workflow_spec": workflow["spec"].model_dump(mode="json"), "spec_digest": workflow["spec_digest"], "member_config": _safe_member_config(self.state.config.member), "member_config_source": "runtime-config", + "limits_snapshot": snapshot_limits, + "limits": {}, } if select is not None: snapshot["selected_external_ids"] = [ @@ -449,11 +488,19 @@ def _challenge_metadata(item) -> dict[str, Any]: container_type = platform_data.get("container_type") if container_type: metadata["container_type"] = str(container_type) + try: + score = float(platform_data.get("score")) + except (TypeError, ValueError): + score = None + if score is not None and 0 <= score < float("inf"): + metadata["score"] = score return metadata def control(self, run_id: str, action: str, revision: int) -> dict: - if not self._tick_lock.acquire(blocking=False): - raise CompetitionConflict("another competition operation is in progress") + if not self._tick_lock.acquire(timeout=20): + error = CompetitionConflict("another competition operation is in progress; retry after 20 seconds") + error.retry_after = 20 + raise error try: run = self.store.get_run(run_id) if run["revision"] != revision: @@ -480,6 +527,19 @@ def control(self, run_id: str, action: str, revision: int) -> dict: finally: self._tick_lock.release() + def update_limits(self, run_id: str, limits: dict, revision: int) -> dict: + if not self._tick_lock.acquire(timeout=20): + error = CompetitionConflict("another competition operation is in progress; retry after 20 seconds") + error.retry_after = 20 + raise error + try: + updated = self.store.update_limits(run_id, limits, revision=revision) + self.store.append_run_event(run_id, "run.limits_updated", {"limits": limits}) + self.wake() + return self.store.run_snapshot(updated["id"]) + finally: + self._tick_lock.release() + def _teardown_stopped_run(self, run_id: str, run: dict) -> None: """Tear a stopped run down so no step's failure strands a seat (T4). @@ -502,6 +562,7 @@ def _teardown_stopped_run(self, run_id: str, run: dict) -> None: try: self._run_teardown_step(step) except Exception as exc: + _recovery_logger.debug('Error handled in _teardown_stopped_run', exc_info=True) self.state.logger.project( "competition_teardown_step_failed", run_id, step=label, error=f"{type(exc).__name__}: {exc}", @@ -528,6 +589,7 @@ def _run_teardown_step(step, *, attempts: int = 3, base_delay: float = 0.2) -> N step() return except Exception as exc: + _recovery_logger.debug('Error handled in _run_teardown_step', exc_info=True) last = exc if attempt >= attempts: break @@ -582,6 +644,7 @@ def _sweep_stale_jobs(self, run: dict) -> None: jobs = AgentJobStore(self.state.db) swept = jobs.sweep_stale(idle_seconds=self._stale_job_seconds) except Exception as exc: + _recovery_logger.debug('Error handled in _sweep_stale_jobs', exc_info=True) self.state.logger.project( "competition_job_sweep_failed", run["id"], error=f"{type(exc).__name__}: {exc}", @@ -606,6 +669,7 @@ def _claim_project_engine(self, run: dict, project_id: str) -> bool: except (UndefinedColumn, UndefinedTable): return True except Exception as exc: + _recovery_logger.debug('Error handled in _claim_project_engine', exc_info=True) self.store.append_run_event( run["id"], "engine.lease_error", {"project_id": project_id, "error": str(exc)}, @@ -643,6 +707,7 @@ def _renew_project_engines(self, run: dict) -> None: epoch=epoch, seconds=60 ) except Exception: + _recovery_logger.debug('Error handled in _renew_project_engines', exc_info=True) renewed = True if not renewed: self._claim_project_engine(run, project_id) @@ -674,9 +739,11 @@ def _stop_owned_instances(self, run: dict) -> None: def _stop_instance(self, run: dict, challenge: dict, *, platform=None) -> bool: platform = platform or self._platform_for_run(run) + self.store.append_run_event(run["id"], "instance.stop_requested", {"challenge_id": challenge["id"]}) try: platform.stop_instance(challenge["external_id"]) except Exception as exc: + _recovery_logger.debug('Error handled in _stop_instance', exc_info=True) with self.state.db.connect() as connection: connection.execute( """UPDATE competition_instances @@ -695,6 +762,7 @@ def _stop_instance(self, run: dict, challenge: dict, *, platform=None) -> bool: WHERE challenge_id=%s""", (challenge["id"],), ) + self.store.append_run_event(run["id"], "instance.stopped", {"challenge_id": challenge["id"]}) return True def _retry_pending_instance_stops(self) -> None: @@ -715,6 +783,7 @@ def _retry_pending_instance_stops(self) -> None: {"id": row["challenge_id"], "external_id": row["external_id"]}, ) except Exception as exc: + _recovery_logger.debug('Error handled in _retry_pending_instance_stops', exc_info=True) self.store.append_run_event( row["run_id"], "instance.stop_retry_failed", {"challenge_id": row["challenge_id"], "error": str(exc)}, @@ -800,7 +869,7 @@ def retry_wp(self, job_id: str) -> dict: with self.state.db.connect() as connection: row = connection.execute( """UPDATE competition_wp_jobs SET status='pending',next_attempt_at=now(),last_error=NULL - WHERE challenge_id=%s AND status IN ('deferred','failed') RETURNING *""", + WHERE challenge_id=%s AND (status='deferred' OR (status='failed' AND attempts<5)) RETURNING *""", (job_id,), ).fetchone() if row is None: @@ -813,9 +882,11 @@ def _run_loop(self) -> None: try: self.tick() except BaseException as exc: + _recovery_logger.debug('Error handled in _run_loop', exc_info=True) try: run = self.store.active_run() except Exception: + _recovery_logger.debug('Error handled in _run_loop', exc_info=True) run = None if run: with suppress(Exception): @@ -842,6 +913,29 @@ def tick(self) -> None: run = self.store.active_run() if run is None or not self.store.claim_run_lease(run["id"], self.owner): return + if run["status"] == "blocked": + # A process restart must reclaim an expired run lease and + # re-run the inexpensive platform preflight before resuming. + due = _timestamp(run.get("next_sync_at")) + if due is None or due <= datetime.now(timezone.utc): + try: + self._platform_for_run(run).preflight() + current = self.store.get_run(run["id"]) + resumed = self.store.transition_run( + run["id"], "running", revision=current["revision"] + ) + self.store.append_run_event( + run["id"], "run.recovered", + {"reason": "startup lease takeover and preflight"}, + ) + run = resumed + except Exception as exc: + _recovery_logger.debug('Error handled in tick', exc_info=True) + self.store.schedule_next_sync(run["id"], seconds=self.sync_interval, error=str(exc)) + self.store.append_run_event( + run["id"], "run.recovery_failed", {"error": str(exc)} + ) + return if run["status"] in {"running", "paused", "draining"}: self.store.heartbeat_run_assignments(run["id"], self.owner) if run["status"] in {"running", "paused"}: @@ -850,6 +944,7 @@ def tick(self) -> None: try: self._refresh_unlocked(run["id"]) except Exception as exc: + _recovery_logger.debug('Error handled in tick', exc_info=True) self.store.schedule_next_sync( run["id"], seconds=self.sync_interval, error=str(exc) ) @@ -881,6 +976,7 @@ def tick(self) -> None: if run["status"] == "running": self._sync_orchestrator_assignments(run) self._renew_instances(run) + self._repair_assigned_instances(run) self._publish_instance_entries(run) self._process_submissions( run, @@ -913,6 +1009,7 @@ def _report_stalled_assignments(self, run: dict) -> None: try: stalled = self.store.stalled_run_assignments(run["id"]) except Exception as exc: + _recovery_logger.debug('Error handled in _report_stalled_assignments', exc_info=True) self.state.logger.project( "competition_stall_probe_failed", run["id"], error=f"{type(exc).__name__}: {exc}", @@ -961,6 +1058,7 @@ def _check_message_delivery(self, run: dict) -> None: run["id"], older_than_seconds=self._message_delivery_window ) except Exception as exc: + _recovery_logger.debug('Error handled in _check_message_delivery', exc_info=True) self.state.logger.project( "competition_message_probe_failed", run["id"], error=f"{type(exc).__name__}: {exc}", @@ -984,6 +1082,7 @@ def _cursor_or_zero(self, session_id: str) -> int: try: return self.store.message_cursor(session_id) except Exception: + _recovery_logger.debug('Error handled in _cursor_or_zero', exc_info=True) return 0 def _note_cursor(self, run: dict, session_id: str) -> None: @@ -991,6 +1090,7 @@ def _note_cursor(self, run: dict, session_id: str) -> None: try: current = self.store.message_cursor(session_id) except Exception: + _recovery_logger.debug('Error handled in _note_cursor', exc_info=True) return previous = self._receiver_cursors.get(session_id, 0) if current > previous: @@ -1060,6 +1160,7 @@ def _degrade_recon_to_blackboard(self, run: dict, message: dict) -> bool: if not recorded: return True except Exception as exc: + _recovery_logger.debug('Error handled in _degrade_recon_to_blackboard', exc_info=True) self.state.logger.project( "competition_message_degrade_failed", run["id"], error=f"{type(exc).__name__}: {exc}", challenge_id=str(challenge_id), @@ -1086,6 +1187,7 @@ def _run_session_watchdog(self, run: dict) -> None: try: rows = self.store.run_session_health(run["id"]) except Exception as exc: + _recovery_logger.debug('Error handled in _run_session_watchdog', exc_info=True) self.state.logger.project( "competition_health_probe_failed", run["id"], error=f"{type(exc).__name__}: {exc}", @@ -1135,6 +1237,7 @@ def _cancel_stalled_member(self, run: dict, row: dict) -> None: try: stop(member) except Exception as exc: + _recovery_logger.debug('Error handled in _cancel_stalled_member', exc_info=True) self.state.logger.project( "competition_turn_cancel_failed", run["id"], member=member, error=f"{type(exc).__name__}: {exc}", @@ -1235,6 +1338,7 @@ def _restart_seat_project(self, run: dict, assignment: dict) -> None: (assignment["challenge_id"],), ).fetchone() except Exception: + _recovery_logger.debug('Error handled in _restart_seat_project', exc_info=True) return project_id = challenge["project_id"] if challenge else None if not project_id: @@ -1242,6 +1346,7 @@ def _restart_seat_project(self, run: dict, assignment: dict) -> None: try: start(project_id) except Exception as exc: + _recovery_logger.debug('Error handled in _restart_seat_project', exc_info=True) self.store.append_run_event( run["id"], "session.recovery_start_failed", { @@ -1287,7 +1392,7 @@ def _idle_member(self, run: dict) -> str | None: ).fetchall() taken.update(row["member"] for row in rows) except Exception: - pass + _recovery_logger.debug('Error handled in _idle_member', exc_info=True) for name in MEMBER_NAMES: if name not in taken: return name @@ -1312,9 +1417,12 @@ def _record_observation(self, run: dict) -> None: if now - self._last_observation_at < self.observation_interval: return try: - self.store.observe_run(run["id"], self.owner) + self.store.observe_run( + run["id"], self.owner, resource_capacity=self._resource_capacity.get(run["id"]), + ) self._last_observation_at = now except Exception as exc: + _recovery_logger.debug('Error handled in _record_observation', exc_info=True) self.store.append_run_event( run["id"], "observation.failed", {"error": str(exc)} ) @@ -1378,7 +1486,7 @@ def _advance_run_completion(self, run: dict) -> None: with self.state.db.connect() as connection: outstanding = connection.execute( """SELECT 1 FROM competition_wp_jobs - WHERE run_id=%s AND status<>'done' LIMIT 1""", + WHERE run_id=%s AND status NOT IN ('done','failed') LIMIT 1""", (run["id"],), ).fetchone() occupied = connection.execute( @@ -1443,6 +1551,7 @@ def _sync_orchestrator_assignments(self, run: dict) -> None: try: orchestrator.start_project_async(project_id) except Exception as exc: + _recovery_logger.debug('Error handled in _sync_orchestrator_assignments', exc_info=True) self._starting_members = { key for key in self._starting_members if key[0] != project_id @@ -1513,12 +1622,6 @@ def _schedule_projects(self, run: dict) -> None: )) remote_limit = self._remote_instance_limit(run, platform) with self.state.db.connect() as connection: - used_rows = connection.execute( - """SELECT count(*) AS count FROM competition_instances - WHERE run_id=%s AND state NOT IN ('stopped','expired')""", - (run["id"],), - ).fetchone() - local_used = int(used_rows["count"]) local_ids = { str(row["external_id"]) for row in connection.execute( @@ -1542,6 +1645,7 @@ def _schedule_projects(self, run: dict) -> None: if instance_active and external_id not in local_ids: external_used += 1 except Exception as exc: + _recovery_logger.debug('Error handled in _schedule_projects', exc_info=True) external_used = remote_limit self.store.append_run_event( run["id"], "instance.quota_unknown", {"error": str(exc)} @@ -1549,11 +1653,42 @@ def _schedule_projects(self, run: dict) -> None: plans = plan_assignments( challenges, occupied_members={item["member"] for item in active}, - remote_capacity=max(0, remote_limit - local_used - external_used), + remote_capacity=max(0, remote_limit - external_used), now=datetime.now(timezone.utc), - local_capacity=self.state.config.limits.max_concurrent_tasks, + local_capacity=self._local_task_limit(run), available_members={member.name for member in self.state.config.available_members()}, ) + planned_ids = {plan.challenge_id for plan in plans} + local_limit = self._local_task_limit(run) + local_used = sum( + bool(item.members) and not item.remote for item in challenges + ) + remote_used = sum( + bool(item.members) and item.remote for item in challenges + ) + _, remote_source = self._resolve_remote_limit( + run["config_snapshot"]["workflow_spec"], platform, run.get("limits"), + ) + self._resource_capacity[run["id"]] = { + "local": {"limit": local_limit, "source": "run" if "max_concurrent_tasks" in (run.get("limits") or {}) else "config"}, + "remote": {"limit": remote_limit, "source": remote_source, "external_used": external_used}, + } + for item in challenges: + if item.id in planned_ids or item.members or item.state not in {"ready", "solving"}: + continue + if item.remote and remote_used >= remote_limit: + reason = "waiting for remote container capacity" + elif not item.remote and local_used >= local_limit: + reason = "waiting for local task capacity" + elif not self.state.config.available_members(): + reason = "waiting for configured Member seat" + else: + reason = "waiting for scheduler tick" + with self.state.db.connect() as connection: + connection.execute( + "UPDATE competition_challenges SET metadata=metadata || %s WHERE id=%s", + (Jsonb({"queue_reason": reason}), item.id), + ) by_id = {item["id"]: item for item in rows} for plan in plans: challenge = by_id[plan.challenge_id] @@ -1586,28 +1721,49 @@ def _schedule_projects(self, run: dict) -> None: continue if self.store.find_assignment(run["id"], challenge["id"], plan.member) is None: try: - self.store.assign( + assignment = self.store.assign( run["id"], challenge["id"], plan.member, self.owner, role="primary", ) except CompetitionConflict: continue + self.store.append_run_event( + run["id"], "assignment.started", + { + "challenge_id": challenge["id"], + "member": plan.member, + "role": "primary", + "session_id": assignment["session_id"], + }, + ) elif plan.role == "helper": if self.store.find_assignment(run["id"], challenge["id"], plan.member) is None: try: - self.store.assign( + assignment = self.store.assign( run["id"], challenge["id"], plan.member, self.owner, role="helper", ) except CompetitionConflict: continue + self.store.append_run_event( + run["id"], "assignment.started", + { + "challenge_id": challenge["id"], + "member": plan.member, + "role": "helper", + "session_id": assignment["session_id"], + }, + ) self._ensure_helper_intent(run, challenge, project_id, plan.member) + if (challenge.get("metadata") or {}).get("remote"): + self._publish_instance_entries(run) try: self._starting_members.add(start_key) if project_id not in self._starting_projects: self._starting_projects.add(project_id) orchestrator.start_project_async(project_id) except Exception as exc: + _recovery_logger.debug('Error handled in _schedule_projects', exc_info=True) self._starting_members = { key for key in self._starting_members if key[0] != project_id } @@ -1617,11 +1773,14 @@ def _schedule_projects(self, run: dict) -> None: {"challenge_id": challenge["id"], "member": plan.member, "error": str(exc)}, ) continue + if (challenge.get("metadata") or {}).get("remote"): + self._publish_instance_entries(run) self._starting_members.add(start_key) self._starting_projects.add(project_id) try: orchestrator.start_project_async(project_id) except Exception as exc: + _recovery_logger.debug('Error handled in _schedule_projects', exc_info=True) self._starting_members = { key for key in self._starting_members if key[0] != project_id } @@ -1708,6 +1867,7 @@ def _ensure_helper_intent( connection, project_id, member, f"intent:{intent_id}", "explore" ) except Exception as exc: + _recovery_logger.debug('Error handled in _ensure_helper_intent', exc_info=True) self.store.append_run_event( run["id"], "assignment.helper_intent_failed", { @@ -1761,35 +1921,37 @@ def _restore_paused_seats(self, run: dict, rows: list[dict]) -> None: {"challenge_id": challenge["id"], "member": member, "role": seat["role"]}, ) - def _remote_instance_limit(self, run: dict, platform: Any) -> int: - """How many containers this run may hold at once. - - The platform wins when it publishes a per-team limit, because that is - the number actually enforced; the workflow's ``remote_instance_limit`` - is the manual override for platforms that stay silent. With neither, - one container is assumed and the decision is recorded, which is safer - than unbounded allocation and more useful than refusing to start a - container challenge at all. - """ - - configured = run["config_snapshot"]["workflow_spec"].get("remote_instance_limit", 0) - try: - configured = max(0, int(configured)) - except (TypeError, ValueError): - configured = 0 + @staticmethod + def _resolve_remote_limit(configured_spec: dict, platform: Any, run_limits=None) -> tuple[int, str]: + """Share the same precedence between preflight, run snapshots and ticks.""" + run_limits = run_limits or {} + if isinstance(run_limits, str): + try: + run_limits = json.loads(run_limits) + except (TypeError, ValueError): + run_limits = {} + override = run_limits.get("remote_concurrency") if isinstance(run_limits, dict) else None + configured = override if override is not None else configured_spec.get("remote_concurrency", 0) + if override is not None or configured: + return max(0, int(configured)), "run" if override is not None else "workflow.remote_concurrency" reported = None reader = getattr(platform, "instance_limit", None) if callable(reader): try: reported = reader() except Exception: + _recovery_logger.debug('Error handled in _resolve_remote_limit', exc_info=True) reported = None - if reported: - return int(reported) - if configured: - return configured - if not self._supports_instance_lifecycle(platform): - return 0 + if reported is not None: + return max(0, int(reported)), "platform.reported" + if configured_spec.get("remote_instance_limit"): + return int(configured_spec["remote_instance_limit"]), "workflow.remote_instance_limit" + return (1, "platform.default") if CompetitionService._supports_instance_lifecycle(platform) else (0, "platform.unsupported") + + def _remote_instance_limit(self, run: dict, platform: Any) -> int: + limit, source = self._resolve_remote_limit(run["config_snapshot"]["workflow_spec"], platform, run.get("limits")) + if source != "platform.default": + return limit warning_key = (run["id"], "instance_limit_default") if warning_key not in self._instance_capability_warnings: self._instance_capability_warnings.add(warning_key) @@ -1801,7 +1963,23 @@ def _remote_instance_limit(self, run: dict, platform: Any) -> int: "the workflow sets no remote_instance_limit", }, ) - return 1 + return limit + + def _local_task_limit(self, run: dict) -> int: + """Read the mutable local capacity on every scheduler tick.""" + limits = run.get("limits") or {} + if isinstance(limits, str): + try: + limits = json.loads(limits) + except (TypeError, ValueError): + limits = {} + value = limits.get("max_concurrent_tasks") if isinstance(limits, dict) else None + if value is None: + value = self.state.config.limits.max_concurrent_tasks + try: + return max(0, int(value)) + except (TypeError, ValueError): + return max(0, int(self.state.config.limits.max_concurrent_tasks)) def _instance_ready(self, challenge_id: str) -> bool: with self.state.db.connect() as connection: @@ -1863,8 +2041,9 @@ def _publish_instance_entries(self, run: dict) -> None: """ with self.state.db.connect() as connection: instances = connection.execute( - """SELECT challenge_id, external_id, metadata FROM competition_instances - WHERE run_id=%s AND state IN ('ready','running','active')""", + """SELECT i.challenge_id,i.external_id,i.metadata,c.instance_generation + FROM competition_instances i JOIN competition_challenges c ON c.id=i.challenge_id + WHERE i.run_id=%s AND i.state IN ('ready','running','active')""", (run["id"],), ).fetchall() if not instances: @@ -1880,7 +2059,8 @@ def _publish_instance_entries(self, run: dict) -> None: continue if assignment["role"] == "wp": continue - key = (instance["challenge_id"], assignment["session_id"], str(entry)) + generation = int(instance["instance_generation"]) + key = (instance["challenge_id"], assignment["session_id"], str(entry), generation) if key in self._published_instance_entries: continue message = Envelope( @@ -1890,7 +2070,7 @@ def _publish_instance_entries(self, run: dict) -> None: receiver_member_id=assignment["member"], sender_session_id=assignment["session_id"], receiver_session_id=assignment["session_id"], - request_id=f"target-instance:{instance['challenge_id']}:{assignment['session_id']}:{entry}"[:128], + request_id=f"target-instance:{instance['challenge_id']}:{assignment['session_id']}:g{generation}:{hashlib.sha256(str(entry).encode()).hexdigest()[:12]}", correlation_id=f"target-instance:{instance['challenge_id']}", lease_epoch=int(assignment["epoch"]), created_at=now, @@ -1900,6 +2080,7 @@ def _publish_instance_entries(self, run: dict) -> None: "kind": "target_instance", "external_id": instance["external_id"], "entry": str(entry), + "instance_generation": generation, "instruction": ( "This challenge's live target is the per-team instance at this entry. " "Attack only this address. Never probe, scan, or submit to the " @@ -1911,11 +2092,28 @@ def _publish_instance_entries(self, run: dict) -> None: self.publish_recon(message) self._published_instance_entries.add(key) except Exception as exc: + _recovery_logger.debug('Error handled in _publish_instance_entries', exc_info=True) self.store.append_run_event( run["id"], "instance.entry_publish_failed", {"challenge_id": instance["challenge_id"], "error": str(exc)}, ) + def _repair_assigned_instances(self, run: dict) -> None: + """Repair an expired target that still belongs to an admitted solver.""" + assigned = {row["challenge_id"] for row in self.store.assignments(run["id"], active_only=True) if row["role"] != "wp"} + with self.state.db.connect() as connection: + expired = {row["challenge_id"] for row in connection.execute( + """SELECT challenge_id FROM competition_instances WHERE run_id=%s AND state='expired' + AND metadata->>'repair_required'='true'""", (run["id"],), + ).fetchall()} + for challenge in self.store.challenges(run["id"]): + if ( + challenge["id"] in assigned & expired + and challenge["state"] == "solving" + and self._start_instance(run, challenge) + ): + self.store.append_run_event(run["id"], "instance.repaired", {"challenge_id": challenge["id"]}) + def _renew_instances(self, run: dict) -> None: platform = self._platform_for_run(run) with self.state.db.connect() as connection: @@ -1926,14 +2124,35 @@ def _renew_instances(self, run: dict) -> None: (run["id"],), ).fetchall() for instance in due: + self.store.append_run_event(run["id"], "instance.renew_requested", {"challenge_id": instance["challenge_id"]}) try: renewed = platform.renew_instance(instance["external_id"]) except Exception as exc: + _recovery_logger.debug('Error handled in _renew_instances', exc_info=True) + message = str(exc).casefold() + # An expired/missing container is a state transition. Defer + # repair to the scheduler so every tick does not destroy and + # recreate the target (which causes entry drift and 429s). + if any(token in message for token in ("not created", "does not exist", "expired", "not found")): + with self.state.db.connect() as connection: + connection.execute( + """UPDATE competition_instances SET state='expired',next_renew_at=NULL, + metadata=metadata || %s,updated_at=now() WHERE challenge_id=%s""", + (Jsonb({"renew_error": str(exc), "repair_required": True, + "repair_after": (datetime.now(timezone.utc) + timedelta(seconds=60)).isoformat()}), instance["challenge_id"]), + ) + self.store.append_run_event( + run["id"], "instance.expired", + {"challenge_id": instance["challenge_id"], "reason": str(exc)}, + ) + continue rebuilt = getattr(platform, "rebuild_instance", None) if callable(rebuilt): try: + self.store.append_run_event(run["id"], "instance.rebuild_requested", {"challenge_id": instance["challenge_id"]}) replacement = rebuilt(instance["external_id"]) except Exception as rebuild_exc: + _recovery_logger.debug('Error handled in _renew_instances', exc_info=True) replacement = None self.store.append_run_event( run["id"], "instance.rebuild_failed", @@ -2004,6 +2223,7 @@ def _renew_instances(self, run: dict) -> None: updated_at=now() WHERE challenge_id=%s""", (next_renewal, instance["challenge_id"]), ) + self.store.append_run_event(run["id"], "instance.renewed", {"challenge_id": instance["challenge_id"]}) def _start_instance(self, run: dict, challenge: dict) -> bool: platform = self._platform_for_run(run) @@ -2011,16 +2231,37 @@ def _start_instance(self, run: dict, challenge: dict) -> bool: return False with self.state.db.connect() as connection: existing = connection.execute( - "SELECT state FROM competition_instances WHERE challenge_id=%s", + "SELECT state,metadata FROM competition_instances WHERE challenge_id=%s", (challenge["id"],), ).fetchone() + if existing is not None and existing["state"] == "expired": + repair_after = (existing.get("metadata") or {}).get("repair_after") + if repair_after: + try: + if _timestamp(repair_after) and _timestamp(repair_after) > datetime.now(timezone.utc): + return False + except (TypeError, ValueError): + pass if existing is not None and existing["state"] in { "ready", "running", "active", "start_pending", "stop_pending" }: return existing["state"] in {"ready", "running", "active"} try: + self.store.append_run_event(run["id"], "instance.start_requested", {"challenge_id": challenge["id"]}) result = platform.start_instance(challenge["external_id"]) except Exception as exc: + _recovery_logger.debug('Error handled in _start_instance', exc_info=True) + with self.state.db.connect() as connection: + connection.execute( + """INSERT INTO competition_instances + (challenge_id,run_id,external_id,state,metadata,updated_at) + VALUES (%s,%s,%s,'expired',%s,now()) + ON CONFLICT (challenge_id) DO UPDATE SET state='expired', + metadata=competition_instances.metadata || EXCLUDED.metadata, + updated_at=now()""", + (challenge["id"], run["id"], challenge["external_id"], + Jsonb({"start_error": str(exc), "repair_after": (datetime.now(timezone.utc) + timedelta(seconds=60)).isoformat()})), + ) self.store.append_run_event( run["id"], "instance.start_failed", {"challenge_id": challenge["id"], "error": str(exc)}, @@ -2064,6 +2305,7 @@ def _start_instance(self, run: dict, challenge: dict) -> bool: (challenge["id"],), ) except Exception as exc: + _recovery_logger.debug('Error handled in _start_instance', exc_info=True) try: with self.state.db.connect() as connection: connection.execute( @@ -2083,11 +2325,33 @@ def _start_instance(self, run: dict, challenge: dict) -> bool: {"challenge_id": challenge["id"], "error": str(exc)}, ) return False + self.store.append_run_event(run["id"], "instance.started", {"challenge_id": challenge["id"], "repair": bool(existing and existing["state"] == "expired")}) return True def _process_submissions(self, run: dict, *, allow_new: bool = True) -> None: platform = self._platform_for_run(run) self._ingest_project_candidates(run) + # A platform verdict can be correct while local closeout is + # temporarily unavailable. Retry that durable fact until the project + # is actually solved and its seats are released. + with self.state.db.connect() as connection: + closeout_rows = connection.execute( + """SELECT s.*,c.external_id,c.project_id FROM competition_submissions s + JOIN competition_challenges c ON c.id=s.challenge_id + LEFT JOIN projects p ON p.id=c.project_id + WHERE s.run_id=%s AND s.status='correct' AND p.id IS NOT NULL + AND (p.status IS DISTINCT FROM 'solved' + OR EXISTS (SELECT 1 FROM competition_assignments a + WHERE a.challenge_id=c.id AND a.released_at IS NULL)) + ORDER BY s.created_at""", + (run["id"],), + ).fetchall() + for submission in closeout_rows: + challenge = next( + item for item in self.store.challenges(run["id"]) + if item["id"] == submission["challenge_id"] + ) + self._on_correct(run, challenge, submission["candidate"]) with self.state.db.connect() as connection: unresolved = connection.execute( """SELECT s.*,c.external_id FROM competition_submissions s @@ -2102,8 +2366,14 @@ def _process_submissions(self, run: dict, *, allow_new: bool = True) -> None: submission["external_id"], submission["platform_submission_id"] ) except Exception: + _recovery_logger.debug('Error handled in _process_submissions', exc_info=True) continue finished = self.store.finish_submission(submission["id"], result) + self.store.append_run_event( + run["id"], "submission.verdict", + {"challenge_id": submission["challenge_id"], "submission_id": submission["id"], + "verdict": finished["status"], "source": "query"}, + ) if finished["status"] == "correct": challenge = next( item for item in self.store.challenges(run["id"]) @@ -2123,6 +2393,7 @@ def _process_submissions(self, run: dict, *, allow_new: bool = True) -> None: try: result = platform.submit(challenge["external_id"], submission["candidate"]) except Exception: + _recovery_logger.debug('Error handled in _process_submissions', exc_info=True) result = {"verdict": "unknown"} finished = self.store.finish_submission(submission["id"], result) self.store.append_run_event( @@ -2191,6 +2462,25 @@ def _on_correct(self, run: dict, challenge: dict, flag: str) -> None: if project_id: try: with self.state.db.connect() as connection: + # Operator/API submissions can bypass the Member tool. Add + # the same idempotent completion edge before accepting the + # verdict so closeout never leaves a solved seat stranded. + self.store._lock(connection, run["id"]) + connection.execute("SELECT id FROM projects WHERE id=%s FOR UPDATE", (project_id,)) + goal = connection.execute( + "SELECT 1 FROM intents WHERE project_id=%s AND to_fact_id='goal' LIMIT 1", + (project_id,), + ).fetchone() + if goal is None: + fact = node_store.reserve_fact( + connection, project_id, + "Verified flag submitted through the competition closeout API.", + ) + node_store.insert_fact(connection, project_id, fact.id, fact.description) + edge_store.complete_goal_intent( + connection, project_id, [fact.id], + "verified flag submission", SERVICE_MEMBER_ID, + ) accept_verified_flag( connection, project_id, flag, source=f"competition:{run['workflow_id']}", @@ -2198,7 +2488,9 @@ def _on_correct(self, run: dict, challenge: dict, flag: str) -> None: from backend.core.postprocess_store import enqueue_postprocess enqueue_postprocess(connection, project_id) + self.store.finalize_correct_challenge(connection, run["id"], challenge["id"]) except Exception as exc: + _recovery_logger.debug('Error handled in _on_correct', exc_info=True) self.store.append_run_event( run["id"], "challenge.closeout_failed", {"challenge_id": challenge["id"], "error": str(exc)}, @@ -2227,7 +2519,7 @@ def _dispatch_wp(self, run: dict) -> None: for key in finished: self._wp_futures.pop(key, None) while len(self._wp_futures) < 2: - claimed = self.store.claim_wp_job(run["id"], self.owner) + claimed = self.store.claim_wp_job(run["id"], self.owner, require_verified=True) if claimed is None: return challenge_id = claimed["job"]["challenge_id"] @@ -2288,10 +2580,12 @@ def generator(prompt: str) -> str: "artifact_path": path}, ) except Exception as exc: + _recovery_logger.debug('Error handled in _run_wp_job', exc_info=True) + finished_job = None with suppress(CompetitionConflict): - self.store.finish_wp_job(assignment, error=str(exc)) + finished_job = self.store.finish_wp_job(assignment, error=str(exc)) self.store.append_run_event( - job["run_id"], "wp.deferred", + job["run_id"], "wp.failed" if finished_job and finished_job.get("status") == "failed" else "wp.deferred", {"challenge_id": job["challenge_id"], "member": job["member"], "error": str(exc)}, ) diff --git a/backend/competition/store.py b/backend/competition/store.py index 8451605..8a5efcf 100644 --- a/backend/competition/store.py +++ b/backend/competition/store.py @@ -1,12 +1,14 @@ from __future__ import annotations -import uuid import hashlib +import json +import uuid from typing import Any from psycopg.types.json import Jsonb from backend.core.config import MEMBER_NAMES +from backend.core.validation import InputValidationError from backend.platform.verdict import cooldown_seconds @@ -53,6 +55,8 @@ class CompetitionStore: deliberately not held during model calls, downloads, or platform requests. """ + provider_progress_events = True + def __init__(self, db): self.db = db @@ -137,11 +141,14 @@ def create_run(self, workflow_id: str, identity_key: str, idempotency_key: str, ).fetchone() if active: raise CompetitionConflict("another competition is active") + limits = snapshot.get("limits") if isinstance(snapshot, dict) else None + if not isinstance(limits, dict): + limits = {} return connection.execute( """INSERT INTO competition_runs - (id,workflow_id,identity_key,idempotency_key,config_snapshot) - VALUES (%s,%s,%s,%s,%s) RETURNING *""", - (new_id(), workflow_id, identity_key, idempotency_key, Jsonb(snapshot)), + (id,workflow_id,identity_key,idempotency_key,config_snapshot,limits) + VALUES (%s,%s,%s,%s,%s,%s) RETURNING *""", + (new_id(), workflow_id, identity_key, idempotency_key, Jsonb(snapshot), Jsonb(limits)), ).fetchone() def run_by_idempotency(self, idempotency_key: str) -> dict | None: @@ -725,15 +732,28 @@ def finish_submission(self, submission_id: str, result: dict) -> dict: (max(1, int(result.get("retry_after") or 60)), row["run_id"]), ) connection.execute("UPDATE competition_submissions SET status='queued' WHERE id=%s", (submission_id,)) - elif status == "correct" and challenge["state"] != "solved": - connection.execute("UPDATE competition_challenges SET state='solved' WHERE id=%s", (challenge["id"],)) - connection.execute( - """INSERT INTO competition_wp_jobs (challenge_id,run_id,member,session_id) - VALUES (%s,%s,%s,%s) ON CONFLICT DO NOTHING""", - (challenge["id"], row["run_id"], row["member"], row["session_id"]), - ) return {**row, "status": status} + def finalize_correct_challenge(self, connection, run_id: str, challenge_id: str) -> None: + """Commit solved/WP in the caller's verified-flag closeout transaction.""" + self._lock(connection, run_id) + submission = connection.execute( + """SELECT * FROM competition_submissions + WHERE run_id=%s AND challenge_id=%s AND status='correct' + ORDER BY created_at,id LIMIT 1 FOR UPDATE""", + (run_id, challenge_id), + ).fetchone() + if submission is None: + raise CompetitionConflict("closeout requires a correct platform verdict") + connection.execute( + "UPDATE competition_challenges SET state='solved' WHERE id=%s", (challenge_id,), + ) + connection.execute( + """INSERT INTO competition_wp_jobs (challenge_id,run_id,member,session_id) + VALUES (%s,%s,%s,%s) ON CONFLICT DO NOTHING""", + (challenge_id, run_id, submission["member"], submission["session_id"]), + ) + def reconcile_inflight_submissions(self, run_id: str, *, grace_seconds: int = 30) -> int: """Move abandoned ``submitting`` rows to queryable ``unknown``. @@ -807,7 +827,7 @@ def run_events(self, run_id: str, after: int = 0, limit: int = 200) -> list[dict (run_id, max(0, after), max(1, min(limit, 1000))), ).fetchall() - def observe_run(self, run_id: str, owner: str) -> dict: + def observe_run(self, run_id: str, owner: str, *, resource_capacity: dict | None = None) -> dict: """Persist a compact, redacted health sample for a competition run. The sample is intentionally derived from durable rows rather than @@ -907,6 +927,8 @@ def observe_run(self, run_id: str, owner: str) -> dict: "sync_lag_seconds": round(float(sync_lag or 0), 3), "artifact_bytes": int(artifact_bytes or 0), } + if resource_capacity is not None: + payload["resource_capacity"] = resource_capacity return connection.execute( """INSERT INTO competition_run_observations (run_id,owner,payload) VALUES (%s,%s,%s) RETURNING *""", @@ -977,6 +999,45 @@ def run_snapshot(self, run_id: str) -> dict: challenge_views.append(item) solving = sum(a["role"] in {"primary", "helper"} for a in assignments) writing = sum(a["role"] == "wp" for a in assignments) + remote_challenge_ids = { + item["id"] for item in challenges if bool((item.get("metadata") or {}).get("remote")) + } + local_used = len({a["challenge_id"] for a in assignments + if a["role"] != "wp" and a["challenge_id"] not in remote_challenge_ids}) + with self.db.connect() as connection: + remote_used = int(connection.execute( + """SELECT count(*) AS count FROM competition_instances WHERE run_id=%s + AND state NOT IN ('stopped','expired')""", (run_id,), + ).fetchone()["count"]) + observation = connection.execute( + """SELECT payload->'resource_capacity' AS capacity FROM competition_run_observations + WHERE run_id=%s AND payload ? 'resource_capacity' + ORDER BY observation_id DESC LIMIT 1""", (run_id,), + ).fetchone() + observed = observation["capacity"] if observation else {} + raw_limits = run.get("limits") or {} + if isinstance(raw_limits, str): + try: + raw_limits = json.loads(raw_limits) + except (TypeError, ValueError): + raw_limits = {} + snapshot_limits = (run.get("config_snapshot") or {}).get("limits_snapshot", {}) + spec = (run.get("config_snapshot") or {}).get("workflow_spec", {}) + local_limit = int( + (raw_limits or {}).get( + "max_concurrent_tasks", + (observed.get("local") or {}).get("limit", (snapshot_limits or {}).get("max_concurrent_tasks", 0)), + ) + or 0 + ) + remote_limit = int(raw_limits.get("remote_concurrency", (observed.get("remote") or {}).get( + "limit", spec.get("remote_concurrency") or snapshot_limits.get("remote_concurrency", spec.get("remote_instance_limit", 0)), + )) or 0) + remote_source = "run" if "remote_concurrency" in raw_limits else (observed.get("remote") or {}).get( + "source", "workflow.remote_concurrency" if spec.get("remote_concurrency") else snapshot_limits.get( + "remote_source", "workflow.remote_instance_limit" if spec.get("remote_instance_limit") else "unreported", + ), + ) return { "run": run, "challenges": challenge_views, @@ -987,8 +1048,58 @@ def run_snapshot(self, run_id: str) -> dict: "collaborating": sum(a["role"] == "helper" for a in assignments), "idle": max(0, len(MEMBER_NAMES) - len(assignments)), }, + "resource_capacity": { + "local": {"used": local_used, "limit": local_limit, "remaining": max(0, local_limit - local_used), + "source": "run" if "max_concurrent_tasks" in raw_limits else (observed.get("local") or {}).get("source", "config_snapshot"), + "challenge_count": len(challenges) - len(remote_challenge_ids)}, + "remote": {"used": remote_used, "limit": remote_limit, "remaining": max(0, remote_limit - remote_used), + "source": remote_source, "challenge_count": len(remote_challenge_ids)}, + }, } + def update_limits(self, run_id: str, limits: dict, *, revision: int) -> dict: + """Patch mutable run limits with optimistic revision control.""" + if not isinstance(limits, dict): + raise InputValidationError("limits must be an object") + allowed = {"max_concurrent_tasks", "total_cpu", "remote_concurrency"} + unknown = set(limits) - allowed + if unknown: + raise ValueError(f"unknown run limit(s): {sorted(unknown)}") + cleaned: dict[str, int] = {} + for key, value in limits.items(): + try: + number = int(value) + except (TypeError, ValueError) as exc: + raise ValueError(f"{key} must be an integer") from exc + if number < 0 or number > 1000: + raise ValueError(f"{key} must be between 0 and 1000") + cleaned[key] = number + with self.db.connect() as connection: + self._lock(connection, run_id) + row = connection.execute( + "SELECT revision,limits FROM competition_runs WHERE id=%s FOR UPDATE", + (run_id,), + ).fetchone() + if row is None: + raise KeyError(run_id) + if int(row["revision"]) != int(revision): + raise CompetitionConflict("stale run revision") + current = row.get("limits") or {} + if isinstance(current, str): + try: + current = json.loads(current) + except (TypeError, ValueError): + current = {} + merged = {**(current if isinstance(current, dict) else {}), **cleaned} + updated = connection.execute( + """UPDATE competition_runs SET limits=%s,revision=revision+1,updated_at=now() + WHERE id=%s AND revision=%s RETURNING *""", + (Jsonb(merged), run_id, revision), + ).fetchone() + if updated is None: + raise CompetitionConflict("stale run revision") + return updated + def member_snapshot(self, run_id: str) -> list[dict]: active = {row["member"]: row for row in self.assignments(run_id, active_only=True)} result = [] @@ -1062,9 +1173,9 @@ def release_expired_assignments(self, run_id: str) -> list[dict]: with self.db.connect() as connection: self._lock(connection, run_id) connection.execute( - """UPDATE competition_wp_jobs w SET status='deferred', + """UPDATE competition_wp_jobs w SET status=CASE WHEN w.attempts >= 5 THEN 'failed' ELSE 'deferred' END, last_error='WP attempt exceeded the 10 minute seat deadline', - next_attempt_at=now()+interval '5 minutes' + next_attempt_at=CASE WHEN w.attempts >= 5 THEN now() ELSE now()+interval '5 minutes' END FROM competition_assignments a WHERE a.run_id=%s AND a.role='wp' AND a.challenge_id=w.challenge_id AND a.released_at IS NULL AND a.wp_deadline_at<=now() @@ -1595,13 +1706,19 @@ def undelivered_messages(self, run_id: str, *, older_than_seconds: int) -> list[ (run_id, max(0, older_than_seconds)), ).fetchall() - def claim_wp_job(self, run_id: str, owner: str) -> dict | None: + def claim_wp_job(self, run_id: str, owner: str, *, require_verified: bool = False) -> dict | None: with self.db.connect() as connection: self._lock(connection, run_id) + verified_filter = """ + AND EXISTS (SELECT 1 FROM competition_challenges c + JOIN projects p ON p.id=c.project_id + WHERE c.id=w.challenge_id AND p.status='solved' AND p.flag IS NOT NULL)""" if require_verified else "" job = connection.execute( - """SELECT w.* FROM competition_wp_jobs w + f"""SELECT w.* FROM competition_wp_jobs w JOIN competition_runs r ON r.id=w.run_id WHERE w.run_id=%s AND w.status IN ('pending','deferred') + AND w.attempts < 5 + {verified_filter} AND w.next_attempt_at<=now() AND NOT EXISTS (SELECT 1 FROM competition_assignments a WHERE a.member=w.member AND a.released_at IS NULL) @@ -1663,13 +1780,20 @@ def finish_wp_job( "SELECT attempts FROM competition_wp_jobs WHERE challenge_id=%s", (assignment["challenge_id"],), ).fetchone()["attempts"] - delay = min(3600, 60 * (2 ** min(attempts - 1, 6))) - job = connection.execute( - """UPDATE competition_wp_jobs SET status='deferred',last_error=%s, - next_attempt_at=now()+(%s*interval '1 second') - WHERE challenge_id=%s RETURNING *""", - ((error or "WP attempt failed")[:2000], delay, assignment["challenge_id"]), - ).fetchone() + if attempts >= 5: + job = connection.execute( + """UPDATE competition_wp_jobs SET status='failed',last_error=%s, + next_attempt_at=now() WHERE challenge_id=%s RETURNING *""", + ((error or "WP attempt failed; retry limit exceeded")[:2000], assignment["challenge_id"]), + ).fetchone() + else: + delay = min(3600, 60 * (2 ** min(attempts - 1, 6))) + job = connection.execute( + """UPDATE competition_wp_jobs SET status='deferred',last_error=%s, + next_attempt_at=now()+(%s*interval '1 second') + WHERE challenge_id=%s RETURNING *""", + ((error or "WP attempt failed")[:2000], delay, assignment["challenge_id"]), + ).fetchone() connection.execute( """UPDATE competition_assignments SET released_at=now(),epoch=epoch+1 WHERE id=%s""", diff --git a/backend/competition/transport.py b/backend/competition/transport.py index f0806d4..8f72f87 100644 --- a/backend/competition/transport.py +++ b/backend/competition/transport.py @@ -7,21 +7,26 @@ from __future__ import annotations import json +import logging import os import queue import threading +from collections.abc import Callable from concurrent.futures import ThreadPoolExecutor from contextlib import suppress from datetime import datetime, timezone from pathlib import Path -from typing import Any, Callable, Literal +from typing import Any, Literal import grpc import zmq from pydantic import BaseModel, ConfigDict, Field, model_validator from backend.competition.proto import pair_pb2 +from backend.core.validation import InputValidationError +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) class Envelope(BaseModel): model_config = ConfigDict(extra="forbid") @@ -126,7 +131,7 @@ def result_from_proto(raw: pair_pb2.Result) -> dict: except (TypeError, ValueError) as exc: raise ValueError("result payload_json is not valid JSON") from exc if not isinstance(value, dict): - raise ValueError("result payload must be a JSON object") + raise InputValidationError("result payload must be a JSON object") value.setdefault("status", raw.status) value.setdefault("request_id", raw.request_id) return value @@ -227,6 +232,7 @@ def _call(self, raw, context): try: result = self.execute(message, cancel) except Exception as exc: + _recovery_logger.debug('Error handled in _call', exc_info=True) result = { "status": "failed", "request_id": message.request_id, @@ -340,6 +346,7 @@ def _run(self) -> None: self._socket = socket self._bound = True except BaseException as exc: + _recovery_logger.debug('Error handled in _run', exc_info=True) self._error = exc self._ready.set() if socket is not None: @@ -358,6 +365,7 @@ def _run(self) -> None: try: socket.send_multipart([topic, payload], flags=zmq.NOBLOCK) except Exception as exc: + _recovery_logger.debug('Error handled in _run', exc_info=True) self._error = exc break finally: @@ -443,10 +451,10 @@ def reliable(self) -> bool: def _normalize(self, value: Any) -> dict: if not isinstance(value, dict): - raise ValueError("recon record must be a JSON object") + raise InputValidationError("recon record must be a JSON object") envelope_value = value.get("envelope", value) if not isinstance(envelope_value, dict): - raise ValueError("recon envelope must be a JSON object") + raise InputValidationError("recon envelope must be a JSON object") sequence = value.get("sequence", envelope_value.get("sequence")) if not isinstance(sequence, int) or isinstance(sequence, bool) or sequence <= 0: raise ValueError("recon record requires a positive persisted sequence") diff --git a/backend/core/diamond.py b/backend/core/diamond.py index 00d3413..34f132c 100644 --- a/backend/core/diamond.py +++ b/backend/core/diamond.py @@ -1,5 +1,6 @@ from __future__ import annotations +import logging from dataclasses import dataclass from backend.blackboard import edge_store, graph_store, node_store @@ -9,6 +10,9 @@ from backend.core.wp_writer import WRITEUP_SYSTEM_PROMPT, generate_wp_content, write_wp from backend.members.adapters import make_adapter +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + BOOTSTRAP_DESC = "Bootstrap: Starting" @@ -68,6 +72,7 @@ def _members_seated_elsewhere(self, project_id: str) -> set[str]: (project_id,), ).fetchall() except Exception: + _recovery_logger.debug('Error handled in _members_seated_elsewhere', exc_info=True) return set() return {row["member"] for row in rows} diff --git a/backend/core/engine_lease.py b/backend/core/engine_lease.py index 9876cf2..38cc204 100644 --- a/backend/core/engine_lease.py +++ b/backend/core/engine_lease.py @@ -5,6 +5,7 @@ from collections.abc import Mapping from typing import Any +from backend.core.validation import InputValidationError ENGINE_KINDS = {"legacy", "competition"} @@ -117,7 +118,7 @@ def release_engine_leases_for_owner( _validate(kind, owner, 60) if not isinstance(epochs, Mapping): - raise ValueError("engine lease epochs are required") + raise InputValidationError("engine lease epochs are required") released = 0 for project_id, epoch in epochs.items(): if not isinstance(epoch, int) or epoch < 1: diff --git a/backend/core/ipc.py b/backend/core/ipc.py index 2d5c87a..7145ede 100644 --- a/backend/core/ipc.py +++ b/backend/core/ipc.py @@ -100,7 +100,7 @@ def accept_verified_flag( ).fetchone() if has_goal_edge is None: raise ValueError("cannot verify flag without a completion edge") - key = hashlib.sha256(f"{project_id}\0{normalized}".encode("utf-8")).hexdigest() + key = hashlib.sha256(f"{project_id}\0{normalized}".encode()).hexdigest() now = utcnow() connection.execute( """ @@ -156,7 +156,7 @@ def record_pending_flag( normalized = flag.strip() project = assert_flag_compatible(connection, project_id, normalized) - key = hashlib.sha256(f"{project_id}\0{normalized}".encode("utf-8")).hexdigest() + key = hashlib.sha256(f"{project_id}\0{normalized}".encode()).hexdigest() now = utcnow() row = connection.execute( """ diff --git a/backend/core/logging_util.py b/backend/core/logging_util.py index 740e555..f74348e 100644 --- a/backend/core/logging_util.py +++ b/backend/core/logging_util.py @@ -5,6 +5,7 @@ from collections.abc import Callable from datetime import UTC, datetime from pathlib import Path +from typing import ClassVar from backend.core.redaction import redact_flag @@ -14,7 +15,7 @@ def _utcnow() -> str: class IPCLogger: - KINDS = { + KINDS: ClassVar[dict] = { "project": "project_logs", "tool": "tool_logs", "llm": "llm_logs", diff --git a/backend/core/orchestrator.py b/backend/core/orchestrator.py index 080d5ad..73e7c8b 100644 --- a/backend/core/orchestrator.py +++ b/backend/core/orchestrator.py @@ -1,28 +1,32 @@ from __future__ import annotations import asyncio -from collections import deque -from contextlib import suppress -from datetime import datetime, timedelta, timezone -import threading -from concurrent.futures import ThreadPoolExecutor -from dataclasses import dataclass import hashlib import json +import logging +import re import sys +import threading +import uuid +from collections import deque +from concurrent.futures import ThreadPoolExecutor +from contextlib import suppress +from dataclasses import dataclass +from datetime import datetime, timedelta, timezone from time import monotonic from typing import Any -import uuid from psycopg.errors import UndefinedColumn, UndefinedTable +from psycopg.types.json import Jsonb from backend.blackboard import edge_store, graph_store, node_store +from backend.competition.transport import Envelope +from backend.core.archive import archive_completed_project +from backend.core.diamond import Diamond from backend.core.engine_lease import ( claim_engine_lease, release_engine_lease, ) -from backend.core.archive import archive_completed_project -from backend.core.diamond import Diamond from backend.core.ipc import ( accept_verified_flag, lock_project_completion, @@ -42,6 +46,7 @@ ) from backend.core.project_manager import ProjectManager from backend.core.resource_manager import ResourceManager +from backend.core.wp_writer import persist_validated_writeup from backend.mcp.mcp_client import MCPClient, MCPRegistryTarget from backend.members.base_member import MemberDeps from backend.members.factory import create_member @@ -52,9 +57,9 @@ ) from backend.sandbox.errors import SandboxStartupError from backend.sandbox.task_sandbox import member_workdir, task_container_name -from backend.core.wp_writer import persist_validated_writeup -from backend.competition.transport import Envelope +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) @dataclass(slots=True) class ReasonCheckpoint: @@ -225,6 +230,7 @@ def _run_project_startup(self, project_id: str, resume: bool) -> None: else: self.start_project(project_id) except Exception as exc: + _recovery_logger.debug('Error handled in _run_project_startup', exc_info=True) self._mark_project_startup_failure( project_id, exc, @@ -286,6 +292,7 @@ def _release_project_engine_lease(self, project_id: str) -> None: self.state.db, project_id, context[0], context[1], epoch=context[2] ) except Exception: + _recovery_logger.debug('Error handled in _release_project_engine_lease', exc_info=True) return def _ensure_project_lease(self, project_id: str) -> bool: @@ -548,6 +555,14 @@ def _startup_in_progress(self, project_id: str) -> bool: with self._lock: return project_id in self._startup_project_ids + def _acquire_task(self, project_id: str) -> bool: + # Competition already owns local/remote capacity and Member seats. + # A second generic task gate would merge the pools again, and would + # reject valid run-level capacity overrides. + if self._competition_project(project_id): + return self.resources.acquire_coordinated_task(project_id) + return self.resources.acquire_task(project_id) + def startup_in_progress(self, project_id: str) -> bool: """Public read-only view for the competition coordinator.""" return self._startup_in_progress(project_id) @@ -572,6 +587,7 @@ def _redispatch_project(self, project_id: str) -> None: return self._dispatch_project(project_id) except Exception as exc: + _recovery_logger.debug('Error handled in _redispatch_project', exc_info=True) self.state.logger.project( "project_redispatch_failed", project_id, @@ -599,7 +615,7 @@ def start_project(self, project_id: str) -> None: self._release_project_lease(project_id) return self._clear_project_member_retries(project_id) - if not self.resources.acquire_task(project_id): + if not self._acquire_task(project_id): self._queue_project(project_id) self._set_runtime_phase(project_id, "queued_capacity") self.state.logger.project( @@ -704,7 +720,7 @@ def resume_project(self, project_id: str) -> None: self._release_project_lease(project_id) return self._clear_project_member_retries(project_id) - if not self.resources.acquire_task(project_id): + if not self._acquire_task(project_id): self._queue_project(project_id) self._set_runtime_phase(project_id, "queued_capacity") self.state.logger.project( @@ -896,6 +912,7 @@ def _publish_competition_recon( ) competition.publish_recon(message) except Exception as exc: + _recovery_logger.debug('Error handled in _publish_competition_recon', exc_info=True) self.state.logger.project( "competition_recon_publish_failed", project_id, @@ -963,6 +980,7 @@ def _competition_project(self, project_id: str) -> bool: (project_id,), ).fetchone()) except Exception: + _recovery_logger.debug('Error handled in _competition_project', exc_info=True) return False def _competition_running(self, project_id: str) -> bool: @@ -991,6 +1009,7 @@ def _competition_members(self, project_id: str) -> set[str] | None: ).fetchall() return {row["member"] for row in rows} except Exception: + _recovery_logger.debug('Error handled in _competition_members', exc_info=True) return None def _competition_preferred_member(self, project_id: str) -> str | None: @@ -1009,6 +1028,7 @@ def _competition_preferred_member(self, project_id: str) -> str | None: ).fetchone() return row["member"] if row else None except Exception: + _recovery_logger.debug('Error handled in _competition_preferred_member', exc_info=True) return None def _competition_assignment(self, project_id: str, member_name: str) -> dict | None: @@ -1025,6 +1045,7 @@ def _competition_assignment(self, project_id: str, member_name: str) -> dict | N (project_id, member_name), ).fetchone() except Exception: + _recovery_logger.debug('Error handled in _competition_assignment', exc_info=True) return None def _global_active_members_locked(self) -> set[str]: @@ -1350,10 +1371,19 @@ def _release_member_assignment( def _run_member(self, project_id, member, intent_id, category, is_initial): try: + seat = getattr(member.deps, "competition_assignment", None) + if seat is not None: + member.deps.competition_store.append_run_event( + seat["run_id"], "member.started", + {"assignment_id": seat["id"], "challenge_id": seat["challenge_id"], + "session_id": seat["session_id"], "member": member.name, + "intent_id": intent_id, "epoch": seat["epoch"]}, + ) return asyncio.run( member.solve_async(project_id, intent_id, category, is_initial=is_initial) ) except Exception as exc: + _recovery_logger.debug('Error handled in _run_member', exc_info=True) self.state.logger.project("member_crash", project_id, member=member.name, error=str(exc)) finally: with self._lock: @@ -1518,18 +1548,18 @@ def _run_platform_verdict(self, project_id: str) -> None: try: self._judge_pending_submissions(project_id) except Exception as exc: + _recovery_logger.debug('Error handled in _run_platform_verdict', exc_info=True) self.state.logger.project( "platform_verdict_crashed", project_id, error=f"{type(exc).__name__}: {exc}", ) - with suppress(Exception): - with self.state.db.connect() as conn: - conn.execute( - "UPDATE flag_submissions SET status = 'unknown' " - "WHERE project_id = %s AND status = 'judging'", - (project_id,), - ) + with suppress(Exception), self.state.db.connect() as conn: + conn.execute( + "UPDATE flag_submissions SET status = 'unknown' " + "WHERE project_id = %s AND status = 'judging'", + (project_id,), + ) finally: with self._lock: self._completing.discard(project_id) @@ -1628,6 +1658,7 @@ def _submit_to_platform(self, client, external_id: str, flag: str) -> tuple[str, except Ret2ShellError as exc: return "unknown", f"platform submit failed: {exc}" except Exception as exc: + _recovery_logger.debug('Error handled in _submit_to_platform', exc_info=True) return "unknown", f"{type(exc).__name__}: {exc}" solved = submission.get("solved") if isinstance(submission, dict) else None if solved is True: @@ -1664,6 +1695,7 @@ def _reject_submission(self, project_id: str, project_row, submission, detail: s source="platform", ) except Exception as exc: + _recovery_logger.debug('Error handled in _reject_submission', exc_info=True) self.state.logger.project( "rejected_flag_memory_failed", project_id, @@ -1709,6 +1741,7 @@ def _drain_postprocess_jobs(self) -> None: try: prepared = self._prepare_postprocess_job(job) except Exception as exc: + _recovery_logger.debug('Error handled in _drain_postprocess_jobs', exc_info=True) heartbeat_stop.set() heartbeat.join() error = f"{type(exc).__name__}: {exc}" @@ -1736,6 +1769,7 @@ def _drain_postprocess_jobs(self) -> None: except PostprocessLeaseLost: self._log_stale_postprocess_job(job, stage="commit") except Exception as exc: + _recovery_logger.debug('Error handled in _drain_postprocess_jobs', exc_info=True) error = f"{type(exc).__name__}: {exc}" with self.state.db.connect() as connection: failed = fail_job(connection, job, error) @@ -1766,6 +1800,7 @@ def _heartbeat_postprocess_job(self, job, stop: threading.Event, lost: threading lease_seconds=self._POSTPROCESS_LEASE_SECONDS, ) except Exception as exc: + _recovery_logger.debug('Error handled in _heartbeat_postprocess_job', exc_info=True) self.state.logger.project( "postprocess_heartbeat_error", job.project_id, @@ -1843,6 +1878,7 @@ def _commit_postprocess_job(self, job, prepared): try: self.state.memory._mirror_to_disk(memory) except Exception as exc: + _recovery_logger.debug('Error handled in _commit_postprocess_job', exc_info=True) self.state.logger.project( "memory_mirror_failed", job.project_id, @@ -1881,9 +1917,11 @@ def _run_loop(self) -> None: try: self._tick() except Exception as exc: + _recovery_logger.debug('Error handled in _run_loop', exc_info=True) try: self.state.logger.project("scheduler_error", "system", error=str(exc)) except Exception: + _recovery_logger.debug('Error handled in _run_loop', exc_info=True) print(f"[ipc-orchestrator] tick failed: {type(exc).__name__}: {exc}", file=sys.stderr, flush=True) self._stop.wait(interval) @@ -1917,6 +1955,7 @@ def _competition_project_ownership( else: terminal.add(row["project_id"]) except Exception: + _recovery_logger.debug('Error handled in _competition_project_ownership', exc_info=True) return set(), set() return active, terminal @@ -1943,6 +1982,7 @@ def _tick(self) -> None: try: self._dispatch_project(summary.id) except Exception as exc: + _recovery_logger.debug('Error handled in _tick', exc_info=True) self.state.logger.project("scheduler_error", summary.id, error=str(exc)) continue if summary.id in competition_terminal_projects: @@ -1967,12 +2007,13 @@ def _tick(self) -> None: continue if self._startup_in_progress(summary.id): continue - if not self.resources.acquire_task(summary.id): + if not self._acquire_task(summary.id): self._queue_project(summary.id) continue try: self._dispatch_project(summary.id) except Exception as exc: + _recovery_logger.debug('Error handled in _tick', exc_info=True) self._mark_project_startup_failure( summary.id, exc, @@ -1987,6 +2028,7 @@ def _schedule_running_recovery(self, project_id: str) -> None: try: future = self.startup_executor.submit(self._recover_running_project, project_id) except Exception as exc: + _recovery_logger.debug('Error handled in _schedule_running_recovery', exc_info=True) with self._lock: self._startup_project_ids.discard(project_id) self._mark_project_startup_failure( @@ -2005,7 +2047,7 @@ def _recover_running_project(self, project_id: str) -> None: try: if not self._ensure_project_lease(project_id): return - if not self.resources.acquire_task(project_id): + if not self._acquire_task(project_id): self._queue_project(project_id) self._set_runtime_phase(project_id, "queued_capacity") self._release_project_lease(project_id) @@ -2033,6 +2075,7 @@ def _recover_running_project(self, project_id: str) -> None: "project_recovered", project_id, instance=self.state.instance_id ) except Exception as exc: + _recovery_logger.debug('Error handled in _recover_running_project', exc_info=True) self._mark_project_startup_failure( project_id, exc, @@ -2235,20 +2278,17 @@ def _drain_pending_projects(self) -> None: if not self._pending_projects: return project_id = self._pending_projects[0] - if not self.resources.can_admit_task(project_id): + if not self._competition_project(project_id) and not self.resources.can_admit_task(project_id): return self._remove_queued_project(project_id) status = self.lifecycle.status(project_id) - if status == "created": + if status == "created" or status == "stopped": self.start_project_async(project_id) - elif status == "stopped": - self.start_project_async(project_id) - elif status == "running": - if ( - not self._startup_in_progress(project_id) - and self._ensure_project_lease(project_id) - ): - self._schedule_running_recovery(project_id) + elif status == "running" and ( + not self._startup_in_progress(project_id) + and self._ensure_project_lease(project_id) + ): + self._schedule_running_recovery(project_id) def _select_member_for_intent(self, project_id: str, detail, intent, active: set[str]) -> str | None: preferred = self._intent_member_candidates(detail, intent) @@ -2419,6 +2459,7 @@ def _reap_finished_futures(self) -> None: try: result = future.result() except Exception as exc: + _recovery_logger.debug('Error handled in _reap_finished_futures', exc_info=True) crashed = True failure_error = f"{type(exc).__name__}: {exc}" self.state.logger.project( @@ -2490,10 +2531,73 @@ def _reap_finished_futures(self) -> None: self.state.logger.project("member_task_concluded", project_id, intent=intent_id, fact=result.fact_id) if result.fact_id is not None: self._broadcast_fact(project_id, result.fact_id, self._intent_worker(project_id, intent_id)) + self._flag_followup_from_fact(project_id, result.fact_id) elif result.status == "flag": self._clear_member_stalls(project_id, intent_id) self.state.logger.project("member_task_flag", project_id, intent=intent_id, flag=result.flag) + def _flag_followup_from_fact(self, project_id: str, fact_id: str) -> None: + """Turn a flag-shaped conclusion into an explicit submit tool task. + + A prose ``conclude`` is evidence only. The follow-up intent keeps the + submission contract enforceable while avoiding an automatic network + submission when a conclusion contains multiple candidates. + """ + with self.state.db.connect() as connection: + connection.execute( + "SELECT id FROM projects WHERE id=%s FOR UPDATE", (project_id,) + ) + row = connection.execute( + "SELECT description FROM facts WHERE project_id=%s AND id=%s", + (project_id, fact_id), + ).fetchone() + if row is None: + return + candidates = sorted(set(re.findall(r"(?:flag|ctf)\{[^}\n]{1,400}\}", row["description"], re.IGNORECASE))) + if len(candidates) != 1: + if len(candidates) > 1: + self.state.logger.project( + "flag.multiple_candidates_in_fact", project_id, fact_id=fact_id, + candidates=len(candidates), + ) + return + candidate = candidates[0] + existing = connection.execute( + "SELECT 1 FROM flag_submissions WHERE project_id=%s AND normalized_flag=%s LIMIT 1", + (project_id, candidate), + ).fetchone() + if existing: + return + description = "Submit the verified flag with the submit_flag tool; do not conclude prose" + open_intent = edge_store.find_similar_open_intent( + connection, project_id, [fact_id], description, + ) + if open_intent is None: + edge_store.create_intent( + connection, project_id, [fact_id], + description, + "orchestrator", + ) + self.state.logger.project( + "flag.found_in_fact_without_submission", project_id, + fact_id=fact_id, candidate=candidate, + ) + competition = connection.execute( + """SELECT c.run_id,c.id AS challenge_id FROM competition_challenges c + WHERE c.project_id=%s ORDER BY c.id LIMIT 1""", + (project_id,), + ).fetchone() + if competition: + connection.execute( + """INSERT INTO competition_run_events (run_id,kind,payload) + VALUES (%s,'flag.found_in_fact_without_submission',%s)""", + (competition["run_id"], Jsonb({ + "challenge_id": competition["challenge_id"], + "fact_id": fact_id, + "candidate": candidate, + })), + ) + def _intent_worker(self, project_id: str, intent_id: str) -> str | None: with self.state.db.connect() as conn: row = edge_store.get_intent(conn, project_id, intent_id) diff --git a/backend/core/postprocess_store.py b/backend/core/postprocess_store.py index 4e7d088..ac01022 100644 --- a/backend/core/postprocess_store.py +++ b/backend/core/postprocess_store.py @@ -4,7 +4,6 @@ from dataclasses import dataclass from typing import Any - POSTPROCESS_KINDS = ("writeup", "memory", "archive") diff --git a/backend/core/resource_manager.py b/backend/core/resource_manager.py index 7a82003..c377600 100644 --- a/backend/core/resource_manager.py +++ b/backend/core/resource_manager.py @@ -15,6 +15,10 @@ def can_admit_task(self, project_id: str) -> bool: def acquire_task(self, project_id: str) -> bool: return self.limiter.acquire(project_id) + def acquire_coordinated_task(self, project_id: str) -> bool: + """Track cleanup for work already admitted by the competition scheduler.""" + return self.limiter.acquire(project_id, externally_scheduled=True) + def reclaim_orphaned_projects(self, active_project_ids: set[str]) -> list[str]: orphaned = sorted(pid for pid in self.pool.active_projects() if pid not in active_project_ids) for project_id in orphaned: diff --git a/backend/core/state.py b/backend/core/state.py index f39ebac..3ec8883 100644 --- a/backend/core/state.py +++ b/backend/core/state.py @@ -1,5 +1,6 @@ from __future__ import annotations +import logging import os import re import shutil @@ -9,9 +10,9 @@ from pathlib import Path from backend.blackboard import graph_store +from backend.blackboard.db import Database from backend.core.config import AppConfig, load_config, save_config from backend.core.logging_util import IPCLogger -from backend.blackboard.db import Database from backend.mcp.mcp_client import MCPRegistry from backend.memory.memory_mcp import build_memory_mcp from backend.memory.memory_store import MemoryStore @@ -20,10 +21,12 @@ from backend.sandbox.container_pool import ContainerPool from backend.sandbox.network_manager import NetworkManager from backend.sandbox.resource_limiter import TaskSlotLimiter -from backend.tools.tool_mcp import build_tool_search_mcp from backend.tools.catalog import ToolCatalog +from backend.tools.tool_mcp import build_tool_search_mcp from backend.tools.tool_registry import ToolRegistry +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) def _env_flag(name: str) -> bool: value = os.environ.get(name, "").strip().lower() @@ -90,8 +93,8 @@ def __init__(self, root: str | Path = ".", config_dir: Path | None = None): self.network = NetworkManager(backend=self.config.runtime.sandbox_backend) self.mcps = MCPRegistry() - from backend.skills.store import SkillStore from backend.skills.mcp import build_skills_mcp + from backend.skills.store import SkillStore self.skills = SkillStore(self.artifact_root / "skills", Path("/opt/ipc-skills")) self.skills.bootstrap() self.mcps.register(build_skills_mcp(self.skills)) @@ -140,12 +143,20 @@ def _clean_runtime_state(self) -> None: def reload_config(self) -> None: self.config = load_config(self.config_dir) self.logger.set_enabled(self.config.log_enabled) + self.limiter.update_limits( + max_concurrent_tasks=self.config.limits.max_concurrent_tasks, + total_cpu=self.config.limits.total_cpu, + ) if self.orchestrator is not None: self.orchestrator.reload_config() def save_config(self) -> None: save_config(self.config, self.config_dir) self.logger.set_enabled(self.config.log_enabled) + self.limiter.update_limits( + max_concurrent_tasks=self.config.limits.max_concurrent_tasks, + total_cpu=self.config.limits.total_cpu, + ) if self.orchestrator is not None: self.orchestrator.reload_config() @@ -164,6 +175,7 @@ def project_log_filename(self, project_id: str) -> str | None: with self.db.connect() as conn: return graph_store.project_log_filename(conn, project_id) except Exception: + _recovery_logger.debug('Error handled in project_log_filename', exc_info=True) return project_id def attachments_dir(self, project_id: str) -> Path: diff --git a/backend/core/validation.py b/backend/core/validation.py new file mode 100644 index 0000000..e0ad4b9 --- /dev/null +++ b/backend/core/validation.py @@ -0,0 +1,5 @@ +"""Validation errors for data received from APIs, providers, and checkpoints.""" + + +class InputValidationError(ValueError): + """Input violates its schema; preserve the ValueError API/recovery contract.""" diff --git a/backend/core/wp_writer.py b/backend/core/wp_writer.py index f149f7b..2fea360 100644 --- a/backend/core/wp_writer.py +++ b/backend/core/wp_writer.py @@ -1,6 +1,7 @@ from __future__ import annotations import json +import logging import os import re import tempfile @@ -10,6 +11,8 @@ from backend.blackboard import graph_store +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) WRITEUP_REQUEST = ( "CTF 题目已解出。请撰写一份 Markdown writeup,并在其中包含一个完整的 Python 利用脚本。" @@ -320,6 +323,7 @@ def _generate_writeup(detail, generator: Callable[[str], str], evidence_logs: Ma try: content = _unwrap_markdown(generator(prompt)) except Exception as exc: + _recovery_logger.debug('Error handled in _generate_writeup', exc_info=True) failures.append(f"generator call {attempt + 1}: {type(exc).__name__}: {exc}") continue errors = validate_writeup(content, expected_flag=detail.project.flag, require_complete=True) diff --git a/backend/mcp/mcp_client.py b/backend/mcp/mcp_client.py index 4193fa7..1c6de38 100644 --- a/backend/mcp/mcp_client.py +++ b/backend/mcp/mcp_client.py @@ -8,12 +8,14 @@ from contextlib import AsyncExitStack, asynccontextmanager from datetime import timedelta from pathlib import Path +from types import TracebackType from typing import Any from mcp import ClientSession, StdioServerParameters, types from mcp.client.stdio import stdio_client from mcp.server.fastmcp import FastMCP from mcp.shared.memory import create_connected_server_and_client_session +from typing_extensions import Self MCPClientTarget = FastMCP | StdioServerParameters @@ -84,7 +86,7 @@ def session(self) -> ClientSession: raise RuntimeError("MCPClient must be used as an async context manager") return self._session - async def __aenter__(self) -> MCPClient: + async def __aenter__(self) -> Self: if self._stack is not None: raise RuntimeError("MCPClient session is already open") stack = AsyncExitStack() @@ -111,7 +113,10 @@ async def __aenter__(self) -> MCPClient: self._session = session return self - async def __aexit__(self, exc_type: Any, exc: Any, tb: Any) -> None: + async def __aexit__( + self, exc_type: type[BaseException] | None, + exc: BaseException | None, tb: TracebackType | None, + ) -> None: stack, self._stack = self._stack, None self._session = None if stack is not None: @@ -156,12 +161,15 @@ def __init__(self, targets: Mapping[str, MCPRegistryTarget]) -> None: self._clients: dict[str, MCPClient] = {} self._open = False - async def __aenter__(self) -> MCPRegistrySession: + async def __aenter__(self) -> Self: await self._stack.__aenter__() self._open = True return self - async def __aexit__(self, exc_type: Any, exc: Any, tb: Any) -> None: + async def __aexit__( + self, exc_type: type[BaseException] | None, + exc: BaseException | None, tb: TracebackType | None, + ) -> None: self._open = False self._clients.clear() await self._stack.__aexit__(exc_type, exc, tb) diff --git a/backend/mcp/mcp_server.py b/backend/mcp/mcp_server.py index b0fef87..29577b6 100644 --- a/backend/mcp/mcp_server.py +++ b/backend/mcp/mcp_server.py @@ -1,9 +1,10 @@ from __future__ import annotations import argparse +from collections.abc import Callable from contextlib import asynccontextmanager from pathlib import Path -from typing import Any, Callable, Literal +from typing import Any, Literal from mcp.server.fastmcp import FastMCP @@ -66,7 +67,10 @@ def build_mcp_server(name: str, root: str | Path = ".", category: str = "misc") lifespan=close_lifespan(store.close), ) if name in {"tool_search", "tools"}: - from backend.tools.tool_mcp import build_category_tools_mcp, build_tool_search_mcp + from backend.tools.tool_mcp import ( + build_category_tools_mcp, + build_tool_search_mcp, + ) from backend.tools.tool_registry import ToolRegistry registry = ToolRegistry().load() diff --git a/backend/mcp/reverse_mcp.py b/backend/mcp/reverse_mcp.py index ff9cce1..50c63c7 100644 --- a/backend/mcp/reverse_mcp.py +++ b/backend/mcp/reverse_mcp.py @@ -2,16 +2,21 @@ import asyncio import json +import logging import os import subprocess import sys import tempfile +from collections.abc import Iterator from pathlib import Path -from typing import Any, Iterator +from typing import Any from backend.mcp.mcp_server import MCPServer, create_mcp_server from backend.mcp.shared import _tool_unavailable +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + _JVM_STARTED = False _DEFAULT_GHIDRA_INSTALL_DIR = Path("/opt/ghidra") _DEFAULT_GHIDRA_JAVA_HOME = Path("/opt/java21") @@ -115,6 +120,7 @@ def _r2_cmd_sync(binary: str, cmd: str) -> dict[str, Any]: handle.quit() return {"available": True, "binary": str(path), "command": cmd, "output": output} except Exception as exc: + _recovery_logger.debug('Error handled in _r2_cmd_sync', exc_info=True) return _tool_unavailable("reverse.r2_cmd", str(exc), binary=binary, command=cmd) @@ -172,6 +178,7 @@ def _r2_decompile_sync(binary: str, function: str) -> dict[str, Any]: "output": output, } except Exception as exc: + _recovery_logger.debug('Error handled in _r2_decompile_sync', exc_info=True) return _tool_unavailable( "reverse.decompile.r2", str(exc), @@ -247,6 +254,7 @@ def _decompile_sync(binary: str, function: str, timeout: int) -> dict[str, Any]: function=function, ) except Exception as exc: + _recovery_logger.debug('Error handled in _decompile_sync', exc_info=True) fallback = _r2_decompile_sync(str(path), function) if fallback.get("available"): return { @@ -276,6 +284,7 @@ def _decompile_all_sync(binary: str, limit: int, timeout: int) -> dict[str, Any] limit=limit, ) except Exception as exc: + _recovery_logger.debug('Error handled in _decompile_all_sync', exc_info=True) return _tool_unavailable("reverse.decompile_all", str(exc), binary=binary) @@ -284,6 +293,7 @@ def _list_functions_sync(binary: str, timeout: int = 90) -> dict[str, Any]: path = _ensure_binary(binary) return _run_ghidra_worker("list_functions", str(path), timeout) except Exception as exc: + _recovery_logger.debug('Error handled in _list_functions_sync', exc_info=True) return _tool_unavailable("reverse.list_functions", str(exc), binary=binary) @@ -294,6 +304,7 @@ def _strings_sync(binary: str, min_len: int, timeout: int = 90) -> dict[str, Any "strings", str(path), timeout, min_len=min_len ) except Exception as exc: + _recovery_logger.debug('Error handled in _strings_sync', exc_info=True) return _tool_unavailable("reverse.strings", str(exc), binary=binary) @@ -310,12 +321,13 @@ def _disassemble_sync( count=count, ) except Exception as exc: + _recovery_logger.debug('Error handled in _disassemble_sync', exc_info=True) return _tool_unavailable("reverse.disassemble", str(exc), binary=binary, address=addr) def _run_command(command: list[str], timeout: int = 60) -> tuple[bool, str]: try: - result = subprocess.run(command, capture_output=True, text=True, timeout=timeout) + result = subprocess.run(command, capture_output=True, text=True, timeout=timeout, check=False) except (OSError, subprocess.TimeoutExpired) as exc: return False, str(exc) output = "\n".join(part for part in (result.stdout, result.stderr) if part).strip() diff --git a/backend/mcp/reverse_worker.py b/backend/mcp/reverse_worker.py index fe940ec..2f70b66 100644 --- a/backend/mcp/reverse_worker.py +++ b/backend/mcp/reverse_worker.py @@ -9,10 +9,13 @@ import argparse import json +import logging import time from pathlib import Path from typing import Any +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) def _remaining(deadline: float) -> int: return max(1, int(deadline - time.monotonic())) @@ -71,6 +74,7 @@ def _run( program, selected, _remaining(deadline) ) except Exception as exc: + _recovery_logger.debug('Error handled in _run', exc_info=True) results.append( { "name": str(selected.getName()), @@ -175,6 +179,7 @@ def main(argv: list[str] | None = None) -> int: project_dir=args.project_dir, ) except Exception as exc: + _recovery_logger.debug('Error handled in main', exc_info=True) result = { "available": False, "error": f"{type(exc).__name__}: {exc}", diff --git a/backend/mcp/shared.py b/backend/mcp/shared.py index 7d029bc..10d5dbe 100644 --- a/backend/mcp/shared.py +++ b/backend/mcp/shared.py @@ -2,15 +2,16 @@ import asyncio import atexit -from collections import deque -from contextlib import asynccontextmanager, suppress -from datetime import datetime, timezone import hashlib import json +import logging import os import re import time import uuid +from collections import deque +from contextlib import asynccontextmanager, suppress +from datetime import datetime, timezone from html.parser import HTMLParser from pathlib import Path from typing import Any, Literal @@ -18,6 +19,8 @@ from backend.mcp.mcp_server import MCPServer, create_mcp_server +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) _SENSITIVE_KEY_RE = re.compile( r"(?:^|[-_])(?:authorization|cookie|password|passwd|proxy-authorization|set-cookie|" @@ -450,6 +453,7 @@ def _request_page_id(self, request: Any) -> str: try: return self.page_id(request.frame.page) except Exception: + _recovery_logger.debug('Error handled in _request_page_id', exc_info=True) return self._active_page_id or "main" def _network_request_allowed(self, request: Any) -> bool: @@ -484,6 +488,7 @@ async def _record_response(self, response: Any) -> None: try: headers = await response.all_headers() except Exception: + _recovery_logger.debug('Error handled in _record_response', exc_info=True) headers = {} content_type = str(headers.get("content-type", "")).split(";", 1)[0].strip().lower() preview = None @@ -499,6 +504,7 @@ async def _record_response(self, response: Any) -> None: self._network_preview_limit, ) except Exception: + _recovery_logger.debug('Error handled in _record_response', exc_info=True) preview = None started = self._request_started.pop(id(request), None) redirected_from = getattr(request, "redirected_from", None) @@ -721,7 +727,7 @@ def _close_browser_at_exit(browser: _BrowserSession) -> None: try: asyncio.run(browser.close()) except Exception: - pass + _recovery_logger.debug('Error handled in _close_browser_at_exit', exc_info=True) def build_browser_mcp(browser: _BrowserSession | None = None) -> MCPServer: @@ -780,6 +786,7 @@ async def navigate( **snapshot, } except Exception as exc: + _recovery_logger.debug('Error handled in navigate', exc_info=True) return _tool_unavailable("browser.navigate", str(exc), url=_redact_url(url), page_id=page_id) @server.tool(name="click", description="Click an element and return the resulting page state.") @@ -790,7 +797,7 @@ async def click(selector: str, page_id: str | None = None) -> dict[str, Any]: try: await page.wait_for_load_state("domcontentloaded", timeout=5000) except Exception: - pass + _recovery_logger.debug('Error handled in click', exc_info=True) return { "available": True, "page_id": _browser_page_id(browser, page), @@ -798,6 +805,7 @@ async def click(selector: str, page_id: str | None = None) -> dict[str, Any]: **await _page_snapshot(page), } except Exception as exc: + _recovery_logger.debug('Error handled in click', exc_info=True) return _tool_unavailable("browser.click", str(exc), selector=selector) @server.tool(name="fill", description="Fill an input or textarea without submitting it.") @@ -813,6 +821,7 @@ async def fill(selector: str, value: str, page_id: str | None = None) -> dict[st "url": page.url, } except Exception as exc: + _recovery_logger.debug('Error handled in fill', exc_info=True) return _tool_unavailable("browser.fill", str(exc), selector=selector) @server.tool(name="press", description="Press a keyboard key on the current page.") @@ -827,6 +836,7 @@ async def press(key: str, page_id: str | None = None) -> dict[str, Any]: **await _page_snapshot(page), } except Exception as exc: + _recovery_logger.debug('Error handled in press', exc_info=True) return _tool_unavailable("browser.press", str(exc), key=key) @server.tool(name="eval_js", description="Evaluate JavaScript in the current page context.") @@ -840,6 +850,7 @@ async def eval_js(script: str, page_id: str | None = None) -> dict[str, Any]: "url": page.url, } except Exception as exc: + _recovery_logger.debug('Error handled in eval_js', exc_info=True) return _tool_unavailable("browser.eval_js", str(exc)) @server.tool(name="get_content", description="Return rendered HTML and visible text for the current page.") @@ -854,6 +865,7 @@ async def get_content(page_id: str | None = None) -> dict[str, Any]: "text": await page.locator("body").inner_text(), } except Exception as exc: + _recovery_logger.debug('Error handled in get_content', exc_info=True) return _tool_unavailable("browser.get_content", str(exc)) @server.tool( @@ -896,6 +908,7 @@ async def screenshot( ) return result except Exception as exc: + _recovery_logger.debug('Error handled in screenshot', exc_info=True) return _tool_unavailable("browser.screenshot", str(exc), path=str(out)) @server.tool( @@ -927,6 +940,7 @@ async def cookies( "cookies": items, } except Exception as exc: + _recovery_logger.debug('Error handled in cookies', exc_info=True) return _tool_unavailable("browser.cookies", str(exc)) @server.tool(name="set_cookie", description="Add or replace a cookie in the persistent browser context.") @@ -968,6 +982,7 @@ async def set_cookie( "cookie": public_cookie, } except Exception as exc: + _recovery_logger.debug('Error handled in set_cookie', exc_info=True) return _tool_unavailable("browser.set_cookie", str(exc), name=name) @server.tool( @@ -1008,6 +1023,7 @@ async def wait_for( **await _page_snapshot(page, max_chars=6000), } except Exception as exc: + _recovery_logger.debug('Error handled in wait_for', exc_info=True) return _tool_unavailable("browser.wait_for", str(exc), page_id=page_id) @server.tool(name="network_log_start", description="Start bounded browser network recording.") @@ -1028,6 +1044,7 @@ async def network_log_start( ) return {"available": True, **result} except Exception as exc: + _recovery_logger.debug('Error handled in network_log_start', exc_info=True) return _tool_unavailable("browser.network_log_start", str(exc), page_id=page_id) @server.tool(name="network_log_list", description="List bounded, redacted network events incrementally.") @@ -1050,6 +1067,7 @@ async def network_log_list( ), } except Exception as exc: + _recovery_logger.debug('Error handled in network_log_list', exc_info=True) return _tool_unavailable("browser.network_log_list", str(exc)) @server.tool(name="network_log_stop", description="Stop browser network recording.") @@ -1057,6 +1075,7 @@ async def network_log_stop() -> dict[str, Any]: try: return {"available": True, **await browser.network_log_stop()} except Exception as exc: + _recovery_logger.debug('Error handled in network_log_stop', exc_info=True) return _tool_unavailable("browser.network_log_stop", str(exc)) @server.tool(name="console_logs", description="List bounded, redacted browser console events.") @@ -1073,6 +1092,7 @@ async def console_logs( **browser.console_logs(after_id=after_id, limit=limit, levels=levels), } except Exception as exc: + _recovery_logger.debug('Error handled in console_logs', exc_info=True) return _tool_unavailable("browser.console_logs", str(exc)) @server.tool(name="page_errors", description="List bounded, redacted uncaught page errors.") @@ -1088,6 +1108,7 @@ async def page_errors( **browser.page_errors(after_id=after_id, limit=limit), } except Exception as exc: + _recovery_logger.debug('Error handled in page_errors', exc_info=True) return _tool_unavailable("browser.page_errors", str(exc)) @server.tool( @@ -1113,6 +1134,7 @@ async def upload_file( ], } except Exception as exc: + _recovery_logger.debug('Error handled in upload_file', exc_info=True) return _tool_unavailable("browser.upload_file", str(exc), selector=selector) @server.tool( @@ -1142,7 +1164,7 @@ async def download( try: await page.goto(url, wait_until="commit", timeout=timeout_ms) except Exception: - pass + _recovery_logger.debug('Error handled in download', exc_info=True) item = await download_info.value suggested_name = Path(str(getattr(item, "suggested_filename", "download"))).name suffix = Path(suggested_name).suffix @@ -1166,6 +1188,7 @@ async def download( **artifact, } except Exception as exc: + _recovery_logger.debug('Error handled in download', exc_info=True) return _tool_unavailable("browser.download", str(exc), page_id=page_id) return server diff --git a/backend/members/adapters.py b/backend/members/adapters.py index e58d0cb..63aee49 100644 --- a/backend/members/adapters.py +++ b/backend/members/adapters.py @@ -2,6 +2,7 @@ import ast import json +import logging import random import re import time @@ -12,6 +13,10 @@ from urllib.parse import urlsplit, urlunsplit from backend.core.config import LLMConfig +from backend.core.validation import InputValidationError + +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) ACTION_KINDS = ( "tool", @@ -40,7 +45,7 @@ class MemberAction: @classmethod def from_obj(cls, obj: dict[str, Any]) -> MemberAction: if not isinstance(obj, dict): - raise ValueError(f"model action must be a JSON object, got {type(obj).__name__}") + raise InputValidationError(f"model action must be a JSON object, got {type(obj).__name__}") raw_kind = obj.get("action") or obj.get("kind") kind = raw_kind.strip() if isinstance(raw_kind, str) else raw_kind if kind not in ACTION_KINDS: @@ -323,6 +328,7 @@ def health(self) -> dict: "retryable": exc.retryable, } except Exception as exc: + _recovery_logger.debug('Error handled in health', exc_info=True) return {"ok": False, "status": 0, "error": str(exc), "format": self.config.api_format} def decide(self, context: dict) -> MemberAction: @@ -599,7 +605,7 @@ def _openai_request_body( def _openai_response_text(payload: Any, surface: str) -> tuple[str, dict[str, Any]]: if not isinstance(payload, dict): - raise ValueError(f"LLM response must be a JSON object, got {type(payload).__name__}") + raise InputValidationError(f"LLM response must be a JSON object, got {type(payload).__name__}") if isinstance(payload.get("choices"), list): return _chat_response_text(payload) if surface == "responses" or isinstance(payload.get("output"), list): @@ -774,6 +780,7 @@ def _response_error_text(response: Any) -> str: value = response.json() return json.dumps(value, ensure_ascii=False)[:4000].lower() except Exception: + _recovery_logger.debug('Error handled in _response_error_text', exc_info=True) return str(getattr(response, "text", ""))[:4000].lower() @@ -1046,6 +1053,7 @@ def health(self) -> dict: "retryable": exc.retryable, } except Exception as exc: + _recovery_logger.debug('Error handled in health', exc_info=True) return {"ok": False, "status": 0, "error": str(exc), "format": self.config.api_format} def decide(self, context: dict) -> MemberAction: diff --git a/backend/members/base_member.py b/backend/members/base_member.py index 90ddee4..d5786d0 100644 --- a/backend/members/base_member.py +++ b/backend/members/base_member.py @@ -3,15 +3,27 @@ import asyncio import hashlib import json +import logging import re import shlex import threading from collections import deque +from collections.abc import Callable from dataclasses import dataclass from typing import Any -from collections.abc import Callable +from backend.agent.jobs import INLINE_LIMIT +from backend.agent.runtime import AgentRuntime, AgentSessionWriter +from backend.agent.session import ( + AgentSessionStore, + SessionConflict, + SessionNeedsRebuild, +) from backend.blackboard import edge_store, graph_store, node_store +from backend.competition.conversation import ConversationAdapter, ToolCall +from backend.competition.runtime import SessionRunner +from backend.competition.store import CompetitionConflict +from backend.competition.transport import ReconSubscriber from backend.core.difficulty import ( DIFFICULTY_RANK, detect_attack_surfaces, @@ -19,13 +31,11 @@ max_difficulty, normalize_difficulty, ) -from backend.core.logging_util import IPCLogger from backend.core.ipc import FlagConflictError, submit_flag_candidate +from backend.core.logging_util import IPCLogger from backend.core.postprocess_store import enqueue_postprocess +from backend.core.validation import InputValidationError from backend.mcp.mcp_client import MCPRegistry, MCPRegistrySession, MCPRegistryTarget -from backend.agent.jobs import INLINE_LIMIT -from backend.agent.runtime import AgentRuntime, AgentSessionWriter -from backend.agent.session import AgentSessionStore, SessionConflict, SessionNeedsRebuild from backend.members.adapters import ( ACTION_KINDS, BaseAdapter, @@ -33,10 +43,6 @@ MemberAction, ProviderError, ) -from backend.competition.runtime import SessionRunner -from backend.competition.store import CompetitionConflict -from backend.competition.conversation import ConversationAdapter, ToolCall -from backend.competition.transport import ReconSubscriber from backend.members.member_tools import ( MEMBER_TOOLS, action_payload, @@ -47,10 +53,16 @@ from backend.memory.memory_store import MemoryStore from backend.sandbox.command_policy import host_path_violation from backend.sandbox.sandbox import Sandbox +from backend.tools.tool_inventory import ( + member_tool_inventory, + member_tool_inventory_path, +) from backend.tools.tool_mcp import build_category_tools_mcp, build_tool_search_mcp -from backend.tools.tool_inventory import member_tool_inventory, member_tool_inventory_path from backend.tools.tool_registry import LANGUAGES, PUBLIC_MCPS, ToolRegistry +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + _LOCAL_WEBUI_URL_RE = re.compile(r"https?://(?:127\.0\.0\.1|localhost|0\.0\.0\.0):(\d{2,5})\b") _PORT_FLAG_RE = re.compile(r"(?:^|\s)(?:--port|-p)\s+(\d{2,5})(?:\s|$)") _WEBUI_HINT_RE = re.compile(r"\b(webui|gradio|streamlit|jupyter|flask|uvicorn)\b", re.IGNORECASE) @@ -210,6 +222,7 @@ def _renew_session_writer(self, runner=None) -> bool: try: return bool(renew()) except Exception: + _recovery_logger.debug('Error handled in _renew_session_writer', exc_info=True) return False def _record_competition_event(self, callback) -> bool: @@ -220,6 +233,7 @@ def _record_competition_event(self, callback) -> bool: callback(runner) return True except Exception as exc: + _recovery_logger.debug('Error handled in _record_competition_event', exc_info=True) self._session_recording_failed = True self._stop.set() self.deps.logger.project( @@ -371,6 +385,7 @@ async def _solve_with_mcp( f"Begin the persistent {category} challenge session for intent {intent_id}." ) except Exception as exc: + _recovery_logger.debug('Error handled in _solve_with_mcp', exc_info=True) self._session_recording_failed = True d.logger.project( "competition_session_restore_failed", @@ -451,6 +466,7 @@ async def _solve_with_mcp( error_kind="provider", ) except Exception as exc: + _recovery_logger.debug('Error handled in _solve_with_mcp', exc_info=True) error = f"{type(exc).__name__}: {exc}" d.logger.project( "member_error", @@ -539,7 +555,7 @@ async def _solve_with_mcp( self._observe("[previous competition tool call is unknown; do not replay it]") continue if not self._record_competition_event( - lambda runner: runner.record_provider_message( + lambda runner, action=action, call_id=call_id: runner.record_provider_message( {"role": "assistant", "content": json.dumps( {"action": action.kind, "arguments": action.args}, ensure_ascii=False, @@ -551,7 +567,7 @@ async def _solve_with_mcp( self._release(project_id, intent_id) return SolveResult(status="stalled", steps=step, error="session lease lost") if not self._record_competition_event( - lambda runner: runner.record_tool_call(session_call) + lambda runner, session_call=session_call: runner.record_tool_call(session_call) ): self._release(project_id, intent_id) return SolveResult(status="stalled", steps=step, error="session lease lost") @@ -608,7 +624,7 @@ async def _solve_with_mcp( "terminal": dispatched.result.status if dispatched.result else None, } if not self._record_competition_event( - lambda runner: runner.record_tool_result( + lambda runner, result_payload=result_payload, session_call=session_call: runner.record_tool_result( session_call, { "role": "tool", @@ -771,30 +787,30 @@ def _make_native_runner( max_output_tokens=getattr(runtime_config, "max_output_tokens", 32768), read_timeout=getattr(runtime_config, "provider_read_timeout", 300), ) - kwargs = dict( - system=( + kwargs = { + "system": ( f"You are Member {self.name}, a persistent {self.role_blurb}. " "Each action is its own tool; call the one that matches what " "you want to do. Read-only tools may be called together in one " "turn. Continue until the challenge is solved, a real flag is " "verified, or evidence is genuinely exhausted." ), - tools=tools, - cancel=self._stop, - emit=lambda text: self.deps.logger.llm( + "tools": tools, + "cancel": self._stop, + "emit": lambda text: self.deps.logger.llm( "stream", self._progress_project_id or "unknown", member=self.name, text=text[:2000], ), - before_turn=self._drain_competition_recon, - compressor=self._semantic_compressor(), - context_token_limit=getattr(runtime_config, "context_token_limit", 0), - compaction_trigger_ratio=getattr( + "before_turn": self._drain_competition_recon, + "compressor": self._semantic_compressor(), + "context_token_limit": getattr(runtime_config, "context_token_limit", 0), + "compaction_trigger_ratio": getattr( runtime_config, "compaction_trigger_ratio", 0.75 ), - max_turns=getattr(runtime_config, "max_turns", 0), - parallel_safe=is_parallel_safe, - is_terminal=is_terminal, - ) + "max_turns": getattr(runtime_config, "max_turns", 0), + "parallel_safe": is_parallel_safe, + "is_terminal": is_terminal, + } assignment = self.deps.competition_assignment if assignment is not None and self.deps.competition_store is not None: return SessionRunner( @@ -876,6 +892,7 @@ async def _solve_with_native_session( try: runner = self._make_native_runner(list(MEMBER_TOOLS), project_id, intent_id) except Exception as exc: + _recovery_logger.debug('Error handled in _solve_with_native_session', exc_info=True) self._release(project_id, intent_id) return SolveResult( status="failed", steps=0, error=str(exc), @@ -1073,6 +1090,7 @@ async def execute(_self, name, arguments, *, idempotency_key): retryable=True, error_kind="session_rebuild", ) except Exception as exc: + _recovery_logger.debug('Error handled in _solve_with_native_session', exc_info=True) self._release(project_id, intent_id) self.deps.logger.project( "member_error", project_id, member=self.name, intent=intent_id, @@ -1213,6 +1231,7 @@ async def _dispatch( try: out = await mcp_session.call_tool(server, tool, args) except Exception as exc: + _recovery_logger.debug('Error handled in _dispatch', exc_info=True) out = {"error": str(exc)} text = f"[mcp:{server}.{tool}] {out}"[:5000] self._observe(text) @@ -1329,6 +1348,7 @@ def _heartbeat(self, project_id, intent_id) -> bool: self.deps.lease_token = token return True except Exception as exc: + _recovery_logger.debug('Error handled in _heartbeat', exc_info=True) self.deps.logger.project( "intent_heartbeat_failed", project_id, @@ -1362,9 +1382,10 @@ def _restore_progress(self, project_id: str, intent_id: str) -> None: raw = self.deps.sandbox.read_file(self._progress_path) parsed = json.loads(raw) if raw else [] if not isinstance(parsed, list): - raise ValueError("progress checkpoint must contain a JSON array") + raise InputValidationError("progress checkpoint must contain a JSON array") self.observations = [str(item)[:5000] for item in parsed if str(item).strip()][-8:] except Exception as exc: + _recovery_logger.debug('Error handled in _restore_progress', exc_info=True) self.deps.logger.project( "member_progress_restore_failed", project_id, @@ -1392,6 +1413,7 @@ def _persist_progress(self) -> None: json.dumps(self.observations[-8:], ensure_ascii=False), ) except Exception as exc: + _recovery_logger.debug('Error handled in _persist_progress', exc_info=True) if self._container_gone(exc): self._progress_save_error_reported = True self.deps.logger.project( @@ -1440,6 +1462,7 @@ def _seed_tool_inventory(self, project_id: str) -> None: member_tool_inventory().rstrip() + "\n\n" + self._runtime_tool_inventory_note(), ) except Exception as exc: + _recovery_logger.debug('Error handled in _seed_tool_inventory', exc_info=True) self.deps.logger.project( "member_tool_inventory_seed_failed", project_id, @@ -1463,6 +1486,7 @@ def _prime_tool_context(self, project_id: str, intent_id: str, category: str) -> query, available_mcps=self._available_mcp_names() )[:5] except Exception as exc: + _recovery_logger.debug('Error handled in _prime_tool_context', exc_info=True) self.deps.logger.project( "member_tool_context_prime_failed", project_id, @@ -1506,6 +1530,7 @@ def _probe_cli_tools(self) -> dict[str, bool]: availability = {str(k): bool(v) for k, v in parsed.items()} break except Exception: + _recovery_logger.debug('Error handled in _probe_cli_tools', exc_info=True) availability = {} self._tool_availability = availability return availability @@ -2197,11 +2222,11 @@ def _build_context(self, project_id, intent_id, category, step, is_initial, eval attachment["path"] = attachment_path(attachment["filename"], attachment["path"]) runtime_notes = [ "All work happens inside this challenge's Linux task container. Only container paths exist.", - "Never touch host paths: no Windows drive paths, no /host, no host interpreter, and no path " + ("Never touch host paths: no Windows drive paths, no /host, no host interpreter, and no path " "inside the IPC deployment itself (source tree, data/, artifacts/, exports/, writeups, .qa-artifacts). " - "Reading a solution or writeup file instead of solving the challenge invalidates the run.", - "If a CLI tool or Python library is missing, use the install action to add it to this container " - "(manager: apt|pip|gem|npm|go), then retry. Do not substitute a host tool.", + "Reading a solution or writeup file instead of solving the challenge invalidates the run."), + ("If a CLI tool or Python library is missing, use the install action to add it to this container " + "(manager: apt|pip|gem|npm|go), then retry. Do not substitute a host tool."), "Flag search priority for this round: try /flag first, then environment variables, then other methods.", "If attachment_true is true, inspect the listed attachments before blind target probing.", ( @@ -2225,7 +2250,7 @@ def _build_context(self, project_id, intent_id, category, step, is_initial, eval "fragments) and only report a flag that reads as a coherent whole." ) except Exception: - pass + _recovery_logger.debug('Error handled in _build_context', exc_info=True) return { "role": self.name, "role_blurb": self.role_blurb, @@ -2234,7 +2259,9 @@ def _build_context(self, project_id, intent_id, category, step, is_initial, eval "max_steps": None if d.continuous else min(d.max_steps, d.max_actions_per_task), "short_task": not d.continuous, "task_contract": ( - "Continue this challenge session until there is a verified result, an operator cancellation, " + "A flag is not submitted by writing it in conclude text. Whenever you have a flag, you MUST call " + "submit_flag with the exact candidate and evidence before concluding; conclude text alone is never " + "a submission. Continue this challenge session until there is a verified result, an operator cancellation, " "a lost lease, or concrete evidence that a different direction or helper is required. " "There is no artificial step budget. Do not repeat previous attempts." if d.continuous else @@ -2306,6 +2333,7 @@ def _observe_webui_links(self, project_id: str, command: str, stdout: str, stder try: url = expose(project_id, self.name, port) except Exception: + _recovery_logger.debug('Error handled in _observe_webui_links', exc_info=True) continue self._observe( f"[webui:{port}] Shared browser URL: {url}/ " diff --git a/backend/members/member_tools.py b/backend/members/member_tools.py index d5f3edc..beb97ea 100644 --- a/backend/members/member_tools.py +++ b/backend/members/member_tools.py @@ -26,6 +26,8 @@ from typing import Any +from backend.core.validation import InputValidationError + TERMINAL_TOOLS = frozenset({"submit_flag", "conclude", "give_up"}) PARALLEL_SAFE_TOOLS = frozenset({"memory_search", "tool_search", "job_status", "job_logs"}) @@ -234,7 +236,7 @@ def tool_call_for_action(action: dict[str, Any]) -> tuple[str, dict[str, Any]]: rides along because every tool schema accepts it. """ if not isinstance(action, dict): - raise ValueError(f"action must be a dict, got {type(action).__name__}") + raise InputValidationError(f"action must be a dict, got {type(action).__name__}") kind = action.get("action") or action.get("kind") if kind not in ACTION_TOOLS: raise ValueError(f"no native tool maps to action kind: {kind!r}") @@ -243,14 +245,14 @@ def tool_call_for_action(action: dict[str, Any]) -> tuple[str, dict[str, Any]]: __all__ = [ + "ACTION_TOOLS", "MEMBER_TOOLS", "MEMBER_TOOL_NAMES", "PARALLEL_SAFE_TOOLS", "TERMINAL_TOOLS", "TOOL_ACTIONS", - "ACTION_TOOLS", "action_payload", - "tool_call_for_action", "is_parallel_safe", "is_terminal", + "tool_call_for_action", ] diff --git a/backend/memory/memory_mcp.py b/backend/memory/memory_mcp.py index 1ab50f6..356dcec 100644 --- a/backend/memory/memory_mcp.py +++ b/backend/memory/memory_mcp.py @@ -1,7 +1,8 @@ from __future__ import annotations import asyncio -from typing import Any, Callable, Literal +from collections.abc import Callable +from typing import Any, Literal from backend.mcp.mcp_server import MCPServer, create_mcp_server from backend.memory.memory_search import search diff --git a/backend/memory/memory_store.py b/backend/memory/memory_store.py index ba46d95..fbb4a29 100644 --- a/backend/memory/memory_store.py +++ b/backend/memory/memory_store.py @@ -8,7 +8,6 @@ from backend.persistence.database import Database, PostgresDatabase - CATEGORIES = ("knowledge", "tool_usage", "exploit", "lessons") diff --git a/backend/ops/attachments.py b/backend/ops/attachments.py index 2f031e6..9f8f08e 100644 --- a/backend/ops/attachments.py +++ b/backend/ops/attachments.py @@ -7,7 +7,6 @@ from pathlib import Path from typing import BinaryIO - UPLOAD_ID_RE = re.compile(r"^upload_[a-f0-9]{24}$") MAX_UPLOAD_BYTES = 20 * 1024 * 1024 MAX_CONTEXT_BYTES = 120_000 diff --git a/backend/ops/ipc_mcp.py b/backend/ops/ipc_mcp.py index 157ced5..2dd5273 100644 --- a/backend/ops/ipc_mcp.py +++ b/backend/ops/ipc_mcp.py @@ -1,13 +1,13 @@ from __future__ import annotations +import logging import re import threading from collections.abc import Callable from typing import Any -from mcp.server.transport_security import TransportSecuritySettings - from mcp.server.fastmcp import Context +from mcp.server.transport_security import TransportSecuritySettings from backend.blackboard import edge_store, graph_store from backend.core.config import CATEGORIES @@ -26,6 +26,9 @@ from backend.ops.store import OpsStore from backend.ops.tools import OpsToolError, OpsToolExecutor +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + _SESSION_ID_RE = re.compile(r"^ops_[a-f0-9]{16}$") _SENSITIVE_FIELD_RE = re.compile( r"(?i)\b(?:authorization|api[ _-]?key|token|cookie|password|secret)\b\s*[:=]\s*[^\s,;]+" @@ -598,5 +601,6 @@ def _session_id_from_context(ctx: Context | None) -> str | None: headers = getattr(request, "headers", None) value = headers.get("x-ipc-ops-session", "") if headers is not None else "" except Exception: + _recovery_logger.debug('Error handled in _session_id_from_context', exc_info=True) return None return value if isinstance(value, str) and _SESSION_ID_RE.fullmatch(value) else None diff --git a/backend/ops/models.py b/backend/ops/models.py index d8b8073..4744114 100644 --- a/backend/ops/models.py +++ b/backend/ops/models.py @@ -94,6 +94,7 @@ class ChallengeMappingSpec(BaseModel): attachments_field: str = "files" remote_field: str = "" solved_field: str = "" + score_field: str = "score" hints_field: str = "" level: int = Field(default=1, ge=1, le=1000) track_id: str = "" @@ -133,6 +134,7 @@ def validate_attachment_base_url(cls, value: str) -> str: "attachments_field", "remote_field", "solved_field", + "score_field", "hints_field", "level_field", "track_id_field", @@ -165,6 +167,7 @@ def to_field_mapping(self, headers: dict[str, str]) -> FieldMapping: attachments_field=self.attachments_field, remote_field=self.remote_field, solved_field=self.solved_field, + score_field=self.score_field, hints_field=self.hints_field, level=self.level, track_id=self.track_id, @@ -243,6 +246,9 @@ class PlatformWorkflowSpec(BaseModel): competition_id: str = Field(default="", max_length=256) team_id: str = Field(default="", max_length=256) ends_at: str = "" + # Maximum number of container challenges this run may execute in parallel. + # ``remote_instance_limit`` remains accepted for older workflow drafts. + remote_concurrency: int = Field(default=0, ge=0, le=100) remote_instance_limit: int = Field(default=0, ge=0, le=100) challenges: ChallengeMappingSpec submit: FlagSubmitSpec | None = None @@ -252,7 +258,12 @@ class PlatformWorkflowSpec(BaseModel): @field_validator("name") @classmethod def validate_name(cls, value: str) -> str: - return value.strip() + value = value.strip() + if not value: + raise ValueError("workflow name must be the actual competition name") + if value.casefold() in {"proposed", "probe", "workflow", "new workflow"}: + raise ValueError("workflow name must be the actual competition name, not a placeholder") + return value @field_validator("ends_at") @classmethod diff --git a/backend/ops/network.py b/backend/ops/network.py index 98c648f..77f77f8 100644 --- a/backend/ops/network.py +++ b/backend/ops/network.py @@ -90,7 +90,7 @@ def _resolved_address(self, parsed) -> str: raise NetworkPolicyError( f"workflow hostname resolves to a non-public address: {parsed.hostname}" ) - return sorted(addresses)[0] + return min(addresses) def _resolve_addresses(self, hostname: str, port: int | None, scheme: str) -> set[str]: effective_port = port or (443 if scheme == "https" else 80) @@ -164,5 +164,6 @@ def _pinned_request( response.reason = raw.reason response.encoding = requests.utils.get_encoding_from_headers(response.headers) if not stream: - response.content + # Materialize the body before the connection is returned to the pool. + _ = response.content return response diff --git a/backend/ops/questions.py b/backend/ops/questions.py index b2b1150..f0e1e9f 100644 --- a/backend/ops/questions.py +++ b/backend/ops/questions.py @@ -4,7 +4,7 @@ from backend.competition.store import CompetitionConflict, new_id from backend.ops.models import validate_secret_name -from backend.ops.store import OpsStore +from backend.ops.store import OpsStore, WorkflowSessionConflict class QuestionStore: @@ -27,6 +27,14 @@ def create(self, *, session_id: str, operation_key: str, title: str, with self.state.db.connect() as connection: if not connection.execute("SELECT id FROM sessions WHERE id=%s", (session_id,)).fetchone(): raise ValueError("question session not found") + if workflow_id: + bound = connection.execute( + "SELECT agent_workflow_id FROM sessions WHERE id=%s", (session_id,) + ).fetchone() + if bound and bound["agent_workflow_id"] and bound["agent_workflow_id"] != workflow_id: + raise WorkflowSessionConflict( + "question targets another workflow; create a new Ops session" + ) connection.execute("SELECT pg_advisory_xact_lock(hashtext(%s))", (scoped_key,)) old = connection.execute("SELECT * FROM competition_questions WHERE operation_key=%s", (scoped_key,)).fetchone() if old: diff --git a/backend/ops/service.py b/backend/ops/service.py index 5d32ba4..dca8d9c 100644 --- a/backend/ops/service.py +++ b/backend/ops/service.py @@ -1,6 +1,6 @@ from __future__ import annotations -import json +import logging import re import secrets import shutil @@ -13,17 +13,10 @@ import requests +from backend.agent.session import AgentSessionStore from backend.blackboard import graph_store from backend.core.state import AppState -from backend.members.adapters import health_check, make_adapter -from backend.ops.models import ( - PlatformWorkflowSpec, - SecretHeader, - render_template, - validate_secret_name, -) -from backend.ops.network import WorkflowHttpClient -from backend.agent.session import AgentSessionStore +from backend.members.adapters import health_check from backend.ops.agent_bridge import ( PROPOSE_WORKFLOW_TOOL, OpsToolBridge, @@ -32,11 +25,21 @@ redact, ) from backend.ops.attachments import OpsAttachmentStore -from backend.ops.store import OpsStore +from backend.ops.models import ( + PlatformWorkflowSpec, + SecretHeader, + render_template, + validate_secret_name, +) +from backend.ops.network import WorkflowHttpClient +from backend.ops.store import OpsStore, WorkflowSessionConflict from backend.ops.tools import OpsToolError, OpsToolExecutor from backend.platform.adapter import PlatformAdapter from backend.platform.factory import build_adapter +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + _RUN_ID_RE = re.compile(r"^run_[A-Za-z0-9_-]{8,128}$") _SYSTEM_PROMPT = """\ @@ -84,6 +87,10 @@ class WorkflowConfirmationError(OpsAgentError): pass +class WorkflowSessionError(OpsAgentError): + pass + + class _OpsRunInterrupted(OpsAgentError): """Internal control flow used by API-backed IPC runs.""" @@ -139,7 +146,7 @@ def write(self, kind: str, text: str) -> None: or time.monotonic() >= self._deadline ) if ready: - keep = self._hold if self._hold < len(self._buffer) else len(self._buffer) + keep = min(len(self._buffer), self._hold) chunk = self._buffer[: len(self._buffer) - keep] if chunk: pending.append((kind, chunk)) @@ -167,6 +174,9 @@ def __init__(self, state: AppState) -> None: self._run_condition = threading.Condition() self._run_threads: dict[str, threading.Thread] = {} self._run_threads_lock = threading.Lock() + # Remove only unreferenced historical drafts; session-bound and + # run-referenced workflows remain available for audit/replay. + self.store.cleanup_duplicate_workflows() self._recover_stale_runs() def _recover_stale_runs(self) -> None: @@ -299,6 +309,8 @@ def _workflow_context(self, workflow_id: str | None) -> str: except KeyError: return "" spec = workflow.get("spec") or {} + if hasattr(spec, "model_dump"): + spec = spec.model_dump(mode="json") challenges = spec.get("challenges") or {} if isinstance(spec, dict) else {} submit = spec.get("submit") or {} if isinstance(spec, dict) else {} lines = [ @@ -342,6 +354,11 @@ def chat( session_id = self.store.create_session(_session_title(safe_message))["id"] else: self.store.get_session(session_id) + if workflow_id: + try: + self.store.bind_agent_workflow(session_id, workflow_id) + except WorkflowSessionConflict as exc: + raise WorkflowSessionError(str(exc)) from exc if normalized_secrets: self.store.save_session_secrets(session_id, normalized_secrets) @@ -400,7 +417,10 @@ def _save_workflow_proposal( self, spec_data: dict[str, Any], session_id: str ) -> dict[str, Any]: spec = PlatformWorkflowSpec.model_validate(spec_data) - workflow = self.store.create_workflow(spec, session_id=session_id, source="agent") + try: + workflow = self.store.update_session_workflow(session_id, spec) + except WorkflowSessionConflict as exc: + raise WorkflowSessionError(str(exc)) from exc return self.workflow_view(workflow) def _chat_with_api( @@ -609,6 +629,11 @@ def _start_api_run( session_id = self.store.create_session(_session_title(safe_message))["id"] else: self.store.get_session(session_id) + if workflow_id: + try: + self.store.bind_agent_workflow(session_id, workflow_id) + except WorkflowSessionConflict as exc: + raise WorkflowSessionError(str(exc)) from exc run_id = f"run_{secrets.token_hex(16)}" self.store.create_run(session_id, run_id) @@ -693,6 +718,7 @@ def _run_api_background( response = self._finish_interrupted_api_chat(session_id=session_id) self.store.finish_run(run_id, status="interrupted", response=response) except Exception as exc: + _recovery_logger.debug('Error handled in _run_api_background', exc_info=True) safe_error = _replace_secret_values(str(exc), redaction_values).strip() if not safe_error: safe_error = "IPC API run failed" @@ -961,6 +987,7 @@ def workflow_view(self, workflow: dict[str, Any]) -> dict[str, Any]: "competition_id": spec.competition_id, "team_id": spec.team_id, "ends_at": spec.ends_at, + "remote_concurrency": spec.remote_concurrency, "remote_instance_limit": spec.remote_instance_limit, "challenges": challenge_view, "submit": submit_view, @@ -1036,6 +1063,7 @@ def _import( raise ValueError(f"unknown external_id values: {missing}") selected = [by_id[external_id] for external_id in select] from tempfile import TemporaryDirectory + from backend.platform.downloads import stage_challenges imported: list[dict[str, Any]] = [] diff --git a/backend/ops/store.py b/backend/ops/store.py index 41c0a14..0580ba1 100644 --- a/backend/ops/store.py +++ b/backend/ops/store.py @@ -11,10 +11,11 @@ from pathlib import Path from typing import Any +from psycopg.errors import UniqueViolation + from backend.core.config import LLMConfig from backend.ops.models import PlatformWorkflowSpec, validate_secret_name from backend.persistence.database import Database, PostgresDatabase -from psycopg.errors import UniqueViolation _RUN_ID_RE = re.compile(r"^run_[A-Za-z0-9_-]{8,128}$") _TERMINAL_RUN_STATUSES = {"completed", "interrupted", "error", "abandoned"} @@ -24,6 +25,10 @@ class WorkflowInUse(RuntimeError): """A workflow still referenced by a competition run cannot be deleted.""" +class WorkflowSessionConflict(RuntimeError): + """An Ops conversation attempted to switch its bound workflow.""" + + class OpsStore: def __init__( self, @@ -120,7 +125,7 @@ def create_session(self, title: str) -> dict[str, str]: session_id = f"ops_{secrets.token_hex(8)}" with self._lock, self._connect() as connection: connection.execute( - "INSERT INTO sessions (id, title, created_at, updated_at) VALUES (%s, %s, %s, %s)", + "INSERT INTO sessions (id, title, created_at, updated_at, agent_workflow_id) VALUES (%s, %s, %s, %s, NULL)", (session_id, title[:120] or "New conversation", now, now), ) return self.get_session(session_id) @@ -128,7 +133,7 @@ def create_session(self, title: str) -> dict[str, str]: def get_session(self, session_id: str) -> dict[str, str]: with self._lock, self._connect() as connection: row = connection.execute( - "SELECT id, title, created_at, updated_at FROM sessions WHERE id = %s", + "SELECT id, title, created_at, updated_at, agent_workflow_id FROM sessions WHERE id = %s", (session_id,), ).fetchone() if row is None: @@ -138,7 +143,7 @@ def get_session(self, session_id: str) -> dict[str, str]: def list_sessions(self) -> list[dict[str, str]]: with self._lock, self._connect() as connection: rows = connection.execute( - "SELECT id, title, created_at, updated_at FROM sessions ORDER BY updated_at DESC" + "SELECT id, title, created_at, updated_at, agent_workflow_id FROM sessions ORDER BY updated_at DESC" ).fetchall() return [dict(row) for row in rows] @@ -160,6 +165,40 @@ def agent_session_id(self, session_id: str) -> str | None: value = row["agent_session_id"] if row is not None else None return str(value) if value else None + def agent_workflow_id(self, session_id: str) -> str | None: + """Return the workflow permanently associated with an Ops session.""" + self.get_session(session_id) + with self._lock, self._connect() as connection: + row = connection.execute( + "SELECT agent_workflow_id FROM sessions WHERE id = %s", (session_id,) + ).fetchone() + value = row["agent_workflow_id"] if row is not None else None + return str(value) if value else None + + def bind_agent_workflow(self, session_id: str, workflow_id: str) -> str: + """Bind a session once; switching workflows requires a new session.""" + self.get_session(session_id) + workflow_id = str(workflow_id or "").strip() + if not workflow_id: + raise ValueError("workflow_id is required") + with self._lock, self._connect() as connection: + if not connection.execute("SELECT 1 FROM workflows WHERE id=%s", (workflow_id,)).fetchone(): + raise KeyError(workflow_id) + row = connection.execute( + "SELECT agent_workflow_id FROM sessions WHERE id=%s FOR UPDATE", + (session_id,), + ).fetchone() + current = row["agent_workflow_id"] if row else None + if current and str(current) != workflow_id: + raise WorkflowSessionConflict( + "this Ops session is already bound to another workflow; create a new session" + ) + connection.execute( + "UPDATE sessions SET agent_workflow_id=%s,updated_at=%s WHERE id=%s", + (workflow_id, _now(), session_id), + ) + return workflow_id + def set_agent_session_id(self, session_id: str, agent_session_id: str | None) -> None: self.get_session(session_id) value = str(agent_session_id).strip() if agent_session_id else None @@ -462,6 +501,15 @@ def create_workflow( workflow_id = f"wf_{secrets.token_hex(8)}" spec_json, digest = _serialize_spec(spec) with self._lock, self._connect() as connection: + if session_id is not None: + bound = connection.execute( + "SELECT agent_workflow_id FROM sessions WHERE id=%s FOR UPDATE", + (session_id,), + ).fetchone() + if bound and bound["agent_workflow_id"]: + raise WorkflowSessionConflict( + "this Ops session is already bound to another workflow; create a new session" + ) connection.execute( """ INSERT INTO workflows ( @@ -471,6 +519,11 @@ def create_workflow( """, (workflow_id, session_id, source, spec.name, spec_json, digest, now, now), ) + if session_id is not None: + connection.execute( + "UPDATE sessions SET agent_workflow_id=%s,updated_at=%s WHERE id=%s", + (workflow_id, now, session_id), + ) if session_id is not None: session_values = self._secret_namespace("sessions", session_id) selected = { @@ -501,6 +554,13 @@ def update_workflow(self, workflow_id: str, spec: PlatformWorkflowSpec) -> dict[ raise KeyError(workflow_id) return self.get_workflow(workflow_id) + def update_session_workflow(self, session_id: str, spec: PlatformWorkflowSpec) -> dict[str, Any]: + """Create the first proposal or update the workflow already bound to a session.""" + bound = self.agent_workflow_id(session_id) + if bound: + return self.update_workflow(bound, spec) + return self.create_workflow(spec, session_id=session_id, source="agent") + def get_workflow(self, workflow_id: str) -> dict[str, Any]: with self._lock, self._connect() as connection: row = connection.execute("SELECT * FROM workflows WHERE id = %s", (workflow_id,)).fetchone() @@ -521,6 +581,39 @@ def list_workflows(self) -> list[dict[str, Any]]: rows = connection.execute("SELECT id FROM workflows ORDER BY updated_at DESC").fetchall() return [self.get_workflow(row["id"]) for row in rows] + def cleanup_duplicate_workflows(self) -> int: + """Remove unreferenced historical drafts while preserving provenance.""" + with self._lock, self._connect() as connection: + rows = connection.execute( + """SELECT w.id,w.session_id,w.status,w.updated_at, + EXISTS (SELECT 1 FROM competition_runs r WHERE r.workflow_id=w.id) AS referenced + FROM workflows w ORDER BY w.session_id NULLS LAST,w.updated_at DESC,w.id DESC""" + ).fetchall() + keep: set[str] = set() + keep.update( + row["agent_workflow_id"] for row in connection.execute( + "SELECT agent_workflow_id FROM sessions WHERE agent_workflow_id IS NOT NULL" + ).fetchall() + ) + latest: set[str] = set() + unbound_kept = False + for row in rows: + sid = row.get("session_id") + if sid and sid not in latest: + latest.add(sid) + keep.add(row["id"]) + elif sid is None and not unbound_kept: + keep.add(row["id"]) + unbound_kept = True + if row.get("referenced"): + keep.add(row["id"]) + doomed = [row["id"] for row in rows if row["id"] not in keep and row.get("status") == "draft"] + if doomed: + connection.execute("DELETE FROM workflows WHERE id = ANY(%s)", (doomed,)) + for workflow_id in doomed: + self._delete_secret_namespace("workflows", workflow_id) + return len(doomed) + def delete_workflow(self, workflow_id: str) -> bool: with self._lock, self._connect() as connection: runs = connection.execute( diff --git a/backend/ops/tools.py b/backend/ops/tools.py index 31a8de6..aa1e982 100644 --- a/backend/ops/tools.py +++ b/backend/ops/tools.py @@ -2,6 +2,7 @@ import copy import json +import logging import os import re import shlex @@ -11,6 +12,8 @@ from backend.sandbox.command_policy import host_path_violation from backend.sandbox.docker_manager import _load_docker_sdk +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) class OpsToolError(RuntimeError): """A tool call was invalid or could not be completed.""" @@ -126,7 +129,7 @@ def execute(self, name: str, arguments: dict[str, Any] | None = None, *, session raise OpsToolError("question requires a conversation session") try: return QuestionStore(self.state).create(session_id=session_id, **args) - except (ValueError, TypeError) as exc: + except (ValueError, TypeError, RuntimeError) as exc: raise OpsToolError(str(exc)) from exc handlers = { "list_task_sandboxes": self.list_task_sandboxes, @@ -222,7 +225,7 @@ def host_exec(self, command: str, timeout: int = 60) -> dict[str, Any]: try: container.remove(force=True) except Exception: - pass + _recovery_logger.debug('Error handled in host_exec', exc_info=True) stdout, stderr = _split_output(output) return { @@ -292,6 +295,7 @@ def _host_helper_image(client) -> str: client.images.get(preferred) return preferred except Exception: + _recovery_logger.debug('Error handled in _host_helper_image', exc_info=True) return "ipc-ctfagent:latest" diff --git a/backend/persistence/database.py b/backend/persistence/database.py index c4a631d..0f5da6d 100644 --- a/backend/persistence/database.py +++ b/backend/persistence/database.py @@ -154,9 +154,8 @@ def configure(self) -> PostgresDatabase: @contextmanager def connect(self) -> Generator[DatabaseConnection, None, None]: self.open() - with self._pool.connection() as raw: - with raw.transaction(): - yield DatabaseConnection(raw) + with self._pool.connection() as raw, raw.transaction(): + yield DatabaseConnection(raw) def close(self) -> None: if self._opened: diff --git a/backend/persistence/migrations/versions/20260807_0002_goal_intent_uniqueness.py b/backend/persistence/migrations/versions/20260807_0002_goal_intent_uniqueness.py index b27debc..7e4c951 100644 --- a/backend/persistence/migrations/versions/20260807_0002_goal_intent_uniqueness.py +++ b/backend/persistence/migrations/versions/20260807_0002_goal_intent_uniqueness.py @@ -2,7 +2,6 @@ from alembic import op - revision = "20260807_0002" down_revision = "20260807_0001" branch_labels = None diff --git a/backend/persistence/migrations/versions/20260920_0004_competition_runtime.py b/backend/persistence/migrations/versions/20260920_0004_competition_runtime.py index b32df5d..93c2a4f 100644 --- a/backend/persistence/migrations/versions/20260920_0004_competition_runtime.py +++ b/backend/persistence/migrations/versions/20260920_0004_competition_runtime.py @@ -2,7 +2,6 @@ from alembic import op - revision = "20260920_0004" down_revision = "20260920_0003" branch_labels = None diff --git a/backend/persistence/migrations/versions/20260920_0005_competition_artifacts.py b/backend/persistence/migrations/versions/20260920_0005_competition_artifacts.py index eed5a80..5af2fc4 100644 --- a/backend/persistence/migrations/versions/20260920_0005_competition_artifacts.py +++ b/backend/persistence/migrations/versions/20260920_0005_competition_artifacts.py @@ -2,7 +2,6 @@ from alembic import op - revision = "20260920_0005" down_revision = "20260920_0004" branch_labels = None diff --git a/backend/persistence/migrations/versions/20260921_0006_redact_competition_credentials.py b/backend/persistence/migrations/versions/20260921_0006_redact_competition_credentials.py index 4da01de..222cc32 100644 --- a/backend/persistence/migrations/versions/20260921_0006_redact_competition_credentials.py +++ b/backend/persistence/migrations/versions/20260921_0006_redact_competition_credentials.py @@ -2,7 +2,6 @@ from alembic import op - revision = "20260921_0006" down_revision = "20260920_0005" branch_labels = None diff --git a/backend/persistence/migrations/versions/20260923_0007_engine_observations.py b/backend/persistence/migrations/versions/20260923_0007_engine_observations.py index 2bc8b27..512df8b 100644 --- a/backend/persistence/migrations/versions/20260923_0007_engine_observations.py +++ b/backend/persistence/migrations/versions/20260923_0007_engine_observations.py @@ -2,7 +2,6 @@ from alembic import op - revision = "20260923_0007" down_revision = "20260921_0006" branch_labels = None diff --git a/backend/persistence/migrations/versions/20260925_0008_run_scoped_challenges.py b/backend/persistence/migrations/versions/20260925_0008_run_scoped_challenges.py index 6aecc88..0ba7532 100644 --- a/backend/persistence/migrations/versions/20260925_0008_run_scoped_challenges.py +++ b/backend/persistence/migrations/versions/20260925_0008_run_scoped_challenges.py @@ -2,7 +2,6 @@ from alembic import op - revision = "20260925_0008" down_revision = "20260923_0007" branch_labels = None diff --git a/backend/persistence/migrations/versions/20260929_0009_agent_sessions.py b/backend/persistence/migrations/versions/20260929_0009_agent_sessions.py index db208dc..a9c7c32 100644 --- a/backend/persistence/migrations/versions/20260929_0009_agent_sessions.py +++ b/backend/persistence/migrations/versions/20260929_0009_agent_sessions.py @@ -11,7 +11,6 @@ from backend.agent.schema import AGENT_SCHEMA - revision = "20260929_0009" down_revision = "20260925_0008" branch_labels = None diff --git a/backend/persistence/migrations/versions/20261008_0010_agent_jobs.py b/backend/persistence/migrations/versions/20261008_0010_agent_jobs.py index 2bd6f26..cf10e65 100644 --- a/backend/persistence/migrations/versions/20261008_0010_agent_jobs.py +++ b/backend/persistence/migrations/versions/20261008_0010_agent_jobs.py @@ -13,7 +13,6 @@ from alembic import op - revision = "20261008_0010" down_revision = "20260929_0009" branch_labels = None diff --git a/backend/persistence/migrations/versions/20261013_0011_ops_workflow_limits.py b/backend/persistence/migrations/versions/20261013_0011_ops_workflow_limits.py new file mode 100644 index 0000000..f92ab81 --- /dev/null +++ b/backend/persistence/migrations/versions/20261013_0011_ops_workflow_limits.py @@ -0,0 +1,35 @@ +"""Bind one Ops conversation to one workflow and add run limit overrides.""" + +from alembic import op + +revision = "20261013_0011" +down_revision = "20261008_0010" +branch_labels = None +depends_on = None + + +def upgrade(): + op.execute("ALTER TABLE sessions ADD COLUMN IF NOT EXISTS agent_workflow_id TEXT") + op.execute( + "CREATE INDEX IF NOT EXISTS ix_ops_sessions_workflow ON sessions(agent_workflow_id)" + ) + op.execute( + "ALTER TABLE competition_runs ADD COLUMN IF NOT EXISTS limits JSONB NOT NULL DEFAULT '{}'::jsonb" + ) + op.execute( + """UPDATE workflows w SET name='Imported competition ' || w.id + WHERE lower(trim(w.name)) IN ('proposed','probe','workflow','new workflow') + AND EXISTS (SELECT 1 FROM competition_runs r WHERE r.workflow_id=w.id)""" + ) + op.execute( + """DELETE FROM workflows w + WHERE lower(trim(w.name)) IN ('proposed','probe','workflow','new workflow') + AND NOT EXISTS (SELECT 1 FROM competition_runs r WHERE r.workflow_id=w.id) + AND NOT EXISTS (SELECT 1 FROM sessions s WHERE s.agent_workflow_id=w.id)""" + ) + + +def downgrade(): + op.execute("DROP INDEX IF EXISTS ix_ops_sessions_workflow") + op.execute("ALTER TABLE sessions DROP COLUMN IF EXISTS agent_workflow_id") + op.execute("ALTER TABLE competition_runs DROP COLUMN IF EXISTS limits") diff --git a/backend/persistence/schema.py b/backend/persistence/schema.py index e7635aa..68590d0 100644 --- a/backend/persistence/schema.py +++ b/backend/persistence/schema.py @@ -1,6 +1,5 @@ from __future__ import annotations - SCHEMA_COMPATIBILITY_STATEMENTS = ( "ALTER TABLE IF EXISTS projects ADD COLUMN IF NOT EXISTS external_id TEXT", "ALTER TABLE IF EXISTS projects ADD COLUMN IF NOT EXISTS category TEXT NOT NULL DEFAULT 'misc'", @@ -230,7 +229,8 @@ title TEXT NOT NULL, created_at TIMESTAMPTZ NOT NULL, updated_at TIMESTAMPTZ NOT NULL, - agent_session_id TEXT + agent_session_id TEXT, + agent_workflow_id TEXT ) """, """ @@ -293,6 +293,8 @@ updated_at TIMESTAMPTZ NOT NULL ) """, + "ALTER TABLE sessions ADD COLUMN IF NOT EXISTS agent_workflow_id TEXT", + "CREATE INDEX IF NOT EXISTS ix_ops_sessions_workflow ON sessions(agent_workflow_id)", """ CREATE TABLE IF NOT EXISTS active_sessions ( session_hash BYTEA PRIMARY KEY, diff --git a/backend/platform/README.md b/backend/platform/README.md new file mode 100644 index 0000000..0091788 --- /dev/null +++ b/backend/platform/README.md @@ -0,0 +1,32 @@ +# Platform adapters + +Shared contracts and helpers stay at this level. Every platform owns a package +under this directory: + +```text +backend/platform/ + adapter.py + factory.py + mapping.py + gzctf/ + __init__.py + adapter.py + ret2shell/ + __init__.py + adapter.py + mcp.py +``` + +Platform packages expose their client and adapter through `__init__.py`. +`factory.py` imports those public exports. URLs, authentication, response +parsing, attachment handling, and instance lifecycle code stay inside the +matching platform package. + +To add a platform, create `backend/platform//`, expose its public types +through that package's `__init__.py`, and register it in `factory.py`. + +GZCTF participant sessions use the `GZCTF_Token` ASP.NET Identity cookie. +Set `IPC_GZ_BASE_URL` and `IPC_GZ_TOKEN` for IPC to use an existing browser +session. `IPC_GZ_USERNAME` and `IPC_GZ_PASSWORD` remain a fallback when no +cookie is supplied. Workflow credentials take precedence over deployment +defaults. Secrets are installed only in the private HTTP session. diff --git a/backend/platform/__init__.py b/backend/platform/__init__.py index f70a5dc..2758470 100644 --- a/backend/platform/__init__.py +++ b/backend/platform/__init__.py @@ -3,4 +3,4 @@ from backend.platform.gzctf import GZCTFAdapter, GZCTFClient from backend.platform.mapping import FieldMapping, PlatformChallenge -__all__ = ["FieldMapping", "HttpJsonAdapter", "GZCTFAdapter", "GZCTFClient", "PlatformChallenge", "build_adapter"] +__all__ = ["FieldMapping", "GZCTFAdapter", "GZCTFClient", "HttpJsonAdapter", "PlatformChallenge", "build_adapter"] diff --git a/backend/platform/_common.py b/backend/platform/_common.py index 22bfbd5..262e076 100644 --- a/backend/platform/_common.py +++ b/backend/platform/_common.py @@ -8,7 +8,6 @@ from collections.abc import Iterable - PLATFORM_CATEGORIES: tuple[str, ...] = ( "pwn", "reverse", "crypto", "web", "misc", "ai", "osint", ) diff --git a/backend/platform/adapter.py b/backend/platform/adapter.py index 0734674..3a8ff67 100644 --- a/backend/platform/adapter.py +++ b/backend/platform/adapter.py @@ -1,13 +1,14 @@ from __future__ import annotations from abc import ABC, abstractmethod -from pathlib import Path from collections.abc import Callable +from pathlib import Path from typing import Any from urllib.parse import unquote, urljoin, urlparse import requests +from backend.core.validation import InputValidationError from backend.platform._common import PLATFORM_CATEGORIES, numbered_filename, safe_stem from backend.platform.mapping import FieldMapping, PlatformChallenge @@ -108,7 +109,7 @@ def fetch_challenges(self) -> list[PlatformChallenge]: raise ValueError("challenge list endpoint did not return JSON") from exc items = _json_path(payload, self.mapping.list_path) if not isinstance(items, list): - raise ValueError(f"list_path '{self.mapping.list_path}' did not resolve to a list") + raise InputValidationError(f"list_path '{self.mapping.list_path}' did not resolve to a list") pages.extend(self._normalize(item) for item in items) if not self.mapping.pagination_path: break @@ -116,7 +117,7 @@ def fetch_challenges(self) -> list[PlatformChallenge]: if next_url in (None, ""): break if not isinstance(next_url, str): - raise ValueError("pagination_path must resolve to a URL or null") + raise InputValidationError("pagination_path must resolve to a URL or null") next_url = urljoin(url, next_url) parsed = urlparse(next_url) if parsed.scheme not in {"http", "https"} or not parsed.netloc: @@ -129,7 +130,7 @@ def fetch_challenges(self) -> list[PlatformChallenge]: def _normalize(self, item: Any) -> PlatformChallenge: if not isinstance(item, dict): - raise ValueError("challenge list entries must be JSON objects") + raise InputValidationError("challenge list entries must be JSON objects") external_id = _field(item, self.mapping.id_field) title = _field(item, self.mapping.title_field) if external_id is None or title is None: @@ -141,7 +142,7 @@ def _normalize(self, item: Any) -> PlatformChallenge: if isinstance(raw_attachments, str): raw_attachments = [raw_attachments] if not isinstance(raw_attachments, list): - raise ValueError("configured attachments field must contain a URL or list of URLs") + raise InputValidationError("configured attachments field must contain a URL or list of URLs") base_url = self.mapping.attachment_base_url or self.mapping.list_url attachment_urls = [urljoin(base_url, str(url)) for url in raw_attachments] return PlatformChallenge( @@ -152,6 +153,7 @@ def _normalize(self, item: Any) -> PlatformChallenge: attachment_urls=attachment_urls, remote=bool(self.mapping.remote_field and _field(item, self.mapping.remote_field, False) is True), solved=bool(self.mapping.solved_field and _field(item, self.mapping.solved_field, False) is True), + platform_data={"score": _field(item, self.mapping.score_field)} if self.mapping.score_field else {}, hints=([str(h) for h in _field(item, self.mapping.hints_field, [])] if self.mapping.hints_field and isinstance(_field(item, self.mapping.hints_field, []), list) else []), ) diff --git a/backend/platform/downloads.py b/backend/platform/downloads.py index cd286f8..f7abf20 100644 --- a/backend/platform/downloads.py +++ b/backend/platform/downloads.py @@ -1,11 +1,11 @@ """Bounded parallel staging with a fresh adapter for each challenge.""" from __future__ import annotations +from collections.abc import Callable from concurrent.futures import ThreadPoolExecutor from contextlib import ExitStack from pathlib import Path from threading import BoundedSemaphore -from typing import Callable from urllib.parse import urlsplit diff --git a/backend/platform/factory.py b/backend/platform/factory.py index 9a4f7db..ac57201 100644 --- a/backend/platform/factory.py +++ b/backend/platform/factory.py @@ -39,9 +39,11 @@ def build_adapter( source_url = resolved_base_url or mapping.list_url if source_url: parsed = urlsplit(source_url) - if parsed.scheme and parsed.netloc: - if not resolved_base_url or parsed.path.lower().startswith("/api/"): - resolved_base_url = f"{parsed.scheme}://{parsed.netloc}" + if ( + parsed.scheme and parsed.netloc + and (not resolved_base_url or parsed.path.lower().startswith("/api/")) + ): + resolved_base_url = f"{parsed.scheme}://{parsed.netloc}" return GZCTFAdapter( GZCTFClient( base_url=resolved_base_url, diff --git a/backend/platform/gzctf/adapter.py b/backend/platform/gzctf/adapter.py index 075830b..337e4f0 100644 --- a/backend/platform/gzctf/adapter.py +++ b/backend/platform/gzctf/adapter.py @@ -1,20 +1,24 @@ from __future__ import annotations -import os import base64 import hashlib +import logging +import os import secrets from datetime import UTC, datetime from pathlib import Path from typing import Any -from urllib.parse import urljoin, urlsplit, unquote +from urllib.parse import unquote, urljoin, urlsplit import requests +from typing_extensions import Self from backend.platform._common import PLATFORM_CATEGORIES, numbered_filename, safe_stem from backend.platform.adapter import PlatformAdapter from backend.platform.mapping import FieldMapping, PlatformChallenge +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) class GZCTFError(RuntimeError): pass @@ -454,11 +458,11 @@ def delete_container(self, game_id: int, challenge_id: int) -> None: timeout=self.timeout, ) if response.status_code == 404: - return None + return if response.status_code == 400 and "未创建容器" in response.text: - return None + return response.raise_for_status() - return None + return def get_container(self, game_id: int, challenge_id: int) -> dict[str, Any]: """Read the live container state from the challenge detail. @@ -681,7 +685,7 @@ def create_ticket(self, payload: dict[str, Any]) -> Any: def close(self) -> None: self.session.close() - def __enter__(self) -> GZCTFClient: + def __enter__(self) -> Self: return self def __exit__(self, *exc: object) -> None: @@ -824,6 +828,7 @@ def _gz_container_error(exc: requests.HTTPError, external_id: str) -> Exception: try: detail = (response.text or "").strip()[:300] if response is not None else "" except Exception: + _recovery_logger.debug('Error handled in _gz_container_error', exc_info=True) detail = "" suffix = f": {detail}" if detail else "" return GZCTFError( @@ -1332,12 +1337,12 @@ def start_instance(self, external_id: str) -> dict[str, Any]: def stop_instance(self, external_id: str) -> None: if not self.supports_instances: - return None + return try: self.client.delete_container(self.game_id, int(external_id)) except requests.HTTPError as exc: raise _gz_container_error(exc, external_id) from exc - return None + return def renew_instance(self, external_id: str) -> dict[str, Any]: if not self.supports_instances: diff --git a/backend/platform/mapping.py b/backend/platform/mapping.py index 45717d5..c05d767 100644 --- a/backend/platform/mapping.py +++ b/backend/platform/mapping.py @@ -19,6 +19,7 @@ class FieldMapping(BaseModel): attachments_field: str = "files" remote_field: str = "" solved_field: str = "" + score_field: str = "score" hints_field: str = "" level: int = 1 track_id: str = "" @@ -68,7 +69,7 @@ def validate_max_challenges(cls, value: int) -> int: raise ValueError("max_challenges must be between 0 and 1000") return value - @field_validator("level_field", "track_id_field", "pagination_path") + @field_validator("level_field", "track_id_field", "pagination_path", "score_field") @classmethod def validate_optional_paths(cls, value: str) -> str: value = value.strip() diff --git a/backend/platform/ret2shell/adapter.py b/backend/platform/ret2shell/adapter.py index 1a4c31c..5882f98 100644 --- a/backend/platform/ret2shell/adapter.py +++ b/backend/platform/ret2shell/adapter.py @@ -4,10 +4,12 @@ import os import threading import time +from collections.abc import Callable from pathlib import Path -from typing import Any, Callable +from typing import Any import requests +from typing_extensions import Self from backend.platform._common import PLATFORM_CATEGORIES, numbered_filename, safe_stem from backend.platform.adapter import PlatformAdapter @@ -481,7 +483,7 @@ def submit_flag( def close(self) -> None: self.session.close() - def __enter__(self) -> Ret2ShellClient: + def __enter__(self) -> Self: return self def __exit__(self, *exc: object) -> None: diff --git a/backend/platform/ret2shell/mcp.py b/backend/platform/ret2shell/mcp.py index 19665b4..2656059 100644 --- a/backend/platform/ret2shell/mcp.py +++ b/backend/platform/ret2shell/mcp.py @@ -1,18 +1,23 @@ from __future__ import annotations import asyncio +import logging import os import shutil import socket import subprocess import threading import time -from typing import Any, Callable +from collections.abc import Callable +from typing import Any from urllib.parse import urlparse from backend.mcp.mcp_server import MCPServer, close_lifespan, create_mcp_server from backend.platform.ret2shell.adapter import Ret2ShellClient +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + WSRX_BINARY = os.getenv("IPC_R2S_WSRX_BINARY", "wsrx") WSRX_BIND_HOST = os.getenv("IPC_R2S_WSRX_BIND_HOST", "0.0.0.0") WSRX_ENDPOINT_HOST = os.getenv("IPC_R2S_WSRX_ENDPOINT_HOST", "ipc-app") @@ -140,9 +145,10 @@ def _terminate_process(process: Any) -> None: try: process.wait(timeout=5) except Exception: + _recovery_logger.debug('Error handled in _terminate_process', exc_info=True) process.kill() except Exception: - pass + _recovery_logger.debug('Error handled in _terminate_process', exc_info=True) def _alive(self, challenge_id: int) -> list[_Tunnel]: diff --git a/backend/sandbox/container_pool.py b/backend/sandbox/container_pool.py index 3e40b02..ed28b4d 100644 --- a/backend/sandbox/container_pool.py +++ b/backend/sandbox/container_pool.py @@ -1,8 +1,8 @@ from __future__ import annotations -from contextlib import suppress import re import threading +from contextlib import suppress from pathlib import Path from backend.sandbox.resource_limiter import TaskSlotLimiter diff --git a/backend/sandbox/docker_manager.py b/backend/sandbox/docker_manager.py index a82e2a3..26e62ce 100644 --- a/backend/sandbox/docker_manager.py +++ b/backend/sandbox/docker_manager.py @@ -1,6 +1,5 @@ from __future__ import annotations - import importlib import sys from pathlib import Path diff --git a/backend/sandbox/network_manager.py b/backend/sandbox/network_manager.py index b45fba9..d93dc18 100644 --- a/backend/sandbox/network_manager.py +++ b/backend/sandbox/network_manager.py @@ -1,6 +1,6 @@ from __future__ import annotations - +import logging import threading from dataclasses import dataclass, field from pathlib import Path @@ -12,6 +12,8 @@ classify_docker_startup_error, ) +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) @dataclass class ChallengeEnv: @@ -106,6 +108,7 @@ def _docker_up(self, env: ChallengeEnv) -> bool: env.error = str(env.startup_error) return False except Exception as exc: + _recovery_logger.debug('Error handled in _docker_up', exc_info=True) env.startup_error = classify_docker_startup_error( exc, "start challenge environment", @@ -137,4 +140,4 @@ def _docker_down(self, env: ChallengeEnv) -> None: else: subprocess.run(["docker", "rm", "-f", env.network_name], check=False, capture_output=True) except Exception: - pass + _recovery_logger.debug('Error handled in _docker_down', exc_info=True) diff --git a/backend/sandbox/resource_limiter.py b/backend/sandbox/resource_limiter.py index 9611727..00892ea 100644 --- a/backend/sandbox/resource_limiter.py +++ b/backend/sandbox/resource_limiter.py @@ -6,40 +6,55 @@ @dataclass class TaskSlotLimiter: - """Concurrency gate for CTF tasks. + """Track tasks and gate work admitted by the standalone scheduler. - Each running task (project) occupies one slot. Memory is no longer - reserved per agent - a task owns a single Docker container shared by all of - its Members, and that container is not memory-capped. The only global limit - is how many tasks may run at once. + Competition work has already passed its own local/remote capacity and + global Member-seat checks. Track it for cleanup without charging a second + standalone slot. """ max_concurrent_tasks: int = 5 total_cpu: int = 4 _active: set[str] = field(default_factory=set) + _coordinated: set[str] = field(default_factory=set) _lock: threading.Lock = field(default_factory=threading.Lock) def can_admit(self, project_id: str) -> bool: with self._lock: if project_id in self._active: return True - return len(self._active) < self.max_concurrent_tasks + return len(self._active - self._coordinated) < self.max_concurrent_tasks - def acquire(self, project_id: str) -> bool: + def acquire(self, project_id: str, *, externally_scheduled: bool = False) -> bool: """Reserve a task slot. Idempotent for a project that already holds one.""" with self._lock: if project_id in self._active: return True - if len(self._active) >= self.max_concurrent_tasks: + if not externally_scheduled and len(self._active - self._coordinated) >= self.max_concurrent_tasks: return False self._active.add(project_id) + if externally_scheduled: + self._coordinated.add(project_id) return True def release(self, project_id: str) -> None: with self._lock: self._active.discard(project_id) + self._coordinated.discard(project_id) def active_tasks(self) -> list[str]: with self._lock: return sorted(self._active) + + def update_limits(self, *, max_concurrent_tasks: int | None = None, total_cpu: int | None = None) -> None: + """Apply configuration changes without interrupting admitted tasks.""" + with self._lock: + if max_concurrent_tasks is not None: + if int(max_concurrent_tasks) < 0: + raise ValueError("max_concurrent_tasks must be non-negative") + self.max_concurrent_tasks = int(max_concurrent_tasks) + if total_cpu is not None: + if int(total_cpu) < 0: + raise ValueError("total_cpu must be non-negative") + self.total_cpu = int(total_cpu) diff --git a/backend/sandbox/task_sandbox.py b/backend/sandbox/task_sandbox.py index ab16361..69ad870 100644 --- a/backend/sandbox/task_sandbox.py +++ b/backend/sandbox/task_sandbox.py @@ -1,11 +1,12 @@ from __future__ import annotations -from contextlib import suppress import io +import logging import os import shlex import tarfile import threading +from contextlib import suppress from pathlib import Path, PurePosixPath from backend.sandbox.docker_manager import _load_docker_sdk @@ -18,6 +19,9 @@ from backend.sandbox.sandbox import ExecResult from backend.sandbox.webui_proxy import webui_proxy_manager +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + WORKSPACE = "/workspace" ATTACHMENTS_DIR = f"{WORKSPACE}/attachments" SHARED_DIR = f"{WORKSPACE}/shared" @@ -70,8 +74,8 @@ def job_launch_script(directory: str, command: str, workdir: str) -> str: f"nohup bash -c {shlex.quote(supervisor)} >/dev/null 2>&1 < /dev/null &", "child=$!", f"printf '%s' \"$child\" > {quoted}/pid", - f"(sed 's/.*) //' /proc/$child/stat 2>/dev/null | awk '{{print $20}}' " - f"|| true) > {quoted}/starttime", + (f"(sed 's/.*) //' /proc/$child/stat 2>/dev/null | awk '{{print $20}}' " + f"|| true) > {quoted}/starttime"), f"cat {quoted}/pid", )) @@ -221,6 +225,7 @@ def _shared_network_name(self) -> str | None: try: current = self._docker().containers.get(hostname) except Exception: + _recovery_logger.debug('Error handled in _shared_network_name', exc_info=True) return None networks = current.attrs.get("NetworkSettings", {}).get("Networks", {}) if not networks: diff --git a/backend/server/app.py b/backend/server/app.py index 03fbfb6..81cad21 100644 --- a/backend/server/app.py +++ b/backend/server/app.py @@ -1,5 +1,6 @@ from __future__ import annotations +import logging import os from contextlib import asynccontextmanager from pathlib import Path @@ -10,8 +11,8 @@ from backend.api import agent as agent_router from backend.api import auth as auth_router -from backend.api import config as config_router from backend.api import competition as competition_router +from backend.api import config as config_router from backend.api import flags as flags_router from backend.api import graph as graph_router from backend.api import logs as logs_router @@ -19,9 +20,9 @@ from backend.api import ops_agent as ops_agent_router from backend.api import platform as platform_router from backend.api import project as project_router -from backend.api import solve as solve_router -from backend.api import skills as skills_router from backend.api import questions as questions_router +from backend.api import skills as skills_router +from backend.api import solve as solve_router from backend.api import wp as wp_router from backend.auth import AuthManager from backend.auth.middleware import AuthenticationMiddleware @@ -29,6 +30,8 @@ from backend.ops.ipc_mcp import build_ipc_mcp from backend.sandbox.webui_proxy import webui_proxy_manager +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) def _resolve_frontend_dir(app_root: Path) -> Path: """Locate the top-level ``frontend/`` web UI directory. @@ -70,6 +73,7 @@ async def lifespan(app: FastAPI): state.orchestrator = Orchestrator(state) state.orchestrator.start() except Exception as exc: + _recovery_logger.debug('Error handled in lifespan', exc_info=True) app.state.orchestrator_error = str(exc) try: from backend.competition.service import CompetitionService @@ -77,6 +81,7 @@ async def lifespan(app: FastAPI): state.competition = CompetitionService(state) state.competition.start_worker() except Exception as exc: + _recovery_logger.debug('Error handled in lifespan', exc_info=True) app.state.competition_error = str(exc) try: async with ipc_mcp_app.router.lifespan_context(ipc_mcp_app): diff --git a/backend/tools/catalog.py b/backend/tools/catalog.py index b20c87e..649907e 100644 --- a/backend/tools/catalog.py +++ b/backend/tools/catalog.py @@ -87,7 +87,7 @@ def load( path: str | Path = CATALOG_PATH, *, validate_documents: bool = True, - ) -> "ToolCatalog": + ) -> ToolCatalog: data = yaml.safe_load(Path(path).read_text(encoding="utf-8")) or {} groups = {str(k): str(v) for k, v in (data.get("groups") or {}).items()} entries = [CatalogEntry(**item) for item in data.get("entries", [])] diff --git a/backend/tools/tool_inventory.py b/backend/tools/tool_inventory.py index 51f255d..53cfc09 100644 --- a/backend/tools/tool_inventory.py +++ b/backend/tools/tool_inventory.py @@ -3,7 +3,6 @@ from functools import lru_cache from pathlib import Path - _INVENTORY_PATH = Path(__file__).with_name("member_tools.txt") diff --git a/backend/tools/tool_mcp.py b/backend/tools/tool_mcp.py index c11e746..ec39e19 100644 --- a/backend/tools/tool_mcp.py +++ b/backend/tools/tool_mcp.py @@ -1,7 +1,8 @@ from __future__ import annotations import asyncio -from typing import Any, Callable, Collection +from collections.abc import Callable, Collection +from typing import Any from backend.mcp.mcp_server import MCPServer, create_mcp_server from backend.tools.tool_registry import ToolRegistry diff --git a/backend/tools/tool_registry.py b/backend/tools/tool_registry.py index af81632..9eda771 100644 --- a/backend/tools/tool_registry.py +++ b/backend/tools/tool_registry.py @@ -4,9 +4,9 @@ import threading import time from collections import OrderedDict +from collections.abc import Collection from dataclasses import dataclass from pathlib import Path -from typing import Collection import yaml diff --git a/coverage-baseline.json b/coverage-baseline.json new file mode 100644 index 0000000..bc01ff2 --- /dev/null +++ b/coverage-baseline.json @@ -0,0 +1,12 @@ +{ + "agent-core": { + "covered_lines": 3124, + "statements": 3841, + "line_percent": 81.33 + }, + "competition": { + "covered_lines": 2559, + "statements": 3162, + "line_percent": 80.93 + } +} diff --git a/docker-compose.e2e.yml b/docker-compose.e2e.yml new file mode 100644 index 0000000..e9ac391 --- /dev/null +++ b/docker-compose.e2e.yml @@ -0,0 +1,68 @@ +name: ipc-e2e +services: + e2e-postgres: + image: postgres:16-alpine + ports: + - "127.0.0.1:15433:5432" + environment: + POSTGRES_DB: ipc_e2e + POSTGRES_USER: ipc + POSTGRES_PASSWORD: ipc + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ipc -d ipc_e2e"] + interval: 2s + timeout: 3s + retries: 20 + + e2e-platform: + image: python:3.12-slim + volumes: + - ./docker/e2e/fake_platform.py:/opt/fake_platform.py:ro + command: ["python", "/opt/fake_platform.py"] + + e2e-app: + image: ipc-ctfagent:latest + command: ["sh", "-c", "alembic upgrade head && exec uvicorn app:app --app-dir /app/docker/e2e --host 0.0.0.0 --port 8000"] + environment: + IPC_ROOT: /app + IPC_ARTIFACT_ROOT: /app/data/artifacts + IPC_DATABASE_URL: postgresql://ipc:ipc@e2e-postgres:5432/ipc_e2e + IPC_ALLOW_LOCAL_SANDBOX: "1" + IPC_LOG_ENABLED: "true" + volumes: + - e2e-data:/app/data + - ./docker/e2e/config:/app/backend/config:ro + - ./docker/e2e:/app/docker/e2e:ro + - ./backend:/app/backend:ro + - ./frontend:/app/frontend:ro + ports: + - "18000:8000" + depends_on: + e2e-postgres: + condition: service_healthy + e2e-platform: + condition: service_started + healthcheck: + test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/auth/status', timeout=3)"] + interval: 2s + timeout: 4s + retries: 30 + + e2e-runner: + build: + context: . + dockerfile: docker/e2e/runner.Dockerfile + image: ipc-e2e-browser:latest + environment: + IPC_E2E_BASE_URL: http://e2e-app:8000 + IPC_E2E_ARTIFACT_DIR: /artifacts + volumes: + - ./scripts/playwright_e2e.py:/opt/playwright_e2e.py:ro + - ./data/exports/e2e:/artifacts + command: ["python", "/opt/playwright_e2e.py"] + depends_on: + e2e-app: + condition: service_healthy + +volumes: + e2e-data: diff --git a/docker-compose.yml b/docker-compose.yml index 2003dbb..a0e3d2b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,8 @@ services: ipc-postgres: image: postgres:16-alpine + ports: + - "15432:5432" environment: - POSTGRES_DB=${IPC_POSTGRES_DB:-ipc} - POSTGRES_USER=${IPC_POSTGRES_USER:-ipc} @@ -30,6 +32,8 @@ services: build: context: . dockerfile: Dockerfile + args: + INSTALL_WSRX: ${IPC_INSTALL_WSRX:-1} image: ipc-ctfagent:latest container_name: ipc-app ports: diff --git a/docker/e2e/app.py b/docker/e2e/app.py new file mode 100644 index 0000000..a1af3fe --- /dev/null +++ b/docker/e2e/app.py @@ -0,0 +1,64 @@ +"""Test-only entrypoint: production orchestration with scripted mock Members.""" + +from contextlib import asynccontextmanager + +from backend.core.config import MEMBER_NAMES +from backend.core.orchestrator import Orchestrator +from backend.server.app import create_app + + +SCRIPT = [ + {"action": "bash", "command": "sleep 2; printf 'e2e-sandbox-command-ok\\n'"}, + {"action": "tool", "server": "memory", "tool": "memory_catalog", "args": {}}, + {"action": "flag", "flag": "flag{e2e-deterministic}", + "description": "Reproduced sandbox command and memory MCP evidence in the acceptance fixture."}, +] + +app = create_app() +original_lifespan = app.router.lifespan_context + + +@asynccontextmanager +async def lifespan(application): + async with original_lifespan(application): + state = application.state.ipc + state.orchestrator.shutdown() + state.orchestrator = Orchestrator( + state, scripts={name: SCRIPT for name in MEMBER_NAMES} + ) + state.orchestrator.start() + yield + + +app.router.lifespan_context = lifespan + + +@app.get("/e2e/runs/{run_id}/evidence") +def evidence(run_id: str): + """Read durable evidence. No production API or solver behavior is replaced.""" + state = app.state.ipc + store = state.competition.store + assignments = store.assignments(run_id) + events = [event for session in {a["session_id"] for a in assignments} + for event in store.events(session, limit=500)] + tool_names = [e["payload"].get("name") for e in events if e["kind"] == "tool_call"] + with state.db.connect() as connection: + jobs = connection.execute( + "SELECT status,attempts,artifact_path FROM competition_wp_jobs WHERE run_id=%s", + (run_id,), + ).fetchall() + backlog = connection.execute( + """SELECT count(*) AS count FROM competition_messages m + LEFT JOIN competition_message_cursors c + ON c.session_id=m.envelope->>'receiver_session_id' + WHERE m.run_id=%s AND m.sequence>COALESCE(c.sequence,0)""", + (run_id,), + ).fetchone()["count"] + return { + "assignments": assignments, + "tool_names": tool_names, + "tool_results": [e["payload"] for e in events if e["kind"] == "tool_result"], + "wp_jobs": jobs, + "collaboration_backlog": int(backlog), + "run_events": store.run_events(run_id, limit=1000), + } diff --git a/docker/e2e/config/config.yaml b/docker/e2e/config/config.yaml new file mode 100644 index 0000000..ee13f43 --- /dev/null +++ b/docker/e2e/config/config.yaml @@ -0,0 +1,17 @@ +log_enabled: true +diamond: + api_format: mock + api_surface: auto + reasoning_effort: high +member: + api_format: mock + api_surface: auto + reasoning_effort: high +runtime: + interval: 1 + sandbox_backend: local + max_member_steps: 10 + max_member_actions_per_task: 5 +limits: + max_concurrent_tasks: 2 + total_cpu: 2 diff --git a/docker/e2e/fake_platform.py b/docker/e2e/fake_platform.py new file mode 100644 index 0000000..e3f5993 --- /dev/null +++ b/docker/e2e/fake_platform.py @@ -0,0 +1,46 @@ +from __future__ import annotations + +import json +from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer + + +CHALLENGE = { + "id": "e2e-web-1", + "name": "Deterministic E2E Web", + "category": "web", + "description": "The deterministic acceptance flag is flag{e2e-deterministic}.", + "files": [], + "score": 100, +} + + +class Handler(BaseHTTPRequestHandler): + def _send(self, status: int, payload: dict) -> None: + body = json.dumps(payload).encode() + self.send_response(status) + self.send_header("Content-Type", "application/json") + self.send_header("Content-Length", str(len(body))) + self.end_headers() + self.wfile.write(body) + + def do_GET(self) -> None: # noqa: N802 + if self.path == "/api/challenges": + self._send(200, {"data": [CHALLENGE]}) + else: + self._send(404, {"error": "not found"}) + + def do_POST(self) -> None: # noqa: N802 + if self.path == "/api/submit": + length = int(self.headers.get("Content-Length", "0")) + payload = json.loads(self.rfile.read(length) or b"{}") + verdict = "correct" if payload.get("flag") == "flag{e2e-deterministic}" else "wrong" + self._send(200, {"verdict": verdict, "submission_id": "e2e-submission-1"}) + return + self._send(404, {"error": "not found"}) + + def log_message(self, *_args) -> None: + return + + +if __name__ == "__main__": + ThreadingHTTPServer(("0.0.0.0", 8080), Handler).serve_forever() diff --git a/docker/e2e/probe.py b/docker/e2e/probe.py new file mode 100644 index 0000000..72d2a44 --- /dev/null +++ b/docker/e2e/probe.py @@ -0,0 +1,67 @@ +import requests +import time + +base = "http://127.0.0.1:8000" +workflow = { + "name": "Deterministic E2E Competition", + "competition_id": "e2e-competition", + "team_id": "e2e-team", + "allow_private_networks": True, + "challenges": { + "platform": "http_json", + "list_url": "http://e2e-platform:8080/api/challenges", + "list_path": "data", + "id_field": "id", + "title_field": "name", + "category_field": "category", + "description_field": "description", + "attachments_field": "files", + }, + "submit": { + "url": "http://e2e-platform:8080/api/submit", + "method": "POST", + "json_template": {"challenge_id": "{{external_id}}", "flag": "{{flag}}"}, + "success_path": "verdict", + "success_values": ["correct"], + "wrong_values": ["wrong"], + }, +} +created = requests.post(f"{base}/api/ops/workflows", json={"workflow": workflow}) +print("create", created.status_code, created.text) +workflow_id = created.json()["id"] +confirmed = requests.post( + f"{base}/api/ops/workflows/{workflow_id}/confirm", + json={"confirmation_phrase": f"CONFIRM WORKFLOW {workflow_id}"}, +) +print("confirm", confirmed.status_code, confirmed.text) +print("preflight", requests.post(f"{base}/api/workflows/{workflow_id}/preflight").text) +started = requests.post( + f"{base}/api/workflows/{workflow_id}/start", + json={"idempotency_key": f"probe-start-{int(time.time())}"}, +) +print("start", started.status_code, started.text[:2000]) +payload = started.json() +run_id = payload["run"]["id"] +assignment = None +for _ in range(30): + snapshot = requests.get(f"{base}/api/runs/{run_id}").json() + challenge = snapshot["challenges"][0] + if challenge["assignments"]: + assignment = challenge["assignments"][0] + break + time.sleep(0.5) +if assignment: + response = requests.post( + f"{base}/api/challenges/{challenge['id']}/candidates", + json={"run_id": run_id, "session_id": assignment["session_id"], + "flag": "flag{e2e-deterministic}", + "evidence": "deterministic evidence", + "instance_generation": challenge["instance_generation"]}, + ) + print("candidate", response.status_code, response.text) + for _ in range(30): + snapshot = requests.get(f"{base}/api/runs/{run_id}").json() + if snapshot["challenges"][0]["state"] == "solved": + print("solved", run_id) + break + time.sleep(0.5) diff --git a/docker/e2e/runner.Dockerfile b/docker/e2e/runner.Dockerfile new file mode 100644 index 0000000..f115a33 --- /dev/null +++ b/docker/e2e/runner.Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.12-slim +RUN sed -i 's|http://deb.debian.org/debian|https://mirrors.tuna.tsinghua.edu.cn/debian|g; s|http://deb.debian.org/debian-security|https://mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list.d/debian.sources \ + && apt-get update \ + && apt-get install -y --no-install-recommends chromium \ + && rm -rf /var/lib/apt/lists/* +RUN pip install --no-cache-dir playwright==1.50.0 +ENV IPC_PLAYWRIGHT_EXECUTABLE=/usr/bin/chromium +CMD ["python", "/opt/playwright_e2e.py"] diff --git a/docker/tests/postgres.Dockerfile b/docker/tests/postgres.Dockerfile new file mode 100644 index 0000000..33259db --- /dev/null +++ b/docker/tests/postgres.Dockerfile @@ -0,0 +1,10 @@ +# Run pytest-postgresql against its own temporary server as a non-root user. +FROM ipc-ctfagent:latest +RUN apt-get update \ + && apt-get install -y --no-install-recommends postgresql \ + && rm -rf /var/lib/apt/lists/* +RUN pip install --no-cache-dir pytest pytest-cov pytest-postgresql httpx +ENV PYTHONDONTWRITEBYTECODE=1 +WORKDIR /workspace +USER postgres +CMD ["python", "-m", "pytest", "-q", "-p", "no:cacheprovider", "--basetemp=/tmp/ipc-native-pytest"] diff --git a/frontend/index.html b/frontend/index.html index 9c0278e..04a6d2a 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,7 +4,7 @@ IPC Agent - + @@ -542,6 +542,7 @@

Competition

+
@@ -555,6 +556,8 @@

Member seats

+ +
@@ -578,23 +581,26 @@

Member seats

Challenges

- +
- - - +
ChallengeCategoryStateMembersDeadlineWrong
@@ -1054,11 +1060,10 @@

Skill

- + @keydown.enter="onQuestionEnter($event, question.id)"> @@ -1172,25 +1177,8 @@

Skill


               
-
-
Workflow secret
-
- -
-
- - - -
-
-
Review the URLs, methods and templates above before authorizing.
-
- -
@@ -1266,9 +1254,9 @@

Skill

opsBusy: false, opsStreaming: false, opsInterrupting: false, opsUploading: false, opsRunId: null, opsNextCalls: [], opsSessions: [], opsSessionId: null, opsMessages: [], opsInput: "", opsAttachments: [], opsAtBottom: true, opsAnswer: "", opsReasoning: "", opsReasoningOpen: false, opsToolNames: [], opsToolsOpen: false, opsError: "", opsRetryMessage: null, opsRunStartedAt: 0, projectPhaseErrorOpen: false, - opsWorkflows: [], opsWorkflowId: null, workflowTokens: {}, workflowSecret: {name:"",value:""}, + opsWorkflows: [], opsWorkflowId: null, workflowTokens: {}, opsConfirmInput: "", opsResult: null, - opsWorkflowBusy: false, opsConfirmError: "", opsConfirmMissing: {}, + opsWorkflowBusy: false, opsConfirmError: "", opsStartBusy: false, opsStartError: "", projectStatusFilter: [], projectFilterOpen: false, competitionRuns: [], competitionRun: null, competitionMembers: [], competitionEvents: [], @@ -1288,7 +1276,7 @@

Skill

this.logEntries=[]; this.llmEntries=[]; this.globalLogs=[]; this.completedWPs=[]; this.memories=[]; this.cfg=null; this.opsCfg=null; this.opsSessions=[]; this.opsSessionId=null; this.opsMessages=[]; this.opsRunId=null; this.opsNextCalls=[]; this.opsAttachments=[]; this.opsStreaming=false; this.opsInterrupting=false; this.opsUploading=false; this.opsWorkflows=[]; this.opsWorkflowId=null; this.opsAnswer=""; this.opsReasoning=""; this.opsToolNames=[]; this.opsError=""; this.opsRetryMessage=null; - this.workflowTokens={}; this.workflowSecret={name:"",value:""}; this.opsResult=null; + this.workflowTokens={}; this.opsResult=null; this.competitionRuns=[]; this.competitionRun=null; this.competitionMembers=[]; this.competitionEvents=[]; if(this.competitionEventSource){ this.competitionEventSource.close(); this.competitionEventSource=null; } this.sessionHealth=[]; this.sessionEvents=[]; this.sessionEventCursor=0; @@ -1932,6 +1920,11 @@

Skill

if(!this.opsInput.trim() || !this.opsCfg?.configured) return; this.sendOpsMessage(); }, + onQuestionEnter(event, questionId){ + if(event.isComposing || event.keyCode===229 || event.shiftKey) return; + event.preventDefault(); + this.answerQuestion(questionId); + }, autoGrowOpsInput(){ const element=this.$refs.opsInputBox; if(!element) return; element.style.height="auto"; @@ -2291,6 +2284,13 @@

Skill

const challenge=this.competitionRun?.challenges?.find(item=>item.id===challengeId); return challenge?.metadata?.title||""; }, + competitionChallengeGroups(){ + const challenges=this.competitionRun?.challenges||[]; + return [ + {label:"Ordinary challenges",items:challenges.filter(item=>!item.metadata?.remote)}, + {label:"Container challenges",items:challenges.filter(item=>!!item.metadata?.remote)}, + ]; + }, competitionStatusClass(){ const status=this.competitionRun?.run?.status; return status==="running"?"bg-teal-50 text-teal-700":status==="paused"?"bg-amber-50 text-amber-700":status==="blocked"?"bg-rose-50 text-rose-700":"bg-slate-100 text-slate-600"; @@ -2314,15 +2314,7 @@

Skill

}, selectOpsWorkflow(workflowId){ this.opsWorkflowId = this.opsWorkflowId===workflowId ? null : workflowId; - this.opsConfirmInput=""; this.opsResult=null; this.workflowSecret={name:"",value:""}; - }, - async saveWorkflowSecret(){ - const workflow=this.selectedOpsWorkflow(); if(!workflow) return; - const name=this.workflowSecret.name.trim().toLowerCase(), value=this.workflowSecret.value; - if(!/^[a-z][a-z0-9_]{0,63}$/.test(name)||!value){ this.flash("enter a valid workflow secret"); return; } - const updated=await this.api("PUT","/api/ops/workflows/"+workflow.id+"/secrets",{secrets:{[name]:value}}); - this.opsWorkflows=this.opsWorkflows.map(item=>item.id===updated.id?updated:item); - this.workflowSecret={name:"",value:""}; this.flash("workflow secret saved"); + this.opsConfirmInput=""; this.opsResult=null; }, async confirmOpsWorkflow(){ const workflow=this.selectedOpsWorkflow(); if(!workflow) return; @@ -2336,9 +2328,8 @@

Skill

this.opsWorkflowBusy=true; this.opsConfirmError=""; try{ const preview=await this.api("GET","/api/ops/workflows/"+workflow.id+"/confirmation"); - this.opsConfirmMissing={...this.opsConfirmMissing,[workflow.id]:preview.missing_secrets||[]}; if((preview.missing_secrets||[]).length){ - this.opsConfirmError="Set the missing workflow secrets first: "+preview.missing_secrets.join(", "); + this.opsConfirmError="The workflow is missing required configuration; answer the pending IPC question first."; return; } this.opsConfirmInput=preview.confirmation_phrase; @@ -2465,17 +2456,16 @@

Skill

async answerQuestion(questionId){ const question=this.pendingQuestions.find(item=>item.id===questionId)||this.pendingQuestions[0]; if(this.questionBusy||!question) return; - const value=(this.questionAnswers[question.id]||"").trim(); - if(!value) return; + const value=this.questionAnswers[question.id]||""; + if(!value.trim()) return; this.questionBusy=true; this.questionError=""; try{ await this.api("POST","/questions/"+question.id+"/answer",{session_id:this.opsSessionId,value}); delete this.questionAnswers[question.id]; await this.loadQuestions(); - const shown=question.sensitive?"******":value; this.opsNextCalls.push({ id:"answer-"+question.id, - message:"已回答问题「"+question.title+"」:"+shown + message:"已回答问题「"+question.title+"」:"+value +"\n\n请使用该问题原本的 operation key 读取答案,并继续之前的操作。", attachments:[] }); diff --git a/image/ipc.png b/image/ipc.png new file mode 100644 index 0000000000000000000000000000000000000000..e7142fe1c6957c4f27504d72cae9d1df476bd6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l9pgBv zDIC;=-ZQ;CPhzeO+DA zNaYZceB!7#dHQx7.json/.md` 和 `_monitor.json/.md`。重连监控数据库不会操作 Agent。 + +Docker fixture 监控已得到 27 条日志、19 个 agent event、匹配的启动/MCP/verdict 延迟、3 个已释放席位和零 backlog;报告标明 `model_mode: mock`。该证据用于验证监控器,不计为真实 20 题验收。 + +当前运行数据库/API 的 workflow 数为 0。模型配置和一条 GZCTF 凭据记录已存在;仍需要指定已确认 workflow 的保存来源,或目标比赛 URL、比赛 ID、队伍 ID。凭据不需要发到聊天中。真实 20 题尚未启动。 + +```bash +python scripts/monitor_real_competition.py \ + --live-run --workflow-id \ + --max-duration 18000 --database-url "$IPC_DATABASE_URL" +``` + +## CI 与剩余检查 + +`.github/workflows/ci.yml` 包含 PostgreSQL tests/coverage、静态和迁移检查、task-image/C5/AI 验收,以及独立 Playwright E2E 和失败诊断上传。 + +- [x] 最新全量 pytest 与覆盖率门禁通过,并保存 81.33%/80.93% 新基线。 +- [x] 最终回归后刷新正常栈应用镜像并重验健康状态。 +- [x] 完整 `python -m ruff check backend scripts tests` 通过,Windows/Linux 实跑均为零诊断;新增故障回归和完整 pytest 通过,覆盖率未下降。 +- [ ] hosted CI 在包含当前改动的 revision 上通过。 +- [x] GitHub active ruleset `25067166` 将 `test`、`e2e`、`task-image` 设为 required checks,并回读确认对 main 生效。证据为 `data/exports/github-required-checks-verification.json`、`github-main-rules-verification.json`。 +- [ ] 完成真实 20 题运行和日志监控,导出脱敏报告,检查终态席位、WP、消息清零并记录自恢复证据。 +- [x] 验证临时 PostgreSQL 自动发现/启动和每例连接池 teardown,测试后活动连接及 schema 残留均为零;异常路径回归通过。 + +完整 Ruff 已通过,证据为 `data/exports/ruff-plan-verification.json`(空诊断数组)和 `ruff-linux-verification.log`。FastAPI 声明标记复用、回调变量绑定、异常诊断和明确的输入校验错误保持既有接口/恢复语义。已修正 `.gitignore` 的 memory 路径,防止意外忽略 `backend/memory`;迁移入口脚本保留 shebang 并设置 Git executable bit。 + +CI 已改用完整 Ruff,并在成功或失败时上传 pytest JUnit 和 coverage JSON;本机通过不代表 hosted CI 已通过。 + +### 待完成工作与完成条件 + +1. **取得 hosted CI 通过证据。** 在包含本轮改动的同一 revision 上运行 `.github/workflows/ci.yml`,确认 `test`(完整 pytest、覆盖率、临时 PostgreSQL、完整 Ruff/迁移检查)、`e2e`(真实浏览器容器)和 `task-image`(C5/AI)全部通过。保存 commit SHA、CI run 链接和诊断产物;本机结果不能替代 GitHub runner 的结果。采用独立修复分支和草稿 PR 触发验收,完成前不合并。 +2. **完成真实 20 题及终态检查。** 前置条件是取得目标平台的已确认 workflow,确认对应比赛、队伍、deadline 和并发限制,且 CI 验证通过。当前数据库/API 没有 workflow,不应根据旧凭据记录中的 workflow ID 猜测比赛。准备完成后,通过显式 `--live-run` 创建新的 run,选择 20 道未解题并覆盖六类;运行期间只观察和记录 bug,不修改代码、重启 Agent、手工重试或调整 limits。观察至比赛终态并完成收尾,核对 remote 上限、首次工具调用前入口可见、静默占席、实例操作/提交/WP 重试、active/WP assignment 和 collaboration backlog 清零。保存 p50/p95/max、类别状态分布、异常与实际自恢复证据,产物为 `data/exports/real_competition_.json/.md`。若 `--max-duration` 到期时 run 仍未终结,报告保持未完成并继续只读观察;没有发生故障时如实注明未观察到自恢复。 + +真实 20 题目前缺少的是已确认 workflow 来源或比赛 URL/比赛 ID/队伍 ID,无需向聊天补发 secret。B7–B9、C 类仍属于后续 backlog,不作为本轮新增待办。 + +```bash +python -m pytest -q --require-postgres --cov=backend --cov-branch --cov-report=json +python scripts/check_coverage.py +python -m ruff check backend scripts tests +python -m compileall -q backend scripts tests +python -m alembic upgrade head --sql +docker compose config --quiet +docker compose -f docker-compose.e2e.yml config --quiet +bash scripts/c5_task_acceptance.sh +``` + +真实测试期间只记录 bug 和异常,不进行人工修复;比赛后的修改另行开展。缺少真实 20 题和 hosted required-check 证据时,整体目标保持未完成。 diff --git a/pyproject.toml b/pyproject.toml index 6b4ce09..c0caa62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ dependencies = [ [project.optional-dependencies] docker = ["docker>=7.0"] -dev = ["pytest>=8.0", "httpx>=0.27"] +dev = ["pytest>=8.0", "httpx>=0.27", "pytest-cov>=5.0", "pytest-postgresql>=6.0", "ruff>=0.6"] [project.scripts] ipc = "backend.cli:main" @@ -48,5 +48,15 @@ include = ["backend*"] testpaths = ["tests"] pythonpath = ["."] markers = [ - "postgres: requires the destructive, isolated IPC_TEST_DATABASE_URL fixture", + "postgres: requires the isolated IPC_TEST_DATABASE_URL fixture", +] + +[tool.coverage.run] +branch = true +source = ["backend"] + +[tool.coverage.report] +exclude_also = [ + "if TYPE_CHECKING:", + "raise NotImplementedError", ] diff --git a/scripts/c5_task_acceptance.sh b/scripts/c5_task_acceptance.sh index 321b4b7..bc86fde 100644 --- a/scripts/c5_task_acceptance.sh +++ b/scripts/c5_task_acceptance.sh @@ -110,4 +110,8 @@ with sync_playwright() as playwright: PY fi +if [[ -n "${IPC_E2E_BASE_URL:-}" ]]; then + run "IPC competition Playwright E2E" python3 /acceptance/playwright_e2e.py +fi + printf '\n[C5] all task-image checks passed\n' diff --git a/scripts/check_coverage.py b/scripts/check_coverage.py new file mode 100644 index 0000000..bd5d112 --- /dev/null +++ b/scripts/check_coverage.py @@ -0,0 +1,47 @@ +"""Enforce the repository's coverage floors by architectural module group.""" + +from __future__ import annotations + +import json +import sys +from pathlib import Path + +GROUPS = { + "agent-core": ("backend/agent/", "backend/members/base_member.py", "backend/core/orchestrator.py"), + "competition": ("backend/competition/",), +} +FLOOR = 80.0 +BASELINE_PATH = Path("coverage-baseline.json") + + +def main() -> int: + path = Path("coverage.json") + if not path.exists(): + print("coverage.json is missing; run pytest --cov --cov-report=json", file=sys.stderr) + return 2 + data = json.loads(path.read_text(encoding="utf-8")) + files = data.get("files", {}) + baseline = json.loads(BASELINE_PATH.read_text(encoding="utf-8")) if BASELINE_PATH.exists() else {} + failed = False + for name, prefixes in GROUPS.items(): + selected = { + file: report for file, report in files.items() + if any(file.replace("\\", "/").startswith(prefix) or file.replace("\\", "/").endswith(prefix) for prefix in prefixes) + } + covered = sum(int(report.get("summary", {}).get("covered_lines", 0)) for report in selected.values()) + total = sum(int(report.get("summary", {}).get("num_statements", 0)) for report in selected.values()) + percent = 100.0 if total == 0 else 100.0 * covered / total + print(f"{name}: {percent:.2f}% ({covered}/{total})") + baseline_percent = float((baseline.get(name) or {}).get("line_percent", 0)) + # The saved baseline is rounded to two decimals. Compare at the same + # precision so a stored 80.81% does not reject its exact 80.806% run. + if baseline_percent and round(percent, 2) < baseline_percent: + print(f"{name}: below saved baseline {baseline_percent:.2f}%", file=sys.stderr) + failed = True + if total == 0 or percent < FLOOR: + failed = True + return 1 if failed else 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/isctf_ipc_smoke.py b/scripts/isctf_ipc_smoke.py index fd40a35..c0e8053 100644 --- a/scripts/isctf_ipc_smoke.py +++ b/scripts/isctf_ipc_smoke.py @@ -26,16 +26,15 @@ from backend.blackboard import graph_store from backend.competition.fixture import FixturePlatform from backend.competition.service import CompetitionService -from backend.ops.models import PlatformWorkflowSpec from backend.mcp.mcp_client import MCPClient from backend.ops.ipc_mcp import build_ipc_mcp +from backend.ops.models import PlatformWorkflowSpec from backend.ops.questions import QuestionStore from backend.ops.store import OpsStore from backend.platform.gzctf import GZCTFAdapter, GZCTFClient from backend.platform.mapping import FieldMapping from backend.server.app import create_app - BASE_URL = "https://gz.imxbt.cn" GAME_ID = 32 SCOREBOARD_URL = f"{BASE_URL}/api/Game/{GAME_ID}/Scoreboard" diff --git a/scripts/isctf_real_ipc_resume.py b/scripts/isctf_real_ipc_resume.py index 2f05720..880a095 100644 --- a/scripts/isctf_real_ipc_resume.py +++ b/scripts/isctf_real_ipc_resume.py @@ -10,6 +10,7 @@ import asyncio import json +import logging import os import shutil import sys @@ -18,6 +19,9 @@ from datetime import datetime, timedelta, timezone from pathlib import Path +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + sys.path.insert(0, str(Path(__file__).resolve().parent)) from isctf_real_ipc_run import ( @@ -28,9 +32,9 @@ _write_config, ) +from backend.competition.service import CompetitionService, _timestamp from backend.core.orchestrator import Orchestrator from backend.core.state import AppState -from backend.competition.service import CompetitionService, _timestamp from backend.ops.service import OpsAgentService RUN_ID = sys.argv[1] if len(sys.argv) > 1 else None @@ -107,6 +111,7 @@ async def _run() -> dict[str, object]: competition.control(run_id, "pause", int(current["revision"])) print(json.dumps({"run_id": run_id, "paused": True}, ensure_ascii=False), flush=True) except Exception as exc: + _recovery_logger.debug('Error handled in _run', exc_info=True) print(json.dumps({"pause_on_exit_error": str(exc)}, ensure_ascii=False), flush=True) finally: competition.shutdown() diff --git a/scripts/isctf_real_ipc_run.py b/scripts/isctf_real_ipc_run.py index 187e104..40cdb7c 100644 --- a/scripts/isctf_real_ipc_run.py +++ b/scripts/isctf_real_ipc_run.py @@ -8,6 +8,7 @@ import asyncio import json +import logging import os import re import shutil @@ -18,15 +19,17 @@ from types import SimpleNamespace from typing import Any +from backend.competition.service import CompetitionService from backend.core.orchestrator import Orchestrator from backend.core.state import AppState -from backend.competition.service import CompetitionService from backend.mcp.mcp_client import MCPClient from backend.ops.ipc_mcp import build_ipc_mcp from backend.ops.questions import QuestionStore from backend.ops.service import OpsAgentService from backend.ops.store import OpsStore +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) BASE_URL = "https://gz.imxbt.cn" DOWNLOAD_URL = "https://download.imxbt.cn" @@ -332,7 +335,7 @@ async def call_question(name: str, arguments: dict[str, object]): try: competition.control(active["id"], "stop", int(active["revision"])) except Exception: - pass + _recovery_logger.debug('Error handled in _run', exc_info=True) finally: competition.shutdown() orchestrator.shutdown() diff --git a/scripts/migrate_legacy_data.py b/scripts/migrate_legacy_data.py old mode 100644 new mode 100755 index 1886cb0..b14ade1 --- a/scripts/migrate_legacy_data.py +++ b/scripts/migrate_legacy_data.py @@ -11,6 +11,7 @@ import argparse import hashlib import json +import logging import os import shutil import sqlite3 @@ -25,6 +26,9 @@ from alembic import command from alembic.config import Config +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + REPOSITORY_ROOT = Path(__file__).resolve().parents[1] if str(REPOSITORY_ROOT) not in sys.path: sys.path.insert(0, str(REPOSITORY_ROOT)) @@ -1070,6 +1074,7 @@ def main() -> int: try: result = run(args) except Exception as exc: + _recovery_logger.debug('Error handled in main', exc_info=True) print( json.dumps( {"status": "failed", "error": f"{type(exc).__name__}: {exc}"}, diff --git a/scripts/monitor_real_competition.py b/scripts/monitor_real_competition.py new file mode 100644 index 0000000..c0cf38b --- /dev/null +++ b/scripts/monitor_real_competition.py @@ -0,0 +1,642 @@ +"""Observe competition execution, anomalies and autonomous recovery. + +After an explicitly requested Start, this process only reads APIs, logs and +PostgreSQL. It never stops, retries, resumes or otherwise repairs a live run. +""" +from __future__ import annotations + +import argparse +import json +import math +import os +import re +import time +from collections import Counter, defaultdict +from datetime import datetime, timedelta, timezone +from pathlib import Path +from typing import Any +from uuid import uuid4 + +import psycopg +import requests +import yaml + +REQUIRED_CATEGORIES = ("web", "misc", "reverse", "crypto", "pwn", "ai") +TERMINAL = {"finished", "stopped"} +SECRET_KEYS = { + "flag", "candidate", "normalized_flag", "password", "api_key", "token", + "access_token", "refresh_token", "secret", "secret_value", "client_secret", + "cookie", "set-cookie", "authorization", "x-api-key", "database_url", + "cookies", "secrets", "credentials", +} +SUCCESSFUL_RECOVERY = { + "session.handed_off", "session.rebuilt", "run.recovered", "run.resumed", + "project_recovered", "tool_order_repaired", + "instance.repaired", +} + + +def timestamp(value: Any) -> datetime | None: + if not value: + return None + parsed = value if isinstance(value, datetime) else datetime.fromisoformat(str(value).replace("Z", "+00:00")) + if parsed.tzinfo is None: + raise ValueError("monitor timestamps must include a timezone") + return parsed + + +def redact(value: Any, secrets: tuple[str, ...] = ()) -> Any: + """Remove known credentials/flags, including inside serialized tool output.""" + if isinstance(value, dict): + return { + key: "[redacted]" if str(key).lower() in SECRET_KEYS else redact(item, secrets) + for key, item in value.items() + } + if isinstance(value, (list, tuple)): + return [redact(item, secrets) for item in value] + if isinstance(value, str): + # Native tool messages often contain JSON inside a content string. + if value.strip().startswith(("{", "[")): + try: + encoded = json.loads(value) + except ValueError: + pass + else: + return json.dumps(redact(encoded, secrets), ensure_ascii=False) + for secret in sorted(set(secrets), key=len, reverse=True): + if secret: + value = value.replace(secret, "[redacted]") + value = re.sub(r"(?:flag|ctf)\{[^}\r\n]+\}", "[redacted-flag]", value, flags=re.IGNORECASE) + value = re.sub(r"(://)[^/\s:@]+:[^/@\s]+@", r"\1[redacted]@", value) + value = re.sub( + r"(?i)((?:authorization|cookie|set-cookie|x-api-key)\s*:\s*)[^\r\n]+", + r"\1[redacted]", value, + ) + return re.sub( + r"(?i)((?:api_key|access_token|token|password|secret|flag|candidate)=)[^&\s]+", + r"\1[redacted]", value, + ) + return value + + +def credential_values(root: Path) -> tuple[str, ...]: + """Load deployment secret values for redaction; never print or export them.""" + values = {value for key, value in os.environ.items() + if key.startswith("IPC_") and any(word in key for word in ("KEY", "TOKEN", "COOKIE", "PASSWORD")) and value} + + def collect(item, secret_context=False): + if isinstance(item, dict): + for key, child in item.items(): + collect(child, secret_context or str(key).lower() in SECRET_KEYS) + elif isinstance(item, list): + for child in item: + collect(child, secret_context) + elif secret_context and isinstance(item, str) and item: + values.add(item) + + for path in (root / "backend/config/config.yaml", root / "data/ops-agent/secrets.json"): + if path.is_file(): + collect(yaml.safe_load(path.read_text(encoding="utf-8")), path.suffix == ".json") + return tuple(values) + + +def percentile(values: list[float], quantile: float) -> float | None: + if not values: + return None + ordered = sorted(values) + offset = (len(ordered) - 1) * quantile + low, high = math.floor(offset), math.ceil(offset) + return round(ordered[low] + (ordered[high] - ordered[low]) * (offset - low), 3) + + +def distribution(values: list[float]) -> dict: + return {"count": len(values), "p50": percentile(values, 0.5), + "p95": percentile(values, 0.95), "max": round(max(values), 3) if values else None} + + +def choose_challenges(challenges: list[dict[str, Any]], count: int = 20) -> list[str]: + if count < len(REQUIRED_CATEGORIES): + raise ValueError("challenge count must cover all required categories") + unsolved = [item for item in challenges if not item.get("solved")] + by_id = {str(item["external_id"]): item for item in unsolved} + selected: list[str] = [] + for category in REQUIRED_CATEGORIES: + candidate = next((key for key, item in by_id.items() if item.get("category") == category), None) + if candidate is None: + raise RuntimeError(f"workflow has no unsolved {category} challenge") + selected.append(candidate) + for key in sorted(by_id, key=lambda key: (str(by_id[key].get("category", "")), key)): + if len(selected) == count: + break + if key not in selected: + selected.append(key) + if len(selected) < count: + raise RuntimeError(f"workflow exposes only {len(by_id)} unique unsolved challenges; need {count}") + return selected + + +def db_snapshot(connection, run_id: str, *, after_event=0, after_agent_event=0) -> dict[str, Any]: + """One read-only, consistent snapshot, with incremental event collection.""" + def rows(query, params=(run_id,)): + return [dict(row) for row in connection.execute(query, params).fetchall()] + + with connection.transaction(): + if connection.execute("SELECT 1 FROM competition_runs WHERE id=%s", (run_id,)).fetchone() is None: + raise ValueError("run is absent from the monitoring database; verify the API and database configuration") + events = rows("""SELECT event_id,kind,payload,created_at FROM competition_run_events + WHERE run_id=%s AND event_id>%s ORDER BY event_id""", (run_id, after_event)) + agent_events = rows("""SELECT e.*,s.challenge_id FROM agent_events e + JOIN competition_sessions s ON s.id=e.session_id + WHERE s.run_id=%s AND e.event_id>%s ORDER BY e.event_id""", (run_id, after_agent_event)) + challenges = rows("""SELECT c.id,c.external_id,c.project_id,c.state,c.metadata, + c.first_assigned_at,c.deadline_at,c.instance_generation + FROM competition_challenges c JOIN competition_run_challenges rc ON rc.challenge_id=c.id + WHERE rc.run_id=%s ORDER BY c.id""") + assignments = rows("""SELECT id,challenge_id,session_id,member,role,epoch,released_at + FROM competition_assignments WHERE run_id=%s ORDER BY id""") + submissions = rows("""SELECT id,challenge_id,session_id,member,status,created_at,submitted_at,candidate + FROM competition_submissions WHERE run_id=%s ORDER BY created_at""") + jobs = rows("""SELECT challenge_id,session_id,status,attempts,next_attempt_at,last_error + FROM competition_wp_jobs WHERE run_id=%s""") + instances = rows("""SELECT challenge_id,state,owned,metadata,updated_at FROM competition_instances WHERE run_id=%s""") + messages = rows("""SELECT count(*) AS total, + count(*) FILTER (WHERE m.sequence>COALESCE(c.sequence,0)) AS backlog, + count(*) FILTER (WHERE m.envelope->>'sender_member_id'<>'competition-control') AS member_messages + FROM competition_messages m LEFT JOIN competition_message_cursors c + ON c.session_id=m.envelope->>'receiver_session_id' WHERE m.run_id=%s""")[0] + health = rows("""SELECT h.* FROM agent_session_health h JOIN competition_sessions s ON s.id=h.session_id + WHERE s.run_id=%s ORDER BY h.session_id""") + return {"events": events, "agent_events": agent_events, "challenges": challenges, + "assignment_rows": assignments, "submission_rows": submissions, + "wp_jobs": jobs, "instance_rows": instances, "messages": messages, + "agent_sessions": health} + + +def log_rows(session, base: str, project_ids: list[str], secrets: tuple[str, ...]) -> list[dict]: + records = [] + for project_id in project_ids: + for kind in ("project", "tool", "llm", "memory"): + response = session.get(f"{base}/logs/{project_id}", params={"kind": kind, "limit": 500}, timeout=30) + response.raise_for_status() + payload = response.json() + entries = payload if isinstance(payload, list) else payload.get("entries", []) + for item in entries: + records.append(redact({**item, "project_id": project_id, "log_kind": kind}, secrets)) + return records + + +def elapsed(start: Any, end: Any) -> float | None: + start_time, end_time = timestamp(start), timestamp(end) + if start_time is None or end_time is None or end_time < start_time: + return None + return (end_time - start_time).total_seconds() + + +def capacity_violations(events: list[dict], initial_limit: int) -> list[dict]: + """Check new admissions; lowering a limit never preempts prior instances.""" + active = set() + limit = initial_limit + violations = [] + for event in events: + payload = event.get("payload") or {} + challenge_id = payload.get("challenge_id") + if event["kind"] == "run.limits_updated" and "remote_concurrency" in payload.get("limits", {}): + limit = int(payload["limits"]["remote_concurrency"]) + elif event["kind"] in {"instance.stopped", "instance.expired"}: + active.discard(challenge_id) + elif event["kind"] == "instance.started": + if challenge_id not in active and not payload.get("repair") and len(active) >= limit: + violations.append({"kind": "remote.capacity_exceeded", "created_at": event["created_at"], + "challenge_id": challenge_id, "limit": limit, "previously_active": len(active)}) + active.add(challenge_id) + return violations + + +def tool_outcome(payload: dict) -> str: + message = payload.get("message") or {} + raw = message.get("content", message.get("output", "")) + try: + output = json.loads(raw) if isinstance(raw, str) else raw + except ValueError: + output = {} + if not isinstance(output, dict): + return "unknown" + status = output.get("status") + if status in {"unknown", "cancelled"}: + return str(status) + if output.get("error") or output.get("ok") is False or output.get("invalid_action") or status in {"failed", "rejected", "invalid_action"}: + return "error" + observation = str(output.get("observation") or "") + if re.search(r"[\{'\"]error['\"]?\s*:", observation): + return "error" + return "ok" + + +def metrics(snapshot: dict, run_events: list[dict], agent_events: list[dict], logs: list[dict], samples: list[dict]) -> dict: + """Match timings by challenge/session/call/submission, never by first kind.""" + latency: dict[str, list[float]] = defaultdict(list) + durations = [] + calls = {} + results = {} + session_events = defaultdict(list) + for event in agent_events: + session_events[event["session_id"]].append(event) + payload = event.get("payload") or {} + call_id = payload.get("id") + if call_id and event["kind"] == "tool_call": + calls[(event["session_id"], call_id)] = event + if call_id and event["kind"] == "tool_result": + results[(event["session_id"], call_id)] = event + for key, event in calls.items(): + result = results.get(key) + duration = elapsed(event["created_at"], result["created_at"]) if result else None + name = (event.get("payload") or {}).get("name", "unknown") + durations.append({"session_id": key[0], "call_id": key[1], "name": name, + "duration_seconds": duration, + "outcome": tool_outcome(result["payload"]) if result else "pending"}) + if duration is not None: + latency["tool_call_to_result"].append(duration) + if name == "mcp_tool": + latency["mcp_call_to_result"].append(duration) + + allocated = {} + member_started = {} + submission_verdicts = {} + for event in run_events: + payload = event.get("payload") or {} + key = (payload.get("challenge_id"), payload.get("session_id")) + if event["kind"] == "assignment.started": + allocated.setdefault(key, event["created_at"]) + if event["kind"] == "member.started": + member_started.setdefault(key, event["created_at"]) + if event["kind"] == "submission.verdict": + submission_verdicts.setdefault(payload.get("submission_id"), event["created_at"]) + for challenge in snapshot["challenges"]: + duration = elapsed((challenge.get("metadata") or {}).get("ready_at"), challenge.get("first_assigned_at")) + if duration is not None: + latency["import_to_primary_assignment"].append(duration) + if (challenge.get("metadata") or {}).get("remote"): + latency["remote_queue"].append(duration) + for key, start in allocated.items(): + duration = elapsed(start, member_started.get(key)) + if duration is not None: + latency["assignment_to_member_start"].append(duration) + events = session_events[key[1]] + first_response = next((event for event in events if event["kind"] == "status" + and event["payload"].get("status") == "provider.first_response"), None) + if first_response: + duration = elapsed(start, first_response["created_at"]) + if duration is not None: + latency["assignment_to_first_provider_response"].append(duration) + for event in events: + if event["kind"] == "status" and event["payload"].get("status") == "provider.first_response": + duration = event["payload"].get("latency_seconds") + if isinstance(duration, (int, float)): + latency["provider_time_to_first_response"].append(duration) + for submission in snapshot["submission_rows"]: + duration = elapsed(submission.get("submitted_at"), submission_verdicts.get(submission["id"])) + if duration is not None: + latency["flag_submit_to_verdict"].append(duration) + for row in logs: + if row.get("event") == "member_start": + challenge = next((item for item in snapshot["challenges"] if item.get("project_id") == row.get("project_id")), None) + if challenge: + duration = elapsed(challenge.get("first_assigned_at"), row.get("ts")) + if duration is not None: + latency["assignment_to_logged_member_start"].append(duration) + + assignments = snapshot["assignment_rows"] + active = [row for row in assignments if row.get("released_at") is None] + resolved_mcp = [row for row in durations if row["name"] == "mcp_tool" and row["outcome"] != "pending"] + kinds = Counter(event["kind"] for event in run_events) + categories = defaultdict(Counter) + for challenge in snapshot["challenges"]: + categories[(challenge.get("metadata") or {}).get("category", "misc")][challenge["state"]] += 1 + remote_samples = [row["resource_capacity"].get("remote", {}) for row in samples] + return { + "latency": {name: distribution(latency.get(name, [])) for name in ( + "import_to_primary_assignment", "assignment_to_member_start", + "assignment_to_logged_member_start", "assignment_to_first_provider_response", + "provider_time_to_first_response", "tool_call_to_result", "mcp_call_to_result", + "flag_submit_to_verdict", "remote_queue", + )}, + "tool_calls": durations, + "mcp": {"calls": sum(row["name"] == "mcp_tool" for row in durations), + "resolved": len(resolved_mcp), "errors": sum(row["outcome"] == "error" for row in resolved_mcp), + "unknown": sum(row["outcome"] == "unknown" for row in resolved_mcp), + "error_rate": (sum(row["outcome"] == "error" for row in resolved_mcp) / len(resolved_mcp)) if resolved_mcp else None}, + "containers": {action: {"attempts": kinds[f"instance.{action}_requested"], "completed": kinds[f"instance.{completed}"]} + for action, completed in (("start", "started"), ("renew", "renewed"), ("rebuild", "rebuilt"), ("stop", "stopped"))}, + "remote_capacity": {"max_used": max((item.get("used", 0) for item in remote_samples), default=0), "samples": remote_samples}, + "assignments": {"total": len(assignments), "active": len(active), "released": len(assignments) - len(active), + "active_wp": sum(row["role"] == "wp" for row in active), + "helpers": sum(row["role"] == "helper" for row in assignments)}, + "submissions": dict(Counter(row["status"] for row in snapshot["submission_rows"])), + "wp": dict(Counter(row["status"] for row in snapshot["wp_jobs"])), + "instances": dict(Counter(row["state"] for row in snapshot["instance_rows"])), + "collaboration_backlog": int(snapshot["messages"].get("backlog", 0)), + "collaboration": snapshot["messages"], + "states": dict(Counter(row["state"] for row in snapshot["challenges"])), + "category_states": {name: dict(values) for name, values in categories.items()}, + } + + +def acceptance_checks(snapshot: dict, measured: dict, status: str, observations: list[dict], run_events=()) -> dict: + def check(ok, evidence, pending=False): + return {"status": "in_progress" if pending else "pass" if ok else "fail", "evidence": evidence} + assignments = measured["assignments"] + terminal = status in TERMINAL + remote_ids = {row["id"] for row in snapshot["challenges"] if (row.get("metadata") or {}).get("remote")} + target_missing = [] + for session_id in {row["session_id"] for row in snapshot["assignment_rows"] if row["challenge_id"] in remote_ids and row["role"] != "wp"}: + events = sorted((row for row in snapshot["agent_events"] if row["session_id"] == session_id), key=lambda row: row["sequence"]) + first_tool = next((row["sequence"] for row in events if row["kind"] == "tool_call"), None) + target = next((row["sequence"] for row in events if row["event_key"].startswith("recon:") + and "target_instance" in json.dumps(row["payload"])), None) + if first_tool is not None and (target is None or target >= first_tool): + target_missing.append(session_id) + quiet = [row for row in observations if row["kind"] == "agent.no_events_for_five_minutes"] + capacity_failures = [row for row in observations if row["kind"] == "remote.capacity_exceeded"] + active_jobs = sum(row["status"] not in {"done", "failed"} for row in snapshot["wp_jobs"]) + lifecycle_issues = [] + active_instances = set() + rebuilds = defaultdict(list) + for row in run_events: + challenge_id = (row.get("payload") or {}).get("challenge_id") + if row["kind"] == "instance.started": + active_instances.add(challenge_id) + elif row["kind"] == "instance.expired": + active_instances.discard(challenge_id) + elif row["kind"] == "instance.stopped": + if challenge_id not in active_instances: + lifecycle_issues.append({"kind": "instance.duplicate_stop", "challenge_id": challenge_id}) + active_instances.discard(challenge_id) + elif row["kind"] == "instance.rebuilt": + at = timestamp(row["created_at"]) + rebuilds[challenge_id] = [previous for previous in rebuilds[challenge_id] if (at - previous).total_seconds() < 60] + rebuilds[challenge_id].append(at) + if len(rebuilds[challenge_id]) > 3: + lifecycle_issues.append({"kind": "instance.rebuild_storm", "challenge_id": challenge_id}) + return { + "terminal_run": check(terminal, status, not terminal), + "remote_capacity": check(not capacity_failures, capacity_failures), + "target_before_first_tool": check(not target_missing, {"missing_sessions": target_missing}), + "no_five_minute_silent_seat": check(not quiet, quiet), + "assignment_cleanup": check(assignments["active"] == 0, assignments, not terminal), + "wp_cleanup": check(active_jobs == 0 and assignments["active_wp"] == 0, + {"outstanding_jobs": active_jobs, "active_wp": assignments["active_wp"]}, not terminal), + "collaboration_cleanup": check(measured["collaboration_backlog"] == 0, measured["collaboration_backlog"], not terminal), + "wp_retry_bound": check(all(row["attempts"] <= 5 for row in snapshot["wp_jobs"]), + {row["challenge_id"]: row["attempts"] for row in snapshot["wp_jobs"]}), + "container_lifecycle": check(not lifecycle_issues, lifecycle_issues), + } + + +def markdown_report(report: dict[str, Any]) -> str: + def cell(value): + return str(value).replace("|", "\\|").replace("\n", " ").replace("\r", " ") + final = report.get("final_resources") or {} + measured = report.get("metrics") or final + assignments = measured.get("assignments") or {} + lines = ["# Competition monitor report", "", f"Run: `{cell(report.get('run_id', ''))}`", + f"Status: `{cell(report.get('status', 'unknown'))}`", "", + f"Observation duration: {report.get('duration_seconds')} seconds.", + f"Self-recovery confirmed by later progress: {bool(report.get('self_recovery_observed'))}.", "", + "## Latency (seconds)", "", "| metric | count | p50 | p95 | max |", "| --- | ---: | ---: | ---: | ---: |"] + for name, values in sorted((report.get("latency") or {}).items()): + lines.append(f"| {cell(name)} | {values.get('count', '-')} | {values.get('p50')} | {values.get('p95')} | {values.get('max')} |") + lines.extend(["", "## Final resources", "", f"Assignments: {json.dumps(assignments, ensure_ascii=False)}.", + f"WP: {json.dumps(measured.get('wp', {}), ensure_ascii=False)}.", + f"States by category: {json.dumps(measured.get('category_states', {}), ensure_ascii=False)}.", + f"Containers: {json.dumps(measured.get('containers', {}), ensure_ascii=False)}.", + f"Collaboration backlog: {measured.get('collaboration_backlog', 0)}.", "", + "## Acceptance", "", "| invariant | result |", "| --- | --- |"]) + for name, result in sorted((report.get("checks") or {}).items()): + lines.append(f"| {cell(name)} | {cell(result['status'])} |") + lines.extend(["", "## Observed anomalies and recovery", "", "| type | event | time |", "| --- | --- | --- |"]) + for key in ("anomalies", "recoveries"): + for row in report.get(key) or []: + lines.append(f"| {key} | {cell(row.get('kind', 'unknown'))} | {cell(row.get('created_at', ''))} |") + lines.extend(["", "Unavailable timing is reported with count 0 and null percentiles; it is not treated as zero latency.", + "The monitor made no remediation calls. A duration limit ends observation and leaves a live run running."]) + return "\n".join(lines) + "\n" + + +def export_report(report: dict, export: Path, secrets=()) -> tuple[Path, Path]: + export.mkdir(parents=True, exist_ok=True) + safe = redact(report, secrets) + # run_id comes from a server/CLI; do not permit arbitrary output paths. + run_id = str(report["run_id"]) + if not re.fullmatch(r"[a-zA-Z0-9_-]{1,128}", run_id): + raise ValueError("invalid run id for export") + base = export / f"real_competition_{run_id}_monitor" + json_path, markdown_path = base.with_suffix(".json"), base.with_suffix(".md") + contents = {".json": json.dumps(safe, ensure_ascii=False, indent=2, default=str), ".md": markdown_report(safe)} + for suffix, content in contents.items(): + # Preserve the original plan's acceptance filenames as well as the + # explicit monitor filenames. Replace each export atomically so a + # crash during sampling leaves the preceding report readable. + for target in (base.with_suffix(suffix), export / f"real_competition_{run_id}{suffix}"): + temporary = target.with_suffix(target.suffix + ".tmp") + temporary.write_text(content, encoding="utf-8") + temporary.replace(target) + return json_path, markdown_path + + +def monitor(base_url: str, run_id: str, duration: float, database_url: str, *, export=Path("data/exports"), + secrets=(), poll_interval=5.0, session=None, selection=None, drain_timeout=600.0) -> dict[str, Any]: + session = session or requests.Session() + base = base_url.rstrip("/") + started = time.monotonic() + samples, anomalies, recoveries, events, agent_events, logs = [], [], [], [], [], [] + after_event = after_agent = 0 + seen_logs, seen_anomalies = set(), set() + snapshot = None + report = None + status = "unknown" + observed_until = None + export.mkdir(parents=True, exist_ok=True) + while True: + try: + response = session.get(f"{base}/api/runs/{run_id}", timeout=30) + response.raise_for_status() + run_view = response.json() + # Each sample gets a fresh read-only connection, so a PostgreSQL + # restart can recover observation without restarting any Agent. + with psycopg.connect(database_url, row_factory=psycopg.rows.dict_row, autocommit=True) as connection: + connection.execute("SET default_transaction_read_only TO on") + connection.execute("SET default_transaction_isolation TO 'repeatable read'") + connection.execute("SET statement_timeout TO 30000") + snapshot = db_snapshot(connection, run_id, after_event=after_event, after_agent_event=after_agent) + secrets = tuple(set(secrets) | {row["candidate"] for row in snapshot["submission_rows"] if row.get("candidate")}) + for key, target in (("events", events), ("agent_events", agent_events)): + target.extend(snapshot[key]) + after_event = max((row["event_id"] for row in events), default=0) + after_agent = max((row["event_id"] for row in agent_events), default=0) + snapshot["events"], snapshot["agent_events"] = events, agent_events + status = run_view["run"]["status"] + ends_at = timestamp((run_view["run"].get("config_snapshot") or {}).get("workflow_spec", {}).get("ends_at")) + if duration <= 0 and ends_at is None: + raise ValueError("workflow has no deadline; specify --max-duration") + observed_until = (ends_at + timedelta(seconds=drain_timeout)) if ends_at and duration <= 0 else None + current_logs = log_rows(session, base, [row["project_id"] for row in snapshot["challenges"] if row.get("project_id")], secrets) + for row in current_logs: + key = json.dumps(row, sort_keys=True, default=str) + if key not in seen_logs: + seen_logs.add(key) + logs.append(row) + sample = {"at": datetime.now(timezone.utc).isoformat(), "status": status, + "resource_capacity": run_view.get("resource_capacity", {}), + "agent_sessions": snapshot["agent_sessions"]} + samples.append(sample) + remote_capacity = sample["resource_capacity"].get("remote") or {} + if remote_capacity.get("source") not in {None, "unreported"} and remote_capacity.get("used", 0) > remote_capacity.get("limit", 0): + # A lower hot-updated cap may intentionally grandfather + # existing tasks. Record the observation for review. + anomalies.append({"kind": "remote.usage_above_current_limit", "created_at": sample["at"], + "capacity": remote_capacity, "requires_admission_review": True}) + initial_limit = (run_view["run"].get("config_snapshot") or {}).get("limits_snapshot", {}).get("remote_concurrency") + if initial_limit is not None: + for violation in capacity_violations(events, int(initial_limit)): + key = (violation["kind"], violation["challenge_id"], str(violation["created_at"])) + if key not in seen_anomalies: + seen_anomalies.add(key) + anomalies.append(violation) + occupied = {row["session_id"] for row in snapshot["assignment_rows"] if row.get("released_at") is None} + for row in snapshot["agent_sessions"]: + silence = elapsed(row.get("last_event_at") or row.get("last_progress_at"), sample["at"]) + if row["session_id"] in occupied and silence is not None and silence >= 300: + key = ("agent.no_events_for_five_minutes", row["session_id"]) + if key not in seen_anomalies: + seen_anomalies.add(key) + anomalies.append({"kind": key[0], "session_id": key[1], "created_at": sample["at"], "silent_seconds": silence}) + measured = metrics(snapshot, events, agent_events, logs, samples) + checks = acceptance_checks(snapshot, measured, status, anomalies, events) + records = [*events, *agent_events, *logs] + for row in records: + kind = str(row.get("kind", row.get("event", ""))) + payload = row.get("payload") or {} + signal = payload.get("status") if kind == "status" else kind + if signal in SUCCESSFUL_RECOVERY: + key = ("recovery", row.get("session_id"), row.get("event_id"), kind, str(row.get("created_at", row.get("ts")))) + if key not in seen_anomalies: + seen_anomalies.add(key) + recoveries.append({**row, "kind": signal}) + if kind == "error" or any(word in kind for word in ("failed", "stalled", "blocked", "lost")): + key = (kind, row.get("session_id"), row.get("event_id"), str(row.get("created_at", row.get("ts")))) + if key not in seen_anomalies: + seen_anomalies.add(key) + anomalies.append(row) + confirmed_recoveries = [] + for recovery in recoveries: + payload = recovery.get("payload") or {} + recovered_session = recovery.get("session_id") or payload.get("session_id") + recovered_challenge = recovery.get("challenge_id") or payload.get("challenge_id") + if not recovered_challenge and recovery.get("project_id"): + recovered_challenge = next((row["id"] for row in snapshot["challenges"] + if row.get("project_id") == recovery["project_id"]), None) + recovered_at = recovery.get("created_at", recovery.get("ts")) + run_recovery = str(recovery.get("kind", "")).startswith("run.") + later = [row for row in agent_events if row["kind"] == "tool_result" and tool_outcome(row["payload"]) == "ok" + and ((recovered_session and row["session_id"] == recovered_session) + or (recovered_challenge and row.get("challenge_id") == recovered_challenge) + or run_recovery) + and elapsed(recovered_at, row["created_at"]) is not None + and elapsed(recovered_at, row["created_at"]) > 0] + if later: + confirmed_recoveries.append({"kind": recovery["kind"], "session_id": recovered_session, + "progress_event_id": later[0]["event_id"]}) + report = {"run_id": run_id, "status": status, "selection": selection or [], + "duration_seconds": round(time.monotonic() - started, 3), + "latency": measured["latency"], "metrics": measured, "samples": samples, + "anomalies": anomalies, "recoveries": recoveries, + "confirmed_recoveries": confirmed_recoveries, + "self_recovery_observed": bool(confirmed_recoveries), "checks": checks, + "final_resources": {**measured, "agent_sessions": snapshot["agent_sessions"]}, + "run_events": events, "agent_events": agent_events, "logs": logs, + "read_only_observation": True, "termination_reason": "observing"} + report["model_mode"] = (run_view["run"].get("config_snapshot") or {}).get("member_config", {}).get("api_format", "unknown") + if selection: + categories = {row.get("metadata", {}).get("category") for row in snapshot["challenges"]} + report["checks"]["twenty_challenge_selection"] = { + "status": "pass" if len(selection) == len(snapshot["challenges"]) == 20 and set(REQUIRED_CATEGORIES).issubset(categories) else "fail", + "evidence": {"selected": len(selection), "imported": len(snapshot["challenges"]), "categories": sorted(categories)}, + } + now = datetime.now(timezone.utc) + reason = "terminal_run" if status in TERMINAL else "max_duration" if duration > 0 and time.monotonic() - started >= duration else "deadline_drain_timeout" if observed_until and now >= observed_until else None + report["termination_reason"] = reason or "observing" + export_report(report, export, secrets) + print(json.dumps({"run_id": run_id, "status": status, "samples": len(samples), + "active_assignments": measured["assignments"]["active"], + "anomalies": len(anomalies), "recoveries": len(confirmed_recoveries)}), flush=True) + if reason: + return report + except (requests.RequestException, psycopg.Error) as exc: + error = {"kind": "monitor.collection_failed", "created_at": datetime.now(timezone.utc).isoformat(), + "error": redact(str(exc), secrets)} + anomalies.append(error) + partial = {**(report or {}), "run_id": run_id, "status": status, "anomalies": anomalies, + "termination_reason": "monitor_error", "read_only_observation": True, + "duration_seconds": round(time.monotonic() - started, 3)} + export_report(partial, export, secrets) + if duration > 0 and time.monotonic() - started >= duration: + raise + wait = min(poll_interval, max(0.01, duration - (time.monotonic() - started))) if duration > 0 else poll_interval + time.sleep(wait) + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--base-url", default=os.environ.get("IPC_BASE_URL", "http://127.0.0.1:8000")) + parser.add_argument("--workflow-id", help="confirmed workflow to use; required if more than one is confirmed") + parser.add_argument("--run-id", help="observe an existing run without starting any work") + parser.add_argument("--max-duration", type=float, default=0.0, help="observation time limit; default follows workflow deadline; does not stop the run") + parser.add_argument("--live-run", action="store_true", help="acknowledge a new real competition run and submissions") + parser.add_argument("--database-url", default=os.environ.get("IPC_DATABASE_URL", "")) + parser.add_argument("--root", type=Path, default=Path.cwd()) + parser.add_argument("--export-dir", type=Path, default=Path("data/exports")) + args = parser.parse_args() + if not args.database_url: + parser.error("--database-url or IPC_DATABASE_URL is required") + if args.max_duration < 0: + parser.error("--max-duration must be nonnegative") + selection = [] + session = requests.Session() + base = args.base_url.rstrip("/") + if args.live_run and not args.run_id: + response = session.get(f"{base}/api/ops/workflows", timeout=30) + response.raise_for_status() + confirmed = [row for row in response.json().get("workflows", []) if row.get("status") == "confirmed"] + if args.workflow_id: + confirmed = [row for row in confirmed if row["id"] == args.workflow_id] + if len(confirmed) != 1: + parser.error("select exactly one confirmed workflow with --workflow-id") + workflow = confirmed[0] + spec = workflow.get("spec") or {} + if args.max_duration == 0 and not spec.get("ends_at"): + parser.error("workflow has no deadline; specify --max-duration before Start") + response = session.post(f"{base}/api/workflows/{workflow['id']}/preflight", timeout=60) + response.raise_for_status() + selection = choose_challenges(response.json().get("challenges", [])) + # Verify durable observation before initiating real work. A wrong DSN + # must fail before Start, not leave a live run without its monitor. + with psycopg.connect(args.database_url, row_factory=psycopg.rows.dict_row, autocommit=True) as connection: + connection.execute("SET default_transaction_read_only TO on") + stored = connection.execute("SELECT status FROM workflows WHERE id=%s", (workflow["id"],)).fetchone() + if stored is None or stored["status"] != "confirmed": + parser.error("monitoring database has no matching confirmed workflow; Start was not called") + response = session.post(f"{base}/api/workflows/{workflow['id']}/start", + json={"idempotency_key": f"monitor-{uuid4().hex}", "select": selection}, timeout=120) + response.raise_for_status() + args.run_id = response.json()["run"]["id"] + if not args.run_id: + parser.error("--run-id is required unless --live-run is used") + report = monitor(base, args.run_id, args.max_duration, args.database_url, export=args.export_dir, + secrets=credential_values(args.root), session=session, selection=selection) + if any(row["status"] == "fail" for row in report.get("checks", {}).values()): + return 1 + return 0 if report["status"] in TERMINAL else 2 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/p3_docker_e2e_probe.py b/scripts/p3_docker_e2e_probe.py index 095c503..7b29c75 100644 --- a/scripts/p3_docker_e2e_probe.py +++ b/scripts/p3_docker_e2e_probe.py @@ -12,7 +12,6 @@ """ from __future__ import annotations -import json import sys from psycopg.types.json import Jsonb @@ -134,6 +133,7 @@ def delete_container(self, g, c): return None def policy_ordering(): from datetime import datetime, timezone + from backend.competition.policy import Challenge, plan_assignments now = datetime.now(timezone.utc) diff --git a/scripts/p4_docker_e2e_probe.py b/scripts/p4_docker_e2e_probe.py index cb59492..e72b337 100644 --- a/scripts/p4_docker_e2e_probe.py +++ b/scripts/p4_docker_e2e_probe.py @@ -20,8 +20,12 @@ """ from __future__ import annotations +import logging import sys +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + results: list[tuple[str, bool, str]] = [] @@ -108,6 +112,7 @@ def execute(self, name, arguments, *, idempotency_key): def t7_event_keys(): import hashlib + from backend.agent.session import SessionNeedsRebuild writer = _MemWriter(epoch=9) @@ -171,11 +176,13 @@ def t3_self_heal(): except SessionNeedsRebuild: check("T3 non-400 propagates unchanged", False, "wrongly rebuilt") except Exception: + _recovery_logger.debug('Error handled in t3_self_heal', exc_info=True) check("T3 non-400 propagates unchanged", True, "raised as-is") def t4_ownership_and_throttle(): from types import SimpleNamespace + from backend.core.orchestrator import Orchestrator from backend.persistence.database import Database @@ -211,6 +218,7 @@ def t4_ownership_and_throttle(): def t12_hardening(): import psycopg.errors + from backend.api import project as project_api calls = {"n": 0} @@ -235,6 +243,7 @@ def always(): check("T12 persistent deadlock propagates", True, "raised after one retry") import os + import backend.persistence as persist_pkg env_path = os.path.join( os.path.dirname(persist_pkg.__file__), "migrations", "env.py" @@ -251,6 +260,7 @@ def main(): try: fn() except Exception as exc: + _recovery_logger.debug('Error handled in main', exc_info=True) check(f"{fn.__name__} ran without crashing", False, f"{type(exc).__name__}: {exc}") passed = sum(1 for _n, ok, _d in results if ok) total = len(results) diff --git a/scripts/p5_docker_e2e_probe.py b/scripts/p5_docker_e2e_probe.py index 0bb1d76..a74fcff 100644 --- a/scripts/p5_docker_e2e_probe.py +++ b/scripts/p5_docker_e2e_probe.py @@ -20,10 +20,14 @@ """ from __future__ import annotations +import logging import os import sys import tempfile +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + results: list[tuple[str, bool, str]] = [] @@ -37,9 +41,9 @@ def check(name, ok, detail=""): def _member_deps(db, tmp): from backend.core.logging_util import IPCLogger - from backend.members.base_member import MemberDeps from backend.mcp.mcp_client import MCPRegistry from backend.mcp.shared import build_browser_mcp + from backend.members.base_member import MemberDeps from backend.memory.memory_mcp import build_memory_mcp from backend.memory.memory_store import MemoryStore from backend.sandbox.sandbox import LocalSandbox @@ -158,7 +162,10 @@ def p52_streaming_mock(): from backend.agent.runtime import AgentRuntime from backend.core.config import LLMConfig from backend.members.member_tools import ( - MEMBER_TOOLS, is_parallel_safe, is_terminal, tool_call_for_action, + MEMBER_TOOLS, + is_parallel_safe, + is_terminal, + tool_call_for_action, ) from backend.members.mock_adapter import MockAdapter @@ -273,11 +280,13 @@ def main(): try: fn() except Exception as exc: + _recovery_logger.debug('Error handled in main', exc_info=True) check(f"{name} ran without crashing", False, f"{type(exc).__name__}: {exc}") finally: try: cleanup(db, pids) except Exception as exc: + _recovery_logger.debug('Error handled in main', exc_info=True) print(f"[WARN] probe cleanup failed: {exc}") db.close() passed = sum(1 for _n, ok, _d in results if ok) diff --git a/scripts/playwright_e2e.py b/scripts/playwright_e2e.py new file mode 100644 index 0000000..26bc42e --- /dev/null +++ b/scripts/playwright_e2e.py @@ -0,0 +1,168 @@ +"""Deterministic IPC competition browser acceptance test. + +The E2E compose stack supplies a fake platform and mock models. The script is +also useful locally: set IPC_E2E_BASE_URL and it will drive the running app, +capturing a trace, screenshot, and browser console on failure. +""" + +from __future__ import annotations + +import json +import logging +import os +from pathlib import Path +from uuid import uuid4 + +from playwright.sync_api import sync_playwright + +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + +def main() -> int: + base = os.environ.get("IPC_E2E_BASE_URL", "http://127.0.0.1:8000") + artifact = Path(os.environ.get("IPC_E2E_ARTIFACT_DIR", "data/exports/e2e")) + artifact.mkdir(parents=True, exist_ok=True) + console: list[str] = [] + run_id = None + evidence = {} + with sync_playwright() as playwright: + executable_path = os.environ.get("IPC_PLAYWRIGHT_EXECUTABLE") + launch_options = {"headless": True} + if executable_path: + launch_options["executable_path"] = executable_path + browser = playwright.chromium.launch(**launch_options) + context = browser.new_context() + context.tracing.start(screenshots=True, snapshots=True, sources=True) + page = context.new_page() + page.on("console", lambda message: console.append(f"{message.type}: {message.text}")) + try: + page.goto(base, wait_until="networkidle") + page.screenshot(path=str(artifact / "initial.png"), full_page=True) + page.get_by_text("IPC", exact=False).first.wait_for() + run_token = uuid4().hex[:12] + workflow = { + "name": f"Deterministic E2E Competition {run_token}", + "competition_id": f"e2e-competition-{run_token}", + "team_id": f"e2e-team-{run_token}", + "allow_private_networks": True, + "challenges": { + "platform": "http_json", + "list_url": "http://e2e-platform:8080/api/challenges", + "list_path": "data", + "id_field": "id", + "title_field": "name", + "category_field": "category", + "description_field": "description", + "attachments_field": "files", + }, + "submit": { + "url": "http://e2e-platform:8080/api/submit", + "method": "POST", + "json_template": {"challenge_id": "{{external_id}}", "flag": "{{flag}}"}, + "success_path": "verdict", + "success_values": ["correct"], + "wrong_values": ["wrong"], + }, + } + created = page.request.post(f"{base}/api/ops/workflows", data={"workflow": workflow}) + created_json = created.json() + workflow_id = created_json["id"] + confirmed = page.request.post( + f"{base}/api/ops/workflows/{workflow_id}/confirm", + data={"confirmation_phrase": f"CONFIRM WORKFLOW {workflow_id}"}, + ) + if not confirmed.ok: + raise RuntimeError(confirmed.text()) + # Fixture setup creates a confirmed workflow; selection, preflight + # and Start are performed through the same visible controls as an + # operator, so JavaScript or request-wiring failures fail E2E. + page.get_by_role("button", name="Competition", exact=True).click() + competition = page.locator('[x-show="showCompetition"]') + selector = competition.locator('select[x-model="competitionWorkflowId"]') + selector.select_option(workflow_id) + assert selector.locator(f'option[value="{workflow_id}"]').inner_text() == f"{workflow['name']} (confirmed)" + with page.expect_response(lambda response: response.url.endswith(f"/api/workflows/{workflow_id}/preflight")) as response_info: + competition.get_by_role("button", name="Preflight", exact=True).click() + if not response_info.value.ok: + raise RuntimeError("UI preflight failed") + with page.expect_response(lambda response: response.url.endswith(f"/api/workflows/{workflow_id}/start")) as response_info: + competition.get_by_role("button", name="Start", exact=True).click() + started = response_info.value + if not started.ok: + raise RuntimeError(f"run start failed ({started.status}): {started.text()}") + started_json = started.json() + run_id = started_json["run"]["id"] + assignment = None + run_json = started_json + for _ in range(60): + run_response = page.request.get(f"{base}/api/runs/{run_id}") + run_json = run_response.json() + assignments = run_json["challenges"][0].get("assignments") or [] + if assignments: + assignment = assignments[0] + break + page.wait_for_timeout(500) + if assignment is None: + raise RuntimeError("deterministic Member assignment was not created") + + # Let the scripted Member perform the sandbox and MCP actions and + # submit the flag through its normal submit_flag tool. Polling the + # durable evidence endpoint makes this browser test cover the + # execution path instead of merely posting a candidate over HTTP. + evidence = {} + for _ in range(120): + evidence_response = page.request.get(f"{base}/e2e/runs/{run_id}/evidence") + evidence = evidence_response.json() + evidence_text = json.dumps(evidence, ensure_ascii=False) + if "e2e-sandbox-command-ok" in evidence_text and "memory_catalog" in evidence_text: + break + page.wait_for_timeout(500) + else: + raise RuntimeError("scripted Member did not complete sandbox and MCP actions") + + for _ in range(60): + run_json = (page.request.get(f"{base}/api/runs/{run_id}")).json() + if run_json["challenges"][0]["state"] == "solved": + break + page.wait_for_timeout(500) + if run_json["challenges"][0]["state"] != "solved": + raise RuntimeError("scripted Member flag submission did not solve the challenge") + + required_events = {"assignment.started", "submission.verdict", "wp.completed", "run.finished"} + for _ in range(60): + evidence = (page.request.get(f"{base}/e2e/runs/{run_id}/evidence")).json() + event_kinds = {event["kind"] for event in evidence.get("run_events", [])} + if required_events.issubset(event_kinds): + break + page.wait_for_timeout(500) + else: + raise RuntimeError(f"incomplete closeout events: {sorted(event_kinds)}") + if evidence.get("collaboration_backlog") != 0: + raise RuntimeError("collaboration backlog was not drained") + if any(item.get("released_at") is None for item in evidence.get("assignments", [])): + raise RuntimeError("an assignment remained active after closeout") + if not evidence.get("wp_jobs") or any(job.get("status") != "done" for job in evidence["wp_jobs"]): + raise RuntimeError("writeup job did not complete") + competition.get_by_text("solved", exact=True).first.wait_for(timeout=30_000) + score = competition.get_by_test_id("competition-score") + score.wait_for() + assert score.inner_text() == "100 solved challenge points" + page.screenshot(path=str(artifact / "completed.png"), full_page=True) + result = {"ok": True, "url": page.url, "console": console, "evidence": evidence} + except Exception as exc: + _recovery_logger.debug('Error handled in main', exc_info=True) + page.screenshot(path=str(artifact / "failure.png"), full_page=True) + if run_id: + evidence = page.request.get(f"{base}/e2e/runs/{run_id}/evidence").json() + result = {"ok": False, "error": str(exc), "url": page.url, "console": console, "evidence": evidence} + finally: + context.tracing.stop(path=str(artifact / "trace.zip")) + context.close() + browser.close() + (artifact / "result.json").write_text(json.dumps(result, ensure_ascii=False, indent=2), encoding="utf-8") + (artifact / "run-events.json").write_text(json.dumps(evidence.get("run_events", []), indent=2), encoding="utf-8") + return 0 if result["ok"] else 1 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/real_competition_acceptance.py b/scripts/real_competition_acceptance.py new file mode 100644 index 0000000..9e8688d --- /dev/null +++ b/scripts/real_competition_acceptance.py @@ -0,0 +1,14 @@ +"""Compatibility entrypoint for the workflow-backed read-only monitor. + +New live runs require --live-run and select exactly 20 unsolved challenges. +Duration limits end observation; this command never stops or repairs a run. +""" + +if __package__: + from .monitor_real_competition import main +else: + from monitor_real_competition import main + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/standalone_solve.py b/scripts/standalone_solve.py index 76ca538..a3e75f9 100644 --- a/scripts/standalone_solve.py +++ b/scripts/standalone_solve.py @@ -5,10 +5,10 @@ import sys import time from pathlib import Path + from psycopg import OperationalError -from backend.blackboard import edge_store -from backend.blackboard import graph_store +from backend.blackboard import edge_store, graph_store from backend.core.orchestrator import Orchestrator from backend.core.state import AppState diff --git a/tests/conftest.py b/tests/conftest.py index fb88aec..b64978b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,13 +1,18 @@ from __future__ import annotations +import importlib.util import os +import shutil +import subprocess +import time +import uuid from pathlib import Path +from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit import pytest from alembic import command from alembic.config import Config - POSTGRES_TEST_MODULES = { "test_api.py", "test_auth.py", @@ -20,6 +25,7 @@ "test_member_driver.py", "test_memory.py", "test_ops_agent.py", + "test_ops_stream.py", "test_optional_startup.py", "test_orchestration.py", "test_platform.py", @@ -27,7 +33,51 @@ "test_wp_writer.py", } -_MIGRATED_DATABASE_URL: str | None = None + +def _native_pg_ctl() -> str | None: + if importlib.util.find_spec("pytest_postgresql") is None: + return None + # initdb deliberately rejects root. Docker verification runs as postgres. + if hasattr(os, "geteuid") and os.geteuid() == 0: + return None + configured = os.environ.get("IPC_TEST_POSTGRES_EXECUTABLE") or shutil.which("pg_ctl") + if configured and Path(configured).is_file(): + return configured + pg_config = shutil.which("pg_config") + if pg_config: + try: + result = subprocess.run([pg_config, "--bindir"], capture_output=True, text=True, timeout=5, check=True) + except (subprocess.SubprocessError, OSError): + return None + executable = Path(result.stdout.strip()) / ("pg_ctl.exe" if os.name == "nt" else "pg_ctl") + if executable.is_file(): + return str(executable) + return None + + +NATIVE_PG_CTL = _native_pg_ctl() +if NATIVE_PG_CTL: + from pytest_postgresql.factories import postgresql_proc + + ipc_postgresql_proc = postgresql_proc(executable=NATIVE_PG_CTL, host="127.0.0.1", port=None, user="postgres", dbname="ipc_test_native") + + +@pytest.fixture(scope="session") +def postgres_test_dsn(request): + configured = os.environ.get("IPC_TEST_DATABASE_URL", "").strip() + if configured: + yield configured + return + if NATIVE_PG_CTL is None: + pytest.skip("install native PostgreSQL or set IPC_TEST_DATABASE_URL") + process = request.getfixturevalue("ipc_postgresql_proc") + from urllib.parse import quote + + password = f":{quote(process.password, safe='')}" if process.password else "" + dsn = f"postgresql://{quote(process.user, safe='')}{password}@{process.host}:{process.port}/{getattr(process, 'maintenance_dbname', 'postgres')}" + with pytest.MonkeyPatch.context() as environment: + environment.setenv("IPC_TEST_DATABASE_URL", dsn) + yield dsn @pytest.fixture(autouse=True) @@ -39,50 +89,21 @@ def allow_local_sandbox(monkeypatch): tests/test_sandbox_containment.py for that guard. """ monkeypatch.setenv("IPC_ALLOW_LOCAL_SANDBOX", "1") + # A Docker deployment may set /app/data as its shared artifact root. + # Tests must resolve their artifacts under their own tmp_path roots. + monkeypatch.delenv("IPC_ARTIFACT_ROOT", raising=False) -TRUNCATE_TABLES = ( - "migration_runs", - "audit_events", - "postprocess_jobs", - "flag_submissions", - "active_sessions", - "workflows", - "session_projects", - "events", - "runs", - "messages", - "sessions", - "mem_counter", - "memories", - "scoped_counters", - "counters", - "broadcasts", - "attachments", - "reports", - "agent_links", - "agents", - "hints", - "intent_sources", - "intents", - "facts", - "projects", - "settings", - "competition_run_observations", - "agent_compactions", - "agent_jobs", - "agent_turns", - "agent_events", - "agent_session_writers", - "agent_sessions", -) + +def pytest_addoption(parser): + parser.addoption("--require-postgres", action="store_true", default=False, + help="fail collection instead of skipping unavailable PostgreSQL integration tests") def pytest_collection_modifyitems(config, items) -> None: - del config unavailable = pytest.mark.skip( - reason="set IPC_TEST_DATABASE_URL to run PostgreSQL integration tests" + reason="install native PostgreSQL or set IPC_TEST_DATABASE_URL" ) - has_database = bool(os.environ.get("IPC_TEST_DATABASE_URL", "").strip()) + has_database = bool(os.environ.get("IPC_TEST_DATABASE_URL", "").strip()) or NATIVE_PG_CTL is not None for item in items: if ( Path(str(item.fspath)).name not in POSTGRES_TEST_MODULES @@ -91,6 +112,8 @@ def pytest_collection_modifyitems(config, items) -> None: continue item.add_marker("postgres") if not has_database: + if config.getoption("--require-postgres"): + raise pytest.UsageError("PostgreSQL integration is required: install native PostgreSQL or set IPC_TEST_DATABASE_URL") item.add_marker(unavailable) @@ -100,37 +123,78 @@ def isolated_postgres(request, monkeypatch): yield return - dsn = os.environ.get("IPC_TEST_DATABASE_URL", "").strip() - if not dsn: - yield - return + dsn = request.getfixturevalue("postgres_test_dsn") - monkeypatch.setenv("IPC_DATABASE_URL", dsn) + schema = "test_" + uuid.uuid4().hex + _create_schema(dsn, schema) + isolated_dsn = _with_search_path(dsn, schema) + monkeypatch.setenv("IPC_DATABASE_URL", isolated_dsn) monkeypatch.setenv("IPC_DB_POOL_MIN", "1") monkeypatch.setenv("IPC_DB_POOL_MAX", "4") from backend.persistence.database import Database + databases = [] + original_init = Database.__init__ - global _MIGRATED_DATABASE_URL - if _MIGRATED_DATABASE_URL != dsn: - config = Config(str(Path(__file__).resolve().parents[1] / "alembic.ini")) - config.attributes["ipc_database_url"] = dsn - command.upgrade(config, "head") - _MIGRATED_DATABASE_URL = dsn + def tracked_init(database, *args, **kwargs): + original_init(database, *args, **kwargs) + databases.append(database) - database = Database(dsn, min_size=1, max_size=4).configure() - _truncate(database) - database.close() + monkeypatch.setattr(Database, "__init__", tracked_init) try: + config = Config(str(Path(__file__).resolve().parents[1] / "alembic.ini")) + config.attributes["ipc_database_url"] = isolated_dsn + command.upgrade(config, "head") + database = Database(isolated_dsn, min_size=1, max_size=4).configure() + database.close() yield finally: - cleanup = Database(dsn, min_size=1, max_size=4).configure() - _truncate(cleanup) - cleanup.close() - - -def _truncate(database) -> None: - with database.connect() as connection: - connection.execute( - "TRUNCATE TABLE " + ", ".join(TRUNCATE_TABLES) + " RESTART IDENTITY CASCADE" - ) + try: + for database in databases: + database.close() + _assert_no_connections(dsn, schema) + finally: + _drop_schema(dsn, schema) + + +def _create_schema(dsn: str, schema: str) -> None: + import psycopg + from psycopg import sql + + with psycopg.connect(dsn, autocommit=True) as connection: + connection.execute(sql.SQL("CREATE SCHEMA {}").format(sql.Identifier(schema))) + + +def _drop_schema(dsn: str, schema: str) -> None: + import psycopg + from psycopg import sql + + with psycopg.connect(dsn, autocommit=True) as connection: + connection.execute(sql.SQL("DROP SCHEMA IF EXISTS {} CASCADE").format(sql.Identifier(schema))) + assert connection.execute("SELECT 1 FROM pg_namespace WHERE nspname=%s", (schema,)).fetchone() is None + + +def _assert_no_connections(dsn: str, schema: str) -> None: + import psycopg + + with psycopg.connect(dsn, autocommit=True) as connection: + until = time.monotonic() + 2 + while True: + remaining = connection.execute( + "SELECT pid,state FROM pg_stat_activity WHERE application_name=%s", (schema,), + ).fetchall() + if not remaining or time.monotonic() >= until: + break + time.sleep(0.05) + assert not remaining, f"test schema {schema} retained connections after pool teardown: {remaining}" + + +def _with_search_path(dsn: str, schema: str) -> str: + parts = urlsplit(dsn) + query = dict(parse_qsl(parts.query, keep_blank_values=True)) + # Including public lets CREATE TABLE IF NOT EXISTS resolve production + # tables there and skip creating the test's own tables. pg_catalog is + # implicit, so isolated migrations need only this schema. + query["options"] = f"-csearch_path={schema}" + query["application_name"] = schema + return urlunsplit((parts.scheme, parts.netloc, parts.path, urlencode(query), parts.fragment)) diff --git a/tests/test_agent_context.py b/tests/test_agent_context.py index 13c0d31..76eb1a7 100644 --- a/tests/test_agent_context.py +++ b/tests/test_agent_context.py @@ -226,7 +226,7 @@ def test_semantic_summarize_falls_back_on_an_empty_or_unparseable_reply(): for reply in ("", "I could not summarize that.", "{}"): summary, retained = summarize( - messages, request=lambda *_args, **_kwargs: reply, keep_recent=4 + messages, request=lambda *_args, reply=reply, **_kwargs: reply, keep_recent=4 ) assert summary["open_questions"], reply assert retained @@ -249,7 +249,7 @@ def test_deterministic_compaction_never_orphans_a_tool_result(): _summary, retained = deterministic_summary(messages, keep_recent=5) tail = retained[1:] assert tail - assert not (tail[0].get("role") == "tool") + assert tail[0].get("role") != "tool" def test_deterministic_compaction_handles_anthropic_tool_result_blocks(): diff --git a/tests/test_agent_jobs.py b/tests/test_agent_jobs.py index 41d4c3a..14a27bd 100644 --- a/tests/test_agent_jobs.py +++ b/tests/test_agent_jobs.py @@ -13,6 +13,7 @@ import os import time +from types import SimpleNamespace import pytest @@ -54,6 +55,82 @@ def wait_for(predicate, timeout=20.0): return None +def test_detached_start_failure_never_leaves_a_running_job(jobs, session): + def unavailable(*_args): + raise ConnectionError("sandbox disconnected during launch") + + service = JobService(jobs, SimpleNamespace(exec_detached=unavailable), session["id"]) + assert service.start(" ")["ok"] is False + result = service.start("sleep 300") + assert result["ok"] is False + row = jobs.job(result["job_id"]) + assert row["state"] == "lost" and row["exit_code"] is None + assert jobs.jobs(session["id"], active_only=True) == [] + + +def test_detached_status_recovers_after_a_temporary_probe_failure(jobs, session): + job = jobs.start(session["id"], "sleep 300", pid=4242) + + def unavailable(_job_id): + raise TimeoutError("sandbox probe timed out") + + sandbox = SimpleNamespace(job_state=unavailable) + service = JobService(jobs, sandbox, session["id"]) + assert service.status(job["id"])["state"] == "running" + assert service.jobs(active_only=True)["jobs"][0]["state"] == "running" + assert jobs.job(job["id"])["exit_code"] is None + + sandbox.job_state = lambda _job_id: {"state": "exited", "exit_code": 7} + assert service.status(job["id"])["exit_code"] == 7 + assert service.jobs(active_only=True)["jobs"] == [] + assert service.status("missing")["ok"] is False + + +def test_detached_log_read_failure_preserves_the_retry_cursor(jobs, session): + job = jobs.start(session["id"], "sleep 300") + + def unavailable(*_args, **_kwargs): + raise OSError("temporary output transport failure") + + sandbox = SimpleNamespace(job_output=unavailable) + service = JobService(jobs, sandbox, session["id"]) + assert service.logs(job["id"])["ok"] is False + assert jobs.job(job["id"])["stdout_offset"] == 0 + + reads = [] + + def restored(_job_id, _stream, *, offset, limit): + reads.append(offset) + return "evidence", offset + len("evidence") + + sandbox.job_output = restored + assert service.logs(job["id"])["text"] == "evidence" + assert reads == [0] + assert jobs.job(job["id"])["stdout_offset"] == len("evidence") + assert service.logs("missing")["ok"] is False + assert service.logs(job["id"], stream="invalid")["ok"] is False + + +def test_detached_cancel_failure_can_retry_without_claiming_success(jobs, session): + job = jobs.start(session["id"], "sleep 300") + + def unavailable(_job_id): + raise ConnectionError("sandbox disconnected during cancellation") + + sandbox = SimpleNamespace(job_cancel=unavailable) + service = JobService(jobs, sandbox, session["id"]) + assert service.cancel(job["id"])["ok"] is False + assert jobs.job(job["id"])["state"] == "running" + + cancelled = [] + sandbox.job_cancel = cancelled.append + assert service.cancel(job["id"])["state"] == "cancelled" + assert cancelled == [job["id"]] + assert service.cancel(job["id"])["state"] == "cancelled" + assert cancelled == [job["id"]] + assert service.cancel("missing")["ok"] is False + + def test_job_rows_record_lifecycle_and_keep_the_first_terminal_state(jobs, session): job = jobs.start(session["id"], "sleep 300", kind="bash", pid=4242) assert job["state"] == "running" @@ -96,11 +173,11 @@ def test_detached_job_outlives_the_sixty_second_foreground_ceiling( job_id = started["job_id"] assert service.status(job_id)["state"] in {"running", "exited"} - final = wait_for( - lambda: (lambda view: view if view["state"] == "exited" else None)( - service.status(job_id) - ) - ) + def completed_job(): + view = service.status(job_id) + return view if view["state"] == "exited" else None + + final = wait_for(completed_job) assert final is not None, "detached job never reached a terminal state" assert final["exit_code"] == 3 diff --git a/tests/test_agent_runtime.py b/tests/test_agent_runtime.py index 404fd9e..254846a 100644 --- a/tests/test_agent_runtime.py +++ b/tests/test_agent_runtime.py @@ -12,7 +12,12 @@ import pytest from backend.agent.context import compacted_history, summary_message -from backend.agent.runtime import AgentRuntime, SessionResult +from backend.agent.runtime import ( + AgentRuntime, + AgentSessionWriter, + AssignmentSessionWriter, + SessionResult, +) from backend.agent.session import SessionConflict, SessionNeedsRebuild from backend.competition.conversation import ToolCall, Turn, TurnTruncated @@ -758,3 +763,95 @@ def test_a_reused_tool_call_id_with_different_arguments_is_rejected(): writer.append("tool-call:dup", "tool_call", {"id": "c1", "name": "shell", "arguments": {"a": 2}}) with pytest.raises(RuntimeError, match="reused with different arguments"): runtime(writer, Adapter([])).run("start") + + +def test_async_truncation_continues_and_preserves_partial_evidence(): + class TruncatedAdapter(Adapter): + def __init__(self): + super().__init__([]) + self.calls = 0 + + def turn(self, messages, system, tools, emit, cancel): + self.calls += 1 + if self.calls == 1: + raise TurnTruncated(Turn([{"role": "assistant", "content": "partial evidence"}], text="partial evidence"), "length") + assert "partial evidence" in str(messages) + return Turn([{"role": "assistant", "content": "continued"}], text="continued") + + writer = MemoryWriter() + result = asyncio.run(runtime(writer, TruncatedAdapter()).run_async("start")) + assert result.status == "idle" and result.text == "continued" + assert writer.usage[0][1] == "truncated" + + +def test_async_repeated_tool_batches_are_bounded_with_distinct_call_ids(): + turns = [Turn([{"role": "assistant", "content": "check"}], + [ToolCall(f"call-{index}", "shell", {"command": "pwd"})]) for index in range(3)] + writer = MemoryWriter() + with pytest.raises(RuntimeError, match="identical tool batch"): + asyncio.run(runtime(writer, Adapter(turns), repeated_batch_limit=3).run_async("start")) + assert writer.items[-1]["kind"] == "loop_detected" + + +def test_durable_writer_adapters_forward_fences_and_calibration(): + class Store: + def __init__(self): + self.calls = [] + self.page = 0 + + def append_event(self, *args, **kwargs): + self.calls.append(("append", args, kwargs)) + return {"kind": args[2]} + + def events(self, session_id, *, after=0, limit=500): + self.calls.append(("events", session_id, after, limit)) + if after == 0 and self.page == 0: + self.page += 1 + return [{"sequence": index} for index in range(1, 501)] + return [{"sequence": 501}] if after == 500 else [] + + def save_checkpoint(self, *args): + self.calls.append(("checkpoint", args)) + + def record_compaction(self, *args, **kwargs): + self.calls.append(("compaction", args, kwargs)) + + def session(self, _session_id): + return {"token_budget": {"old": 1}} + + def save_token_budget(self, *args): + self.calls.append(("budget", args)) + + def handoff(self, _session_id, new_owner, *, reason): + self.calls.append(("handoff", new_owner, reason)) + return {"owner": new_owner, "epoch": 4} + + def record_turn(self, assignment, turn, status, *, usage=None): + self.calls.append(("turn", assignment, turn, status, usage)) + + def renew_assignment_writer(self, assignment): + self.calls.append(("renew", assignment)) + return True + + store = Store() + writer = AgentSessionWriter(store, "s1", "owner-a", 3) + assert writer.session_id == "s1" + writer.append("e", "status", {"ok": True}) + assert len(writer.events(0, 10)) == 500 + writer.save_checkpoint({"status": "ok"}) + store.page = 0 + writer.record_compaction({"facts": []}, token_estimate=12) + writer.save_calibration(1.25) + assert writer.handoff("owner-b", reason="resume") == {"owner": "owner-b", "epoch": 4} + assert writer.owner == "owner-b" and writer.epoch == 4 + assert any(item[0] == "compaction" for item in store.calls) + + assignment = {"id": "a1", "session_id": "s1", "lease_owner": "owner", "epoch": 2} + seat = AssignmentSessionWriter(store, assignment) + assert seat.session_id == "s1" + seat.append("e2", "status", {}) + seat.save_checkpoint({"status": "running"}) + seat.record_usage(2, "completed", {"prompt_tokens": 10}) + assert seat.renew() is True + seat.save_calibration(0.9) + assert any(item[0] == "turn" for item in store.calls) diff --git a/tests/test_agent_session_store.py b/tests/test_agent_session_store.py index 4fd1d41..b83dabe 100644 --- a/tests/test_agent_session_store.py +++ b/tests/test_agent_session_store.py @@ -39,7 +39,7 @@ def owned(store, task_key="ops:session-1", owner="worker-a", kind="ops"): def test_event_keys_are_idempotent_and_reuse_with_new_content_is_rejected(store): session = owned(store) - args = dict(owner="worker-a", epoch=1) + args = {"owner": "worker-a", "epoch": 1} first = store.append_event(session["id"], "call-1", "tool_call", {"cmd": "id"}, **args) assert store.append_event(session["id"], "call-1", "tool_call", {"cmd": "id"}, **args) == first with pytest.raises(SessionConflict, match="different content"): @@ -97,7 +97,7 @@ def test_handoff_transfers_write_access_without_starting_a_new_transcript(store) assert [event["kind"] for event in events] == [ "provider_messages", "handoff", "provider_messages", ] - assert [event["event_key"] for event in events][0] == "first" + assert next(event["event_key"] for event in events) == "first" assert events[1]["payload"] == { "previous_owner": "worker-a", "owner": "worker-b", "epoch": 2, "reason": "member_handoff", @@ -225,3 +225,21 @@ def test_events_can_be_read_by_the_global_event_id_cursor(store): assert second["event_id"] > first["event_id"] tail = store.events_after_event_id(session["id"], first["event_id"]) assert [event["event_key"] for event in tail] == ["e2"] + + +def test_session_store_rejects_invalid_transitions_and_missing_rows(store): + with pytest.raises(SessionConflict, match="task key"): + store.create_session("ops", " ") + session = owned(store, task_key="ops:edge-cases") + with pytest.raises(SessionConflict, match="unknown session state"): + store.set_state(session["id"], "running") + with pytest.raises(SessionConflict, match="provider session state"): + store.record_provider_session(session["id"], "provider", "running") + with pytest.raises(SessionConflict, match="status"): + store.finish_turn(session["id"], 99, "mystery") + with pytest.raises(KeyError): + store.session("missing-session") + with pytest.raises(KeyError): + store.save_checkpoint("missing-session", {}) + with pytest.raises(KeyError): + store.record_provider_session("missing-session", "provider", "native") diff --git a/tests/test_agent_watchdog.py b/tests/test_agent_watchdog.py index be8351a..88ed63c 100644 --- a/tests/test_agent_watchdog.py +++ b/tests/test_agent_watchdog.py @@ -9,12 +9,11 @@ """ from __future__ import annotations -import pytest - from backend.agent.watchdog import ( CANCEL_AFTER, DIAGNOSE_AFTER, HANDOFF_AFTER, + SessionWatchdog, classify, diagnosis, ) @@ -107,3 +106,23 @@ def test_the_verdict_carries_the_evidence_behind_it(): def test_quiet_seconds_is_read_defensively(): assert classify(health(quiet_seconds=None)).level == "ok" + + +def test_session_watchdog_filters_actionable_rows_and_preserves_scope(): + rows = [health(session_id="quiet", quiet_seconds=CANCEL_AFTER), + health(session_id="busy", quiet_seconds=10, running_jobs=1)] + + class Store: + def health_for_scope(self, **kwargs): + assert kwargs == {"kind": "competition"} + return rows + + watchdog = SessionWatchdog( + Store(), object(), diagnose_after=100, cancel_after=200, handoff_after=300, + ) + assert [item.session_id for item in watchdog.verdicts()] == ["quiet", "busy"] + actionable = watchdog.inspect() + assert len(actionable) == 1 + verdict, evidence = actionable[0] + assert verdict.session_id == "quiet" + assert evidence["session_id"] == "quiet" diff --git a/tests/test_api.py b/tests/test_api.py index 8cc7322..db367ed 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -50,6 +50,7 @@ def test_list_projects(client): def test_get_project_retries_once_on_a_deadlock(client, monkeypatch): """T12: a single DeadlockDetected on a read is retried transparently.""" import psycopg.errors + from backend.api import project as project_api pid = client.post( @@ -74,6 +75,7 @@ def flaky(conn, timeout, project_id=None): def test_get_project_degrades_to_last_snapshot_instead_of_500(client, monkeypatch): """T12: a persistent deadlock degrades to the last good snapshot, not 500.""" import psycopg.errors + from backend.api import project as project_api pid = client.post( @@ -101,7 +103,6 @@ def test_start_returns_before_slow_sandbox_bootstrap(client, monkeypatch): def slow_start(_project_id): entered.set() release.wait(5) - return None orchestrator = client.app.state.ipc.orchestrator monkeypatch.setattr(orchestrator.projects, "start_challenge_env", slow_start) diff --git a/tests/test_browser_integration.py b/tests/test_browser_integration.py index 8cbf0de..08d34fe 100644 --- a/tests/test_browser_integration.py +++ b/tests/test_browser_integration.py @@ -1,9 +1,9 @@ from __future__ import annotations import asyncio +import threading from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer from pathlib import Path -import threading import pytest @@ -12,7 +12,6 @@ from backend.mcp.mcp_client import MCPClient from backend.mcp.shared import _BrowserSession, build_browser_mcp - _PAGE = b""" Browser integration diff --git a/tests/test_competition_api.py b/tests/test_competition_api.py index 4a43891..f598d85 100644 --- a/tests/test_competition_api.py +++ b/tests/test_competition_api.py @@ -1,12 +1,13 @@ from __future__ import annotations +from typing import ClassVar + import pytest from fastapi.testclient import TestClient from backend.server.app import create_app from tests.helpers import setup_test_auth, write_mock_config - pytestmark = pytest.mark.postgres @@ -54,7 +55,7 @@ def workflow(): def test_competition_lifecycle_is_revisioned_and_idempotent(client, monkeypatch): class Response: status_code = 200 - headers = {} + headers: ClassVar[dict] = {} def raise_for_status(self): return None @@ -135,7 +136,7 @@ def _two_challenge_platform(monkeypatch): class Response: status_code = 200 - headers = {} + headers: ClassVar[dict] = {} def raise_for_status(self): return None diff --git a/tests/test_competition_collab.py b/tests/test_competition_collab.py index 4a196ec..bd11578 100644 --- a/tests/test_competition_collab.py +++ b/tests/test_competition_collab.py @@ -13,7 +13,6 @@ from __future__ import annotations -import json from types import SimpleNamespace import pytest @@ -154,8 +153,6 @@ def test_undelivered_recon_degrades_to_blackboard_and_emits_event(harness): with harness.db.connect() as connection: hints = graph_store.list_hints(connection, project_id) - facts = graph_store.list_facts(connection, project_id) \ - if hasattr(graph_store, "list_facts") else None hint_text = "\n".join(h.content for h in hints) assert "no canary" in hint_text assert "root shell" in hint_text @@ -221,7 +218,7 @@ def test_recon_for_released_seat_is_not_flagged(harness): def test_cursor_advance_reports_message_consumed(harness): run = _running_run(harness.store) - challenge, project_id, session_id = _live_receiver_seat(harness, run) + challenge, _project_id, session_id = _live_receiver_seat(harness, run) sequence = _insert_recon( harness, run, challenge, session_id, report={"member": "topaz", "knowledge": ["eventually consumed"]}, diff --git a/tests/test_competition_migration_smoke.py b/tests/test_competition_migration_smoke.py index 5da454d..6867204 100644 --- a/tests/test_competition_migration_smoke.py +++ b/tests/test_competition_migration_smoke.py @@ -8,8 +8,7 @@ from alembic import command from alembic.config import Config from psycopg import connect -from psycopg.sql import Identifier, SQL - +from psycopg.sql import SQL, Identifier pytestmark = pytest.mark.postgres diff --git a/tests/test_competition_monitor.py b/tests/test_competition_monitor.py new file mode 100644 index 0000000..d52ab71 --- /dev/null +++ b/tests/test_competition_monitor.py @@ -0,0 +1,180 @@ +"""Monitor correlation, export secrecy and observation-only operation.""" +from __future__ import annotations + +import copy +import json +from datetime import datetime, timedelta, timezone +from types import SimpleNamespace + +import pytest + +from scripts import monitor_real_competition as monitor + +BASE = datetime(2026, 10, 14, tzinfo=timezone.utc) + + +def at(seconds): + return BASE + timedelta(seconds=seconds) + + +def snapshot(): + return { + "challenges": [{"id": "c1", "external_id": "1", "project_id": "p1", "state": "solved", + "metadata": {"category": "web", "ready_at": at(0).isoformat()}, "first_assigned_at": at(2)}], + "assignment_rows": [{"session_id": "s1", "challenge_id": "c1", "role": "primary", "released_at": at(10)}], + "submission_rows": [{"id": "f1", "challenge_id": "c1", "status": "correct", "created_at": at(4), "submitted_at": at(5), "candidate": "private-answer"}], + "wp_jobs": [{"challenge_id": "c1", "status": "done", "attempts": 1}], + "instance_rows": [], "messages": {"total": 0, "backlog": 0, "member_messages": 0}, + "agent_sessions": [], "events": [], "agent_events": [], + } + + +def event(kind, seconds, **payload): + return {"kind": kind, "created_at": at(seconds), "payload": payload} + + +def test_selection_is_exact_unique_unsolved_and_covers_categories(): + challenges = [{"external_id": str(i), "category": monitor.REQUIRED_CATEGORIES[i % 6], "solved": False} + for i in range(24)] + challenges.append({**challenges[0]}) + challenges.append({"external_id": "solved", "category": "web", "solved": True}) + selected = monitor.choose_challenges(challenges) + assert len(selected) == len(set(selected)) == 20 + assert "solved" not in selected + with pytest.raises(RuntimeError, match="unsolved ai"): + monitor.choose_challenges([row for row in challenges if row["category"] != "ai"]) + with pytest.raises(RuntimeError, match="unique unsolved"): + monitor.choose_challenges(challenges[:7]) + + +def test_redaction_handles_nested_native_messages_and_known_nonstandard_flags(tmp_path): + report = {"run_id": "run", "status": "finished", "latency": {}, + "logs": [{"content": json.dumps({"flag": "nonstandard-answer", "api_key": "provider-key"})}, + {"text": "URL https://user:secret@host/?token=abc and private-answer and flag{hidden}"}], + "final_resources": {}, "anomalies": [], "recoveries": []} + paths = monitor.export_report(report, tmp_path, ("provider-key", "private-answer")) + for path in paths: + content = path.read_text(encoding="utf-8") + for secret in ("nonstandard-answer", "provider-key", "private-answer", "hidden", "token=abc", "user:secret"): + assert secret not in content + exported = json.loads(paths[0].read_text(encoding="utf-8")) + assert exported["status"] == "finished" + assert json.loads((tmp_path / "real_competition_run.json").read_text(encoding="utf-8")) == exported + assert (tmp_path / "real_competition_run.md").is_file() + with pytest.raises(ValueError, match="run id"): + monitor.export_report({"run_id": "../escape"}, tmp_path) + + +def test_concurrent_timings_match_session_call_and_submission_ids(): + data = snapshot() + data["submission_rows"].append({"id": "f2", "challenge_id": "c1", "status": "correct", "submitted_at": at(50)}) + run_events = [event("assignment.started", 2, challenge_id="c1", session_id="s1"), + event("member.started", 3, challenge_id="c1", session_id="s1"), + event("submission.verdict", 8, submission_id="f1"), + event("submission.verdict", 51, submission_id="f2")] + agent_events = [ + {**event("tool_call", 4, id="same", name="mcp_tool"), "session_id": "s1"}, + {**event("tool_call", 100, id="same", name="mcp_tool"), "session_id": "s2"}, + {**event("tool_result", 6, id="same", message={"content": '{"status":"ok"}'}), "session_id": "s1"}, + {**event("tool_result", 107, id="same", message={"content": '{"error":"failed"}'}), "session_id": "s2"}, + ] + measured = monitor.metrics(data, run_events, agent_events, [], []) + assert measured["latency"]["flag_submit_to_verdict"] == {"count": 2, "p50": 2.0, "p95": 2.9, "max": 3.0} + assert measured["latency"]["mcp_call_to_result"]["max"] == 7.0 + assert measured["latency"]["assignment_to_member_start"]["p50"] == 1.0 + assert measured["mcp"]["error_rate"] == 0.5 + assert measured["latency"]["provider_time_to_first_response"]["count"] == 0 + + +def test_lowering_capacity_grandfathers_existing_instances_and_checks_new_admission(): + events = [event("instance.started", 1, challenge_id="a"), event("instance.started", 2, challenge_id="b"), + event("run.limits_updated", 3, limits={"remote_concurrency": 1})] + assert monitor.capacity_violations(events, 2) == [] + events.append(event("instance.started", 4, challenge_id="c")) + assert monitor.capacity_violations(events, 2)[0]["previously_active"] == 2 + + +def test_target_delivery_and_terminal_cleanup_are_checked_from_evidence(): + data = snapshot() + data["challenges"][0]["metadata"]["remote"] = True + data["agent_events"] = [{"session_id": "s1", "kind": "tool_call", "sequence": 1, "event_key": "call:1", "payload": {}}] + measured = monitor.metrics(data, [], [], [], []) + checks = monitor.acceptance_checks(data, measured, "finished", []) + assert checks["target_before_first_tool"]["status"] == "fail" + data["agent_events"].insert(0, {"session_id": "s1", "kind": "provider_messages", "sequence": 0, + "event_key": "recon:1", "payload": {"kind": "target_instance"}}) + data["messages"]["backlog"] = 1 + measured = monitor.metrics(data, [], [], [], []) + checks = monitor.acceptance_checks(data, measured, "finished", []) + assert checks["target_before_first_tool"]["status"] == "pass" + assert checks["collaboration_cleanup"]["status"] == "fail" + + +def test_monitor_uses_only_get_and_readonly_sql_and_saves_completed_evidence(tmp_path, monkeypatch): + queries = [] + class Connection: + def __enter__(self): return self + def __exit__(self, *_args): return False + def execute(self, sql): queries.append(sql) + class Session: + def get(self, url, **kwargs): + return SimpleNamespace(raise_for_status=lambda: None, json=lambda: {"run": {"status": "finished"}}) + def post(self, *_args, **_kwargs): + pytest.fail("observation must not mutate the live application") + monkeypatch.setattr(monitor.psycopg, "connect", lambda *args, **kwargs: Connection()) + monkeypatch.setattr(monitor, "db_snapshot", lambda *args, **kwargs: copy.deepcopy(snapshot())) + monkeypatch.setattr(monitor, "log_rows", lambda *args, **kwargs: []) + report = monitor.monitor("http://local", "run", 1, "postgresql://unused", export=tmp_path, session=Session()) + assert report["termination_reason"] == "terminal_run" + assert report["read_only_observation"] is True + assert "SET default_transaction_read_only TO on" in queries + assert report["checks"]["assignment_cleanup"]["status"] == "pass" + assert (tmp_path / "real_competition_run_monitor.md").exists() + + +@pytest.mark.parametrize("resumed_successfully", [False, True]) +def test_recovery_requires_a_successful_result_after_the_recovery_signal(tmp_path, monkeypatch, resumed_successfully): + data = snapshot() + data["events"] = [{**event("session.rebuilt", 5, session_id="s1"), "event_id": 1}] + output = {"status": "ok"} if resumed_successfully else {"status": "unknown"} + data["agent_events"] = [{**event("tool_result", 6, id="call", message={"content": json.dumps(output)}), + "event_id": 2, "session_id": "s1", "sequence": 1, "event_key": "tool-result:call"}] + class Connection: + def __enter__(self): return self + def __exit__(self, *_args): return False + def execute(self, sql): return None + class Session: + def get(self, url, **kwargs): + return SimpleNamespace(raise_for_status=lambda: None, json=lambda: {"run": {"status": "finished"}}) + monkeypatch.setattr(monitor.psycopg, "connect", lambda *args, **kwargs: Connection()) + monkeypatch.setattr(monitor, "db_snapshot", lambda *args, **kwargs: copy.deepcopy(data)) + monkeypatch.setattr(monitor, "log_rows", lambda *args, **kwargs: []) + report = monitor.monitor("http://local", "run", 1, "postgresql://unused", export=tmp_path, session=Session()) + assert len(report["recoveries"]) == 1 + assert report["self_recovery_observed"] is resumed_successfully + + +@pytest.mark.postgres +def test_snapshot_reads_real_postgres_rows_under_readonly_transaction(tmp_path): + import os + + import psycopg + + from backend.competition.fixture import FixturePlatform + from backend.platform.mapping import PlatformChallenge + from tests.test_competition_service_fixture import _new_fixture_service + + platform = FixturePlatform([PlatformChallenge(external_id="read", title="Read", category="misc", description="monitor")]) + db, service, _state, _ops, workflow_id = _new_fixture_service(tmp_path, platform, "monitor") + try: + run_id = service.start(workflow_id, "monitor")['run']['id'] + service.tick() + with psycopg.connect(os.environ["IPC_DATABASE_URL"], row_factory=psycopg.rows.dict_row, autocommit=True) as connection: + connection.execute("SET default_transaction_read_only TO on") + data = monitor.db_snapshot(connection, run_id) + assert data["challenges"][0]["external_id"] == "read" + assert data["assignment_rows"] + assert data["events"] + finally: + service.shutdown() + db.close() diff --git a/tests/test_competition_policy.py b/tests/test_competition_policy.py index 850e1c2..5a065d5 100644 --- a/tests/test_competition_policy.py +++ b/tests/test_competition_policy.py @@ -55,7 +55,7 @@ def test_container_challenges_precede_local_ones_at_equal_solve_counts(): """ tasks = [task(1, remote=True, category="pwn"), task(2, remote=True, category="web"), task(3)] assignments = plan_assignments(tasks, occupied_members=set(), remote_capacity=5, now=NOW, local_capacity=1) - assert [a.challenge_id for a in assignments] == ["1"] + assert [a.challenge_id for a in assignments] == ["1", "2", "3"] def test_most_solved_challenges_are_scheduled_first(): @@ -122,8 +122,8 @@ def test_container_challenges_are_serialised_inside_the_instance_quota(): both = plan_assignments( ready, occupied_members=set(), remote_capacity=1, now=NOW, local_capacity=10, ) - assert [a.challenge_id for a in both] == ["c1", "c2"] - assert [a.needs_instance for a in both] == [False, True] + assert [a.challenge_id for a in both] == ["c1"] + assert [a.needs_instance for a in both] == [False] def test_naive_clock_rejected(): diff --git a/tests/test_competition_restart.py b/tests/test_competition_restart.py index a411084..e16508f 100644 --- a/tests/test_competition_restart.py +++ b/tests/test_competition_restart.py @@ -14,7 +14,6 @@ from backend.competition.workspace import SharedWorkspace from backend.ops.models import PlatformWorkflowSpec from backend.platform.mapping import PlatformChallenge - from tests.test_competition_service_fixture import ( _FixtureConfig, _FixtureLogger, @@ -76,8 +75,8 @@ def make_service(owner: str): state.orchestrator = _FixtureOrchestrator(service) return service, state - first, first_state = make_service("old-coordinator") - second = second_state = None + first, _first_state = make_service("old-coordinator") + second = None try: snapshot = first.start(workflow_id, "restart-run") run_id = snapshot["run"]["id"] @@ -112,7 +111,7 @@ def make_service(owner: str): ) first.shutdown() - second, second_state = make_service("new-coordinator") + second, _second_state = make_service("new-coordinator") second.tick() recovered = second.store.assignments(run_id, active_only=True)[0] challenge_after = second.store.challenges(run_id)[0] diff --git a/tests/test_competition_runtime.py b/tests/test_competition_runtime.py index a0def9b..540c61f 100644 --- a/tests/test_competition_runtime.py +++ b/tests/test_competition_runtime.py @@ -1,9 +1,9 @@ from __future__ import annotations import asyncio +from types import SimpleNamespace import pytest -from types import SimpleNamespace from backend.competition.conversation import ToolCall, Turn, TurnTruncated from backend.competition.runtime import SessionRunner @@ -104,6 +104,29 @@ def assignment(): } +def test_provider_progress_records_start_first_response_and_completion_once(): + store = MemoryStore() + store.provider_progress_events = True + + class Streaming(Adapter): + emits_reasoning = True + + def turn(self, messages, system, tools, emit, cancel, emit_reasoning=None): + assert store.turns[1]["status"] == "running" + emit_reasoning("checking") + emit("first") + emit("second") + return Turn([{"role": "assistant", "content": "firstsecond"}], text="firstsecond") + + runner = SessionRunner(store, Streaming([]), Executor(), assignment=assignment(), system="solve", tools=[]) + result = runner.run("start") + assert result.status == "idle" + progress = [row["payload"] for row in store.items if row["kind"] == "status"] + assert [row["status"] for row in progress] == ["provider.started", "provider.first_response", "provider.completed"] + assert progress[2]["latency_seconds"] >= progress[1]["latency_seconds"] >= 0 + assert store.turns[1]["status"] == "completed" + + def test_session_runner_persists_native_messages_and_tool_results(): store = MemoryStore() executor = Executor() @@ -180,8 +203,8 @@ def test_conversation_adapter_tolerates_null_stream_fields(): payloads = [ '{"choices":[{"index":0,"delta":{"role":"assistant","content":"working","tool_calls":null},"finish_reason":null}]}', - '{"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_1","type":"function",' - '"function":{"name":"member_action","arguments":"{\\"action\\": \\"done\\"}"}}]},"finish_reason":"tool_calls"}]}', + ('{"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_1","type":"function",' + '"function":{"name":"member_action","arguments":"{\\"action\\": \\"done\\"}"}}]},"finish_reason":"tool_calls"}]}'), ] class FakeResponse: @@ -605,10 +628,10 @@ def test_anthropic_output_limit_yields_a_continuable_partial_turn(): payloads = [ '{"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}', '{"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"analysing"}}', - '{"type":"content_block_start","index":1,"content_block":' - '{"type":"tool_use","id":"cut","name":"member_action"}}', - '{"type":"content_block_delta","index":1,"delta":' - '{"type":"input_json_delta","partial_json":"{\\"action\\": \\"ba"}}', + ('{"type":"content_block_start","index":1,"content_block":' + '{"type":"tool_use","id":"cut","name":"member_action"}}'), + ('{"type":"content_block_delta","index":1,"delta":' + '{"type":"input_json_delta","partial_json":"{\\"action\\": \\"ba"}}'), '{"type":"message_delta","delta":{"stop_reason":"max_tokens"}}', ] diff --git a/tests/test_competition_service_fixture.py b/tests/test_competition_service_fixture.py index 68d771f..a977587 100644 --- a/tests/test_competition_service_fixture.py +++ b/tests/test_competition_service_fixture.py @@ -24,7 +24,6 @@ from backend.ops.models import PlatformWorkflowSpec from backend.platform.mapping import PlatformChallenge - pytestmark = pytest.mark.postgres @@ -168,6 +167,96 @@ def _resume_after_verdict(self, *_args, **_kwargs) -> None: return None +@pytest.mark.parametrize("failure_stage", ["verification", "writeup"]) +def test_correct_closeout_recovers_without_resubmitting_or_releasing_early(tmp_path, monkeypatch, failure_stage): + import backend.competition.service as service_module + + platform = FixturePlatform([ + PlatformChallenge(external_id="closeout", title="Closeout", category="misc", description="fixture"), + ], flags={"closeout": "fixture:correct"}) + db, service, _state, _ops, workflow_id = _new_fixture_service(tmp_path, platform, "closeout-fault") + try: + run_id = service.start(workflow_id, "closeout-fault-run")["run"]["id"] + service.tick() + challenge = service.store.challenges(run_id)[0] + seat = service.store.assignments(run_id, active_only=True)[0] + with db.connect() as connection: + connection.execute("DELETE FROM intents WHERE project_id=%s AND to_fact_id='goal'", (challenge["project_id"],)) + + original_accept = service_module.accept_verified_flag + original_closeout = service.store.finalize_correct_challenge + + def unavailable(*_args, **_kwargs): + raise OSError("temporary closeout storage failure") + + def unavailable_writeup(connection, owner_run_id, challenge_id): + original_closeout(connection, owner_run_id, challenge_id) + raise OSError("writeup persistence failed after flag verification") + + if failure_stage == "verification": + monkeypatch.setattr(service_module, "accept_verified_flag", unavailable) + else: + monkeypatch.setattr(service.store, "finalize_correct_challenge", unavailable_writeup) + service.submit_candidate(run_id, challenge["id"], seat["session_id"], "fixture:correct", "verified evidence", 0) + service.tick() + assert service.store.get_run(run_id)["status"] == "blocked" + assert service.store.assignments(run_id, active_only=True) + with db.connect() as connection: + submission = connection.execute("SELECT status FROM competition_submissions WHERE run_id=%s", (run_id,)).fetchone() + assert submission["status"] == "correct" + assert connection.execute("SELECT 1 FROM competition_wp_jobs WHERE run_id=%s", (run_id,)).fetchone() is None + assert connection.execute("SELECT flag FROM projects WHERE id=%s", (challenge["project_id"],)).fetchone()["flag"] is None + + monkeypatch.setattr(service_module, "accept_verified_flag", original_accept) + monkeypatch.setattr(service.store, "finalize_correct_challenge", original_closeout) + service._process_submissions(service.store.get_run(run_id), allow_new=False) + assert platform.calls == [("closeout", "fixture:correct")] + assert all(row["role"] == "wp" for row in service.store.assignments(run_id, active_only=True)) + with db.connect() as connection: + project = connection.execute("SELECT status,flag FROM projects WHERE id=%s", (challenge["project_id"],)).fetchone() + assert project["status"] == "solved" and project["flag"] == "fixture:correct" + assert connection.execute("SELECT count(*) AS n FROM competition_wp_jobs WHERE run_id=%s", (run_id,)).fetchone()["n"] == 1 + service._process_submissions(service.store.get_run(run_id), allow_new=False) + assert platform.calls == [("closeout", "fixture:correct")] + finally: + service.shutdown() + db.close() + + +def test_external_solve_refresh_releases_solver_and_instance_once(tmp_path, monkeypatch): + item = PlatformChallenge(external_id="external", title="External", category="web", description="fixture", remote=True) + platform = FixturePlatform([item], remote_limit=1) + db, service, state, _ops, workflow_id = _new_fixture_service(tmp_path, platform, "external-solve") + try: + run_id = service.start(workflow_id, "external-solve-run")["run"]["id"] + service.tick() + challenge = service.store.challenges(run_id)[0] + assert service.store.assignments(run_id, active_only=True) + assert platform.instances() + stopped = [] + original_stop = platform.stop_instance + + def stop(external_id): + stopped.append(external_id) + original_stop(external_id) + + monkeypatch.setattr(platform, "stop_instance", stop) + platform.replace_challenges([item.model_copy(update={"solved": True})]) + service.control(run_id, "refresh", service.store.get_run(run_id)["revision"]) + assert service.store.challenges(run_id)[0]["state"] == "solved" + assert service.store.assignments(run_id, active_only=True) == [] + assert platform.instances() == [] + assert challenge["project_id"] in state.orchestrator.stopped + service.control(run_id, "refresh", service.store.get_run(run_id)["revision"]) + assert stopped == ["external"] + with db.connect() as connection: + assert connection.execute("SELECT flag FROM projects WHERE id=%s", (challenge["project_id"],)).fetchone()["flag"] is None + assert connection.execute("SELECT 1 FROM competition_wp_jobs WHERE run_id=%s", (run_id,)).fetchone() is None + finally: + service.shutdown() + db.close() + + def test_competition_service_fixture_runs_to_finished_with_wp_and_release(tmp_path): from backend.persistence.database import Database @@ -475,6 +564,176 @@ def test_instance_renewal_failure_rebuilds_and_fences_new_generation(tmp_path): db.close() +def test_instance_entry_is_published_once_to_active_members(tmp_path): + platform = FixturePlatform( + [PlatformChallenge( + external_id="entry-remote", title="Entry", category="web", + description="entry fixture", remote=True, + )], + flags={"entry-remote": "fixture:correct"}, remote_limit=1, + ) + db, service, _state, _ops, workflow_id = _new_fixture_service( + tmp_path, platform, "entry" + ) + try: + run_id = service.start(workflow_id, "entry-run")["run"]["id"] + service.tick() + challenge = service.store.challenges(run_id)[0] + snapshot = service.store.run_snapshot(run_id) + assert snapshot["resource_capacity"]["remote"]["limit"] == 1 + assert snapshot["resource_capacity"]["remote"]["used"] == 1 + assert snapshot["resource_capacity"]["local"]["used"] == 0 + assert snapshot["resource_capacity"]["remote"]["source"] == "workflow.remote_instance_limit" + kinds = {row["kind"] for row in service.store.run_events(run_id)} + assert {"instance.start_requested", "instance.started"}.issubset(kinds) + with db.connect() as connection: + connection.execute( + "UPDATE competition_instances SET metadata=%s WHERE challenge_id=%s", + (Jsonb({"entry": "10.0.0.5:30001"}), challenge["id"]), + ) + messages = [] + service.publish_recon = messages.append + run = service.store.get_run(run_id) + service._publish_instance_entries(run) + service._publish_instance_entries(run) + assert len(messages) == 1 + assert messages[0].payload["kind"] == "target_instance" + assert messages[0].payload["entry"] == "10.0.0.5:30001" + finally: + service.shutdown() + db.close() + + +def test_missing_instance_renewal_is_marked_expired_for_deferred_repair(tmp_path): + platform = FixturePlatform( + [PlatformChallenge( + external_id="expired-remote", title="Expired", category="web", + description="expired fixture", remote=True, + )], + flags={"expired-remote": "fixture:correct"}, remote_limit=1, + ) + db, service, _state, _ops, workflow_id = _new_fixture_service( + tmp_path, platform, "expired" + ) + try: + run_id = service.start(workflow_id, "expired-run")["run"]["id"] + service.tick() + challenge = service.store.challenges(run_id)[0] + platform._instances.clear() + with db.connect() as connection: + connection.execute( + "UPDATE competition_instances SET next_renew_at=now()-interval '1 second' WHERE challenge_id=%s", + (challenge["id"],), + ) + service._renew_instances(service.store.get_run(run_id)) + with db.connect() as connection: + row = connection.execute( + "SELECT state,metadata->>'repair_required' AS repair_required FROM competition_instances WHERE challenge_id=%s", + (challenge["id"],), + ).fetchone() + assert row["state"] == "expired" + assert row["repair_required"] == "true" + assert any(event["kind"] == "instance.expired" for event in service.store.run_events(run_id)) + run = service.store.get_run(run_id) + service._repair_assigned_instances(run) + assert platform.instances() == [] + with db.connect() as connection: + connection.execute( + "UPDATE competition_instances SET metadata=metadata || %s WHERE challenge_id=%s", + (Jsonb({"repair_after": "2026-01-01T00:00:00+00:00"}), challenge["id"]), + ) + service._repair_assigned_instances(run) + assert platform.instances() + service._publish_instance_entries(run) + assert any(event["kind"] == "instance.repaired" for event in service.store.run_events(run_id)) + finally: + service.shutdown() + db.close() + + +def test_submission_wrong_verdict_keeps_run_retriable(tmp_path): + platform = FixturePlatform( + [PlatformChallenge( + external_id="wrong-remote", title="Wrong", category="web", + description="wrong fixture", remote=False, + )], + flags={"wrong-remote": "fixture:correct"}, remote_limit=0, + ) + db, service, _state, _ops, workflow_id = _new_fixture_service(tmp_path, platform, "wrong") + try: + run_id = service.start(workflow_id, "wrong-run")["run"]["id"] + service.tick() + challenge = service.store.challenges(run_id)[0] + seat = service.store.assignments(run_id, active_only=True)[0] + service.submit_candidate(run_id, challenge["id"], seat["session_id"], "fixture:wrong", "wrong evidence", challenge["instance_generation"]) + service.tick() + assert platform.calls[-1] == ("wrong-remote", "fixture:wrong") + assert service.store.get_run(run_id)["status"] == "running" + assert service.store.challenges(run_id)[0]["state"] == "solving" + finally: + service.shutdown() + db.close() + + +def test_rate_limited_verdict_is_requeued_with_backoff(tmp_path): + platform = FixturePlatform( + [PlatformChallenge( + external_id="rate-remote", title="Rate", category="web", + description="rate fixture", remote=False, + )], + flags={"rate-remote": "fixture:correct"}, remote_limit=0, + ) + db, service, _state, _ops, workflow_id = _new_fixture_service(tmp_path, platform, "rate") + try: + run_id = service.start(workflow_id, "rate-run")["run"]["id"] + service.tick() + challenge = service.store.challenges(run_id)[0] + seat = service.store.assignments(run_id, active_only=True)[0] + service.submit_candidate(run_id, challenge["id"], seat["session_id"], "fixture:rate-limited", "rate evidence", challenge["instance_generation"]) + service.tick() + with db.connect() as connection: + row = connection.execute( + "SELECT status FROM competition_submissions WHERE challenge_id=%s ORDER BY created_at DESC LIMIT 1", + (challenge["id"],), + ).fetchone() + assert row["status"] == "queued" + finally: + service.shutdown() + db.close() + + +def test_renewal_failure_without_rebuild_uses_delayed_retry(tmp_path): + platform = FixturePlatform( + [PlatformChallenge( + external_id="retry-remote", title="Retry", category="web", + description="retry fixture", remote=True, + )], + flags={"retry-remote": "fixture:correct"}, remote_limit=1, + renew_failures=1, rebuild_on_renew_failure=False, + ) + db, service, _state, _ops, workflow_id = _new_fixture_service(tmp_path, platform, "retry") + try: + run_id = service.start(workflow_id, "retry-run")["run"]["id"] + service.tick() + challenge = service.store.challenges(run_id)[0] + with db.connect() as connection: + connection.execute( + "UPDATE competition_instances SET next_renew_at=now()-interval '1 second' WHERE challenge_id=%s", + (challenge["id"],), + ) + service._renew_instances(service.store.get_run(run_id)) + with db.connect() as connection: + row = connection.execute( + "SELECT state,next_renew_at>now() AS delayed FROM competition_instances WHERE challenge_id=%s", + (challenge["id"],), + ).fetchone() + assert row["state"] == "ready" and row["delayed"] is True + assert any(event["kind"] == "instance.renew_failed" for event in service.store.run_events(run_id)) + finally: + service.shutdown() + db.close() + + def test_stop_teardown_is_resilient_to_a_failing_instance_cleanup(tmp_path): """T4: a raising instance teardown must not strand the stop. diff --git a/tests/test_competition_service_guards.py b/tests/test_competition_service_guards.py index b72bf7f..a70ec59 100644 --- a/tests/test_competition_service_guards.py +++ b/tests/test_competition_service_guards.py @@ -1,12 +1,37 @@ +import threading from types import SimpleNamespace import pytest from backend.competition.service import ( CompetitionService, + _safe_member_config, _select_discovered, _selected_external_ids, ) +from backend.competition.store import CompetitionConflict + + +def test_quota_probe_failure_preserves_workflow_capacity(): + service = object.__new__(CompetitionService) + service._instance_capability_warnings = set() + events = [] + service.store = SimpleNamespace(append_run_event=lambda *args: events.append(args)) + + class UnavailableQuota: + supports_instances = True + + def instance_limit(self): + raise ConnectionError("platform quota endpoint unavailable") + + def start_instance(self, _external_id): + return {} + + run = {"id": "run", "limits": {}, "config_snapshot": {"workflow_spec": {"remote_instance_limit": 2}}} + spec = run["config_snapshot"]["workflow_spec"] + assert service._resolve_remote_limit(spec, UnavailableQuota()) == (2, "workflow.remote_instance_limit") + assert service._resolve_remote_limit(spec, UnavailableQuota()) == (2, "workflow.remote_instance_limit") + assert events == [] def test_select_discovered_keeps_only_requested_challenges(): @@ -92,7 +117,7 @@ def start_project_async(self, project_id): def test_start_rejects_platform_without_submit_capability_before_persisting_run(): service = object.__new__(CompetitionService) service.state = SimpleNamespace( - config=SimpleNamespace(startup_errors=lambda: []), + config=SimpleNamespace(startup_errors=list), ) service._workflow = lambda _workflow_id: { "id": "workflow", @@ -102,7 +127,7 @@ def test_start_rejects_platform_without_submit_capability_before_persisting_run( service._platform_for_workflow = lambda _workflow: SimpleNamespace( identity="readonly://platform", supports_submit=False, - preflight=lambda: [], + preflight=list, ) service.store = SimpleNamespace( create_run=lambda *_args, **_kwargs: pytest.fail( @@ -112,3 +137,121 @@ def test_start_rejects_platform_without_submit_capability_before_persisting_run( with pytest.raises(ValueError, match="does not support flag submission"): service.start("workflow", "run-key") + + +def test_capacity_and_instance_helpers_choose_explicit_sources_and_bounds(): + service = object.__new__(CompetitionService) + service.state = SimpleNamespace( + config=SimpleNamespace(limits=SimpleNamespace(max_concurrent_tasks=3)), + ) + service._instance_capability_warnings = set() + events = [] + service.store = SimpleNamespace(append_run_event=lambda *args: events.append(args)) + run = { + "id": "run", + "limits": {"remote_concurrency": 4, "max_concurrent_tasks": 2}, + "config_snapshot": {"workflow_spec": {"remote_concurrency": 2}}, + } + + class Reported: + supports_instances = True + + def instance_limit(self): + return 9 + + def start_instance(self, _external_id): + return {} + + assert service._remote_instance_limit(run, Reported()) == 4 + assert service._local_task_limit(run) == 2 + assert service._supports_instance_lifecycle(Reported()) is True + assert service._supports_instance_lifecycle(SimpleNamespace(supports_instances=False)) is False + assert service._instance_next_renewal({"ttl_seconds": 2}) + assert service._instance_next_renewal({"expires_at": "2099-01-01T00:00:00+00"}) + assert service._instance_next_renewal({"ttl_seconds": "bad"}) + + fallback = {"id": "run-2", "limits": {}, "config_snapshot": {"workflow_spec": {}}} + assert service._remote_instance_limit(fallback, Reported()) == 9 + assert service._remote_instance_limit(fallback, SimpleNamespace(supports_instances=False)) == 0 + assert events and events[-1][1] == "instance.limit_defaulted" or events == [] + + +def test_member_snapshot_redacts_credentials_and_preserves_presence(): + assert _safe_member_config(None) is None + config = SimpleNamespace(model_dump=lambda mode="json": { + "api_key": "secret", "model": "m", "nested": {"token": "x"} + }) + result = _safe_member_config(config) + assert result["api_key_set"] is True + assert result["api_key_fingerprint"] + assert result["nested"]["token"] == "x" + + +def test_challenge_metadata_normalizes_remote_solve_count_and_container_type(): + from backend.platform.mapping import PlatformChallenge + + item = PlatformChallenge.model_validate({ + "external_id": "42", "title": "Dynamic", "category": "Web", + "description": "target", "remote": True, "solved": True, + "solve_count": "7", "platform_data": {"solve_count": "7", "container_type": "DynamicContainer", "score": "100"}, + }) + metadata = CompetitionService._challenge_metadata(item) + assert metadata["remote"] is True + assert metadata["solve_count"] == 7 + assert metadata["container_type"] == "DynamicContainer" + assert metadata["score"] == 100 + malformed = CompetitionService._challenge_metadata( + SimpleNamespace(external_id="x", title="x", category="misc", description="x", + remote=False, solved=False, attachment_urls=[], hints=[], + platform_data={"solve_count": "bad"}) + ) + assert "solve_count" not in malformed + + +def test_service_control_and_limit_update_use_revision_and_wake_scheduler(): + service = object.__new__(CompetitionService) + service._tick_lock = threading.Lock() + service._refresh_unlocked = lambda _run_id: None + service.wake = lambda: setattr(service, "woken", True) + service.store = SimpleNamespace( + get_run=lambda _run_id: {"id": "run", "revision": 2, "status": "running"}, + run_snapshot=lambda _run_id: {"run": {"id": "run"}}, + update_limits=lambda run_id, limits, revision: {"id": run_id, "revision": revision + 1}, + append_run_event=lambda *_args: None, + ) + service._teardown_stopped_run = lambda *_args: None + service.store.transition_run = lambda *args, **kwargs: {"id": "run", "status": "paused"} + assert service.control("run", "refresh", 2) == {"run": {"id": "run"}} + with pytest.raises(ValueError, match="unsupported"): + service.control("run", "unknown", 2) + result = service.update_limits("run", {"remote_concurrency": 2}, 2) + assert result == {"run": {"id": "run"}} + assert service.woken is True + + class BusyLock: + def acquire(self, **_kwargs): + return False + def release(self): + return None + service._tick_lock = BusyLock() + with pytest.raises(CompetitionConflict, match="20 seconds") as caught: + service.control("run", "refresh", 2) + assert caught.value.retry_after == 20 + + +def test_service_pair_and_import_compatibility_seams(): + service = object.__new__(CompetitionService) + service.state = SimpleNamespace(competition_message_handler=None) + message = SimpleNamespace(request_id="req") + result = service._execute_pair_message(message, object()) + assert result["status"] == "failed" + service.state.competition_message_handler = lambda msg, cancel: {"request_id": msg.request_id, "cancelled": cancel.is_set()} + assert service._execute_pair_message(message, SimpleNamespace(is_set=lambda: False))["request_id"] == "req" + + calls = [] + def old_importer(workflow_id, spec, ids): + calls.append((workflow_id, ids)) + return {"imported": []} + service._ops_service = SimpleNamespace(_import=old_importer) + assert service._import_for_run("wf", object(), ["1"], "run") == {"imported": []} + assert calls == [("wf", ["1"])] diff --git a/tests/test_competition_store.py b/tests/test_competition_store.py index 38a57c4..8977c86 100644 --- a/tests/test_competition_store.py +++ b/tests/test_competition_store.py @@ -1,17 +1,26 @@ """Integration invariants; run only with an isolated IPC_TEST_DATABASE_URL.""" +import logging from datetime import datetime, timedelta, timezone from types import SimpleNamespace import pytest import zmq +from psycopg.errors import RaiseException from backend.blackboard import graph_store -from backend.competition.store import CompetitionConflict, CompetitionStore +from backend.competition.store import ( + CompetitionConflict, + CompetitionStore, + _redact_snapshot, +) from backend.competition.transport import Envelope, ReconPublisher, ReconSubscriber from backend.competition.workspace import SharedWorkspace from backend.core.orchestrator import Orchestrator from backend.persistence.database import Database +# Error boundaries keep their recovery behavior and retain debug diagnostics. +_recovery_logger = logging.getLogger(__name__) + pytestmark = pytest.mark.postgres @@ -47,6 +56,147 @@ def test_idempotent_start_and_only_one_active_run(store): store.create_run("workflow", "different/team", "other-start", {}) +def test_run_limit_updates_validate_types_bounds_and_revision(store): + run = running(store, "limits") + updated = store.update_limits( + run["id"], {"max_concurrent_tasks": "3", "remote_concurrency": 2}, + revision=run["revision"], + ) + assert updated["limits"]["max_concurrent_tasks"] == 3 + assert updated["limits"]["remote_concurrency"] == 2 + with pytest.raises(ValueError, match="object"): + store.update_limits(run["id"], [], revision=updated["revision"]) + with pytest.raises(ValueError, match="unknown run"): + store.update_limits(run["id"], {"unknown": 1}, revision=updated["revision"]) + with pytest.raises(ValueError, match="integer"): + store.update_limits(run["id"], {"total_cpu": "bad"}, revision=updated["revision"]) + with pytest.raises(ValueError, match="between"): + store.update_limits(run["id"], {"total_cpu": 1001}, revision=updated["revision"]) + with pytest.raises(CompetitionConflict, match="stale"): + store.update_limits(run["id"], {"total_cpu": 1}, revision=run["revision"]) + + +def test_submission_queue_and_verdict_branches_fence_evidence_and_cooldowns(store): + run = running(store, "submission-branches") + challenge = ready(store, run, "submit-branches") + assignment = store.assign(run["id"], challenge["id"], "amber", "submitter") + with pytest.raises(ValueError, match="candidate"): + store.queue_candidate(assignment, "", "evidence", challenge["instance_generation"]) + with pytest.raises(ValueError, match="candidate"): + store.queue_candidate(assignment, "flag{x}", "", challenge["instance_generation"]) + with pytest.raises(CompetitionConflict, match="stale instance"): + store.queue_candidate(assignment, "flag{x}", "evidence", challenge["instance_generation"] + 1) + + queued = store.queue_candidate( + assignment, "flag{x}", "evidence", challenge["instance_generation"] + ) + submitting = store.claim_submission(run["id"]) + assert submitting["id"] == queued["id"] + wrong = store.finish_submission(queued["id"], {"verdict": "wrong"}) + assert wrong["status"] == "wrong" + + queued_again = store.queue_candidate( + assignment, "flag{rate}", "second evidence", challenge["instance_generation"] + ) + with store.db.connect() as connection: + connection.execute( + "UPDATE competition_challenges SET next_submission_at=now() WHERE id=%s", + (challenge["id"],), + ) + store.claim_submission(run["id"]) + rate = store.finish_submission(queued_again["id"], {"verdict": "rate_limited", "retry_after": 2}) + assert rate["status"] == "rate_limited" + with pytest.raises(ValueError, match="unknown verdict"): + store.finish_submission(queued_again["id"], {"verdict": "wat"}) + + with pytest.raises(ValueError, match="grace"): + store.reconcile_inflight_submissions(run["id"], grace_seconds=-1) + + +def test_recovered_candidate_and_inflight_reconciliation_guards(store): + run = running(store, "recovered-candidate") + challenge = ready(store, run, "recovered") + with pytest.raises(ValueError, match="candidate and evidence"): + store.queue_recovered_candidate(run["id"], challenge["id"], "", "") + with pytest.raises(CompetitionConflict, match="accepting candidates"): + store.queue_recovered_candidate(run["id"], challenge["id"], "flag{x}", "evidence") + no_seat = ready(store, run, "no-seat") + with store.db.connect() as connection: + connection.execute( + "UPDATE competition_challenges SET state='solving' WHERE id=%s", + (no_seat["id"],), + ) + with pytest.raises(CompetitionConflict, match="solver session"): + store.queue_recovered_candidate(run["id"], no_seat["id"], "flag{x}", "evidence") + assignment = store.assign(run["id"], challenge["id"], "amber", "recover") + recovered = store.queue_recovered_candidate( + run["id"], challenge["id"], "flag{x}", "legacy evidence" + ) + assert recovered["status"] == "queued" + claimed = store.claim_submission(run["id"]) + with store.db.connect() as connection: + connection.execute( + "UPDATE competition_submissions SET submitted_at=now()-interval '2 minutes' WHERE id=%s", + (claimed["id"],), + ) + assert store.reconcile_inflight_submissions(run["id"], grace_seconds=30) == 1 + assert store.submission(claimed["id"])["status"] == "unknown" + assert assignment["member"] == "amber" + + +def test_external_solved_marking_is_idempotent_and_reports_missing_challenges(store): + run = running(store, "external-solved") + challenge = ready(store, run, "external-solved") + solved = store.mark_external_solved(challenge["id"]) + assert solved["state"] == "solved" + assert store.mark_external_solved(challenge["id"])["state"] == "solved" + with pytest.raises(KeyError): + store.mark_external_solved("missing-challenge") + + +def test_run_transition_rejects_stale_and_invalid_terminal_transitions(store): + run = running(store, "transition-guards") + with pytest.raises(CompetitionConflict, match="stale revision"): + store.transition_run(run["id"], "paused", revision=run["revision"] - 1) + with pytest.raises(CompetitionConflict, match="invalid run transition"): + store.transition_run(run["id"], "importing", revision=run["revision"]) + + +def test_challenge_state_guards_reject_unknown_and_missing_rows(store): + run = running(store, "state-guards") + challenge = ready(store, run, "state-guards") + with pytest.raises(ValueError, match="invalid challenge state"): + store.set_challenge_state(challenge["id"], "running") + changed = store.set_challenge_state(challenge["id"], "blocked") + assert changed["state"] == "blocked" + with pytest.raises(KeyError): + store.set_challenge_state("missing-challenge", "ready") + + +def test_store_argument_and_missing_row_guards(store): + with pytest.raises(ValueError, match="identity"): + store.create_run("workflow", "", "", {}) + run = running(store, "argument-guards") + challenge = ready(store, run, "argument-guards") + with pytest.raises(ValueError, match="Member assignment"): + store.assign(run["id"], challenge["id"], "unknown", "owner") + with pytest.raises(ValueError, match="Member assignment"): + store.assign(run["id"], challenge["id"], "amber", "") + with pytest.raises(KeyError): + store.get_run("missing-run") + + +def test_competition_snapshot_redaction_keeps_only_secret_presence(): + assert _redact_snapshot({ + "api_key": "secret", "nested": {"token": "t", "host": "x"}, + "items": [{"password": "p"}], + }) == { + "api_key_set": True, + "nested": {"token_set": True, "host": "x"}, + "items": [{"password_set": True}], + } + + def test_engine_lease_fences_legacy_and_competition_schedulers(store): """The scheduler fence closes the check/start race across processes.""" run = running(store, "engine-fence") @@ -200,9 +350,8 @@ def test_release_reassignment_preserves_deadline_and_session(store): assert second["session_id"] == first["session_id"] with store.db.connect() as c: assert c.execute("SELECT deadline_at FROM competition_challenges WHERE id=%s", (challenge["id"],)).fetchone() == original - with pytest.raises(Exception, match="immutable"): - with store.db.connect() as c: - c.execute("UPDATE competition_challenges SET first_assigned_at=now(),deadline_at=now()+interval '5 hours' WHERE id=%s", (challenge["id"],)) + with pytest.raises(RaiseException, match="immutable"), store.db.connect() as c: + c.execute("UPDATE competition_challenges SET first_assigned_at=now(),deadline_at=now()+interval '5 hours' WHERE id=%s", (challenge["id"],)) def test_restart_recovers_expired_assignment_without_resetting_deadline(store): @@ -244,7 +393,7 @@ def test_session_events_are_idempotent_and_stale_writer_is_fenced(store): run = running(store) challenge = ready(store, run) assignment = store.assign(run["id"], challenge["id"], "amber", "worker") - args = dict(assignment_id=assignment["id"], owner="worker", epoch=assignment["epoch"]) + args = {"assignment_id": assignment["id"], "owner": "worker", "epoch": assignment["epoch"]} event = store.append_event(assignment["session_id"], "call-1", "tool_call", {"command": "pwd"}, **args) assert store.append_event(assignment["session_id"], "call-1", "tool_call", {"command": "pwd"}, **args) == event with pytest.raises(CompetitionConflict): @@ -455,16 +604,26 @@ def test_submission_dedupe_wrong_cooldown_and_redaction(store): assert store.challenges(run["id"])[0]["wrong_count"] == 1 -def test_correct_submission_creates_original_author_wp_job(store): +def test_correct_closeout_creates_original_author_wp_job(store): run = running(store) challenge = ready(store, run) assignment = store.assign(run["id"], challenge["id"], "agate", "worker") queued = store.queue_candidate(assignment, "flag{correct}", "verified exploit", 0) claimed = store.claim_submission(run["id"]) + assert claimed["id"] == queued["id"] + with pytest.raises(CompetitionConflict, match="requires a correct"), store.db.connect() as connection: + store.finalize_correct_challenge(connection, run["id"], challenge["id"]) store.finish_submission( claimed["id"], {"verdict": "correct", "submission_id": "remote-1"} ) + assert store.challenges(run["id"])[0]["state"] == "solving" + with store.db.connect() as connection: + assert connection.execute( + "SELECT 1 FROM competition_wp_jobs WHERE challenge_id=%s", (challenge["id"],), + ).fetchone() is None + store.finalize_correct_challenge(connection, run["id"], challenge["id"]) + store.finalize_correct_challenge(connection, run["id"], challenge["id"]) solved = store.challenges(run["id"])[0] assert solved["state"] == "solved" with store.db.connect() as connection: @@ -557,6 +716,7 @@ def hold_the_run_shard() -> None: holding.set() release.wait(10) except BaseException as exc: + _recovery_logger.debug('Error handled in hold_the_run_shard', exc_info=True) failure.append(exc) holding.set() @@ -606,6 +766,7 @@ def persist() -> None: with lock: results.append(record) except BaseException as exc: + _recovery_logger.debug('Error handled in persist', exc_info=True) with lock: failures.append(exc) @@ -642,6 +803,7 @@ def hold_first_run_shard() -> None: holding.set() release.wait(10) except BaseException as exc: + _recovery_logger.debug('Error handled in hold_first_run_shard', exc_info=True) failure.append(exc) holding.set() @@ -736,7 +898,7 @@ def test_orchestrator_report_bridge_uses_durable_recon_store(store): """The production report bridge persists one record per helper seat.""" run = running(store, "recon-bridge") challenge = ready(store, run, "bridge") - sender = store.assign(run["id"], challenge["id"], "amber", "bridge-a") + store.assign(run["id"], challenge["id"], "amber", "bridge-a") receiver = store.assign( run["id"], challenge["id"], "agate", "bridge-b", role="helper" ) diff --git a/tests/test_competition_transport.py b/tests/test_competition_transport.py index 4e45828..8acf192 100644 --- a/tests/test_competition_transport.py +++ b/tests/test_competition_transport.py @@ -1,21 +1,44 @@ -from datetime import datetime, timedelta, timezone import threading import time +from datetime import datetime, timedelta, timezone import pytest +import zmq from backend.competition.proto import pair_pb2 from backend.competition.transport import ( Envelope, + PairCoordinator, ReconPublisher, ReconSubscriber, WaitGraph, + call, + encode, envelope_from_proto, envelope_to_proto, result_from_proto, result_to_proto, ) -import zmq + + +class _Abort(Exception): + pass + + +class _RpcContext: + def __init__(self, *, remaining=10.0): + self.remaining = remaining + self.callbacks = [] + + def abort(self, code, detail): + raise _Abort(f"{code.name}: {detail}") + + def time_remaining(self): + return self.remaining + + def add_callback(self, callback): + self.callbacks.append(callback) + return True def message(**changes): @@ -68,6 +91,181 @@ def test_invalid_protobuf_payload_and_cyclic_wait_are_rejected(): waits.enter("b", "c") with pytest.raises(ValueError, match="cyclic"): waits.enter("c", "a") + with pytest.raises(ValueError, match="already"): + waits.enter("a", "d") + waits = WaitGraph() + waits.enter("a", "b") + waits.enter("b", "c") + with pytest.raises(ValueError, match="cyclic"): + waits.enter("c", "b") + + +def test_transport_validation_and_result_error_paths(): + with pytest.raises(ValueError, match="timezone"): + message(created_at=datetime.now(), deadline_at=datetime.now() + timedelta(seconds=1)) + with pytest.raises(ValueError, match="same Member"): + message(receiver_member_id="amber") + with pytest.raises(ValueError, match="256 KiB"): + encode({"payload": "x" * (256 * 1024)}) + with pytest.raises(ValueError, match="not valid JSON"): + result_from_proto(pair_pb2.Result(payload_json=b"not-json")) + with pytest.raises(ValueError, match="JSON object"): + result_from_proto(pair_pb2.Result(payload_json=b"[]", status="ok")) + expired_at = datetime.now(timezone.utc) + expired = message( + created_at=expired_at - timedelta(seconds=2), + deadline_at=expired_at - timedelta(seconds=1), + ) + with pytest.raises(TimeoutError, match="expired"): + call("unused.sock", expired) + + +def test_pair_coordinator_call_is_idempotent_and_converts_failures(): + finished = [] + coordinator = PairCoordinator( + "/tmp/unused.sock", + authorize=lambda _message: True, + claim=lambda _message: None, + execute=lambda _message, _cancel: {"status": "done", "value": 3}, + finish=lambda message, result: finished.append((message.request_id, result)), + ) + try: + result = coordinator._call(envelope_to_proto(message()), _RpcContext()) + assert result_from_proto(result)["value"] == 3 + assert finished[0][0] == "request" + finally: + coordinator.close() + + coordinator = PairCoordinator( + "/tmp/unused.sock", + authorize=lambda _message: True, + claim=lambda _message: {"status": "cached", "value": 9}, + execute=lambda *_args: pytest.fail("cached request must not execute"), + finish=lambda *_args: pytest.fail("cached request must not finish"), + ) + try: + assert result_from_proto(coordinator._call(envelope_to_proto(message()), _RpcContext()))["value"] == 9 + finally: + coordinator.close() + + +def test_pair_coordinator_authorization_deadline_and_cancel_paths(): + raw = envelope_to_proto(message()) + coordinator = PairCoordinator( + "/tmp/unused.sock", authorize=lambda _message: False, + claim=lambda _message: None, execute=lambda *_args: {}, finish=lambda *_args: None, + ) + try: + with pytest.raises(_Abort, match="PERMISSION_DENIED"): + coordinator._call(raw, _RpcContext()) + finally: + coordinator.close() + + coordinator = PairCoordinator( + "/tmp/unused.sock", authorize=lambda _message: True, + claim=lambda _message: None, execute=lambda *_args: {}, finish=lambda *_args: None, + ) + try: + with pytest.raises(_Abort, match="INVALID_ARGUMENT"): + coordinator._call(pair_pb2.Envelope(payload_json=b"not-json"), _RpcContext()) + with pytest.raises(_Abort, match="DEADLINE_EXCEEDED"): + expired_created = datetime.now(timezone.utc) - timedelta(seconds=2) + coordinator._call( + envelope_to_proto(message( + created_at=expired_created, + deadline_at=expired_created + timedelta(seconds=1), + )), + _RpcContext(), + ) + with pytest.raises(_Abort, match="DEADLINE_EXCEEDED"): + coordinator._call(envelope_to_proto(message()), _RpcContext(remaining=None)) + coordinator.waits.enter("sender-session", "other") + with pytest.raises(_Abort, match="FAILED_PRECONDITION"): + coordinator._call(envelope_to_proto(message()), _RpcContext()) + coordinator.waits.leave("sender-session") + finally: + coordinator.close() + + coordinator = PairCoordinator( + "/tmp/unused.sock", authorize=lambda _message: True, + claim=lambda _message: None, + execute=lambda _message, cancel: cancel.set(), + finish=lambda _message, result: None, + ) + try: + assert result_from_proto(coordinator._call(raw, _RpcContext()))["status"] == "cancelled" + finally: + coordinator.close() + + coordinator = PairCoordinator( + "/tmp/unused.sock", authorize=lambda _message: True, + claim=lambda _message: None, + execute=lambda *_args: (_ for _ in ()).throw(RuntimeError("boom")), + finish=lambda _message, result: None, + ) + try: + result = result_from_proto(coordinator._call(raw, _RpcContext())) + assert result["status"] == "failed" and "RuntimeError" in result["error"] + finally: + coordinator.close() + + +def test_recon_subscriber_validation_and_ack_errors(): + with pytest.raises(ValueError, match="configured together"): + ReconSubscriber(None, "challenge", session_id="s") + with pytest.raises(ValueError, match="live-only"): + ReconSubscriber(None, "challenge") + context = zmq.Context() + subscriber = ReconSubscriber( + "inproc://recon-errors", "challenge", session_id="receiver-session", + replay=lambda _session, **_kwargs: [], + advance=lambda _session, sequence: sequence, + context=context, + ) + try: + with pytest.raises(RuntimeError, match="no recon record"): + subscriber.ack() + with pytest.raises(ValueError, match="positive persisted"): + subscriber._queue({"sequence": 0, "envelope": message(message_type="recon").model_dump(mode="json")}) + finally: + subscriber.close() + context.term() + + +def test_recon_subscriber_rejects_malformed_and_duplicate_records(): + context = zmq.Context() + subscriber = ReconSubscriber( + "inproc://recon-malformed", "challenge", session_id="receiver-session", + replay=lambda _session, **_kwargs: [], + advance=lambda _session, sequence: sequence, + context=context, + ) + record = {"sequence": 1, "envelope": message(message_type="recon").model_dump(mode="json")} + try: + with pytest.raises(ValueError, match="JSON object"): + subscriber._normalize([]) + with pytest.raises(ValueError, match="different challenge"): + subscriber._normalize({"sequence": 1, "envelope": message(challenge_id="other", message_type="recon").model_dump(mode="json")}) + with pytest.raises(ValueError, match="different receiver"): + subscriber._normalize({"sequence": 1, "envelope": message(receiver_session_id="other", message_type="recon").model_dump(mode="json")}) + with pytest.raises(ValueError, match="does not match"): + subscriber._normalize({"sequence": 1, "envelope": message(sequence=2, message_type="recon").model_dump(mode="json")}) + subscriber._queue(record) + with pytest.raises(ValueError, match="different content"): + subscriber._queue({"sequence": 1, "envelope": message(request_id="other", message_type="recon").model_dump(mode="json")}) + subscriber._inflight = subscriber._pending[1] + with pytest.raises(ValueError, match="in-flight"): + subscriber.ack(2) + subscriber._inflight = None + subscriber._pending.clear() + subscriber._cursor = 1 + subscriber._inflight = record + subscriber.advance = lambda _session, _sequence: 0 + with pytest.raises(RuntimeError, match="did not advance"): + subscriber.ack() + finally: + subscriber.close() + context.term() def test_recon_subscriber_replays_orders_deduplicates_and_acknowledges(): diff --git a/tests/test_competition_uds.py b/tests/test_competition_uds.py index e365a8d..9e62f92 100644 --- a/tests/test_competition_uds.py +++ b/tests/test_competition_uds.py @@ -7,7 +7,6 @@ from backend.competition.transport import Envelope, PairCoordinator, call - pytestmark = pytest.mark.skipif(os.name != "posix", reason="gRPC UDS requires Linux") diff --git a/tests/test_config.py b/tests/test_config.py index f016acb..f0d9cfb 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,13 +1,22 @@ from __future__ import annotations -from pathlib import Path import os import stat +from pathlib import Path import pytest import yaml - -from backend.core.config import AppConfig, MEMBER_NAMES, LLMConfig, MemberConfig, RuntimeConfig, load_config, save_config +from pydantic import ValidationError + +from backend.core.config import ( + MEMBER_NAMES, + AppConfig, + LLMConfig, + MemberConfig, + RuntimeConfig, + load_config, + save_config, +) from tests.helpers import write_mock_config @@ -75,15 +84,15 @@ def test_browser_runtime_limits_and_origins_are_validated(): browser_allowed_origins=["HTTPS://Example.Test:443/", "http://[::1]:8080"], ) assert runtime.browser_allowed_origins == ["https://example.test", "http://[::1]:8080"] - with pytest.raises(Exception): + with pytest.raises(ValidationError): RuntimeConfig(browser_event_limit=1001) - with pytest.raises(Exception): + with pytest.raises(ValidationError): RuntimeConfig(browser_response_preview_bytes=16385) - with pytest.raises(Exception): + with pytest.raises(ValidationError): RuntimeConfig(browser_artifact_max_bytes=50 * 1024 * 1024 + 1) - with pytest.raises(Exception): + with pytest.raises(ValidationError): RuntimeConfig(browser_allowed_origins=["file:///tmp/page.html"]) - with pytest.raises(Exception): + with pytest.raises(ValidationError): RuntimeConfig(browser_allowed_origins=["https://example.test/path"]) @@ -91,9 +100,9 @@ def test_llm_surface_and_reasoning_settings_are_validated(): cfg = LLMConfig(api_surface="responses", reasoning_effort="low") assert cfg.api_surface == "responses" assert cfg.reasoning_effort == "low" - with pytest.raises(Exception): + with pytest.raises(ValidationError): LLMConfig(api_surface="legacy-completions") - with pytest.raises(Exception): + with pytest.raises(ValidationError): LLMConfig(reasoning_effort="ultra") @@ -129,7 +138,7 @@ def test_available_members_filters_unconfigured(): def test_duplicate_member_names_rejected(): - with pytest.raises(Exception): + with pytest.raises(ValidationError): AppConfig( diamond=LLMConfig(api_format="mock"), members=[ diff --git a/tests/test_coverage_gate.py b/tests/test_coverage_gate.py new file mode 100644 index 0000000..af6f719 --- /dev/null +++ b/tests/test_coverage_gate.py @@ -0,0 +1,33 @@ +"""Regression checks for the coverage gate's saved-baseline comparison.""" +import json + +from scripts import check_coverage + + +def reports(tmp_path, monkeypatch, covered, statements): + monkeypatch.chdir(tmp_path) + files = { + "backend/agent/runtime.py": {"summary": {"covered_lines": 4, "num_statements": 5}}, + "backend/competition/service.py": {"summary": {"covered_lines": covered, "num_statements": statements}}, + } + (tmp_path / "coverage.json").write_text(json.dumps({"files": files}), encoding="utf-8") + (tmp_path / "coverage-baseline.json").write_text( + json.dumps({"agent-core": {"line_percent": 80}, "competition": {"line_percent": 80.81}}), encoding="utf-8", + ) + + +def test_gate_accepts_the_exact_run_used_to_save_a_rounded_baseline(tmp_path, monkeypatch): + reports(tmp_path, monkeypatch, 2505, 3100) + assert check_coverage.main() == 0 + + +def test_rounding_does_not_bypass_the_eighty_percent_floor(tmp_path, monkeypatch): + reports(tmp_path, monkeypatch, 79999, 100000) + # Remove the stricter saved baseline to exercise the floor itself. + (tmp_path / "coverage-baseline.json").unlink() + assert check_coverage.main() == 1 + + +def test_gate_rejects_a_missing_module_group(tmp_path, monkeypatch): + reports(tmp_path, monkeypatch, 0, 0) + assert check_coverage.main() == 1 diff --git a/tests/test_frontend.py b/tests/test_frontend.py index 3bd4396..7d07bcc 100644 --- a/tests/test_frontend.py +++ b/tests/test_frontend.py @@ -70,7 +70,9 @@ def test_index_served(client): assert "deleteOpsWorkflow" in body assert "authorizeOpsWorkflow" in body assert "/confirmation" in body - assert "opsConfirmMissing" in body + assert "onQuestionEnter($event, question.id)" in body + assert "Workflow secret" not in body + assert 'question.sensitive?"******"' not in body assert 'placeholder="confirmation phrase"' not in body assert "Review every URL, method and template above, then type:" not in body assert "startOpsRun" in body @@ -182,6 +184,7 @@ def test_ops_chat_helpers_behave(): capture_output=True, text=True, timeout=120, + check=False, ) assert result.returncode == 0, result.stderr or result.stdout assert result.stdout.strip().endswith("ok") diff --git a/tests/test_goal_intent_postgres.py b/tests/test_goal_intent_postgres.py index bc559a0..0cb5661 100644 --- a/tests/test_goal_intent_postgres.py +++ b/tests/test_goal_intent_postgres.py @@ -9,7 +9,6 @@ from backend.blackboard import edge_store, graph_store from backend.persistence.database import Database - pytestmark = pytest.mark.postgres @@ -54,18 +53,17 @@ def test_raw_sql_cannot_insert_a_second_goal_intent() -> None: (project_id,), ) - with pytest.raises(UniqueViolation): - with database.connect() as connection: - connection.execute( - """ + with pytest.raises(UniqueViolation), database.connect() as connection: + connection.execute( + """ INSERT INTO intents ( id, project_id, to_fact_id, description, creator, created_at, concluded_at ) VALUES ('intent_2', %s, 'goal', 'second', 'test', now(), now()) """, - (project_id,), - ) + (project_id,), + ) finally: database.close() diff --git a/tests/test_gzctf_adapter.py b/tests/test_gzctf_adapter.py index cba8a61..c85f7cf 100644 --- a/tests/test_gzctf_adapter.py +++ b/tests/test_gzctf_adapter.py @@ -1,13 +1,14 @@ from __future__ import annotations from pathlib import Path +from typing import ClassVar import pytest -from backend.platform.gzctf import GZCTFAdapter, GZCTFPreflightError -from backend.platform.mapping import FieldMapping from backend.competition.platform import CompetitionPlatform from backend.ops.models import PlatformWorkflowSpec +from backend.platform.gzctf import GZCTFAdapter, GZCTFPreflightError +from backend.platform.mapping import FieldMapping class _Response: @@ -420,3 +421,132 @@ def test_platform_reported_container_limit_wins_over_silence(): assert _adapter(_ContainerClient(limit=3)).instance_limit() == 3 assert _adapter(_ContainerClient(limit=0)).instance_limit() is None assert _adapter(_ContainerClient()).instance_limit() is None + + +def test_competition_platform_fallbacks_and_lifecycle_errors(monkeypatch): + class _HttpResponse: + status_code = 200 + headers: ClassVar[dict] = {} + + @staticmethod + def json(): + return {"verdict": "correct", "submission": "s-1"} + + class _Http: + @staticmethod + def get(url, headers=None): + assert url.endswith("/challenge%2F1/sub-1") + assert headers == {"Authorization": "secret"} + return _HttpResponse() + + class _Store: + @staticmethod + def workflow_secrets(_workflow_id): + return {"token": "secret"} + + class _Adapter: + identity = "https://platform.example/account/a" + supports_submit = False + supports_instances = True + + def fetch_challenges(self): + return ["fetched"] + + def submit(self, external_id, flag): + return {"native": external_id, "flag": flag} + + def instance_limit(self): + return "4" + + def instances(self): + return ["instance"] + + def start_instance(self, external_id): + return {"started": external_id} + + def stop_instance(self, external_id): + return {"stopped": external_id} + + def renew_instance(self, external_id): + return {"renewed": external_id} + + def rebuild_instance(self, external_id): + return {"rebuilt": external_id} + + spec = PlatformWorkflowSpec.model_validate( + { + "name": "Fallback platform", + "competition_id": "competition/id", + "team_id": "team/x", + "challenges": {"list_url": "https://platform.example/challenges"}, + "submit": { + "url": "https://platform.example/submit/{{external_id}}", + "success_path": "verdict", + "success_values": ["correct"], + "query_url": "https://platform.example/query/{{external_id}}/{{submission_id}}", + "headers": [{"name": "Authorization", "secret_name": "token"}], + }, + } + ) + adapter = _Adapter() + submitted = [] + + class _Ops: + store = _Store() + + @staticmethod + def _adapter(_workflow_id, _spec): + return adapter + + @staticmethod + def _submit(_workflow_id, _spec, external_id, flag, *, include_verdict): + submitted.append((external_id, flag, include_verdict)) + return {"fallback": True} + + @staticmethod + def _http_client(_spec): + return _Http() + + platform = CompetitionPlatform(_Ops(), "wf", spec) + assert platform.identity == "https://platform.example/account/a/competition%2Fid/team%2Fx" + assert platform.supports_submit is True + assert platform.supports_instances is True + assert platform.instance_limit() == 4 + assert platform.challenges() == ["fetched"] + assert platform.submit("id", "flag") == {"native": "id", "flag": "flag"} + assert platform.query("challenge/1", "sub-1")["verdict"] == "correct" + assert platform.instances() == ["instance"] + assert platform.start_instance("id") == {"started": "id"} + assert platform.stop_instance("id") == {"stopped": "id"} + assert platform.renew_instance("id") == {"renewed": "id"} + assert platform.rebuild_instance("id") == {"rebuilt": "id"} + + class _FallbackAdapter: + identity = "https://platform.example/team/team%2Fx" + + def fetch_challenges(self): + return ["fallback"] + + fallback = _FallbackAdapter() + adapter = fallback + platform = CompetitionPlatform(_Ops(), "wf", spec) + assert platform.identity == "https://platform.example/team/team%2Fx" + assert platform.challenges() == ["fallback"] + assert platform.submit("id", "flag") == {"fallback": True} + assert submitted == [("id", "flag", True)] + assert platform.instances() == [] + for operation in (platform.start_instance, platform.stop_instance, + platform.renew_instance, platform.rebuild_instance): + with pytest.raises(ValueError, match="no verified"): + operation("id") + + class _BrokenAdapter: + identity = None + + def instance_limit(self): + raise RuntimeError("unavailable") + + adapter = _BrokenAdapter() + broken = CompetitionPlatform(_Ops(), "wf", spec) + assert broken.instance_limit() is None + assert broken.identity.startswith("https://platform.example/") diff --git a/tests/test_legacy_migration.py b/tests/test_legacy_migration.py index ba65bdc..7ba58ca 100644 --- a/tests/test_legacy_migration.py +++ b/tests/test_legacy_migration.py @@ -1,8 +1,8 @@ from __future__ import annotations +import sqlite3 from argparse import Namespace from pathlib import Path -import sqlite3 import pytest diff --git a/tests/test_lifecycle.py b/tests/test_lifecycle.py index 2cd6be4..6b042c6 100644 --- a/tests/test_lifecycle.py +++ b/tests/test_lifecycle.py @@ -1,6 +1,7 @@ from __future__ import annotations import asyncio +import sys from concurrent.futures import ThreadPoolExecutor import pytest @@ -8,13 +9,18 @@ from backend.blackboard.db import Database from backend.core.state import AppState -from backend.mcp.mcp_client import MCPClient +from backend.mcp.mcp_client import MCPClient, MCPToolError from backend.mcp.mcp_server import close_lifespan, create_mcp_server from backend.memory.memory_store import MemoryStore from backend.server.app import create_app from backend.tools.tool_registry import ToolRegistry from tests.helpers import setup_test_auth, write_mock_config +if sys.version_info >= (3, 11): + from builtins import ExceptionGroup +else: + from exceptiongroup import ExceptionGroup + def test_postgres_pool_serves_concurrent_connections(): database = Database(min_size=1, max_size=8).configure() @@ -39,12 +45,10 @@ def test_storage_close_methods_are_idempotent_and_clear_local_cache(): resource.close() resource.close() - with pytest.raises(Exception, match="closed|reused"): - with database.connect(): - pass - with pytest.raises(Exception, match="closed|reused"): - with memory.db.connect(): - pass + with pytest.raises(Exception, match="closed|reused"), database.connect(): + pass + with pytest.raises(Exception, match="closed|reused"), memory.db.connect(): + pass assert registry.cached_search("query") is None @@ -77,9 +81,8 @@ def test_app_state_closes_owned_resources_in_dependency_order(tmp_path, monkeypa state.close() assert order[:3] == ["registry", "memory", "database"] - with pytest.raises(Exception, match="closed|reused"): - with state.db.connect(): - pass + with pytest.raises(Exception, match="closed|reused"), state.db.connect(): + pass def test_fastmcp_lifespan_closes_owned_resource_on_normal_and_error_exit(): @@ -94,7 +97,7 @@ async def explode() -> str: raise RuntimeError("expected") async def run() -> None: - with pytest.raises(Exception): + with pytest.raises((MCPToolError, ExceptionGroup)): async with MCPClient.in_process(server) as client: await client.call_tool("explode") @@ -117,6 +120,5 @@ def fail_request(): assert conn.execute("SELECT 1 AS value").fetchone()["value"] == 1 assert state.registry._cache == {} - with pytest.raises(Exception, match="closed|reused"): - with state.db.connect(): - pass + with pytest.raises(Exception, match="closed|reused"), state.db.connect(): + pass diff --git a/tests/test_member_driver.py b/tests/test_member_driver.py index 4e99218..be2f1cd 100644 --- a/tests/test_member_driver.py +++ b/tests/test_member_driver.py @@ -18,12 +18,12 @@ from backend.blackboard.db import Database from backend.core.config import MemberConfig from backend.core.logging_util import IPCLogger +from backend.mcp.mcp_client import MCPRegistry +from backend.mcp.shared import build_browser_mcp from backend.members import base_member from backend.members.adapters import MemberAction from backend.members.base_member import MemberDeps from backend.members.factory import create_member -from backend.mcp.mcp_client import MCPRegistry -from backend.mcp.shared import build_browser_mcp from backend.memory.memory_mcp import build_memory_mcp from backend.memory.memory_store import MemoryStore from backend.sandbox.sandbox import LocalSandbox diff --git a/tests/test_member_edges.py b/tests/test_member_edges.py new file mode 100644 index 0000000..20b6122 --- /dev/null +++ b/tests/test_member_edges.py @@ -0,0 +1,160 @@ +from __future__ import annotations + +from types import SimpleNamespace + +import pytest + +from backend.members.adapters import MemberAction +from backend.members.base_member import BaseMember, MemberDeps + + +class Logger: + def __init__(self): + self.events = [] + + def project(self, event, *args, **kwargs): + self.events.append((event, args, kwargs)) + + def tool(self, *args, **kwargs): + self.events.append((args[0] if args else "tool", args, kwargs)) + + +class Adapter: + config = SimpleNamespace(api_format="mock") + + def turn(self, *args): + return None + + +def member(**changes): + logger = changes.pop("logger", Logger()) + values = { + "db": None, + "logger": logger, + "sandbox": SimpleNamespace(), + "mcps": SimpleNamespace(names=list), + "registry": SimpleNamespace(search=lambda *_args, **_kwargs: []), + "memory": None, + "competition_store": None, + "competition_assignment": None, + "container_mcps": {}, + } + values.update(changes) + return BaseMember("amber", Adapter(), MemberDeps(**values)), logger + + +def test_member_session_job_and_recovery_seams(monkeypatch): + solver, logger = member() + assert solver._jobs() is None + assert solver._competition_session() is None + assert solver._renew_session_writer() is False + assert solver._record_competition_event(lambda _runner: None) is True + + class JobSandbox: + def exec_detached(self, command): + return command + + solver.deps.job_store = object() + solver.deps.sandbox = JobSandbox() + solver.deps.competition_assignment = {"session_id": "session-1"} + assert solver._jobs() is not None + + class Writer: + def renew(self): + return True + + solver._session_runner = SimpleNamespace(writer=Writer()) + assert solver._renew_session_writer() is True + + class BrokenWriter: + def renew(self): + raise RuntimeError("lost") + + solver._session_runner = SimpleNamespace(writer=BrokenWriter()) + assert solver._renew_session_writer() is False + solver._session_runner = SimpleNamespace(writer=Writer()) + assert solver._record_competition_event(lambda _runner: (_ for _ in ()).throw(RuntimeError("db"))) is False + assert solver._session_recording_failed is True + assert any(event[0] == "competition_session_persistence_failed" for event in logger.events) + + +def test_member_recon_drain_persists_before_ack(monkeypatch): + solver, _logger = member( + competition_assignment={"challenge_id": "ch", "session_id": "s"}, + competition_recon_replay=lambda *_args, **_kwargs: [], + competition_recon_advance=lambda _session, sequence: sequence, + ) + + class Subscriber: + def __init__(self): + self.acked = [] + self.records = [ + {"sequence": 3, "envelope": {"payload": {"hint": "use /admin"}}}, + None, + ] + + def receive(self, timeout_ms=0): + return self.records.pop(0) + + def ack(self, sequence): + self.acked.append(sequence) + + def close(self): + return None + + subscriber = Subscriber() + monkeypatch.setattr("backend.members.base_member.ReconSubscriber", lambda *args, **kwargs: subscriber) + runner = SimpleNamespace(record_provider_message=lambda message, event_key: setattr(runner, "message", (message, event_key))) + messages = solver._drain_competition_recon(runner) + assert messages[0]["role"] == "user" + assert subscriber.acked == [3] + assert runner.message[1] == "recon:3" + + +def test_member_driver_selection_and_argument_helpers(): + solver, _logger = member() + assert solver._streaming_enabled() == (True, "mock_stream") + solver.adapter = SimpleNamespace(config=SimpleNamespace(api_format="openai"), turn=lambda *args: None) + assert solver._streaming_enabled() == (True, "provider_native") + solver.adapter = SimpleNamespace(config=SimpleNamespace(api_format="mock"), decide=lambda *_args: None) + assert solver._streaming_enabled() == (False, "adapter_without_turn_surface") + assert solver._missing_command_from_result("python3 solve.py", "bash: nope: command not found") == "nope" + assert solver._missing_command_from_result("python3", "'tool.exe' is not recognized") == "tool.exe" + assert solver._missing_command_from_result("python3", "") is None + solver.bump("new evidence") + solver.bump(" ") + assert solver._consume_bumps() == ["new evidence"] + assert solver._consume_bumps() == [] + assert solver._native_action_tool()["name"] == "member_action" + + +@pytest.mark.parametrize("kind,args", [ + ("job_status", {}), + ("job_status", {"job_id": "j1"}), + ("job_logs", {"job_id": "j1", "offset": "2", "limit": 3}), + ("job_cancel", {"job_id": "j1"}), + ("job_start", {"command": "echo hi"}), +]) +def test_member_detached_job_dispatch_contract(kind, args): + class Jobs: + def jobs(self): return {"ok": True, "state": "listed"} + def status(self, job_id): return {"ok": True, "job_id": job_id, "state": "running"} + def logs(self, job_id, **kwargs): return {"ok": True, "job_id": job_id, **kwargs} + def cancel(self, job_id): return {"ok": True, "job_id": job_id, "state": "cancelled"} + def start(self, command): return {"ok": True, "job_id": "new", "command": command} + + solver, _logger = member() + solver._job_service = Jobs() + result = solver._dispatch_job("project", "intent", MemberAction(kind=kind, args=args)) + assert result.invalid_action is False + if kind == "job_logs": + assert "offset" in (result.observation or "") + + +def test_member_invalid_detached_job_arguments_are_rejected(): + solver, _logger = member() + result = solver._dispatch_job("project", "intent", MemberAction(kind="job_status", args={})) + assert result.invalid_action is True + solver._job_service = None + result = solver._dispatch_job("project", "intent", MemberAction(kind="job_start", args={"command": ""})) + assert result.invalid_action is True diff --git a/tests/test_member_tools.py b/tests/test_member_tools.py index 32b8151..6465479 100644 --- a/tests/test_member_tools.py +++ b/tests/test_member_tools.py @@ -18,6 +18,7 @@ from backend.agent.runtime import AgentRuntime from backend.competition.conversation import ToolCall, Turn +from backend.members.adapters import ACTION_KINDS, MemberAction from backend.members.member_tools import ( MEMBER_TOOL_NAMES, MEMBER_TOOLS, @@ -26,7 +27,6 @@ is_parallel_safe, is_terminal, ) -from backend.members.adapters import ACTION_KINDS, MemberAction class Writer: diff --git a/tests/test_members.py b/tests/test_members.py index b21e633..1a50c9b 100644 --- a/tests/test_members.py +++ b/tests/test_members.py @@ -8,15 +8,14 @@ from backend.blackboard.db import Database from backend.core.config import LLMConfig, MemberConfig from backend.core.logging_util import IPCLogger +from backend.mcp.mcp_client import MCPClient, MCPRegistry, MCPRegistrySession +from backend.mcp.shared import build_browser_mcp from backend.members.adapters import MemberAction, _extract_json, make_adapter from backend.members.base_member import MemberDeps from backend.members.factory import create_member -from backend.mcp.mcp_client import MCPClient, MCPRegistry, MCPRegistrySession -from backend.mcp.shared import build_browser_mcp from backend.memory.memory_mcp import build_memory_mcp from backend.memory.memory_store import MemoryStore -from backend.sandbox.sandbox import ExecResult -from backend.sandbox.sandbox import LocalSandbox +from backend.sandbox.sandbox import ExecResult, LocalSandbox from backend.tools.tool_registry import ToolRegistry @@ -51,8 +50,11 @@ async def run(): assert unused.exited == 0 -@pytest.fixture -def deps(tmp_path): +@pytest.fixture(params=[False, True], ids=["streaming", "legacy"]) +def deps(tmp_path, request, monkeypatch): + # Both supported drivers must preserve the same flag, graph, validation, + # interruption, and observation contracts. + monkeypatch.setattr("backend.members.base_member.MEMBER_LEGACY_DRIVER", request.param) db = Database().configure() mem = MemoryStore(db).configure() reg = ToolRegistry().load() @@ -70,7 +72,11 @@ def deps(tmp_path): on_flag=lambda pid: flags.append(pid), expected_flag="flag{test}", ) - return db, d, reports, flags + try: + yield db, d, reports, flags + finally: + sb.stop() + db.close() def _project(db): @@ -118,7 +124,7 @@ def test_adapter_extracts_common_non_strict_json_shapes(raw, kind): def test_initial_member_solves_to_flag(deps): - db, d, reports, flags = deps + db, d, _reports, flags = deps pid, iid = _project(db) cfg = MemberConfig(name="aventurine", api_format="mock") script = [ @@ -144,7 +150,7 @@ def test_initial_member_solves_to_flag(deps): def test_member_interrupt_after_model_call_prevents_returned_action(deps): - db, d, reports, flags = deps + db, d, _reports, _flags = deps pid, iid = _project(db) member = create_member(MemberConfig(name="aventurine", api_format="mock"), d) @@ -163,7 +169,7 @@ def decide(self, context): def test_continuous_member_is_not_stopped_by_legacy_action_budget(deps): - db, d, reports, flags = deps + db, d, _reports, _flags = deps pid, iid = _project(db) d.max_actions_per_task = 1 d.continuous = True @@ -187,7 +193,7 @@ def decide(self, context): def test_member_restores_observations_after_failed_model_call(deps): - db, d, reports, flags = deps + db, d, _reports, _flags = deps pid, iid = _project(db) d.max_actions_per_task = 3 first = create_member(MemberConfig(name="aventurine", api_format="mock"), d) @@ -222,7 +228,7 @@ def decide(self, context): def test_followup_member_concludes(deps): - db, d, reports, flags = deps + db, d, _reports, _flags = deps pid, iid = _project(db) cfg = MemberConfig(name="pearl", api_format="mock") script = [ @@ -350,7 +356,7 @@ async def invalid_dispatch(*_args, **_kwargs): def test_member_reports_difficulty_on_eval_step(deps): - db, d, reports, flags = deps + db, d, reports, _flags = deps pid, iid = _project(db) cfg = MemberConfig(name="aventurine", api_format="mock") script = [ @@ -370,7 +376,7 @@ def test_member_reports_difficulty_on_eval_step(deps): def test_scripted_member_tool_and_done(deps): - db, d, reports, flags = deps + db, d, _reports, _flags = deps pid, iid = _project(db) script = [ {"action": "tool", "server": "browser", "tool": "navigate", "args": {"url": "http://t"}}, @@ -425,7 +431,7 @@ def expose_webui(self, project_id: str, member: str, port: int) -> str: def test_member_stalls_after_repeated_invalid_bash(deps): - db, d, reports, flags = deps + db, d, reports, _flags = deps pid, iid = _project(db) d.max_actions_per_task = 5 script = [ @@ -448,7 +454,7 @@ def exec(self, command: str, timeout: int = 60) -> ExecResult: return ExecResult(127, "", "bash: line 1: rg: command not found") return super().exec(command, timeout=timeout) - db, d, reports, flags = deps + db, d, reports, _flags = deps sandbox = MissingRgSandbox("missing-rg", tmp_path / "missing-rg") sandbox.start() d.sandbox = sandbox @@ -487,7 +493,7 @@ def exec(self, command: str, timeout: int = 60) -> ExecResult: self.commands.append(command) return super().exec(command, timeout=timeout) - db, d, reports, flags = deps + db, d, reports, _flags = deps sandbox = RecordingSandbox("host-escape", tmp_path / "host-escape") sandbox.start() d.sandbox = sandbox @@ -530,7 +536,7 @@ def exec(self, command: str, timeout: int = 60) -> ExecResult: return ExecResult(0, "Successfully installed pymupdf-1.24.0", "") return super().exec(command, timeout=timeout) - db, d, reports, flags = deps + db, d, _reports, _flags = deps sandbox = InstallSandbox("installer", tmp_path / "installer") sandbox.start() d.sandbox = sandbox @@ -556,7 +562,7 @@ def exec(self, command: str, timeout: int = 60) -> ExecResult: def test_member_install_rejects_an_unsupported_manager(deps): - db, d, reports, flags = deps + db, d, reports, _flags = deps d.max_actions_per_task = 5 pid, iid = _project(db) script = [ @@ -574,7 +580,7 @@ def test_member_install_rejects_an_unsupported_manager(deps): def test_scripted_member_category_tools_mcp(deps): - db, d, reports, flags = deps + db, d, _reports, _flags = deps pid, iid = _project(db) script = [ {"action": "tool", "server": "tools", "tool": "get_tool", "args": {"name": "sqlmap"}}, @@ -612,7 +618,7 @@ def test_scripted_member_category_tools_mcp(deps): def test_member_context_uses_sandbox_visible_attachment_paths(deps): - db, d, reports, flags = deps + db, d, _reports, _flags = deps pid, iid = _project(db) with db.connect() as conn: graph_store.create_attachment( @@ -640,7 +646,7 @@ def test_member_context_uses_sandbox_visible_attachment_paths(deps): def test_member_context_includes_challenge_description_and_external_id(deps): - db, d, reports, flags = deps + db, d, _reports, _flags = deps origin = "https://ctf.example/challenges\n\nConnect: nc 10.0.0.1 9999\nFlag format: flag{...}" with db.connect() as conn: pid = graph_store.create_project( @@ -659,7 +665,7 @@ def test_member_context_includes_challenge_description_and_external_id(deps): def test_member_context_defaults_without_external_id(deps): - db, d, reports, flags = deps + db, d, _reports, _flags = deps pid, iid = _project(db) member = create_member(MemberConfig(name="jade", api_format="mock"), d) @@ -670,7 +676,7 @@ def test_member_context_defaults_without_external_id(deps): def test_member_report_defaults_to_low_when_unspecified(deps): - db, d, reports, flags = deps + db, d, reports, _flags = deps pid, iid = _project(db) d.max_actions_per_task = 2 script = [ @@ -686,7 +692,7 @@ def test_member_report_defaults_to_low_when_unspecified(deps): def test_member_suppresses_same_difficulty_without_new_evidence(deps): - db, d, reports, flags = deps + db, d, reports, _flags = deps pid, iid = _project(db) d.max_actions_per_task = 3 script = [ @@ -704,7 +710,7 @@ def test_member_suppresses_same_difficulty_without_new_evidence(deps): def test_member_reports_same_difficulty_when_evidence_accumulates(deps): - db, d, reports, flags = deps + db, d, reports, _flags = deps pid, iid = _project(db) d.max_actions_per_task = 3 script = [ @@ -723,7 +729,7 @@ def test_member_reports_same_difficulty_when_evidence_accumulates(deps): def test_no_new_fact_accumulates_for_same_intent_across_members(deps): - db, d, reports, flags = deps + db, d, reports, _flags = deps pid, iid = _project(db) intent_tag = f"intent:{iid}" with db.connect() as conn: @@ -751,7 +757,7 @@ def test_no_new_fact_accumulates_for_same_intent_across_members(deps): def test_member_duplicate_intent_does_not_count_as_progress(deps): - db, d, reports, flags = deps + db, d, reports, _flags = deps pid, iid = _project(db) d.max_actions_per_task = 1 script = [ @@ -769,7 +775,7 @@ def test_member_duplicate_intent_does_not_count_as_progress(deps): def test_source_disclosure_does_not_escalate_from_speculative_open_intents(deps): - db, d, reports, flags = deps + db, d, reports, _flags = deps pid, iid = _project(db) with db.connect() as conn: node_store.create_fact( @@ -800,7 +806,7 @@ def test_source_disclosure_does_not_escalate_from_speculative_open_intents(deps) def test_member_creates_at_most_one_new_intent_per_task(deps): - db, d, reports, flags = deps + db, d, _reports, _flags = deps pid, iid = _project(db) d.max_actions_per_task = 3 script = [ @@ -818,7 +824,7 @@ def test_member_creates_at_most_one_new_intent_per_task(deps): def test_member_defaults_new_intent_to_latest_fact_and_draws_link(deps): - db, d, reports, flags = deps + db, d, _reports, _flags = deps pid, iid = _project(db) with db.connect() as conn: fact = node_store.create_fact(conn, pid, "found debug endpoint") diff --git a/tests/test_ops_agent.py b/tests/test_ops_agent.py index 9c56c9d..afe4298 100644 --- a/tests/test_ops_agent.py +++ b/tests/test_ops_agent.py @@ -2,9 +2,9 @@ import asyncio import json -from pathlib import Path import threading import time +from pathlib import Path import pytest import requests @@ -12,15 +12,15 @@ from backend.blackboard import graph_store from backend.core.config import LLMConfig +from backend.mcp.mcp_client import MCPClient from backend.members.adapters import ( ClaudeAdapter, DecisionOutputError, NonRetryableProviderError, OpenAICompatibleAdapter, ) -from backend.mcp.mcp_client import MCPClient -from backend.ops.network import NetworkPolicyError, WorkflowHttpClient from backend.ops.ipc_mcp import build_ipc_mcp +from backend.ops.network import NetworkPolicyError, WorkflowHttpClient from backend.ops.store import OpsStore from backend.ops.tools import OpsToolExecutor from backend.server.app import create_app @@ -214,7 +214,7 @@ def test_ops_workflow_proposal_is_an_explicit_tool_call(client, monkeypatch): service = _configure_openai(client) spec = { - "name": "Proposed", + "name": "Fixture CTF 2026", "challenges": { "list_url": "https://ctf.invalid/api/challenges", "list_path": "data", @@ -242,7 +242,7 @@ def test_ops_workflow_proposal_is_an_explicit_tool_call(client, monkeypatch): assert result["reply"] == "drafted a workflow" assert len(result["proposals"]) == 1 - assert result["proposals"][0]["name"] == "Proposed" + assert result["proposals"][0]["name"] == "Fixture CTF 2026" assert result["proposals"][0]["status"] == "draft" @@ -379,7 +379,7 @@ def test_ops_store_uses_shared_postgres_schema(client): for row in connection.execute( """ SELECT table_name FROM information_schema.tables - WHERE table_schema = 'public' + WHERE table_schema = current_schema() AND table_name IN ('sessions', 'events', 'runs', 'workflows') """ ) diff --git a/tests/test_ops_stream.py b/tests/test_ops_stream.py index c44c8df..2e7aca7 100644 --- a/tests/test_ops_stream.py +++ b/tests/test_ops_stream.py @@ -1,7 +1,6 @@ from __future__ import annotations import json -import threading import pytest from fastapi.testclient import TestClient diff --git a/tests/test_optional_startup.py b/tests/test_optional_startup.py index d251342..4a169a3 100644 --- a/tests/test_optional_startup.py +++ b/tests/test_optional_startup.py @@ -7,7 +7,7 @@ from backend import cli from backend.api.config import ConfigUpdate, LLMUpdate, update_config -from backend.core.config import AppConfig, MEMBER_NAMES, load_config +from backend.core.config import MEMBER_NAMES, AppConfig, load_config from backend.core.state import AppState diff --git a/tests/test_orchestration.py b/tests/test_orchestration.py index 8817893..5f2edf4 100644 --- a/tests/test_orchestration.py +++ b/tests/test_orchestration.py @@ -11,8 +11,8 @@ from backend.core.lifecycle import Lifecycle, LifecycleError from backend.core.postprocess_store import ( claim_next_job, - complete_job, complete_existing_job, + complete_job, enqueue_postprocess, fail_job, recover_expired_jobs, @@ -41,6 +41,154 @@ def _make_project(state, category="web"): return pid +def test_real_orchestrator_starts_local_and_remote_tasks_with_independent_capacity(state): + import hashlib + import json + + from psycopg.types.json import Jsonb + + from backend.competition.fixture import FixturePlatform + from backend.competition.service import CompetitionService + from backend.core.orchestrator import Orchestrator + from backend.platform.mapping import PlatformChallenge + from tests.test_competition_service_fixture import _FixtureOps, _spec + + state.config.limits.max_concurrent_tasks = 1 + state.limiter.update_limits(max_concurrent_tasks=1) + orch = Orchestrator(state, scripts={name: [ + {"action": "bash", "command": 'python -c "import time; time.sleep(2)"'}, + {"action": "done", "reason": "capacity fixture complete"}, + ] for name in (m.name for m in state.config.available_members())}) + state.orchestrator = orch + spec = _spec() + digest = hashlib.sha256(json.dumps(spec.model_dump(mode="json"), sort_keys=True).encode()).hexdigest() + with state.db.connect() as connection: + connection.execute( + """INSERT INTO workflows (id,source,name,spec_json,spec_digest,status,confirmed_digest,created_at,updated_at) + VALUES ('capacity-workflow','fixture',%s,%s,%s,'confirmed',%s,now(),now())""", + (spec.name, Jsonb(spec.model_dump(mode="json")), digest, digest), + ) + workflow = {"id": "capacity-workflow", "status": "confirmed", "spec_digest": digest, + "confirmed_digest": digest, "spec": spec} + platform = FixturePlatform([ + PlatformChallenge(external_id="local", title="Local", category="misc", description="capacity"), + PlatformChallenge(external_id="remote", title="Remote", category="web", description="capacity", remote=True), + ], remote_limit=1) + service = CompetitionService(state, platform_factory=lambda *_args: platform, + ops_service=_FixtureOps(state.db, workflow)) + state.competition = service + try: + run_id = service.start(workflow["id"], "capacity-start")["run"]["id"] + service.tick() + projects = {row["project_id"] for row in service.store.challenges(run_id)} + until = time.monotonic() + 10 + while time.monotonic() < until: + if projects.issubset(set(orch.active_member_owners().values())): + break + time.sleep(0.02) + assert projects.issubset(set(orch.active_member_owners().values())) + assert projects.issubset(set(state.limiter.active_tasks())) + until = time.monotonic() + 5 + remote = next(row for row in service.store.challenges(run_id) if row["external_id"] == "remote") + seat = next(row for row in service.store.assignments(run_id, active_only=True) if row["challenge_id"] == remote["id"]) + while time.monotonic() < until: + events = service.store.events(seat["session_id"], limit=500) + tools = [row for row in events if row["kind"] == "tool_call"] + if tools: + break + time.sleep(0.02) + target = next(row for row in events if row["event_key"].startswith("recon:") and "target_instance" in str(row["payload"])) + assert tools and target["sequence"] < tools[0]["sequence"] + run = service.store.get_run(run_id) + service.control(run_id, "stop", run["revision"]) + assert not projects.intersection(state.limiter.active_tasks()) + finally: + service.shutdown() + + +@pytest.mark.parametrize("mode", ["recovered", "capacity", "sandbox_failure"]) +def test_running_project_recovery_preserves_state_and_releases_failed_capacity(state, monkeypatch, mode): + from backend.core.orchestrator import Orchestrator + from backend.sandbox.errors import SandboxStartupError + + pid = _make_project(state) + with state.db.connect() as connection: + graph_store.set_status(connection, pid, "running") + orch = Orchestrator(state, max_workers=1) + state.orchestrator = orch + dispatched = [] + monkeypatch.setattr(orch, "_dispatch_project", dispatched.append) + if mode == "capacity": + monkeypatch.setattr(orch.resources, "acquire_task", lambda _pid: False) + elif mode == "sandbox_failure": + def fail_preflight(_pid): + raise SandboxStartupError("daemon unavailable", operation="recovery preflight") + monkeypatch.setattr(orch.resources, "preflight_project", fail_preflight) + + orch._startup_project_ids.add(pid) + orch._recover_running_project(pid) + + assert not orch.startup_in_progress(pid) + status = orch.runtime_status(pid) + if mode == "recovered": + assert dispatched == [pid] + assert status["status"] == "running" and status["phase"] == "ready" + elif mode == "capacity": + assert dispatched == [] + assert status["phase"] == "queued_capacity" + assert pid in orch._pending_project_ids + assert pid not in orch._project_leases + else: + assert dispatched == [] + assert status["status"] == "infra_error" + assert pid not in state.limiter.active_tasks() + assert pid not in orch._project_leases + + +@pytest.mark.parametrize("status", ["running", "flag_found", "solved"]) +def test_startup_failure_fences_workers_but_preserves_flag_state(state, status): + from backend.core.orchestrator import Orchestrator + from backend.sandbox.errors import SandboxStartupError + + pid = _make_project(state) + with state.db.connect() as connection: + graph_store.set_status(connection, pid, status) + orch = Orchestrator(state, max_workers=1) + state.orchestrator = orch + assert orch._ensure_project_lease(pid) + orch.resources.acquire_task(pid) + orch._mark_project_startup_failure( + pid, SandboxStartupError("cannot start", operation="preflight"), event="startup.failed", + ) + assert orch.runtime_status(pid)["status"] == ("infra_error" if status == "running" else status) + assert pid not in state.limiter.active_tasks() + assert pid not in orch._project_leases + + +@pytest.mark.parametrize("description,expected", [ + ("Found flag{followup} in the response", 1), + ("Found flag{first} and ctf{second}", 0), + ("No candidate in this observation", 0), +]) +def test_concluded_flag_evidence_requires_one_idempotent_submission_followup(state, description, expected): + from backend.core.orchestrator import Orchestrator + + pid = _make_project(state) + orch = Orchestrator(state, max_workers=1) + state.orchestrator = orch + with state.db.connect() as connection: + fact = node_store.reserve_fact(connection, pid, description) + node_store.insert_fact(connection, pid, fact.id, fact.description) + orch._flag_followup_from_fact(pid, fact.id) + orch._flag_followup_from_fact(pid, fact.id) + with state.db.connect() as connection: + intents = edge_store.list_intents(connection, pid) + submissions = connection.execute("SELECT 1 FROM flag_submissions WHERE project_id=%s", (pid,)).fetchall() + followups = [intent for intent in intents if "submit_flag tool" in intent.description] + assert len(followups) == expected + assert submissions == [] + + def test_app_state_clean_start_wipes_files_but_preserves_postgres(tmp_path, monkeypatch): cfgdir = write_mock_config(tmp_path / "config") diff --git a/tests/test_persistence_schema.py b/tests/test_persistence_schema.py index 6f95432..e7e613f 100644 --- a/tests/test_persistence_schema.py +++ b/tests/test_persistence_schema.py @@ -157,7 +157,6 @@ def test_alembic_env_prefers_explicit_config_url_when_environment_is_empty(monke def _load_migration_env_for_test(): import sys import types - from contextlib import nullcontext context = types.SimpleNamespace(config=types.SimpleNamespace(config_file_name=None)) diff --git a/tests/test_platform.py b/tests/test_platform.py index 5da83db..8e3231e 100644 --- a/tests/test_platform.py +++ b/tests/test_platform.py @@ -1,7 +1,7 @@ from __future__ import annotations -from fastapi.testclient import TestClient import pytest +from fastapi.testclient import TestClient from backend.blackboard import graph_store from backend.server.app import create_app diff --git a/tests/test_postgres_isolation.py b/tests/test_postgres_isolation.py new file mode 100644 index 0000000..dc855ed --- /dev/null +++ b/tests/test_postgres_isolation.py @@ -0,0 +1,85 @@ +"""Cleanup must hold when migration or the test body fails.""" +from __future__ import annotations + +from types import SimpleNamespace + +import psycopg +import pytest + +from tests import conftest as isolation + +pytestmark = pytest.mark.postgres + + +def nested_request(request): + return SimpleNamespace( + node=SimpleNamespace(get_closest_marker=lambda _name: True), + getfixturevalue=request.getfixturevalue, + ) + + +def capture_schemas(monkeypatch): + created = [] + original = isolation._create_schema + + def create(dsn, schema): + created.append(schema) + original(dsn, schema) + + monkeypatch.setattr(isolation, "_create_schema", create) + return created + + +def schema_exists(dsn, schema): + with psycopg.connect(dsn, autocommit=True) as connection: + return connection.execute("SELECT 1 FROM pg_namespace WHERE nspname=%s", (schema,)).fetchone() is not None + + +def test_migration_failure_removes_its_schema(request, monkeypatch): + dsn = request.getfixturevalue("postgres_test_dsn") + with monkeypatch.context() as nested: + schemas = capture_schemas(nested) + + def fail(*_args): + raise RuntimeError("migration failed") + + nested.setattr(isolation.command, "upgrade", fail) + fixture = isolation.isolated_postgres.__wrapped__(nested_request(request), nested) + with pytest.raises(RuntimeError, match="migration failed"): + next(fixture) + assert len(schemas) == 1 + assert not schema_exists(dsn, schemas[0]) + + +def test_test_failure_closes_unclosed_pools_and_removes_schema(request, monkeypatch): + from backend.persistence.database import Database + + dsn = request.getfixturevalue("postgres_test_dsn") + with monkeypatch.context() as nested: + schemas = capture_schemas(nested) + fixture = isolation.isolated_postgres.__wrapped__(nested_request(request), nested) + next(fixture) + database = Database().configure() + assert database._opened + with pytest.raises(RuntimeError, match="test failed"): + fixture.throw(RuntimeError("test failed")) + assert database._pool.closed + assert not database._opened + assert not schema_exists(dsn, schemas[0]) + + +def test_untracked_connection_is_reported_but_schema_is_still_removed(request, monkeypatch): + import os + + dsn = request.getfixturevalue("postgres_test_dsn") + with monkeypatch.context() as nested: + schemas = capture_schemas(nested) + fixture = isolation.isolated_postgres.__wrapped__(nested_request(request), nested) + next(fixture) + connection = psycopg.connect(os.environ["IPC_DATABASE_URL"], autocommit=True) + try: + with pytest.raises(AssertionError, match="retained connections"): + fixture.close() + assert not schema_exists(dsn, schemas[0]) + finally: + connection.close() diff --git a/tests/test_provider_adapters.py b/tests/test_provider_adapters.py index f2c8928..e783d5f 100644 --- a/tests/test_provider_adapters.py +++ b/tests/test_provider_adapters.py @@ -297,8 +297,8 @@ def request(url, **kwargs): return _StreamResponse([ '{"choices":[{"index":0,"delta":{"content":"hi"},"finish_reason":null}]}', '{"choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}', - '{"choices":[],"usage":{"prompt_tokens":1200,"completion_tokens":34,' - '"completion_tokens_details":{"reasoning_tokens":12}}}', + ('{"choices":[],"usage":{"prompt_tokens":1200,"completion_tokens":34,' + '"completion_tokens_details":{"reasoning_tokens":12}}}'), ]) turn = _run(_conversation(), request) @@ -359,14 +359,14 @@ def test_anthropic_usage_is_merged_across_start_and_delta_events(): def request(url, **kwargs): return _StreamResponse( [ - '{"type":"message_start","message":{"usage":{"input_tokens":900,' - '"cache_read_input_tokens":100}}}', - '{"type":"content_block_start","index":0,' - '"content_block":{"type":"text","text":""}}', - '{"type":"content_block_delta","index":0,' - '"delta":{"type":"text_delta","text":"hello"}}', - '{"type":"message_delta","delta":{"stop_reason":"end_turn"},' - '"usage":{"output_tokens":42}}', + ('{"type":"message_start","message":{"usage":{"input_tokens":900,' + '"cache_read_input_tokens":100}}}'), + ('{"type":"content_block_start","index":0,' + '"content_block":{"type":"text","text":""}}'), + ('{"type":"content_block_delta","index":0,' + '"delta":{"type":"text_delta","text":"hello"}}'), + ('{"type":"message_delta","delta":{"stop_reason":"end_turn"},' + '"usage":{"output_tokens":42}}'), '{"type":"message_stop"}', ], done=False, @@ -384,9 +384,9 @@ def request(url, **kwargs): return _StreamResponse( [ '{"type":"response.output_text.delta","delta":"done"}', - '{"type":"response.completed","response":{"output":[],' + ('{"type":"response.completed","response":{"output":[],' '"usage":{"input_tokens":777,"output_tokens":21,' - '"output_tokens_details":{"reasoning_tokens":9}}}}', + '"output_tokens_details":{"reasoning_tokens":9}}}}'), ], done=False, ) @@ -404,8 +404,8 @@ def test_a_truncated_turn_still_reports_its_usage(): def request(url, **kwargs): return _StreamResponse([ '{"choices":[{"index":0,"delta":{"content":"partial"},"finish_reason":null}]}', - '{"choices":[{"index":0,"delta":{},"finish_reason":"length"}],' - '"usage":{"prompt_tokens":50,"completion_tokens":4096}}', + ('{"choices":[{"index":0,"delta":{},"finish_reason":"length"}],' + '"usage":{"prompt_tokens":50,"completion_tokens":4096}}'), ]) with pytest.raises(TurnTruncated) as caught: @@ -423,6 +423,19 @@ def test_provider_session_id_is_stable_across_rebuilt_adapters(): assert _conversation().provider_session_id != _conversation().provider_session_id +def test_first_response_hook_runs_for_tool_only_stream(): + adapter = _conversation() + responses = [] + adapter.on_first_response = lambda: responses.append("first event") + turn = _run(adapter, lambda *args, **kwargs: _StreamResponse([ + '{"choices":[{"delta":{"role":"assistant"},"finish_reason":null}]}', + '{"choices":[{"delta":{"tool_calls":[{"index":0,"id":"call1","function":{"name":"bash","arguments":"{}"}}]},"finish_reason":"tool_calls"}]}', + ])) + assert responses == ["first event"] + assert turn.tools[0].id == "call1" + assert turn.text == "" + + def test_member_adapter_accepts_a_durable_provider_session_id(): durable = "ipc-agent-stable99" adapter = OpenAICompatibleAdapter( @@ -474,14 +487,14 @@ def test_anthropic_thinking_is_streamed_without_entering_the_answer(): def request(url, **kwargs): return _StreamResponse([ - '{"type":"content_block_start","index":0,' - '"content_block":{"type":"thinking"}}', - '{"type":"content_block_delta","index":0,' - '"delta":{"type":"thinking_delta","thinking":"let me check"}}', - '{"type":"content_block_start","index":1,' - '"content_block":{"type":"text","text":""}}', - '{"type":"content_block_delta","index":1,' - '"delta":{"type":"text_delta","text":"the answer"}}', + ('{"type":"content_block_start","index":0,' + '"content_block":{"type":"thinking"}}'), + ('{"type":"content_block_delta","index":0,' + '"delta":{"type":"thinking_delta","thinking":"let me check"}}'), + ('{"type":"content_block_start","index":1,' + '"content_block":{"type":"text","text":""}}'), + ('{"type":"content_block_delta","index":1,' + '"delta":{"type":"text_delta","text":"the answer"}}'), '{"type":"message_stop"}', ], done=False) @@ -499,12 +512,12 @@ def test_chat_completions_reasoning_content_is_streamed(): def request(url, **kwargs): return _StreamResponse([ - '{"choices":[{"index":0,"delta":{"reasoning_content":"step one"},' - '"finish_reason":null}]}', - '{"choices":[{"index":0,"delta":{"reasoning":" step two"},' - '"finish_reason":null}]}', - '{"choices":[{"index":0,"delta":{"content":"done"},' - '"finish_reason":null}]}', + ('{"choices":[{"index":0,"delta":{"reasoning_content":"step one"},' + '"finish_reason":null}]}'), + ('{"choices":[{"index":0,"delta":{"reasoning":" step two"},' + '"finish_reason":null}]}'), + ('{"choices":[{"index":0,"delta":{"content":"done"},' + '"finish_reason":null}]}'), '{"choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}', ]) @@ -520,8 +533,8 @@ def request(url, **kwargs): return _StreamResponse([ '{"type":"response.reasoning_summary_text.delta","delta":"planning"}', '{"type":"response.output_text.delta","delta":"result"}', - '{"type":"response.completed","response":{"output":[' - '{"type":"message","content":[{"type":"output_text","text":"result"}]}]}}', + ('{"type":"response.completed","response":{"output":[' + '{"type":"message","content":[{"type":"output_text","text":"result"}]}]}}'), ]) _, text, reasoning = _run_with_reasoning( @@ -537,10 +550,10 @@ def test_a_turn_without_a_reasoning_callback_still_streams_text(): def request(url, **kwargs): return _StreamResponse([ - '{"choices":[{"index":0,"delta":{"reasoning_content":"ignored"},' - '"finish_reason":null}]}', - '{"choices":[{"index":0,"delta":{"content":"plain"},' - '"finish_reason":null}]}', + ('{"choices":[{"index":0,"delta":{"reasoning_content":"ignored"},' + '"finish_reason":null}]}'), + ('{"choices":[{"index":0,"delta":{"content":"plain"},' + '"finish_reason":null}]}'), '{"choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}', ]) diff --git a/tests/test_ret2shell.py b/tests/test_ret2shell.py index a085af0..d3d5dd7 100644 --- a/tests/test_ret2shell.py +++ b/tests/test_ret2shell.py @@ -77,15 +77,15 @@ def close(self): def make_client(router, authed=True, **kwargs): - defaults = dict( - base_url=BASE, - game_id=37, - username="user", - password="pass", - poll_attempts=3, - poll_interval=0.0, - sleep=lambda seconds: None, - ) + defaults = { + "base_url": BASE, + "game_id": 37, + "username": "user", + "password": "pass", + "poll_attempts": 3, + "poll_interval": 0.0, + "sleep": lambda seconds: None, + } if authed: defaults["token"] = "seed-token" defaults.update(kwargs) @@ -433,7 +433,6 @@ def __init__(self): def find_instance(self, challenge_id, game_id=None): self.calls.append(("find", challenge_id)) - return None def start_instance(self, challenge_id, game_id=None): self.calls.append(("start", challenge_id)) diff --git a/tests/test_sandbox.py b/tests/test_sandbox.py index 7c4c1be..a216265 100644 --- a/tests/test_sandbox.py +++ b/tests/test_sandbox.py @@ -1,16 +1,17 @@ from __future__ import annotations import sys +import threading import time import types from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer -import threading +from typing import ClassVar import pytest import requests -from backend.sandbox import docker_manager, task_sandbox from backend.core.resource_manager import ResourceManager +from backend.sandbox import docker_manager, task_sandbox from backend.sandbox.container_pool import ContainerPool from backend.sandbox.network_manager import NetworkManager from backend.sandbox.resource_limiter import TaskSlotLimiter @@ -67,7 +68,7 @@ def test_local_sandbox_timeout_kills_grandchildren_holding_pipes(tmp_path): def test_local_sandbox_exposes_webui_via_proxy(tmp_path): class Handler(BaseHTTPRequestHandler): def do_GET(self): - body = f"origin {self.path}".encode("utf-8") + body = f"origin {self.path}".encode() self.send_response(200) self.send_header("Content-Type", "text/plain; charset=utf-8") self.send_header("Content-Length", str(len(body))) @@ -316,7 +317,7 @@ def test_task_sandbox_initializes_shared_workspace_and_copies_attachments(tmp_pa (attachments / "challenge.bin").write_bytes(b"binary") class FakeContainer: - attrs = {"NetworkSettings": {"Networks": {"bridge": {"IPAddress": "172.17.0.2"}}}} + attrs: ClassVar[dict] = {"NetworkSettings": {"Networks": {"bridge": {"IPAddress": "172.17.0.2"}}}} def __init__(self): self.commands = [] diff --git a/tests/test_sandbox_containment.py b/tests/test_sandbox_containment.py index e825b4e..4bfd99d 100644 --- a/tests/test_sandbox_containment.py +++ b/tests/test_sandbox_containment.py @@ -50,8 +50,8 @@ def test_container_commands_are_allowed(command): @pytest.mark.parametrize( "command", [ - "p='D:/Desktop/Codex/IPC_CTFAgent/.qa-artifacts/isctf-real-20260927-150115" - "/artifacts/projects/proj_104/sandbox/shared/work_i001/ISCTF2025-WriteUp.pdf'", + ("p='D:/Desktop/Codex/IPC_CTFAgent/.qa-artifacts/isctf-real-20260927-150115" + "/artifacts/projects/proj_104/sandbox/shared/work_i001/ISCTF2025-WriteUp.pdf'"), "cd /workspace/shared && /d/Language/Python314/python - << 'EOF'", r"cat C:\Users\Administrator\AppData\Local\Temp\amber\grid.py", "chroot /host /bin/bash -lc id", diff --git a/tests/test_sandbox_jobs.py b/tests/test_sandbox_jobs.py index 80fc2b7..b756f4b 100644 --- a/tests/test_sandbox_jobs.py +++ b/tests/test_sandbox_jobs.py @@ -9,6 +9,7 @@ """ from __future__ import annotations +import os import shutil import subprocess import time @@ -25,7 +26,23 @@ parse_job_probe, ) -BASH = shutil.which("bash") + +def find_bash() -> str | None: + if os.name == "nt": + # Windows' system bash.exe launches WSL; these tests share Windows + # temp paths and therefore need Git Bash's MSYS filesystem mapping. + git = shutil.which("git") + if git: + root = Path(git).resolve().parent.parent + for relative in ("bin/bash.exe", "usr/bin/bash.exe"): + candidate = root / relative + if candidate.is_file(): + return str(candidate) + return None + return shutil.which("bash") + + +BASH = find_bash() pytestmark = pytest.mark.skipif(BASH is None, reason="requires a POSIX bash") @@ -46,6 +63,7 @@ def posix(path: Path) -> str: def run(script: str, cwd: Path) -> subprocess.CompletedProcess: return subprocess.run( [BASH, "-lc", script], cwd=str(cwd), capture_output=True, text=True, + encoding="utf-8", errors="replace", timeout=60, check=False, ) @@ -85,11 +103,11 @@ def test_launch_records_pid_and_real_exit_status(tmp_path): early = probe(directory, tmp_path) assert early["state"] in {"running", "exited"} - final = wait_for( - lambda: (lambda v: v if v["state"] == "exited" else None)( - probe(directory, tmp_path) - ) - ) + def completed_job(): + view = probe(directory, tmp_path) + return view if view["state"] == "exited" else None + + final = wait_for(completed_job) assert final is not None, "job never recorded a status" assert final["exit_code"] == 5 assert (directory / "stdout").read_text().split() == ["one", "two"] diff --git a/tests/test_shared_member_config.py b/tests/test_shared_member_config.py index a00b817..c13a467 100644 --- a/tests/test_shared_member_config.py +++ b/tests/test_shared_member_config.py @@ -4,7 +4,14 @@ from fastapi import HTTPException from backend.api.config import ConfigUpdate, LLMUpdate, RuntimeUpdate, update_config -from backend.core.config import AppConfig, LLMConfig, MEMBER_NAMES, MemberConfig, load_config, save_config +from backend.core.config import ( + MEMBER_NAMES, + AppConfig, + LLMConfig, + MemberConfig, + load_config, + save_config, +) def test_conflicting_legacy_endpoints_require_explicit_selection(tmp_path): diff --git a/tests/test_streaming_mock.py b/tests/test_streaming_mock.py index 9a2e76c..0632f97 100644 --- a/tests/test_streaming_mock.py +++ b/tests/test_streaming_mock.py @@ -16,7 +16,6 @@ from backend.members.adapters import MemberAction from backend.members.member_tools import ( MEMBER_TOOLS, - TOOL_ACTIONS, action_payload, is_parallel_safe, is_terminal, diff --git a/tests/test_tools_mcp.py b/tests/test_tools_mcp.py index 0b7a1d7..e37e7d2 100644 --- a/tests/test_tools_mcp.py +++ b/tests/test_tools_mcp.py @@ -117,7 +117,7 @@ def test_category_tools_mcp_returns_tool_contract(registry): def test_removed_webshell_mcp_is_not_exposed(): - removed_name = "".join(("ant", "sword")) + removed_name = "antsword" assert removed_name not in SERVER_NAMES with pytest.raises(ValueError, match="unknown MCP server"): build_mcp_server(removed_name) From 480df326cc0b26172f8ed498afe7223f59ac335e Mon Sep 17 00:00:00 2001 From: PureStream108 <1262364207@qq.com> Date: Wed, 14 Oct 2026 10:25:45 +0000 Subject: [PATCH 02/21] Prevent completion and postprocess lock-order deadlocks --- backend/core/postprocess_store.py | 50 ++++++++++++++++++++++------- plan.md | 2 ++ tests/test_orchestration.py | 52 ++++++++++++++++++++++++++++++- 3 files changed, 91 insertions(+), 13 deletions(-) diff --git a/backend/core/postprocess_store.py b/backend/core/postprocess_store.py index ac01022..5d965be 100644 --- a/backend/core/postprocess_store.py +++ b/backend/core/postprocess_store.py @@ -16,7 +16,16 @@ class PostprocessJob: lease_token: str +def _lock_project(connection: Any, project_id: str) -> None: + # API completion already owns this row. Every job writer must take it + # before job rows, otherwise enqueue and worker status refresh can deadlock. + connection.execute( + "SELECT id FROM projects WHERE id=%s FOR NO KEY UPDATE", (project_id,), + ).fetchone() + + def enqueue_postprocess(connection: Any, project_id: str) -> None: + _lock_project(connection, project_id) for kind in POSTPROCESS_KINDS: connection.execute( """ @@ -38,21 +47,22 @@ def claim_next_job( ) -> PostprocessJob | None: row = connection.execute( """ - SELECT id - FROM postprocess_jobs - WHERE status IN ('pending', 'retry') - AND next_attempt_at <= now() - AND (lease_expires_at IS NULL OR lease_expires_at < now()) + SELECT job.id, job.project_id + FROM postprocess_jobs job + JOIN projects project ON project.id = job.project_id + WHERE job.status IN ('pending', 'retry') + AND job.next_attempt_at <= now() + AND (job.lease_expires_at IS NULL OR job.lease_expires_at < now()) AND ( - kind <> 'archive' + job.kind <> 'archive' OR EXISTS ( SELECT 1 FROM postprocess_jobs writeup - WHERE writeup.project_id = postprocess_jobs.project_id + WHERE writeup.project_id = job.project_id AND writeup.kind = 'writeup' AND writeup.status = 'completed' ) ) - ORDER BY created_at, id - FOR UPDATE SKIP LOCKED + ORDER BY job.created_at, job.id + FOR NO KEY UPDATE OF project SKIP LOCKED LIMIT 1 """ ).fetchone() @@ -66,11 +76,13 @@ def claim_next_job( lease_token = %s, lease_expires_at = now() + make_interval(secs => %s), updated_at = now() - WHERE id = %s + WHERE id = %s AND status IN ('pending', 'retry') RETURNING id, project_id, kind, attempts, lease_token """, (worker_id, token, lease_seconds, row["id"]), ).fetchone() + if claimed is None: + return None refresh_project_status(connection, claimed["project_id"]) return PostprocessJob(**claimed) @@ -108,6 +120,7 @@ def lock_job( database commit phase concurrently. """ + _lock_project(connection, job.project_id) row = connection.execute( """ SELECT id @@ -138,6 +151,7 @@ def complete_job( *, lease_locked: bool = False, ) -> bool: + _lock_project(connection, job.project_id) live_clause = "" if lease_locked else ( " AND lease_expires_at IS NOT NULL AND lease_expires_at > now()" ) @@ -171,6 +185,7 @@ def complete_existing_job( overwrite another worker's result. """ + _lock_project(connection, project_id) if lease_token is None: changed = connection.execute( """ @@ -214,6 +229,7 @@ def fail_job( *, max_attempts: int = 4, ) -> bool: + _lock_project(connection, job.project_id) delay = min(900, 15 * (2 ** max(0, job.attempts - 1))) changed = connection.execute( """ @@ -235,11 +251,21 @@ def fail_job( def recover_expired_jobs(connection: Any) -> int: cursor = connection.execute( """ - UPDATE postprocess_jobs + WITH expired_projects AS MATERIALIZED ( + SELECT project.id FROM projects project + WHERE EXISTS ( + SELECT 1 FROM postprocess_jobs job WHERE job.project_id=project.id + AND job.status='running' AND job.lease_expires_at Date: Wed, 14 Oct 2026 18:50:11 +0800 Subject: [PATCH 03/21] Cover asynchronous transcript repair and safe tool continuation --- plan.md | 4 ++++ tests/test_agent_runtime.py | 40 +++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/plan.md b/plan.md index b244562..1729a68 100644 --- a/plan.md +++ b/plan.md @@ -122,6 +122,10 @@ python scripts/monitor_real_competition.py \ 实现已提交到独立分支 `codex/competition-reliability-20261014`,首个 commit `05893ab23421beac43e37727de7b3c1f01276472`。草稿 [PR #4](https://github.com/PureStream108/IPC_CTFAgent/pull/4) 已触发 [CI run 38545171757](https://github.com/PureStream108/IPC_CTFAgent/actions/runs/38545171757):hosted 浏览器 E2E 通过,但 pytest 捕获同一 flag 重复 complete 与后台 postprocess 的 PostgreSQL 死锁,整体 CI 尚未通过。已统一项目/任务的加锁顺序,并为领取与过期恢复增加跳过已锁项目的并发回归;本机相关 128 项测试通过。修复将更新到同一草稿 PR,要求新 revision 的三个 check 全部通过。状态快照保存于 `data/exports/github-plan-ci-verification.json`,锁回归证据为 `pytest-postprocess-lock-verification.log/.xml`。 +死锁修复已发布为 `480df326cc0b26172f8ed498afe7223f59ac335e`,对应 [CI run 38549517281](https://github.com/PureStream108/IPC_CTFAgent/actions/runs/38549517281)。该 revision 的 hosted E2E 已通过;test 和 task-image 尚在运行。Linux 临时 PostgreSQL 另外实际执行同 flag 完成和并发锁回归,4 项通过,见 `data/exports/native-postprocess-lock-verification.log/.xml`。 + +该次 hosted pytest 随后完成:`774 passed, 2 skipped`,但 Agent 覆盖率为 81.25%,低于保存的 81.33% 基线;Competition 为 82.73%。门禁正确阻止了通过。已补充异步 tool-order 故障恢复回归:修复输入历史后执行一个新的工具调用,确认旧的中断副作用不重放,且不消耗额外成功 turn 配额。Agent runtime 38 项测试通过,基线保持 81.33%/80.93%,等待新 revision 的 hosted 验证。 + - [x] 最新全量 pytest 与覆盖率门禁通过,并保存 81.33%/80.93% 新基线。 - [x] 最终回归后刷新正常栈应用镜像并重验健康状态。 - [x] 完整 `python -m ruff check backend scripts tests` 通过,Windows/Linux 实跑均为零诊断;新增故障回归和完整 pytest 通过,覆盖率未下降。 diff --git a/tests/test_agent_runtime.py b/tests/test_agent_runtime.py index 254846a..82d80a7 100644 --- a/tests/test_agent_runtime.py +++ b/tests/test_agent_runtime.py @@ -534,6 +534,46 @@ def test_watchdog_resume_without_new_input_never_triggers_a_rebuild(): assert not [i for i in writer.items if i["kind"] == "user_message"] +def test_async_tool_order_repair_continues_without_replaying_an_interrupted_call(): + writer = MemoryWriter() + executor = AsyncExecutor() + queued = [[{"role": "assistant", "tool_calls": [{ + "id": "interrupted-call", "function": {"name": "shell", "arguments": "{}"}, + }]}]] + + def deliver_after_bootstrap(_runtime): + return queued.pop(0) if queued else [] + + class RecoveringAdapter(Adapter): + emits_reasoning = True + + def turn(self, messages, system, tools, emit, cancel, emit_reasoning): + self.seen.append(list(messages)) + emit_reasoning("checking recovered history") + if len(self.seen) == 1: + raise _Status400Error() + if len(self.seen) == 3: + return Turn([{"role": "assistant", "content": "complete"}], [], "complete") + return Turn( + [{"role": "assistant", "tool_calls": [{"id": "recovery-check"}]}], + [ToolCall("recovery-check", "shell", {"command": "pwd"})], + "recovered", + ) + + adapter = RecoveringAdapter([]) + result = asyncio.run(runtime( + writer, adapter, executor, before_turn=deliver_after_bootstrap, + max_turns=2, + ).run_async("continue")) + + assert result.status == "idle" and result.turns == 2 + assert len(adapter.seen) == 3 + assert any(message.get("tool_call_id") == "interrupted-call" for message in adapter.seen[1]) + assert executor.calls == [("shell", {"command": "pwd"}, "s1:recovery-check")] + assert any(item["kind"] == "status" and item["payload"].get("status") == "tool_order_repaired" for item in writer.items) + assert writer.epoch == 1 + + def test_an_invalid_tool_order_turn_is_repaired_in_place_before_a_retry(): """A 400 whose repair changes the projection retries over the fixed history. From dc5e9d05485ad6bda1f87e46b2e284cbaafffc86 Mon Sep 17 00:00:00 2001 From: PureStream108 <1262364207@qq.com> Date: Sat, 17 Oct 2026 18:49:33 +0800 Subject: [PATCH 04/21] feat(agent): bounded tool output pipeline and teammate messaging --- backend/agent/compaction.py | 79 ++++++++++++++++---- backend/agent/context.py | 17 +---- backend/agent/job_service.py | 31 ++++---- backend/agent/runtime.py | 66 ++++++++++------ backend/agent/schema.py | 24 ++---- backend/core/config.py | 6 ++ backend/core/orchestrator.py | 37 ++++++--- backend/members/adapters.py | 5 +- backend/members/base_member.py | 128 +++++++++++++++++++++++++++++--- backend/members/member_tools.py | 19 ++++- backend/sandbox/output.py | 98 ++++++++++++++++++++++++ backend/sandbox/sandbox.py | 66 ++++++++++------ backend/sandbox/task_sandbox.py | 51 ++++++++++++- tests/test_member_tools.py | 16 +--- tests/test_output_budgets.py | 56 ++++++++++++++ 15 files changed, 560 insertions(+), 139 deletions(-) create mode 100644 backend/sandbox/output.py create mode 100644 tests/test_output_budgets.py diff --git a/backend/agent/compaction.py b/backend/agent/compaction.py index 29ab4f6..2a35ded 100644 --- a/backend/agent/compaction.py +++ b/backend/agent/compaction.py @@ -1,22 +1,9 @@ -"""Semantic compaction: a structured summary, not a truncated transcript. - -Dropping the oldest messages loses exactly what a long investigation needs to -keep: which facts were verified, which approaches already failed, and where the -interesting bytes live. That is why the summary has an explicit schema with a -``do_not_retry`` marker on failed paths - the point is to stop the model from -re-running work it has already ruled out. - -Compaction is an optimisation, never a precondition for running. If the -summarizer fails, the caller falls back to :func:`deterministic_summary`, which -needs no model at all. -""" from __future__ import annotations import json import logging from typing import Any -# Error boundaries keep their recovery behavior and retain debug diagnostics. _recovery_logger = logging.getLogger(__name__) SUMMARY_SCHEMA_HINT = { @@ -114,9 +101,68 @@ def deterministic_summary( "evidence": "compacted transcript", } ] + for message in dropped: + if not isinstance(message, dict): + continue + content = message.get("content") + if not isinstance(content, str): + continue + try: + value = json.loads(content.split("\n", 1)[1]) if content.startswith("[compacted context summary]") else json.loads(content) + except (ValueError, IndexError): + continue + if isinstance(value, dict): + for key in _SUMMARY_KEYS: + if isinstance(value.get(key), list): + summary[key].extend(value[key]) + artifacts = (value.get("process") or {}).get("artifacts", {}) + if isinstance(artifacts, dict): + summary["artifacts"].extend(item for item in artifacts.values() if isinstance(item, dict)) return summary, [*head, *tail] +def fit_history(messages: list[dict[str, Any]], *, max_bytes: int, max_tokens: int = 0, + calibration: float = 1.0) -> list[dict[str, Any]]: + """Bound a projection while removing orphaned results with their old batch.""" + from backend.agent.context import estimate_tokens + from backend.sandbox.output import preview_text + + limit = max(1024, min(16384, max_bytes // 4)) + bounded = [] + for original in messages: + message = dict(original) + for key in ("content", "output"): + content = message.get(key) + if isinstance(content, str): + message[key] = preview_text(content, limit) + elif isinstance(content, list): + blocks = [] + for original_block in content: + if not isinstance(original_block, dict): + blocks.append(original_block) + continue + block = dict(original_block) + for field in ("text", "content"): + if isinstance(block.get(field), str): + block[field] = preview_text(block[field], limit) + blocks.append(block) + message[key] = blocks + bounded.append(message) + while bounded: + size = len(json.dumps(bounded, ensure_ascii=False).encode("utf-8")) + if size <= max_bytes and (not max_tokens or estimate_tokens(bounded, calibration=calibration) <= max_tokens): + return bounded + if len(bounded) > 1: + bounded = bounded[:1] + _balanced_tail(bounded[2:], len(bounded)) + continue + content = bounded[0].get("content") + if isinstance(content, str) and len(content.encode("utf-8")) > 512: + bounded[0]["content"] = preview_text(content, max(512, len(content.encode("utf-8")) // 2)) + continue + raise ValueError("opening context exceeds the configured projection budget") + return [] + + def _balanced_tail( messages: list[dict[str, Any]], keep_recent: int ) -> list[dict[str, Any]]: @@ -162,6 +208,7 @@ def summarize( *, request, keep_recent: int = 8, + on_degraded=None, ) -> tuple[dict[str, Any], list[dict[str, Any]]]: """Produce a structured summary plus the retained tail. @@ -179,10 +226,14 @@ def summarize( try: raw = request(_PROMPT, dropped) summary = normalize_summary(_parse_json(raw)) - except Exception: + except Exception as exc: _recovery_logger.debug('Error handled in summarize', exc_info=True) + if on_degraded is not None: + on_degraded(f"{type(exc).__name__}: {exc}"[:1000]) return fallback_summary, retained if is_empty(summary): + if on_degraded is not None: + on_degraded("semantic summarizer returned no usable structured facts") return fallback_summary, retained return summary, retained diff --git a/backend/agent/context.py b/backend/agent/context.py index f25b6fd..78d9160 100644 --- a/backend/agent/context.py +++ b/backend/agent/context.py @@ -1,18 +1,3 @@ -"""Context projection: rebuild what the provider sees from durable events. - -The reconstruction rule is deliberately simple and total: the newest -compaction's summary leads, followed by every message the compaction retained -and every event recorded after it. Because ``agent_events`` is append-only, a -projection decision is never destructive - a bad compaction costs one turn of -context quality, not the evidence chain. - -Budgeting works in tokens rather than bytes. A byte threshold is wrong by a -factor of roughly two between CJK and ASCII text, which in practice means -compacting far too late (context overflow) or far too early (throwing away -usable evidence). The estimate is calibrated against the real -``usage.prompt_tokens`` the provider reports, so it converges on the tokenizer -actually in use instead of assuming one. -""" from __future__ import annotations import json @@ -45,7 +30,7 @@ ("gpt-4o", 128_000), ("o4", 200_000), ("o3", 200_000), - ("deepseek", 128_000), + ("deepseek", 1_000_000), ("kimi-k2", 256_000), ("kimi-for-coding", 256_000), ("qwen3", 128_000), diff --git a/backend/agent/job_service.py b/backend/agent/job_service.py index 53c575a..5f5ae3a 100644 --- a/backend/agent/job_service.py +++ b/backend/agent/job_service.py @@ -1,15 +1,3 @@ -"""Run a sandbox command that outlives the turn which started it. - -This is the orchestration half of P4a: :mod:`backend.agent.jobs` owns the -durable rows, the sandbox owns the process, and this module is what keeps the -two honest about each other. - -The distinction it exists to protect: a job whose process has vanished without -a recorded exit status is ``lost``, not ``exited 0``. Telling a model that a -brute force "finished successfully" when the container was actually restarted -underneath it produces confident, wrong conclusions, so the uncertainty is -reported instead of smoothed over. -""" from __future__ import annotations import logging @@ -18,7 +6,6 @@ from backend.agent.jobs import INLINE_LIMIT, AgentJobStore, JobConflict, new_job_id from backend.sandbox.command_policy import host_path_violation -# Error boundaries keep their recovery behavior and retain debug diagnostics. _recovery_logger = logging.getLogger(__name__) class JobService: @@ -84,6 +71,24 @@ def status(self, job_id: str) -> dict[str, Any]: return self._view(row) return self._view(self._reconcile(row)) + def wait(self, job_id: str, *, timeout: int = 5, cancel=None) -> dict[str, Any]: + import time + + deadline = time.monotonic() + max(1, min(15, timeout)) + while True: + result = self.status(job_id) + if result.get("state") != "running" or not result.get("ok", True): + return result + if cancel is not None and cancel.is_set(): + return {**result, "wait_cancelled": True} + remaining = deadline - time.monotonic() + if remaining <= 0: + return {**result, "wait_timed_out": True} + if cancel is not None: + cancel.wait(min(.5, remaining)) + else: + time.sleep(min(.5, remaining)) + def _reconcile(self, row: dict) -> dict: """Fold the sandbox's observation of a running job into its row.""" try: diff --git a/backend/agent/runtime.py b/backend/agent/runtime.py index 25719b6..4f200c9 100644 --- a/backend/agent/runtime.py +++ b/backend/agent/runtime.py @@ -1,22 +1,3 @@ -"""The single durable action loop shared by Ops, competition and projects. - -The loop has no step budget: it ends when the provider stops asking for tools, -when cancellation is requested, when the writer loses its fence, or when the -provider repeats an identical tool batch (a real loop, as opposed to slow -progress). Everything it needs from storage arrives through a -:class:`SessionWriter`, which is what lets one implementation serve a -competition Member seat and an Ops chat turn without either knowing about the -other's lease model. - -Durability rules the loop depends on: - -* Every provider message, tool call and tool result is appended before the next - step, keyed so a replay after a restart is idempotent. -* A tool call whose result never landed is repaired as ``unknown`` rather than - silently retried, because the side effect may already have happened. -* Executors receive a stable idempotency key and are responsible for returning - a prior result instead of repeating a side effect. -""" from __future__ import annotations import asyncio @@ -29,7 +10,7 @@ from dataclasses import dataclass from typing import Any, Protocol -from backend.agent.compaction import deterministic_summary +from backend.agent.compaction import deterministic_summary, fit_history from backend.agent.context import ( calibrate, compacted_history, @@ -45,7 +26,6 @@ ) from backend.competition.store import CompetitionConflict -# Error boundaries keep their recovery behavior and retain debug diagnostics. _recovery_logger = logging.getLogger(__name__) _EVENT_KEY_REUSE_MESSAGE = "event key reused with different content" @@ -420,6 +400,10 @@ def _compact(self, messages: list[dict[str, Any]], turn: int) -> list[dict[str, if not needed: return messages + started = time.monotonic() + self._append(f"compact-start:{self._writer_epoch()}:{turn}", "status", + {"status": "compaction.started", "turn": turn, **detail}) + summary: Any compacted: list[dict[str, Any]] if self.compressor is None: @@ -446,8 +430,27 @@ def _compact(self, messages: list[dict[str, Any]], turn: int) -> list[dict[str, {**detail, "status": "compressor_failed", "error": f"{type(exc).__name__}: {exc}"[:2000]}, ) - payload = {"summary": summary, "messages": compacted} + from backend.sandbox.output import preview_text + + summary_budget = max(1024, min(8192, self.context_bytes // 8)) + if len(json.dumps(summary, ensure_ascii=False).encode("utf-8")) > summary_budget: + summary = {"text": preview_text(json.dumps(summary, ensure_ascii=False), summary_budget - 128)} + compacted = fit_history( + compacted, max_bytes=max(2048, int(self.context_bytes * .6) - summary_budget), + max_tokens=max(512, int(self.context_token_limit * .5)) if self.context_token_limit else 0, + calibration=self.calibration, + ) + metadata = dict(getattr(self.compressor, "last_metadata", {})) + fallback = "compacted without a semantic summary" in json.dumps(summary, ensure_ascii=False) + payload = {"summary": summary, "messages": compacted, "metrics": { + "duration_seconds": round(time.monotonic() - started, 6), + "input_tokens": detail.get("tokens"), "output_tokens": estimate_tokens(compacted), + "output_bytes": len(json.dumps(compacted, ensure_ascii=False).encode("utf-8")), + "degraded": fallback or bool(metadata.get("degraded_reason")), **metadata, + }} self._append(f"compact:{self._writer_epoch()}:{turn}", "context_compacted", payload) + self._append(f"compact-end:{self._writer_epoch()}:{turn}", "status", + {"status": "compaction.completed", "turn": turn, **payload["metrics"]}) record = getattr(self.writer, "record_compaction", None) if callable(record): record(summary, token_estimate=detail.get("tokens")) @@ -749,11 +752,17 @@ def _turn_args(self, messages: list[dict[str, Any]], on_delta, on_reasoning): return args def _provider_callbacks(self, turn: int): + sequences = getattr(self, "recon_sequences", []) + if sequences: + self._append(f"recon-context:{self._writer_epoch()}:{turn}", "status", + {"status": "recon.in_provider_context", "turn": turn, "sequences": sequences}) + self.recon_sequences = [] recorder = getattr(self.writer, "record_provider_progress", None) if callable(recorder): recorder(turn, "provider.started", 0.0) started = time.monotonic() responded = False + content_received = False def first_response(): nonlocal responded @@ -767,8 +776,19 @@ def completed(): if callable(recorder): recorder(turn, "provider.completed", time.monotonic() - started) + def first_content(): + nonlocal content_received + if not content_received: + content_received = True + if callable(recorder): + recorder(turn, "provider.first_content", time.monotonic() - started) + if hasattr(self.adapter, "on_first_response"): self.adapter.on_first_response = first_response + if hasattr(self.adapter, "on_first_content"): + self.adapter.on_first_content = first_content + if hasattr(self.adapter, "on_progress") and callable(recorder): + self.adapter.on_progress = lambda: recorder(turn, "provider.progress", time.monotonic() - started) return first_response, completed def _record_tool_call(self, call: ToolCall) -> None: @@ -980,7 +1000,7 @@ async def run_async(self, initial_message: str | None = None) -> SessionResult: return SessionResult("turn_budget", turn_number - 1, last_text) if self.before_turn is not None: messages.extend(self.before_turn(self)) - messages = self._compact(messages, turn_number) + messages = await asyncio.to_thread(self._compact, messages, turn_number) deltas: list[str] = [] first_response, provider_completed = self._provider_callbacks(turn_number) diff --git a/backend/agent/schema.py b/backend/agent/schema.py index 462c0f0..51f0ceb 100644 --- a/backend/agent/schema.py +++ b/backend/agent/schema.py @@ -1,13 +1,3 @@ -"""Storage contract for the unified agent runtime. Keep migration-stable. - -The central invariant: ``agent_events`` is append-only. Nothing in this -contract modifies or deletes an event, so the evidence chain of a task -survives compaction, member handoff, and worker restarts. Context -reconstruction is a projection over these events (see -``backend.agent.context``), and a compaction is a *derived* summary recorded -in ``agent_compactions`` rather than a destructive rewrite of the transcript. -""" - AGENT_SCHEMA = ( """CREATE TABLE IF NOT EXISTS agent_sessions ( id TEXT PRIMARY KEY, @@ -136,24 +126,26 @@ -- any kind. A long provider turn and a long tool both count as -- progress; only genuine silence accumulates here. GREATEST( - COALESCE(e.last_event_at, s.created_at), + COALESCE(e.last_progress_event_at, s.created_at), COALESCE(t.current_turn_started_at, s.created_at), COALESCE(t.last_finished_turn_at, s.created_at), - COALESCE(j.last_job_progress_at, s.created_at), - COALESCE(w.last_renewed_at, s.created_at) + COALESCE(j.last_job_progress_at, s.created_at) ) AS last_progress_at, EXTRACT(EPOCH FROM now() - GREATEST( - COALESCE(e.last_event_at, s.created_at), + COALESCE(e.last_progress_event_at, s.created_at), COALESCE(t.current_turn_started_at, s.created_at), COALESCE(t.last_finished_turn_at, s.created_at), - COALESCE(j.last_job_progress_at, s.created_at), - COALESCE(w.last_renewed_at, s.created_at) + COALESCE(j.last_job_progress_at, s.created_at) ))::bigint AS quiet_seconds FROM agent_sessions s LEFT JOIN agent_session_writers w ON w.session_id = s.id LEFT JOIN ( SELECT session_id, max(created_at) AS last_event_at, + max(created_at) FILTER (WHERE kind IN ('tool_call','tool_result','context_compacted') + OR (kind='status' AND payload->>'status' IN + ('provider.started','provider.first_content','provider.progress','provider.completed', + 'compaction.started','compaction.completed'))) AS last_progress_event_at, count(*) AS event_count, (array_agg(kind ORDER BY sequence DESC))[1] AS last_event_kind FROM agent_events GROUP BY session_id diff --git a/backend/core/config.py b/backend/core/config.py index 2fe6c6c..3c62bdb 100644 --- a/backend/core/config.py +++ b/backend/core/config.py @@ -86,6 +86,12 @@ class RuntimeConfig(BaseModel): compaction_trigger_ratio: float = Field(default=0.75, gt=0.0, le=0.95) max_turns: int = Field(default=0, ge=0) provider_read_timeout: int = Field(default=300, ge=30) + provider_turn_timeout: int = Field(default=900, ge=30, le=7200) + provider_progress_timeout: int = Field(default=300, ge=10, le=3600) + tool_output_bytes: int = Field(default=16384, ge=1024, le=65536) + context_bytes: int = Field(default=1_000_000, ge=16384, le=16_000_000) + compaction_timeout: int = Field(default=30, ge=1, le=120) + compaction_max_output_tokens: int = Field(default=2048, ge=256, le=8192) browser_event_limit: int = Field(default=200, gt=0, le=1000) browser_console_limit: int = Field(default=100, gt=0, le=1000) browser_error_limit: int = Field(default=50, gt=0, le=1000) diff --git a/backend/core/orchestrator.py b/backend/core/orchestrator.py index 73e7c8b..0276a2c 100644 --- a/backend/core/orchestrator.py +++ b/backend/core/orchestrator.py @@ -58,7 +58,6 @@ from backend.sandbox.errors import SandboxStartupError from backend.sandbox.task_sandbox import member_workdir, task_container_name -# Error boundaries keep their recovery behavior and retain debug diagnostics. _recovery_logger = logging.getLogger(__name__) @dataclass(slots=True) @@ -556,9 +555,6 @@ def _startup_in_progress(self, project_id: str) -> bool: return project_id in self._startup_project_ids def _acquire_task(self, project_id: str) -> bool: - # Competition already owns local/remote capacity and Member seats. - # A second generic task gate would merge the pools again, and would - # reject valid run-level capacity overrides. if self._competition_project(project_id): return self.resources.acquire_coordinated_task(project_id) return self.resources.acquire_task(project_id) @@ -865,11 +861,12 @@ def _publish_competition_recon( *, event_id: str, payload: dict[str, Any], - ) -> None: + receiver_member: str | None = None, + ) -> list[dict]: """Bridge durable Member reports into the same-challenge PUB/SUB path.""" competition = getattr(self.state, "competition", None) if competition is None or not callable(getattr(competition, "publish_recon", None)): - return + return [] now = datetime.now(timezone.utc) try: with self.state.db.connect() as connection: @@ -889,12 +886,15 @@ def _publish_competition_recon( if source_member is None or item["member"] == source_member ] if not senders: - return + return [] sender = senders[0] actual_source = sender["member"] + published = [] for receiver in assignments: if receiver["member"] == actual_source: continue + if receiver_member and receiver["member"] != receiver_member: + continue message = Envelope( run_id=sender["run_id"], challenge_id=sender["challenge_id"], @@ -906,11 +906,14 @@ def _publish_competition_recon( correlation_id=event_id, lease_epoch=sender["epoch"], created_at=now, - deadline_at=now + timedelta(seconds=30), + deadline_at=now + timedelta(seconds=300), message_type="recon", payload=payload, ) - competition.publish_recon(message) + receipt = competition.publish_recon(message) + published.append({"request_id": message.request_id, "receiver": receiver["member"], + "sequence": receipt.get("sequence") if isinstance(receipt, dict) else None}) + return published except Exception as exc: _recovery_logger.debug('Error handled in _publish_competition_recon', exc_info=True) self.state.logger.project( @@ -919,6 +922,15 @@ def _publish_competition_recon( member=source_member, error=f"{type(exc).__name__}: {exc}", ) + return [] + + def _send_member_message(self, project_id: str, source: str, receiver: str, payload: dict) -> dict: + event_id = "member:" + hashlib.sha256(json.dumps([project_id, source, receiver, payload], sort_keys=True).encode()).hexdigest()[:32] + receipts = self._publish_competition_recon(project_id, source, event_id=event_id, + payload=payload, receiver_member=receiver) + if not receipts: + raise ValueError("recipient is not an active teammate on this challenge or message delivery is unavailable") + return {"published": True, "receipts": receipts} def _broadcast_fact(self, project_id: str, fact_id: str, source_member: str | None) -> None: with self.state.db.connect() as conn: @@ -1194,6 +1206,8 @@ def _launch_member( max_actions_per_task=self.state.config.runtime.max_member_actions_per_task, continuous=self._competition_project(project_id), on_report=self.handle_report, + on_fact=self._broadcast_fact, + on_message=self._send_member_message, on_flag=self.on_flag_found, lease_owner=lease_owner, lease_token=lease_token, @@ -2553,7 +2567,10 @@ def _flag_followup_from_fact(self, project_id: str, fact_id: str) -> None: ).fetchone() if row is None: return - candidates = sorted(set(re.findall(r"(?:flag|ctf)\{[^}\n]{1,400}\}", row["description"], re.IGNORECASE))) + text = row["description"] + if re.search(r"\b(?:example|placeholder|sample flag)\b|示例|占位", text, re.IGNORECASE): + return + candidates = sorted(set(re.findall(r"(?:[A-Za-z0-9_]*ctf|flag)\{[^}\n]{1,400}\}", text, re.IGNORECASE))) if len(candidates) != 1: if len(candidates) > 1: self.state.logger.project( diff --git a/backend/members/adapters.py b/backend/members/adapters.py index 63aee49..413ff23 100644 --- a/backend/members/adapters.py +++ b/backend/members/adapters.py @@ -15,10 +15,13 @@ from backend.core.config import LLMConfig from backend.core.validation import InputValidationError -# Error boundaries keep their recovery behavior and retain debug diagnostics. _recovery_logger = logging.getLogger(__name__) ACTION_KINDS = ( + "fact", + "message", + "artifact_read", + "job_wait", "tool", "bash", "install", diff --git a/backend/members/base_member.py b/backend/members/base_member.py index d5786d0..1e502cd 100644 --- a/backend/members/base_member.py +++ b/backend/members/base_member.py @@ -60,7 +60,6 @@ from backend.tools.tool_mcp import build_category_tools_mcp, build_tool_search_mcp from backend.tools.tool_registry import LANGUAGES, PUBLIC_MCPS, ToolRegistry -# Error boundaries keep their recovery behavior and retain debug diagnostics. _recovery_logger = logging.getLogger(__name__) _LOCAL_WEBUI_URL_RE = re.compile(r"https?://(?:127\.0\.0\.1|localhost|0\.0\.0\.0):(\d{2,5})\b") @@ -117,6 +116,8 @@ class MemberDeps: competition_recon_advance: Callable[[str, int], int] | None = None runtime: Any | None = None job_store: Any | None = None + on_fact: Callable[[str, str, str], None] | None = None + on_message: Callable[[str, str, str, dict], dict] | None = None @dataclass @@ -137,6 +138,7 @@ class DispatchResult: invalid_action: bool = False invalid_knowledge: list[str] | None = None observation: str | None = None + process: dict[str, Any] | None = None class _IntentLeaseLost(RuntimeError): @@ -165,6 +167,9 @@ def __init__(self, name: str, adapter: BaseAdapter, deps: MemberDeps): self._recon_subscriber: ReconSubscriber | None = None self._session_recording_failed = False self._job_service: Any | None = None + configure_output = getattr(getattr(deps, "sandbox", None), "configure_output", None) + if callable(configure_output): + configure_output(getattr(getattr(deps, "runtime", None), "tool_output_bytes", 16384)) def _jobs(self): """Return the detached-job service, or None when it cannot be backed. @@ -298,6 +303,16 @@ def _drain_competition_recon(self, runner: SessionRunner | None = None) -> list[ ) messages.append(message) subscriber.ack(sequence) + if runner is not None: + pending = getattr(runner, "recon_sequences", []) + runner.recon_sequences = [*pending, sequence][-100:] + if (self.deps.competition_store is not None and envelope.get("run_id") + and callable(getattr(self.deps.competition_store, "append_run_event", None))): + self.deps.competition_store.append_run_event( + envelope["run_id"], "competition.message_read", + {"sequence": sequence, "request_id": envelope.get("request_id"), + "session_id": envelope.get("receiver_session_id"), "challenge_id": envelope.get("challenge_id")}, + ) return messages def solve(self, project_id: str, intent_id: str, category: str, is_initial: bool = False) -> SolveResult: @@ -757,17 +772,28 @@ def _semantic_compressor(self): """ from backend.agent.compaction import summarize + runtime = getattr(self.deps, "runtime", None) + timeout = getattr(runtime, "compaction_timeout", 30) + def request(prompt: str, dropped: list[dict[str, Any]]) -> str: - rendered = json.dumps(dropped, ensure_ascii=False)[:400_000] - return self.adapter.chat( - [{"role": "user", "content": rendered}], - system_prompt=prompt, - temperature=0.0, + from backend.agent.compaction import fit_history + + rendered = json.dumps(fit_history(dropped, max_bytes=100_000), ensure_ascii=False) + config = self.adapter.config.model_copy(update={"reasoning_effort": "low"}) + adapter = ConversationAdapter( + config, max_output_tokens=getattr(runtime, "compaction_max_output_tokens", 2048), + read_timeout=timeout, turn_timeout=timeout, progress_timeout=timeout, ) + result = adapter.turn([{"role": "user", "content": rendered}], prompt, [], lambda _text: None, self._stop) + compress.last_metadata["usage"] = result.usage + return result.text def compress(messages: list[dict[str, Any]]): - return summarize(messages, request=request) + compress.last_metadata = {"budget_seconds": timeout, "attempts": 1} + return summarize(messages, request=request, + on_degraded=lambda reason: compress.last_metadata.update(degraded_reason=reason)) + compress.last_metadata = {} return compress def _make_native_runner( @@ -786,6 +812,8 @@ def _make_native_runner( self.adapter.config, max_output_tokens=getattr(runtime_config, "max_output_tokens", 32768), read_timeout=getattr(runtime_config, "provider_read_timeout", 300), + turn_timeout=getattr(runtime_config, "provider_turn_timeout", 900), + progress_timeout=getattr(runtime_config, "provider_progress_timeout", 300), ) kwargs = { "system": ( @@ -793,7 +821,12 @@ def _make_native_runner( "Each action is its own tool; call the one that matches what " "you want to do. Read-only tools may be called together in one " "turn. Continue until the challenge is solved, a real flag is " - "verified, or evidence is genuinely exhausted." + "verified, or evidence is genuinely exhausted. Publish verified intermediate facts with publish_fact " + "without concluding your intent; put artifacts under /workspace/shared/// and include " + "their hash and run command. Use send_message to hand off work to an active teammate, not at every step. " + "Read received facts before redoing analysis. After a sustained stretch without new evidence, report " + "the failed approaches and switch hypothesis. Use job_start/job_wait for long work and artifact_read " + "to page large outputs. A verified flag must be submitted with submit_flag." ), "tools": tools, "cancel": self._stop, @@ -803,6 +836,7 @@ def _make_native_runner( ), "before_turn": self._drain_competition_recon, "compressor": self._semantic_compressor(), + "context_bytes": getattr(runtime_config, "context_bytes", 1_000_000), "context_token_limit": getattr(runtime_config, "context_token_limit", 0), "compaction_trigger_ratio": getattr( runtime_config, "compaction_trigger_ratio", 0.75 @@ -1034,6 +1068,8 @@ async def execute(_self, name, arguments, *, idempotency_key): } if dispatched.observation: payload["observation"] = dispatched.observation + if dispatched.process is not None: + payload["process"] = dispatched.process return payload runner.executor = Executor() @@ -1188,7 +1224,18 @@ async def _dispatch( observation=text, ) res = d.sandbox.exec(cmd, timeout=60) - text = f"$ {cmd}\n{res.stdout}\n{res.stderr}".strip() + from backend.sandbox.output import preview_text + + budget = getattr(d.runtime, "tool_output_bytes", 16384) + text = preview_text(f"$ {preview_text(cmd, 2048)}\n{res.stdout}\n{res.stderr}".strip(), budget) + artifacts = getattr(res, "artifacts", {}) + process = {"exit_code": res.exit_code, "timed_out": res.timed_out, + "duration_seconds": getattr(res, "duration_seconds", None), + "output_truncated": bool(artifacts), "artifacts": artifacts} + if artifacts: + text += "\n[output artifacts] " + json.dumps(artifacts, ensure_ascii=False) + if res.timed_out: + text += "\nCommand timed out. Use job_start for work that requires more than 60 seconds." self._observe(text) self._observe_webui_links(project_id, cmd, res.stdout, res.stderr) d.logger.tool( @@ -1199,6 +1246,7 @@ async def _dispatch( exit_code=res.exit_code, stdout=res.stdout[:4000], stderr=res.stderr[:4000], + process=process, ) missing_command = self._missing_command_from_result(cmd, res.stderr) if missing_command: @@ -1206,7 +1254,23 @@ async def _dispatch( return DispatchResult( invalid_action=True, invalid_knowledge=knowledge, observation=text ) - return DispatchResult(observation=text) + return DispatchResult(observation=text, process=process) + if kind == "job_wait": + service = self._jobs() + if service is None: + return DispatchResult(invalid_action=True, observation="job service unavailable") + job_id = self._string_arg(action.args.get("job_id", "")) + timeout = max(1, min(15, int(action.args.get("timeout", 5)))) + result = await asyncio.to_thread(service.wait, job_id, timeout=timeout, cancel=self._stop) + return DispatchResult(observation="[job_wait] " + json.dumps(result, ensure_ascii=False, default=str)) + if kind == "artifact_read": + reader = getattr(d.sandbox, "read_page", None) + if not callable(reader): + return DispatchResult(invalid_action=True, observation="artifact paging unavailable") + result = await asyncio.to_thread(reader, self._string_arg(action.args.get("path", "")), + offset=max(0, int(action.args.get("offset", 0))), + limit=max(1, min(8192, int(action.args.get("limit", 8192))))) + return DispatchResult(observation=json.dumps(result, ensure_ascii=False)) if kind in ("job_start", "job_status", "job_logs", "job_cancel"): return self._dispatch_job(project_id, intent_id, action) if kind == "install": @@ -1275,6 +1339,50 @@ async def _dispatch( if kind == "report": report = self._submit_report(project_id, intent_id, action) return DispatchResult(graph_action="report" if report is not None else None) + if kind == "fact": + description = self._string_arg(action.args.get("description", "")).strip() + evidence = self._string_arg(action.args.get("evidence", "")).strip() + artifacts = action.args.get("artifacts", []) + if not description or not evidence or len(description) > 1800 or len(evidence) > 1800: + return DispatchResult(invalid_action=True, observation="publish_fact requires a bounded claim and concrete evidence") + if not isinstance(artifacts, list) or len(artifacts) > 8 or len(json.dumps(artifacts)) > 4096: + return DispatchResult(invalid_action=True, observation="invalid artifact handoff") + for artifact in artifacts: + if (not isinstance(artifact, dict) or not str(artifact.get("path", "")).startswith("/workspace/shared/") + or not re.fullmatch(r"[a-fA-F0-9]{64}", str(artifact.get("sha256", "")))): + return DispatchResult(invalid_action=True, observation="shared artifacts need a /workspace/shared/ path and SHA-256") + text = description + "\nEvidence: " + evidence + if artifacts: + text += "\nArtifacts: " + json.dumps(artifacts, ensure_ascii=False) + with d.db.connect() as connection: + connection.execute("SELECT id FROM projects WHERE id=%s FOR UPDATE", (project_id,)) + owned = connection.execute( + """SELECT id FROM intents WHERE project_id=%s AND id=%s AND worker=%s AND lease_owner=%s + AND lease_token=%s AND lease_expires_at>now() AND to_fact_id IS NULL FOR UPDATE""", + (project_id, intent_id, self.name, d.lease_owner, d.lease_token), + ).fetchone() + if owned is None: + raise _IntentLeaseLost("intent lease lost before fact publication") + old = connection.execute("SELECT id FROM facts WHERE project_id=%s AND description=%s LIMIT 1", (project_id, text)).fetchone() + if old: + fact_id = old["id"] + else: + fact = node_store.reserve_fact(connection, project_id, text) + node_store.insert_fact(connection, project_id, fact.id, fact.description) + fact_id = fact.id + graph_store.add_link(connection, project_id, self.name, f"fact:{fact_id}", "explore") + if not old and d.on_fact: + d.on_fact(project_id, fact_id, self.name) + d.logger.project("member_fact_published", project_id, member=self.name, fact_id=fact_id, artifacts=artifacts) + return DispatchResult(graph_action="fact", observation=f"Published fact {fact_id}; your intent remains active.") + if kind == "message": + receiver = self._string_arg(action.args.get("receiver", "")).strip() + content = self._string_arg(action.args.get("content", "")).strip() + if not receiver or receiver == self.name or not content or len(content) > 1800 or d.on_message is None: + return DispatchResult(invalid_action=True, observation="message needs one active teammate and bounded content") + result = d.on_message(project_id, self.name, receiver, + {"kind": "member_message", "content": content, "reply_to": action.args.get("reply_to", "")}) + return DispatchResult(graph_action="message", observation=json.dumps(result, ensure_ascii=False)) if kind == "intent": if not allow_intent: d.logger.project( diff --git a/backend/members/member_tools.py b/backend/members/member_tools.py index beb97ea..08d89e8 100644 --- a/backend/members/member_tools.py +++ b/backend/members/member_tools.py @@ -30,9 +30,13 @@ TERMINAL_TOOLS = frozenset({"submit_flag", "conclude", "give_up"}) -PARALLEL_SAFE_TOOLS = frozenset({"memory_search", "tool_search", "job_status", "job_logs"}) +PARALLEL_SAFE_TOOLS = frozenset({"memory_search", "tool_search", "job_status", "job_logs", "artifact_read"}) TOOL_ACTIONS: dict[str, str] = { + "publish_fact": "fact", + "send_message": "message", + "artifact_read": "artifact_read", + "job_wait": "job_wait", "bash": "bash", "install": "install", "mcp_tool": "tool", @@ -71,6 +75,19 @@ def _tool( MEMBER_TOOLS: tuple[dict[str, Any], ...] = ( + _tool("publish_fact", "Publish a verified intermediate fact and notify active teammates without finishing your intent. Include concrete evidence and versioned shared artifact paths. Never use this instead of submit_flag.", + {"description": {**_STRING, "maxLength": 1800}, "evidence": {**_STRING, "maxLength": 1800}, + "artifacts": {"type": "array", "maxItems": 8, "items": {"type": "object", "properties": { + "path": _STRING, "sha256": _STRING, "version": _STRING, "purpose": _STRING}, + "required": ["path", "sha256"], "additionalProperties": False}}, "thought": _STRING}, + ["description", "evidence"]), + _tool("send_message", "Send a bounded business message to one active teammate on this challenge. State the requested subtask or handoff, shared artifact version, and expected response. Set reply_to to the incoming request_id when responding.", + {"receiver": _STRING, "content": {**_STRING, "maxLength": 1800}, "reply_to": _STRING, "thought": _STRING}, + ["receiver", "content"]), + _tool("artifact_read", "Read a bounded page of a workspace artifact or a full-output file returned by bash. Use next_offset to continue; do not cat large files into context.", + {"path": _STRING, "offset": {**_INTEGER, "minimum": 0}, "limit": {**_INTEGER, "minimum": 1, "maximum": 8192}, "thought": _STRING}, ["path"]), + _tool("job_wait", "Wait up to 15 seconds for a job to exit or produce more progress. Use this instead of shell sleep loops. A still-running or lost job is not success.", + {"job_id": _STRING, "timeout": {**_INTEGER, "minimum": 1, "maximum": 15}, "thought": _STRING}, ["job_id"]), _tool( "bash", "Run one shell command in this challenge's container. Killed after 60 " diff --git a/backend/sandbox/output.py b/backend/sandbox/output.py new file mode 100644 index 0000000..744d670 --- /dev/null +++ b/backend/sandbox/output.py @@ -0,0 +1,98 @@ +from __future__ import annotations + +import base64 +import hashlib +import json +from pathlib import Path + +DEFAULT_OUTPUT_BYTES = 16_384 + + +def read_page_file(path: Path, *, offset: int = 0, limit: int = 8192) -> dict: + if offset < 0 or not 1 <= limit <= 8192: + raise ValueError("invalid artifact page range") + with path.open("rb") as handle: + handle.seek(offset) + raw = handle.read(limit) + while True: + try: + data, encoding = raw.decode("utf-8"), "utf8" + except UnicodeDecodeError: + data, encoding = base64.b64encode(raw).decode("ascii"), "base64" + result = {"path": str(path), "offset": offset, "next_offset": offset + len(raw), + "total_bytes": path.stat().st_size, "encoding": encoding, "data": data} + if len(json.dumps(result, ensure_ascii=False).encode()) <= DEFAULT_OUTPUT_BYTES: + return result + raw = raw[:max(1, len(raw) // 2)] + + +def preview_bytes(value: bytes, limit: int = DEFAULT_OUTPUT_BYTES) -> str: + limit = max(512, limit) + if len(value) <= limit: + return value.decode("utf-8", "replace") + marker = f"\n[output truncated; {len(value)} bytes total; read the output artifact in pages]\n".encode() + side = max(1, (limit - len(marker)) // 2) + return (value[:side].decode("utf-8", "ignore") + marker.decode() + + value[-side:].decode("utf-8", "ignore")) + + +def preview_text(value: str, limit: int = DEFAULT_OUTPUT_BYTES) -> str: + return preview_bytes(value.encode("utf-8"), limit) + + +def read_output_file(path: Path, limit: int, *, visible_path: str | None = None) -> tuple[str, dict | None]: + size = path.stat().st_size + with path.open("rb") as handle: + if size <= limit: + return handle.read().decode("utf-8", "replace"), None + head = handle.read(max(1, (limit - 128) // 2)) + handle.seek(max(0, size - max(1, (limit - 128) // 2))) + tail = handle.read() + handle.seek(0) + digest = hashlib.sha256() + while chunk := handle.read(1024 * 1024): + digest.update(chunk) + marker = f"\n[output truncated; {size} bytes total; read the artifact in pages]\n" + return head.decode("utf-8", "ignore") + marker + tail.decode("utf-8", "ignore"), { + "path": visible_path or str(path), "bytes": size, "sha256": digest.hexdigest(), + } + + +OUTPUT_FINALIZER = r''' +import hashlib,json,os,sys +limit=max(512,int(sys.argv[4])) +result={"exit_code":int(sys.argv[3]),"stdout":"","stderr":"","artifacts":{}} +for stream,path in zip(("stdout","stderr"),sys.argv[1:3]): + size=os.path.getsize(path) + with open(path,"rb") as f: + if size<=limit: + result[stream]=f.read().decode("utf-8","replace") + else: + side=max(1,(limit-128)//2) + head=f.read(side);f.seek(max(0,size-side));tail=f.read() + result[stream]=head.decode("utf-8","ignore")+"\n[output truncated; read the output artifact in pages]\n"+tail.decode("utf-8","ignore") + digest=hashlib.sha256();f.seek(0) + while True: + chunk=f.read(1048576) + if not chunk:break + digest.update(chunk) + result["artifacts"][stream]={"path":path,"bytes":size,"sha256":digest.hexdigest()} + if stream not in result["artifacts"]:os.unlink(path) +print(json.dumps(result,ensure_ascii=False)) +''' + +OUTPUT_PAGE_READER = r''' +import base64,json,pathlib,sys +path=pathlib.Path(sys.argv[1]).resolve() +if not path.is_relative_to(pathlib.Path("/workspace")):raise ValueError("artifact path must stay in the workspace") +offset=max(0,int(sys.argv[2]));limit=max(1,min(8192,int(sys.argv[3]))) +with path.open("rb") as f: + f.seek(offset);raw=f.read(limit) +while True: + try:data,encoding=raw.decode("utf-8"),"utf8" + except UnicodeDecodeError:data,encoding=base64.b64encode(raw).decode("ascii"),"base64" + result={"path":str(path),"offset":offset,"next_offset":offset+len(raw),"total_bytes":path.stat().st_size,"encoding":encoding,"data":data} + if len(json.dumps(result,ensure_ascii=False).encode())<=16000:break + raw=raw[:max(1,len(raw)//2)] +print(json.dumps(result,ensure_ascii=False)) +''' diff --git a/backend/sandbox/sandbox.py b/backend/sandbox/sandbox.py index da4b209..bf4f212 100644 --- a/backend/sandbox/sandbox.py +++ b/backend/sandbox/sandbox.py @@ -6,11 +6,18 @@ import signal import subprocess import threading +import time +import uuid from contextlib import suppress -from dataclasses import dataclass +from dataclasses import dataclass, field from pathlib import Path from typing import Protocol +from backend.sandbox.output import ( + DEFAULT_OUTPUT_BYTES, + read_output_file, + read_page_file, +) from backend.sandbox.webui_proxy import webui_proxy_manager @@ -91,6 +98,8 @@ class ExecResult: stdout: str stderr: str timed_out: bool = False + artifacts: dict = field(default_factory=dict) + duration_seconds: float | None = None @property def ok(self) -> bool: @@ -123,6 +132,10 @@ def __init__(self, name: str, workspace: str | Path, env: dict[str, str] | None self._started = False self._webui_keys: set[tuple[str, str]] = set() self._jobs: dict[str, subprocess.Popen] = {} + self.output_limit = DEFAULT_OUTPUT_BYTES + + def configure_output(self, limit: int) -> None: + self.output_limit = max(1024, int(limit)) def start(self) -> None: with self._lock: @@ -146,28 +159,36 @@ def exec(self, command: str, timeout: int = 60) -> ExecResult: popen_kwargs["creationflags"] = subprocess.CREATE_NEW_PROCESS_GROUP else: popen_kwargs["start_new_session"] = True - proc = subprocess.Popen( - args, - shell=use_shell, - cwd=str(self.workspace), - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - text=True, - encoding="utf-8", - errors="replace", - env=full_env, - **popen_kwargs, - ) - try: - out, err = proc.communicate(timeout=timeout) - return ExecResult(int(proc.returncode or 0), out or "", err or "") - except subprocess.TimeoutExpired: - _kill_process_tree(proc) + directory = self.workspace / ".ipc" / "output" + directory.mkdir(parents=True, exist_ok=True) + identifier = uuid.uuid4().hex + paths = [directory / f"{identifier}.{stream}" for stream in ("stdout", "stderr")] + started = time.monotonic() + timed_out = False + with paths[0].open("wb") as stdout, paths[1].open("wb") as stderr: + proc = subprocess.Popen( + args, shell=use_shell, cwd=str(self.workspace), stdout=stdout, stderr=stderr, + env=full_env, **popen_kwargs, + ) try: - out, err = proc.communicate(timeout=10) + proc.wait(timeout=timeout) except subprocess.TimeoutExpired: - out, err = "", "" - return ExecResult(124, out or "", err or "", timed_out=True) + timed_out = True + _kill_process_tree(proc) + with suppress(subprocess.TimeoutExpired): + proc.wait(timeout=10) + previews = [] + artifacts = {} + for stream, path in zip(("stdout", "stderr"), paths): + preview, artifact = read_output_file(path, self.output_limit // 2) + previews.append(preview) + if artifact: + artifacts[stream] = artifact + else: + path.unlink(missing_ok=True) + return ExecResult(124 if timed_out else int(proc.returncode or 0), *previews, + timed_out=timed_out, artifacts=artifacts, + duration_seconds=round(time.monotonic() - started, 6)) def write_file(self, rel_path: str, content: str) -> None: target = self._safe_path(rel_path) @@ -317,6 +338,9 @@ def read_file(self, rel_path: str) -> str | None: return None return target.read_text(encoding="utf-8", errors="replace") + def read_page(self, path: str, *, offset: int = 0, limit: int = 8192) -> dict: + return read_page_file(self._safe_path(path), offset=offset, limit=limit) + def stop(self) -> None: for project_id, member in list(self._webui_keys): webui_proxy_manager.close_member(project_id, member) diff --git a/backend/sandbox/task_sandbox.py b/backend/sandbox/task_sandbox.py index 69ad870..f4c07a0 100644 --- a/backend/sandbox/task_sandbox.py +++ b/backend/sandbox/task_sandbox.py @@ -1,11 +1,14 @@ from __future__ import annotations import io +import json import logging import os import shlex import tarfile import threading +import time +import uuid from contextlib import suppress from pathlib import Path, PurePosixPath @@ -16,10 +19,14 @@ SandboxStartupError, classify_docker_startup_error, ) +from backend.sandbox.output import ( + DEFAULT_OUTPUT_BYTES, + OUTPUT_FINALIZER, + OUTPUT_PAGE_READER, +) from backend.sandbox.sandbox import ExecResult from backend.sandbox.webui_proxy import webui_proxy_manager -# Error boundaries keep their recovery behavior and retain debug diagnostics. _recovery_logger = logging.getLogger(__name__) WORKSPACE = "/workspace" @@ -393,6 +400,40 @@ def _raw_exec(self, command: str, workdir: str, timeout: int = 60) -> ExecResult timed_out = res.exit_code in (124, 137) return ExecResult(res.exit_code if res.exit_code is not None else -1, stdout, stderr, timed_out) + def exec_bounded(self, command: str, workdir: str, timeout: int = 60) -> ExecResult: + if self._container is None: + self.start() + identifier = uuid.uuid4().hex + directory = f"{SHARED_DIR}/.ipc-output" + stdout, stderr = (f"{directory}/{identifier}.{stream}" for stream in ("stdout", "stderr")) + limit = max(1024, int(getattr(self, "output_limit", DEFAULT_OUTPUT_BYTES))) + script = "\n".join([ + f"mkdir -p {shlex.quote(directory)}", + f"timeout -k 5s {timeout}s bash -lc {shlex.quote(command)} >{shlex.quote(stdout)} 2>{shlex.quote(stderr)}", + "ipc_output_status=$?", + (f"python3 -c {shlex.quote(OUTPUT_FINALIZER)} {shlex.quote(stdout)} {shlex.quote(stderr)} " + f'"$ipc_output_status" {limit // 2}'), + ]) + started = time.monotonic() + envelope = self._raw_exec(script, workdir=workdir, timeout=timeout + 15) + if not envelope.ok: + return envelope + try: + payload = json.loads(envelope.stdout) + code = int(payload["exit_code"]) + return ExecResult(code, payload["stdout"], payload["stderr"], code in (124, 137), + payload["artifacts"], round(time.monotonic() - started, 6)) + except (ValueError, KeyError, TypeError): + raise RuntimeError("sandbox output finalizer returned an invalid envelope") from None + + + def read_page(self, path: str, *, workdir: str, offset: int = 0, limit: int = 8192) -> dict: + target = str(PurePosixPath(workdir) / path) if not PurePosixPath(path).is_absolute() else path + result = self._raw_exec(f"python3 -c {shlex.quote(OUTPUT_PAGE_READER)} {shlex.quote(target)} {int(offset)} {int(limit)}", + workdir=workdir, timeout=10) + if not result.ok: + raise ValueError("artifact is unavailable or outside this workspace") + return json.loads(result.stdout) def exec_detached(self, job_id: str, command: str, workdir: str) -> int: """Start ``command`` with no timeout and return its process-group PID. @@ -508,7 +549,13 @@ def start(self) -> None: self._task.start() def exec(self, command: str, timeout: int = 60) -> ExecResult: - return self._task.exec(command, workdir=self.workdir, timeout=timeout) + return self._task.exec_bounded(command, workdir=self.workdir, timeout=timeout) + + def configure_output(self, limit: int) -> None: + self._task.output_limit = max(1024, int(limit)) + + def read_page(self, path: str, *, offset: int = 0, limit: int = 8192) -> dict: + return self._task.read_page(path, workdir=self.workdir, offset=offset, limit=limit) def exec_detached(self, job_id: str, command: str) -> int: diff --git a/tests/test_member_tools.py b/tests/test_member_tools.py index 6465479..720346d 100644 --- a/tests/test_member_tools.py +++ b/tests/test_member_tools.py @@ -1,15 +1,3 @@ -"""One tool per Member action, and concurrency within a turn (P4b). - -Two invariants are the point of these tests: - -* A terminal action stops the rest of its batch. Running a side effect after - the call that submitted a flag or concluded the intent would apply changes - past the decision that ended the task, and the loop's dangling-call repair - assumes nothing lands after that point. -* Parallel execution keeps ``tool-call:{id}`` and ``tool-result:{id}`` paired - and in the provider's order. The transcript has to match the ``tool_calls`` - array regardless of which tool finished first. -""" from __future__ import annotations import asyncio @@ -108,6 +96,10 @@ def test_every_action_kind_has_exactly_one_tool(): def test_each_tool_payload_builds_a_valid_member_action(): """The dispatcher is still keyed on the legacy kinds, so the map must hold.""" samples = { + "publish_fact": {"description": "LFI verified", "evidence": "GET /read?file=/etc/hostname returned hostname"}, + "send_message": {"receiver": "jade", "content": "Verify the shared solver"}, + "artifact_read": {"path": "/workspace/shared/solver.log", "offset": 0}, + "job_wait": {"job_id": "j1", "timeout": 1}, "bash": {"command": "id"}, "install": {"packages": ["jq"]}, "mcp_tool": {"server": "web", "tool": "fetch", "args": {"url": "http://x"}}, diff --git a/tests/test_output_budgets.py b/tests/test_output_budgets.py new file mode 100644 index 0000000..1f2ee6b --- /dev/null +++ b/tests/test_output_budgets.py @@ -0,0 +1,56 @@ +from __future__ import annotations + +import hashlib +import json +import sys +from pathlib import Path + +import pytest + +from backend.agent.compaction import fit_history, summarize +from backend.sandbox.sandbox import LocalSandbox + + +def test_forty_megabyte_output_is_spooled_and_fully_readable(tmp_path): + sandbox = LocalSandbox("output-budget", tmp_path) + result = sandbox.exec(f'"{sys.executable}" -c "import sys;sys.stdout.buffer.write(b\'x\'*(40*1024*1024))"') + assert result.ok + assert len(result.stdout.encode()) < 16384 + artifact = result.artifacts["stdout"] + assert artifact["bytes"] == 40 * 1024 * 1024 + path = Path(artifact["path"]) + with path.open("rb") as stream: + assert hashlib.file_digest(stream, "sha256").hexdigest() == artifact["sha256"] + first = sandbox.read_page(str(path), limit=8192) + last = sandbox.read_page(str(path), offset=artifact["bytes"]-8, limit=8) + assert first["data"] == "x" * 8192 + assert first["next_offset"] == 8192 + assert last["data"] == "x" * 8 + assert last["next_offset"] == artifact["bytes"] + with pytest.raises(ValueError): + sandbox.read_page("../../outside") + + +def test_large_recent_result_cannot_survive_the_context_budget(): + history = [{"role": "user", "content": "Investigate the attachment"}, + {"role": "assistant", "tool_calls": [{"id": "c1", "function": {"name": "bash", "arguments": "{}"}}]}, + {"role": "tool", "tool_call_id": "c1", "content": "x" * (40 * 1024 * 1024)}] + projection = fit_history(history, max_bytes=16384, max_tokens=4000) + assert len(json.dumps(projection).encode()) <= 16384 + assert projection[0]["content"] == history[0]["content"] + assert all(item.get("role") != "tool" or any( + call.get("id") == item.get("tool_call_id") for message in projection + for call in message.get("tool_calls", []) + ) for item in projection) + + +def test_compaction_failure_reports_its_reason_and_preserves_artifact_refs(): + reasons = [] + artifact = {"path": "/workspace/shared/result.log", "sha256": "a" * 64} + history = [{"role": "user", "content": "task"}, {"role": "tool", "content": json.dumps({"process": {"artifacts": {"stdout": artifact}}})}, + *[{"role": "user", "content": str(i)} for i in range(20)]] + def unavailable(_prompt, _history): + raise TimeoutError("summary deadline") + summary, _tail = summarize(history, request=unavailable, on_degraded=reasons.append) + assert reasons == ["TimeoutError: summary deadline"] + assert artifact in summary["artifacts"] From e0d8d17a15f3de514253b935f137018f4c26d04d Mon Sep 17 00:00:00 2001 From: PureStream108 <1262364207@qq.com> Date: Sat, 17 Oct 2026 18:49:35 +0800 Subject: [PATCH 05/21] feat(competition): durable control operations and instance lifecycle --- backend/api/competition.py | 10 +- backend/competition/control_schema.py | 18 + backend/competition/conversation.py | 108 +++- backend/competition/service.py | 252 ++++---- backend/competition/store.py | 73 ++- .../20261016_0012_control_operations.py | 21 + backend/persistence/schema.py | 3 +- tests/test_competition_service_fixture.py | 23 +- tests/test_plan_features.py | 563 ++++++++++++++++++ 9 files changed, 921 insertions(+), 150 deletions(-) create mode 100644 backend/competition/control_schema.py create mode 100644 backend/persistence/migrations/versions/20261016_0012_control_operations.py create mode 100644 tests/test_plan_features.py diff --git a/backend/api/competition.py b/backend/api/competition.py index d0b1948..8c00f40 100644 --- a/backend/api/competition.py +++ b/backend/api/competition.py @@ -44,6 +44,7 @@ def validate_select(cls, value: list[str] | None) -> list[str] | None: class ControlRequest(BaseModel): model_config = ConfigDict(extra="forbid") revision: int = Field(ge=1) + operation_id: str | None = Field(default=None, min_length=8, max_length=128, pattern=r"^[A-Za-z0-9_-]+$") class LimitsRequest(BaseModel): @@ -65,7 +66,6 @@ class CandidateRequest(BaseModel): -# FastAPI resolves request values from these reusable declaration markers. _GET_STATE_DEPENDENCY = Depends(get_state) def get_competition(state: AppState = _GET_STATE_DEPENDENCY) -> CompetitionService: @@ -95,7 +95,6 @@ def _call(function, *args, **kwargs): -# FastAPI resolves request values from these reusable declaration markers. _GET_COMPETITION_DEPENDENCY = Depends(get_competition) @router.post("/workflows/{workflow_id}/preflight") @@ -140,9 +139,16 @@ def control_run( body: ControlRequest, service: CompetitionService = _GET_COMPETITION_DEPENDENCY, ): + if body.operation_id: + return _call(service.control, run_id, action, body.revision, operation_id=body.operation_id) return _call(service.control, run_id, action, body.revision) +@router.get("/runs/{run_id}/operations/{operation_id}") +def control_operation(run_id: str, operation_id: str, service: CompetitionService = _GET_COMPETITION_DEPENDENCY): + return _call(service.store.control_operation, run_id, operation_id) + + @router.patch("/runs/{run_id}/limits") def patch_run_limits( run_id: str, diff --git a/backend/competition/control_schema.py b/backend/competition/control_schema.py new file mode 100644 index 0000000..49831bc --- /dev/null +++ b/backend/competition/control_schema.py @@ -0,0 +1,18 @@ + +CONTROL_SCHEMA = ( + """CREATE TABLE IF NOT EXISTS competition_control_operations ( + id TEXT PRIMARY KEY, + run_id TEXT NOT NULL REFERENCES competition_runs(id), + action TEXT NOT NULL CHECK(action IN ('pause','resume','stop','refresh')), + requested_revision BIGINT NOT NULL, + status TEXT NOT NULL DEFAULT 'queued' CHECK(status IN ('queued','running','completed','failed')), + owner TEXT, + epoch BIGINT NOT NULL DEFAULT 0, + lease_expires_at TIMESTAMPTZ, + error TEXT, + created_at TIMESTAMPTZ NOT NULL DEFAULT now(), + finished_at TIMESTAMPTZ + )""", + """CREATE INDEX IF NOT EXISTS ix_competition_control_pending + ON competition_control_operations(created_at) WHERE status IN ('queued','running')""", +) diff --git a/backend/competition/conversation.py b/backend/competition/conversation.py index c5b95ed..10490a6 100644 --- a/backend/competition/conversation.py +++ b/backend/competition/conversation.py @@ -1,13 +1,10 @@ -"""Native streamed tool conversations. Persist returned provider messages intact. - -The runtime owns replay and side-effect fencing; this adapter performs one -model turn and never silently retries after receiving part of a response. -""" from __future__ import annotations import json import logging +import socket import threading +import time import uuid from collections.abc import Callable from dataclasses import dataclass, field @@ -17,11 +14,11 @@ from backend.members.adapters import ( _anthropic_endpoint, + _is_reasoning_model, _openai_endpoint, opencode_provider_headers, ) -# Error boundaries keep their recovery behavior and retain debug diagnostics. _recovery_logger = logging.getLogger(__name__) @dataclass @@ -162,18 +159,24 @@ def __init__( request=requests.post, max_output_tokens: int = 32768, read_timeout: int = 300, + turn_timeout: float = 900, + progress_timeout: float = 300, provider_session_id: str | None = None, ) -> None: self.config = config self.request = request self.max_output_tokens = max_output_tokens - self.read_timeout = max(30, read_timeout) + self.read_timeout = max(.1, float(read_timeout)) + self.turn_timeout = max(.1, float(turn_timeout)) + self.progress_timeout = max(.1, float(progress_timeout)) self.surface = "anthropic" if config.api_format == "anthropic" else ( "responses" if config.api_surface == "responses" else "chat_completions" ) self._provider_session = provider_session_id or f"ipc-session-{uuid.uuid4().hex[:16]}" self._stream_usage_supported = True self.on_first_response: Callable[[], None] | None = None + self.on_first_content: Callable[[], None] | None = None + self.on_progress: Callable[[], None] | None = None @property def provider_session_id(self) -> str: @@ -191,6 +194,7 @@ def turn(self, messages: list[dict], system: str, tools: list[dict], emit: Callable[[str], None], cancel: threading.Event, emit_reasoning: Callable[[str], None] | None = None) -> Turn: config = self.config + self._request_started_at = time.monotonic() if config.api_format == "mock": latest = "" for message in reversed(messages): @@ -214,6 +218,7 @@ def turn(self, messages: list[dict], system: str, tools: list[dict], elif self.surface == "responses": endpoint = _openai_endpoint(config.base_url, "responses") body.update(input=messages, instructions=system, store=False, + max_output_tokens=self.max_output_tokens, include=["reasoning.encrypted_content"], tools=[{"type": "function", **t, "strict": False} for t in tools]) if config.reasoning_effort not in {"auto", "none", "minimal"}: @@ -222,6 +227,8 @@ def turn(self, messages: list[dict], system: str, tools: list[dict], endpoint = _openai_endpoint(config.base_url, "chat_completions") body.update(messages=[{"role": "system", "content": system}, *messages], tools=[{"type": "function", "function": t} for t in tools]) + token_key = "max_completion_tokens" if config.api_format != "deepseek" and _is_reasoning_model(config.model) else "max_tokens" + body[token_key] = self.max_output_tokens if config.reasoning_effort not in {"auto", "none", "minimal"} and config.api_format != "deepseek": body["reasoning_effort"] = config.reasoning_effort if self._stream_usage_supported: @@ -232,7 +239,7 @@ def turn(self, messages: list[dict], system: str, tools: list[dict], try: with self.request( endpoint, headers=headers, json=body, stream=True, - timeout=(15, self.read_timeout), + timeout=(min(15, self.turn_timeout), min(self.read_timeout, self.turn_timeout, self.progress_timeout)), ) as response: response.raise_for_status() return self._read(response, emit, cancel, think) @@ -243,7 +250,7 @@ def turn(self, messages: list[dict], system: str, tools: list[dict], body.pop("stream_options", None) with self.request( endpoint, headers=headers, json=body, stream=True, - timeout=(15, self.read_timeout), + timeout=(min(15, self.turn_timeout), min(self.read_timeout, self.turn_timeout, self.progress_timeout)), ) as response: response.raise_for_status() return self._read(response, emit, cancel, think) @@ -264,6 +271,82 @@ def _should_drop_stream_options(exc: requests.HTTPError, body: dict) -> bool: return "stream_options" in detail or "include_usage" in detail def _read(self, response, emit, cancel, emit_reasoning=None): + finished = threading.Event() + started = getattr(self, "_request_started_at", time.monotonic()) + progress = [started] + interrupted = [] + + def abort(): + raw = getattr(response, "raw", None) + connection = getattr(raw, "_connection", None) + sock = getattr(connection, "sock", None) + if sock is None: + sock = getattr(getattr(getattr(getattr(raw, "_fp", None), "fp", None), "raw", None), "_sock", None) + if sock is not None: + try: + sock.shutdown(socket.SHUT_RDWR) + except OSError: + pass + close = getattr(response, "close", None) + if callable(close): + close() + + def watch(): + while not finished.wait(.05): + now = time.monotonic() + reason = ("cancelled" if cancel.is_set() else "turn deadline" if now-started >= self.turn_timeout + else "no effective progress" if now-progress[0] >= self.progress_timeout else None) + if reason: + interrupted.append(reason) + try: + abort() + except Exception: + _recovery_logger.debug("stream abort failed", exc_info=True) + return + + first_content = [False] + last_noted = [started] + def progressed(value): + progress[0] = time.monotonic() + if not first_content[0]: + first_content[0] = True + if self.on_first_content is not None: + self.on_first_content() + if progress[0] - last_noted[0] >= 15: + last_noted[0] = progress[0] + if self.on_progress is not None: + self.on_progress() + return value + + def text(value): + if value: + progressed(value) + emit(value) + + def thinking(value): + if value: + progressed(value) + if emit_reasoning: + emit_reasoning(value) + + watcher = threading.Thread(target=watch, name="ipc-provider-deadline", daemon=True) + watcher.start() + try: + result = self._read_stream(response, text, cancel, thinking, progressed) + if interrupted: + raise TimeoutError(interrupted[0]) + return result + except Exception: + if cancel.is_set(): + raise InterruptedError("session cancelled") from None + if interrupted: + raise TimeoutError(f"provider exceeded {interrupted[0]}") from None + raise + finally: + finished.set() + watcher.join(timeout=1) + + def _read_stream(self, response, emit, cancel, emit_reasoning=None, progressed=None): think = emit_reasoning or (lambda _text: None) text = "" calls: dict[int, dict] = {} @@ -305,6 +388,9 @@ def _read(self, response, emit, cancel, emit_reasoning=None): raise RuntimeError( "provider stream did not complete successfully" ) + elif (kind in {"response.function_call_arguments.delta", "response.output_item.added"} + and progressed and (event.get("delta") or (event.get("item") or {}).get("type") == "function_call")): + progressed(event) elif self.surface == "anthropic": index = event.get("index", 0) if kind == "content_block_start": @@ -318,6 +404,8 @@ def _read(self, response, emit, cancel, emit_reasoning=None): blocks[index]["text"] = blocks[index].get("text", "") + delta_text elif delta.get("type") == "input_json_delta": blocks[index]["_json"] += delta.get("partial_json", "") + if delta.get("partial_json") and progressed: + progressed(event) elif delta.get("type") == "thinking_delta": reasoning_text = delta.get("thinking", "") blocks[index]["thinking"] = blocks[index].get("thinking", "") + reasoning_text @@ -349,6 +437,8 @@ def _read(self, response, emit, cancel, emit_reasoning=None): if isinstance(value, str): reasoning_text += value for item in delta.get("tool_calls") or []: + if progressed: + progressed(item) item = item or {} entry = calls.setdefault(item.get("index", 0), {"id": "", "type": "function", "function": {"name": "", "arguments": ""}}) if item.get("id"): diff --git a/backend/competition/service.py b/backend/competition/service.py index ace1a50..cf8b13e 100644 --- a/backend/competition/service.py +++ b/backend/competition/service.py @@ -36,7 +36,6 @@ from backend.ops.models import PlatformWorkflowSpec from backend.ops.service import OpsAgentService -# Error boundaries keep their recovery behavior and retain debug diagnostics. _recovery_logger = logging.getLogger(__name__) TERMINAL_RUN_STATES = {"finished", "stopped"} @@ -150,6 +149,17 @@ def __init__( self._receiver_cursors: dict[str, int] = {} self._stale_job_seconds = 1800 self._resource_capacity: dict[str, dict] = {} + self.phase_metrics: dict[str, dict] = {} + + def _phase(self, name: str, operation, *args, **kwargs): + started = time.monotonic() + try: + return operation(*args, **kwargs) + finally: + previous = self.phase_metrics.get(name, {}) + duration = round(time.monotonic()-started, 6) + self.phase_metrics[name] = {"last_seconds": duration, "max_seconds": max(duration, previous.get("max_seconds", 0)), + "calls": previous.get("calls", 0)+1} @property def ops(self) -> OpsAgentService: @@ -496,37 +506,66 @@ def _challenge_metadata(item) -> dict[str, Any]: metadata["score"] = score return metadata - def control(self, run_id: str, action: str, revision: int) -> dict: - if not self._tick_lock.acquire(timeout=20): - error = CompetitionConflict("another competition operation is in progress; retry after 20 seconds") - error.retry_after = 20 - raise error + def control(self, run_id: str, action: str, revision: int, operation_id: str | None = None) -> dict: + if not self._tick_lock.acquire(blocking=False): + if not callable(getattr(self.store, "queue_control", None)): + error = CompetitionConflict("another competition operation is in progress; retry after 20 seconds") + error.retry_after = 20 + raise error + operation = self.store.queue_control(run_id, action, revision, operation_id) + self.wake() + return {**self.store.run_snapshot(run_id), "control_operation": operation} try: - run = self.store.get_run(run_id) - if run["revision"] != revision: - raise CompetitionConflict("stale run revision") - if action == "refresh": - self._refresh_unlocked(run_id) - return self.store.run_snapshot(run_id) - target = {"pause": "paused", "resume": "running", "stop": "stopped"}.get(action) - if target is None: - raise ValueError("unsupported run action") - changed = self.store.transition_run( - run_id, target, revision=revision, - permit_active=action == "stop", - ) - if action == "stop": - self._teardown_stopped_run(run_id, run) - elif action == "pause": - self._stop_run_projects(run_id) - self.store.release_run_assignments(run_id) - self.store.append_run_event(run_id, f"run.{target}", {}) - if action == "resume": + if operation_id: + operation = self.store.queue_control(run_id, action, revision, operation_id) self.wake() - return self.store.run_snapshot(changed["id"]) + return {**self.store.run_snapshot(run_id), "control_operation": operation} + return self._control_unlocked(run_id, action, revision) finally: self._tick_lock.release() + def _control_unlocked(self, run_id: str, action: str, revision: int) -> dict: + run = self.store.get_run(run_id) + if run["revision"] != revision: + raise CompetitionConflict("stale run revision") + if action == "refresh": + self._refresh_unlocked(run_id) + return self.store.run_snapshot(run_id) + target = {"pause": "paused", "resume": "running", "stop": "stopped"}.get(action) + if target is None: + raise ValueError("unsupported run action") + if run["status"] != target: + self.store.transition_run(run_id, target, revision=revision, permit_active=action == "stop") + if action == "stop": + self._teardown_stopped_run(run_id, run) + elif action == "pause": + self._stop_run_projects(run_id) + self.store.release_run_assignments(run_id) + self.store.append_run_event(run_id, f"run.{target}", {}) + if action == "resume": + self.wake() + return self.store.run_snapshot(run_id) + + def _process_controls(self) -> bool: + if not callable(getattr(self.store, "claim_control", None)): + return False + processed = False + for _ in range(10): + operation = self.store.claim_control(self.owner) + if operation is None: + break + error = None + try: + run = self.store.get_run(operation["run_id"]) + self._control_unlocked(run["id"], operation["action"], run["revision"]) + except Exception as exc: + error = f"{type(exc).__name__}: {exc}"[:2000] + if self.store.finish_control(operation, error=error): + self.store.append_run_event(operation["run_id"], "run.control_failed" if error else "run.control_completed", + {"operation_id": operation["id"], "action": operation["action"], "error": error}) + processed = True + return processed + def update_limits(self, run_id: str, limits: dict, revision: int) -> dict: if not self._tick_lock.acquire(timeout=20): error = CompetitionConflict("another competition operation is in progress; retry after 20 seconds") @@ -909,13 +948,12 @@ def tick(self) -> None: if not self._tick_lock.acquire(blocking=False): return try: + self._process_controls() self._retry_pending_instance_stops() run = self.store.active_run() if run is None or not self.store.claim_run_lease(run["id"], self.owner): return if run["status"] == "blocked": - # A process restart must reclaim an expired run lease and - # re-run the inexpensive platform preflight before resuming. due = _timestamp(run.get("next_sync_at")) if due is None or due <= datetime.now(timezone.utc): try: @@ -973,12 +1011,16 @@ def tick(self) -> None: self._check_message_delivery(run) self._sweep_stale_jobs(run) self._renew_project_engines(run) + if self._process_controls(): + return if run["status"] == "running": self._sync_orchestrator_assignments(run) - self._renew_instances(run) - self._repair_assigned_instances(run) + self._phase("instance_renewal", self._renew_instances, run) + self._phase("instance_repair", self._repair_assigned_instances, run) self._publish_instance_entries(run) - self._process_submissions( + if self._process_controls(): + return + self._phase("submissions", self._process_submissions, run, allow_new=run["status"] == "running", ) @@ -1428,27 +1470,43 @@ def _record_observation(self, run: dict) -> None: ) def _stop_expired_challenges(self, run: dict) -> None: - expired_ids = { - item["id"] for item in self.store.challenges(run["id"]) - if item["state"] == "expired" - } - if not expired_ids: - return orchestrator = self.state.orchestrator platform = self._platform_for_run(run) for challenge in self.store.challenges(run["id"]): - if challenge["id"] not in expired_ids: + if challenge["state"] != "expired": continue - if challenge.get("project_id"): - if orchestrator is not None: - with suppress(Exception): + with self.state.db.connect() as connection: + claimed = connection.execute( + """UPDATE competition_challenges SET metadata=metadata || %s + WHERE id=%s AND state='expired' + AND COALESCE(metadata->>'expiry_cleanup_state','')<>'done' + AND (metadata->>'expiry_cleanup_after' IS NULL + OR (metadata->>'expiry_cleanup_after')::timestamptz<=now()) + RETURNING id""", + (Jsonb({"expiry_cleanup_state": "running", "expiry_cleanup_after": ( + datetime.now(timezone.utc) + timedelta(seconds=60) + ).isoformat()}), challenge["id"]), + ).fetchone() + if claimed is None: + continue + try: + if challenge.get("project_id"): + if orchestrator is not None: orchestrator.stop_project(challenge["project_id"]) - self._release_project_engine(challenge["project_id"]) - if self._instance_ready(challenge["id"]): - self._stop_instance(run, challenge, platform=platform) - self.store.append_run_event( - run["id"], "challenge.expired", {"challenge_id": challenge["id"]} - ) + self._release_project_engine(challenge["project_id"]) + if self._instance_ready(challenge["id"]): + self._stop_instance(run, challenge, platform=platform) + except Exception as exc: + self.store.append_run_event( + run["id"], "challenge.cleanup_failed", + {"challenge_id": challenge["id"], "error": str(exc), "retry_after": 60}, + ) + continue + with self.state.db.connect() as connection: + connection.execute( + "UPDATE competition_challenges SET metadata=metadata || %s WHERE id=%s", + (Jsonb({"expiry_cleanup_state": "done"}), challenge["id"]), + ) def _release_external_solved(self, run: dict, challenge: dict) -> None: """Release local resources for a challenge solved outside this run.""" @@ -1839,10 +1897,14 @@ def _ensure_helper_intent( start_node = latest.node_id if not direction: direction = ( - "Cross-check the primary solver's findings on this challenge: " - "read the blackboard facts and the latest report first, then " - "independently verify the current hypothesis and explore a " - "different approach instead of repeating the main line." + "Helper contract: the primary owns the main exploit/solver. " + "Read the blackboard and /workspace/shared handoffs first. " + "Own one complementary subtask: verify a claimed property or test a distinct fallback hypothesis. " + "Do not independently redo the full primary analysis. Deliver concrete evidence and a runnable " + "artifact under /workspace/shared/// with its SHA-256 and run command. " + "Use publish_fact for verified milestones and send_message to notify the primary of the " + "handoff or a blocker; reply_to identifies the request being addressed. " + "Finish when that subtask is verified or its failure is evidenced." ) existing = edge_store.find_similar_open_intent( connection, project_id, [start_node], direction @@ -2025,6 +2087,9 @@ def _instance_next_renewal(value: Any, *, default_seconds: int = 300) -> datetim expiry = None if expiry is not None: remaining = max(5, int((expiry - now).total_seconds())) + margin = value.get("renew_before_seconds") + if isinstance(margin, (int, float)) and margin > 0: + return now + timedelta(seconds=max(5, remaining - margin)) return now + timedelta( seconds=max(5, min(3600, remaining // 2)) ) @@ -2130,10 +2195,10 @@ def _renew_instances(self, run: dict) -> None: except Exception as exc: _recovery_logger.debug('Error handled in _renew_instances', exc_info=True) message = str(exc).casefold() - # An expired/missing container is a state transition. Defer - # repair to the scheduler so every tick does not destroy and - # recreate the target (which causes entry drift and 429s). - if any(token in message for token in ("not created", "does not exist", "expired", "not found")): + reason = getattr(exc, "reason", "") + if reason in {"expired", "missing"} or (not reason and any( + token in message for token in ("not created", "does not exist", "expired", "not found") + )): with self.state.db.connect() as connection: connection.execute( """UPDATE competition_instances SET state='expired',next_renew_at=NULL, @@ -2143,70 +2208,25 @@ def _renew_instances(self, run: dict) -> None: ) self.store.append_run_event( run["id"], "instance.expired", - {"challenge_id": instance["challenge_id"], "reason": str(exc)}, + {"challenge_id": instance["challenge_id"], "reason": reason or "unavailable", + "renew_error": str(exc), "external_id": instance["external_id"]}, ) continue - rebuilt = getattr(platform, "rebuild_instance", None) - if callable(rebuilt): - try: - self.store.append_run_event(run["id"], "instance.rebuild_requested", {"challenge_id": instance["challenge_id"]}) - replacement = rebuilt(instance["external_id"]) - except Exception as rebuild_exc: - _recovery_logger.debug('Error handled in _renew_instances', exc_info=True) - replacement = None - self.store.append_run_event( - run["id"], "instance.rebuild_failed", - { - "challenge_id": instance["challenge_id"], - "error": str(rebuild_exc), - }, - ) - if replacement is not None: - if not isinstance(replacement, dict): - replacement = {"state": "ready"} - with self.state.db.connect() as connection: - connection.execute( - """UPDATE competition_instances - SET state='ready',metadata=%s,next_renew_at=%s,updated_at=now() - WHERE challenge_id=%s""", - ( - Jsonb(replacement), - self._instance_next_renewal(replacement), - instance["challenge_id"], - ), - ) - connection.execute( - """UPDATE competition_challenges - SET instance_generation=instance_generation+1 - WHERE id=%s""", - (instance["challenge_id"],), - ) - self.store.append_run_event( - run["id"], "instance.rebuilt", - { - "challenge_id": instance["challenge_id"], - "external_id": instance["external_id"], - }, - ) - logger = getattr(self.state, "logger", None) - log_project = getattr(logger, "project", None) - if callable(log_project): - log_project( - "instance.rebuilt", - str(instance["challenge_id"]), - run_id=run["id"], - external_id=instance["external_id"], - ) - continue + try: + retry_after = max(5, min(3600, int(getattr(exc, "retry_after", 60)))) + except (TypeError, ValueError): + retry_after = 60 with self.state.db.connect() as connection: connection.execute( - """UPDATE competition_instances SET next_renew_at=now()+interval '60 seconds', - updated_at=now() WHERE challenge_id=%s""", - (instance["challenge_id"],), + """UPDATE competition_instances SET next_renew_at=now()+(%s*interval '1 second'), + metadata=metadata || %s,updated_at=now() WHERE challenge_id=%s""", + (retry_after, Jsonb({"renew_error": str(exc), "renew_error_kind": reason or "transient"}), + instance["challenge_id"]), ) self.store.append_run_event( run["id"], "instance.renew_failed", - {"challenge_id": instance["challenge_id"], "error": str(exc)}, + {"challenge_id": instance["challenge_id"], "external_id": instance["external_id"], + "error": str(exc), "reason": reason or "transient", "retry_after": retry_after}, ) continue next_renewal = self._instance_next_renewal(renewed) @@ -2331,9 +2351,6 @@ def _start_instance(self, run: dict, challenge: dict) -> bool: def _process_submissions(self, run: dict, *, allow_new: bool = True) -> None: platform = self._platform_for_run(run) self._ingest_project_candidates(run) - # A platform verdict can be correct while local closeout is - # temporarily unavailable. Retry that durable fact until the project - # is actually solved and its seats are released. with self.state.db.connect() as connection: closeout_rows = connection.execute( """SELECT s.*,c.external_id,c.project_id FROM competition_submissions s @@ -2462,9 +2479,6 @@ def _on_correct(self, run: dict, challenge: dict, flag: str) -> None: if project_id: try: with self.state.db.connect() as connection: - # Operator/API submissions can bypass the Member tool. Add - # the same idempotent completion edge before accepting the - # verdict so closeout never leaves a solved seat stranded. self.store._lock(connection, run["id"]) connection.execute("SELECT id FROM projects WHERE id=%s FOR UPDATE", (project_id,)) goal = connection.execute( diff --git a/backend/competition/store.py b/backend/competition/store.py index 8a5efcf..a91f878 100644 --- a/backend/competition/store.py +++ b/backend/competition/store.py @@ -60,6 +60,66 @@ class CompetitionStore: def __init__(self, db): self.db = db + def queue_control(self, run_id: str, action: str, revision: int, operation_id: str | None = None) -> dict: + if action not in {"pause", "resume", "stop", "refresh"}: + raise ValueError("unsupported run action") + operation_id = operation_id or new_id() + with self.db.connect() as connection: + previous = connection.execute("SELECT * FROM competition_control_operations WHERE id=%s", (operation_id,)).fetchone() + if previous: + if (previous["run_id"], previous["action"], previous["requested_revision"]) != (run_id, action, revision): + raise CompetitionConflict("control operation id reused with different content") + return previous + run = connection.execute("SELECT revision FROM competition_runs WHERE id=%s", (run_id,)).fetchone() + if run is None: + raise KeyError(run_id) + if run["revision"] != revision: + raise CompetitionConflict("stale run revision") + connection.execute( + """INSERT INTO competition_control_operations(id,run_id,action,requested_revision) + VALUES (%s,%s,%s,%s) ON CONFLICT(id) DO NOTHING""", (operation_id, run_id, action, revision), + ) + operation = connection.execute("SELECT * FROM competition_control_operations WHERE id=%s", (operation_id,)).fetchone() + if (operation["run_id"], operation["action"], operation["requested_revision"]) != (run_id, action, revision): + raise CompetitionConflict("control operation id reused with different content") + return operation + + def claim_control(self, owner: str) -> dict | None: + with self.db.connect() as connection: + operation = connection.execute( + """UPDATE competition_control_operations SET status='running',owner=%s,epoch=epoch+1, + lease_expires_at=now()+interval '90 seconds' + WHERE id=(SELECT o.id FROM competition_control_operations o JOIN competition_runs r ON r.id=o.run_id + WHERE (o.status='queued' OR (o.status='running' AND o.lease_expires_at<=now())) + AND (r.status IN ('stopped','finished') OR r.lease_owner=%s + OR r.lease_expires_at IS NULL OR r.lease_expires_at<=now()) + ORDER BY o.created_at,o.id FOR UPDATE OF o SKIP LOCKED LIMIT 1) + RETURNING *""", (owner, owner), + ).fetchone() + if operation: + connection.execute( + """UPDATE competition_runs SET lease_owner=%s,lease_expires_at=now()+interval '90 seconds' + WHERE id=%s AND status NOT IN ('finished','stopped')""", (owner, operation["run_id"]), + ) + return operation + + def finish_control(self, operation: dict, *, error: str | None = None) -> bool: + with self.db.connect() as connection: + return connection.execute( + """UPDATE competition_control_operations SET status=%s,error=%s,finished_at=now(),lease_expires_at=NULL + WHERE id=%s AND owner=%s AND epoch=%s AND status='running' RETURNING id""", + ("failed" if error else "completed", error, operation["id"], operation["owner"], operation["epoch"]), + ).fetchone() is not None + + def control_operation(self, run_id: str, operation_id: str) -> dict: + with self.db.connect() as connection: + result = connection.execute( + "SELECT * FROM competition_control_operations WHERE id=%s AND run_id=%s", (operation_id, run_id), + ).fetchone() + if result is None: + raise KeyError(operation_id) + return result + def claim_engine_lease( self, project_id: str, kind: str, owner: str, *, seconds: int = 60 ) -> dict | None: @@ -1195,12 +1255,19 @@ def release_expired_assignments(self, run_id: str) -> list[dict]: self._expire_assignment_writers( connection, [row["session_id"] for row in rows] ) - connection.execute( + expired = connection.execute( """UPDATE competition_challenges SET state='expired' WHERE id IN (SELECT challenge_id FROM competition_run_challenges WHERE run_id=%s) - AND deadline_at IS NOT NULL AND deadline_at<=now() AND state NOT IN ('solved','cancelled')""", + AND deadline_at IS NOT NULL AND deadline_at<=now() + AND state NOT IN ('solved','cancelled','expired') RETURNING id""", (run_id,), - ) + ).fetchall() + for challenge in expired: + connection.execute( + """INSERT INTO competition_run_events(run_id,kind,payload) + VALUES (%s,'challenge.expired',%s)""", + (run_id, Jsonb({"challenge_id": challenge["id"]})), + ) return rows def recover_expired_assignments(self, run_id: str, owner: str) -> list[dict]: diff --git a/backend/persistence/migrations/versions/20261016_0012_control_operations.py b/backend/persistence/migrations/versions/20261016_0012_control_operations.py new file mode 100644 index 0000000..fb43a67 --- /dev/null +++ b/backend/persistence/migrations/versions/20261016_0012_control_operations.py @@ -0,0 +1,21 @@ +from alembic import op + +from backend.agent.schema import AGENT_SCHEMA +from backend.competition.control_schema import CONTROL_SCHEMA + +revision = "20261016_0012" +down_revision = "20261013_0011" +branch_labels = None +depends_on = None + + +def upgrade(): + for statement in CONTROL_SCHEMA: + op.execute(statement) + for statement in AGENT_SCHEMA: + if statement.startswith("CREATE OR REPLACE VIEW agent_session_health"): + op.execute(statement) + + +def downgrade(): + op.execute("DROP TABLE IF EXISTS competition_control_operations") diff --git a/backend/persistence/schema.py b/backend/persistence/schema.py index 68590d0..2bc3089 100644 --- a/backend/persistence/schema.py +++ b/backend/persistence/schema.py @@ -361,8 +361,9 @@ from backend.agent.schema import AGENT_SCHEMA +from backend.competition.control_schema import CONTROL_SCHEMA from backend.competition.schema import COMPETITION_SCHEMA -SCHEMA_STATEMENTS = (*SCHEMA_STATEMENTS, *COMPETITION_SCHEMA, *AGENT_SCHEMA) +SCHEMA_STATEMENTS = (*SCHEMA_STATEMENTS, *COMPETITION_SCHEMA, *AGENT_SCHEMA, *CONTROL_SCHEMA) SCHEMA_CONTRACT_STATEMENTS = (*SCHEMA_COMPATIBILITY_STATEMENTS, *SCHEMA_STATEMENTS) diff --git a/tests/test_competition_service_fixture.py b/tests/test_competition_service_fixture.py index a977587..1c4e663 100644 --- a/tests/test_competition_service_fixture.py +++ b/tests/test_competition_service_fixture.py @@ -1,11 +1,3 @@ -"""A database-backed competition coordinator acceptance flow. - -The platform is deterministic, but the run, assignments, leases, submissions, -and writeups all use the production PostgreSQL paths. This catches regressions -that isolated store tests cannot see, especially around the coordinator's -ordering of platform calls and durable state transitions. -""" - from __future__ import annotations import hashlib @@ -526,7 +518,7 @@ def test_paused_run_reconciles_pending_submission_and_renews_without_new_submit( db.close() -def test_instance_renewal_failure_rebuilds_and_fences_new_generation(tmp_path): +def test_transient_instance_renewal_failure_preserves_target_and_generation(tmp_path): platform = FixturePlatform( [PlatformChallenge( external_id="rebuild-remote", title="Rebuild remote", category="web", @@ -552,13 +544,12 @@ def test_instance_renewal_failure_rebuilds_and_fences_new_generation(tmp_path): ) service.tick() current = service.store.challenges(run_id)[0] - assert current["instance_generation"] == challenge["instance_generation"] + 1 - assert platform.rebuilds == ["rebuild-remote"] - assert any( - kind == "instance.rebuilt" - for kind, _fields in _state.logger.events - ) - assert platform.instances()[0]["generation"] == 2 + assert current["instance_generation"] == challenge["instance_generation"] + assert platform.rebuilds == [] + assert platform.instances()[0]["generation"] == 1 + events = service.store.run_events(run_id) + assert any(event["kind"] == "instance.renew_failed" for event in events) + assert not any(event["kind"] == "instance.rebuild_requested" for event in events) finally: service.shutdown() db.close() diff --git a/tests/test_plan_features.py b/tests/test_plan_features.py new file mode 100644 index 0000000..adbd3fd --- /dev/null +++ b/tests/test_plan_features.py @@ -0,0 +1,563 @@ +from __future__ import annotations + +import json +from types import SimpleNamespace + +from backend.agent.compaction import deterministic_summary, fit_history +from backend.competition.service import CompetitionService +from backend.ops.presets import GZCTFWorkflowInput, workflow_templates + + +def test_gzctf_preset_contains_only_platform_specific_inputs(): + assert workflow_templates()[0]["default"] is True + settings = GZCTFWorkflowInput( + base_url="https://ctf.example", game_id=33, name="Games 33", + attachment_base_url="https://cdn.example", secrets={"gzctf_token": "secret"}, + ) + spec = settings.workflow_spec() + assert spec.template_id == "gzctf" + assert spec.challenges.platform == "gzctf" + assert spec.challenges.game_id == 33 + assert spec.challenges.list_url == "https://ctf.example" + assert spec.challenges.attachment_base_url == "https://cdn.example" + + +def test_control_queue_is_accepted_when_tick_lock_is_busy(): + service = object.__new__(CompetitionService) + + class BusyLock: + def acquire(self, **_kwargs): + return False + + service._tick_lock = BusyLock() + service.wake = lambda: setattr(service, "woken", True) + service.store = SimpleNamespace( + queue_control=lambda run_id, action, revision, operation_id: { + "id": operation_id or "op", "run_id": run_id, "action": action, + "requested_revision": revision, "status": "queued", + }, + run_snapshot=lambda _run_id: {"run": {"id": "run"}}, + ) + result = service.control("run", "pause", 2, operation_id="op-1") + assert result["control_operation"]["id"] == "op-1" + assert service.woken is True + + +def test_control_worker_records_success_and_failure_without_holding_tick_lock(): + service = object.__new__(CompetitionService) + service.owner = "coordinator" + calls = [] + queue = [ + {"id": "op-1", "run_id": "run", "action": "pause", "owner": "coordinator", "epoch": 1}, + {"id": "op-2", "run_id": "run", "action": "stop", "owner": "coordinator", "epoch": 1}, + ] + service.store = SimpleNamespace( + claim_control=lambda _owner: queue.pop(0) if queue else None, + get_run=lambda _run_id: {"id": "run", "revision": 2}, + finish_control=lambda operation, error=None: calls.append((operation["id"], error)) or True, + append_run_event=lambda _run_id, kind, payload: calls.append((kind, payload)), + ) + service._control_unlocked = lambda _run_id, action, _revision: (_ for _ in ()).throw( + RuntimeError("fixture failure") + ) if action == "stop" else None + assert service._process_controls() is True + assert calls[0] == ("op-1", None) + assert calls[2][0] == "op-2" + assert "fixture failure" in calls[2][1] + + +def test_phase_metrics_record_last_and_max_duration(): + service = object.__new__(CompetitionService) + service.phase_metrics = {} + assert service._phase("demo", lambda: 42) == 42 + assert service.phase_metrics["demo"]["calls"] == 1 + assert service.phase_metrics["demo"]["last_seconds"] >= 0 + assert service.phase_metrics["demo"]["max_seconds"] >= 0 + + +def test_degraded_summary_carries_prior_facts_and_artifacts(): + artifact = {"path": "/workspace/shared/amber/task/out", "sha256": "b" * 64} + messages = [ + {"role": "user", "content": "task"}, + {"role": "user", "content": "[compacted context summary]\n" + json.dumps({ + "verified_facts": [{"claim": "port open", "evidence": "scan"}], + "artifacts": [artifact], + })}, + {"role": "assistant", "content": "old"}, + ] + summary, _tail = deterministic_summary(messages, keep_recent=1) + assert summary["verified_facts"][0]["claim"] == "port open" + assert artifact in summary["artifacts"] + + +def test_deterministic_summary_handles_malformed_and_anthropic_tool_blocks(): + messages = [ + {"role": "user", "content": "task"}, + "not a message", + {"role": "assistant", "content": [{"type": "tool_use", "name": "artifact_read"}]}, + {"role": "user", "content": "[compacted context summary]\nnot-json"}, + {"role": "user", "content": [{"type": "tool_result", "tool_use_id": "c1"}]}, + ] + summary, _tail = deterministic_summary(messages, keep_recent=1) + assert "artifact_read" in summary["verified_facts"][0]["claim"] + + +def test_fit_history_bounds_structured_blocks_and_rejects_unshrinkable_message(): + history = [{"role": "user", "content": "task"}, {"role": "user", "content": [ + {"type": "text", "text": "x" * 100_000}, {"type": "tool_result", "content": "y" * 100_000}, + "plain", + ]}] + bounded = fit_history(history, max_bytes=4096) + assert len(json.dumps(bounded).encode()) <= 4096 + try: + fit_history([{"role": "user", "content": "x" * 1000, "meta": "z" * 1000}], max_bytes=1024) + except ValueError as exc: + assert "opening context" in str(exc) + + +def test_fit_history_bounds_single_oversized_opening_message(): + history = [{"role": "user", "content": "x" * 100_000}] + bounded = fit_history(history, max_bytes=4096) + assert len(json.dumps(bounded).encode()) <= 4096 + + +def test_control_unlocked_handles_pause_resume_and_stop_branches(): + service = object.__new__(CompetitionService) + events = [] + service.wake = lambda: events.append("wake") + service._refresh_unlocked = lambda _run_id: events.append("refresh") + service._stop_run_projects = lambda _run_id: events.append("projects") + service._teardown_stopped_run = lambda *_args: events.append("teardown") + service.store = SimpleNamespace( + get_run=lambda _run_id: {"id": "run", "revision": 2, "status": "running"}, + transition_run=lambda *_args, **_kwargs: events.append("transition"), + release_run_assignments=lambda _run_id: events.append("release"), + append_run_event=lambda _run_id, kind, _payload: events.append(kind), + run_snapshot=lambda _run_id: {"run": {"id": "run"}}, + ) + assert service._control_unlocked("run", "pause", 2) == {"run": {"id": "run"}} + assert service._control_unlocked("run", "resume", 2) == {"run": {"id": "run"}} + assert service._control_unlocked("run", "stop", 2) == {"run": {"id": "run"}} + assert {"projects", "release", "teardown", "wake"}.issubset(events) + + +def test_control_operation_id_is_queued_even_when_lock_is_free(): + service = object.__new__(CompetitionService) + import threading + service._tick_lock = threading.Lock() + service.wake = lambda: setattr(service, "woken", True) + service.store = SimpleNamespace( + queue_control=lambda run_id, action, revision, operation_id: {"id": operation_id, "action": action}, + run_snapshot=lambda _run_id: {"run": {"id": "run"}}, + ) + result = service.control("run", "refresh", 2, operation_id="op-2") + assert result["control_operation"]["id"] == "op-2" + assert service.woken is True + + +def test_control_worker_without_store_queue_is_a_noop(): + service = object.__new__(CompetitionService) + service.store = SimpleNamespace() + assert service._process_controls() is False + + +def test_control_unlocked_rejects_stale_revision_and_unknown_action(): + service = object.__new__(CompetitionService) + service.store = SimpleNamespace(get_run=lambda _run_id: {"revision": 3, "status": "running"}) + import pytest + with pytest.raises(Exception, match="stale"): + service._control_unlocked("run", "pause", 2) + service.store = SimpleNamespace(get_run=lambda _run_id: {"revision": 2, "status": "running"}) + with pytest.raises(ValueError, match="unsupported"): + service._control_unlocked("run", "unknown", 2) + + +def test_expired_cleanup_is_claimed_once_and_marked_done(): + service = object.__new__(CompetitionService) + service.state = SimpleNamespace(orchestrator=None, db=None) + service.store = SimpleNamespace( + challenges=lambda _run_id: [{"id": "challenge", "state": "expired", "project_id": None}], + append_run_event=lambda *_args, **_kwargs: None, + ) + service._platform_for_run = lambda _run: object() + service._instance_ready = lambda _challenge_id: False + calls = [] + + class Connection: + def execute(self, sql, params=()): + calls.append((sql, params)) + return SimpleNamespace(fetchone=lambda: {"id": "challenge"}) + + class DB: + def connect(self): + class Context: + def __enter__(self): return Connection() + def __exit__(self, *_args): return None + return Context() + + service.state.db = DB() + service._stop_expired_challenges({"id": "run"}) + assert len(calls) == 2 + assert "expiry_cleanup_state" in calls[0][0] + assert "done" in str(calls[1][1]) + + +def test_expired_cleanup_skips_a_claim_already_owned_by_another_tick(): + service = object.__new__(CompetitionService) + service.state = SimpleNamespace(orchestrator=None, db=None) + service.store = SimpleNamespace( + challenges=lambda _run_id: [{"id": "challenge", "state": "expired", "project_id": None}], + append_run_event=lambda *_args, **_kwargs: None, + ) + service._platform_for_run = lambda _run: object() + service._instance_ready = lambda _challenge_id: False + + class DB: + def connect(self): + class Context: + def __enter__(self): return SimpleNamespace(execute=lambda *_args, **_kwargs: SimpleNamespace(fetchone=lambda: None)) + def __exit__(self, *_args): return None + return Context() + + service.state.db = DB() + service._stop_expired_challenges({"id": "run"}) + + +def test_instance_entry_publish_is_deduplicated_per_assignment_generation(): + service = object.__new__(CompetitionService) + service._published_instance_entries = set() + published = [] + service.publish_recon = lambda message: published.append(message) + service.store = SimpleNamespace( + assignments=lambda _run_id, active_only=True: [{ + "challenge_id": "challenge", "session_id": "session", "member": "amber", + "role": "primary", "epoch": 2, + }], + ) + service.state = SimpleNamespace(db=None) + + class Connection: + def execute(self, _sql, _params=()): + return SimpleNamespace(fetchall=lambda: [{ + "challenge_id": "challenge", "external_id": "1244", + "metadata": {"entry": "10.0.0.1:31337"}, "instance_generation": 3, + }]) + + class DB: + def connect(self): + class Context: + def __enter__(self): return Connection() + def __exit__(self, *_args): return None + return Context() + + service.state.db = DB() + service._publish_instance_entries({"id": "run"}) + service._publish_instance_entries({"id": "run"}) + assert len(published) == 1 + assert published[0].payload["instance_generation"] == 3 + + +def test_instance_entry_publish_skips_missing_entry_and_wp_and_records_publish_failure(): + service = object.__new__(CompetitionService) + service._published_instance_entries = set() + events = [] + service.publish_recon = lambda _message: (_ for _ in ()).throw(RuntimeError("bus down")) + service.store = SimpleNamespace( + assignments=lambda _run_id, active_only=True: [ + {"challenge_id": "missing", "session_id": "s1", "member": "amber", "role": "primary", "epoch": 1}, + {"challenge_id": "wp", "session_id": "s2", "member": "topaz", "role": "wp", "epoch": 1}, + {"challenge_id": "good", "session_id": "s3", "member": "agate", "role": "primary", "epoch": 1}, + ], + append_run_event=lambda _run, kind, payload: events.append((kind, payload)), + ) + service.state = SimpleNamespace(db=None) + + class DB: + def connect(self): + class Context: + def __enter__(self): + return SimpleNamespace(execute=lambda *_args, **_kwargs: SimpleNamespace(fetchall=lambda: [ + {"challenge_id": "missing", "external_id": "1", "metadata": {}, "instance_generation": 1}, + {"challenge_id": "wp", "external_id": "2", "metadata": {"entry": "x"}, "instance_generation": 1}, + {"challenge_id": "good", "external_id": "3", "metadata": {"entry": "x"}, "instance_generation": 1}, + ])) + def __exit__(self, *_args): return None + return Context() + service.state.db = DB() + service._publish_instance_entries({"id": "run"}) + assert events and events[-1][0] == "instance.entry_publish_failed" + + +def test_renewal_transient_retry_and_non_dict_success_paths(): + class DB: + def connect(self): + class Context: + def __enter__(self): + return SimpleNamespace(execute=lambda sql, _params=(): SimpleNamespace( + fetchall=lambda: [{"challenge_id": "c", "external_id": "3"}] if "SELECT * FROM competition_instances" in sql else [], + )) + def __exit__(self, *_args): return None + return Context() + + state = SimpleNamespace(db=DB()) + service = object.__new__(CompetitionService) + service.state = state + service.store = SimpleNamespace(append_run_event=lambda *_args: None) + class Failing: + def renew_instance(self, _external_id): + error = RuntimeError("temporary") + error.retry_after = "bad" + raise error + service._platform_for_run = lambda _run: Failing() + service._renew_instances({"id": "run"}) + + class NonDict: + def renew_instance(self, _external_id): return "renewed" + service._platform_for_run = lambda _run: NonDict() + service._renew_instances({"id": "run"}) + + +def test_instance_lifecycle_without_platform_support_returns_false(): + service = object.__new__(CompetitionService) + service._platform_for_run = lambda _run: SimpleNamespace(supports_instances=False) + assert service._start_instance({"id": "run"}, {"id": "c", "external_id": "3"}) is False + + +def test_renewal_schedule_uses_explicit_margin(): + from datetime import datetime, timedelta, timezone + now = datetime.now(timezone.utc) + due = CompetitionService._instance_next_renewal({ + "expires_at": (now + timedelta(seconds=600)).isoformat(), "renew_before_seconds": 300, + }) + assert 250 <= (due - now).total_seconds() <= 350 + + +def test_expire_at_competition_end_updates_unfinished_challenges(): + service = object.__new__(CompetitionService) + calls = [] + class DB: + def connect(self): + class Context: + def __enter__(self): + return SimpleNamespace(execute=lambda sql, params=(): calls.append((sql, params))) + def __exit__(self, *_args): return None + return Context() + service.state = SimpleNamespace(db=DB()) + service._expire_at_competition_end({"id": "run", "config_snapshot": {"workflow_spec": {"ends_at": "2000-01-01T00:00:00+00:00"}}}) + assert calls and "state='expired'" in calls[0][0] + + +def test_repair_assigned_expired_instance_starts_a_new_generation(): + service = object.__new__(CompetitionService) + service.store = SimpleNamespace( + assignments=lambda _run_id, active_only=True: [{"challenge_id": "c", "role": "primary"}], + challenges=lambda _run_id: [{"id": "c", "state": "solving"}], + append_run_event=lambda *_args: setattr(service, "repaired", True), + ) + service.state = SimpleNamespace(db=None) + class DB: + def connect(self): + class Context: + def __enter__(self): return SimpleNamespace(execute=lambda *_args: SimpleNamespace(fetchall=lambda: [{"challenge_id": "c"}])) + def __exit__(self, *_args): return None + return Context() + service.state.db = DB() + service._start_instance = lambda _run, _challenge: True + service._repair_assigned_instances({"id": "run"}) + assert service.repaired is True + + +def test_start_instance_ready_result_persists_metadata_and_bumps_generation(): + service = object.__new__(CompetitionService) + service.store = SimpleNamespace(append_run_event=lambda *_args: None) + service.state = SimpleNamespace(db=None) + class Platform: + supports_instances = True + def start_instance(self, _external_id): return {"state": "ready", "entry": "10.0.0.1:31337", "renew_after": 300} + service._platform_for_run = lambda _run: Platform() + calls = [] + class DB: + def connect(self): + class Context: + def __enter__(self): + return SimpleNamespace(execute=lambda sql, params=(): (calls.append((sql, params)) or SimpleNamespace(fetchone=lambda: None))) + def __exit__(self, *_args): return None + return Context() + service.state.db = DB() + assert service._start_instance({"id": "run"}, {"id": "c", "external_id": "3"}) is True + assert len(calls) == 3 + assert "instance_generation=instance_generation+1" in calls[2][0] + + +def test_start_instance_pending_result_is_recorded_without_admission(): + service = object.__new__(CompetitionService) + events = [] + service.store = SimpleNamespace(append_run_event=lambda _run, kind, payload: events.append((kind, payload))) + service.state = SimpleNamespace(db=None) + class Platform: + supports_instances = True + def start_instance(self, _external_id): return {"state": "pending", "entry": ""} + service._platform_for_run = lambda _run: Platform() + class DB: + def connect(self): + class Context: + def __enter__(self): return SimpleNamespace(execute=lambda *_args, **_kwargs: SimpleNamespace(fetchone=lambda: None)) + def __exit__(self, *_args): return None + return Context() + service.state.db = DB() + assert service._start_instance({"id": "run"}, {"id": "c", "external_id": "3"}) is False + assert events[-1][0] == "instance.start_pending" + + +def test_start_instance_failure_records_expired_repair(): + service = object.__new__(CompetitionService) + events = [] + service.store = SimpleNamespace(append_run_event=lambda _run, kind, payload: events.append((kind, payload))) + service.state = SimpleNamespace(db=None) + class Platform: + supports_instances = True + def start_instance(self, _external_id): raise RuntimeError("platform unavailable") + service._platform_for_run = lambda _run: Platform() + class DB: + def connect(self): + class Context: + def __enter__(self): return SimpleNamespace(execute=lambda *_args, **_kwargs: SimpleNamespace(fetchone=lambda: None)) + def __exit__(self, *_args): return None + return Context() + service.state.db = DB() + assert service._start_instance({"id": "run"}, {"id": "c", "external_id": "3"}) is False + assert events[-1][0] == "instance.start_failed" + + +def test_start_instance_respects_existing_ready_and_deferred_expired_records(): + service = object.__new__(CompetitionService) + service.store = SimpleNamespace(append_run_event=lambda *_args: None) + service.state = SimpleNamespace(db=None) + class Platform: + supports_instances = True + def start_instance(self, _external_id): raise AssertionError("must not start") + service._platform_for_run = lambda _run: Platform() + class DB: + def __init__(self, row): self.row = row + def connect(self): + row = self.row + class Context: + def __enter__(self): return SimpleNamespace(execute=lambda *_args, **_kwargs: SimpleNamespace(fetchone=lambda: row)) + def __exit__(self, *_args): return None + return Context() + service.state.db = DB({"state": "ready", "metadata": {}}) + assert service._start_instance({"id": "run"}, {"id": "c", "external_id": "3"}) is True + service.state.db = DB({"state": "expired", "metadata": {"repair_after": "2099-01-01T00:00:00+00:00"}}) + assert service._start_instance({"id": "run"}, {"id": "c", "external_id": "3"}) is False + + +def test_run_completion_drains_terminal_challenges_and_finishes_when_empty(): + service = object.__new__(CompetitionService) + events = [] + service.store = SimpleNamespace( + challenges=lambda _run_id: [{"state": "solved"}], + get_run=lambda _run_id: {"id": "run", "status": "running", "revision": 2}, + transition_run=lambda _run_id, status, **_kwargs: {"id": "run", "status": status, "revision": 3}, + release_run_assignments=lambda _run_id: events.append("release"), + append_run_event=lambda _run_id, kind, _payload: events.append(kind), + ) + service.state = SimpleNamespace(db=None) + service._stop_run_projects = lambda _run_id: events.append("stop") + class DB: + def connect(self): + class Context: + def __enter__(self): return SimpleNamespace(execute=lambda *_args, **_kwargs: SimpleNamespace(fetchone=lambda: None)) + def __exit__(self, *_args): return None + return Context() + service.state.db = DB() + service._advance_run_completion({"id": "run", "config_snapshot": {"workflow_spec": {"ends_at": ""}}}) + assert "run.draining" in events + + +def test_capacity_helpers_record_default_and_parse_mutable_limits(): + service = object.__new__(CompetitionService) + service._instance_capability_warnings = set() + events = [] + service.store = SimpleNamespace(append_run_event=lambda *args: events.append(args)) + service.state = SimpleNamespace(config=SimpleNamespace(limits=SimpleNamespace(max_concurrent_tasks=7))) + platform = SimpleNamespace(supports_instances=True, instance_limit=lambda: None, start_instance=lambda _id: {}) + run = {"id": "run", "limits": '{"max_concurrent_tasks": "bad"}', "config_snapshot": {"workflow_spec": {}}} + assert service._remote_instance_limit(run, platform) == 1 + assert service._remote_instance_limit(run, platform) == 1 + assert events and events[0][1] == "instance.limit_defaulted" + assert service._local_task_limit(run) == 7 + assert service._local_task_limit({"limits": {"max_concurrent_tasks": 3}}) == 3 + + +def test_renewal_helper_ignores_malformed_expiry_and_uses_default(): + service = object.__new__(CompetitionService) + before = __import__("datetime").datetime.now(__import__("datetime").timezone.utc) + result = service._instance_next_renewal({"expires_at": "not-a-date"}, default_seconds=17) + assert 10 <= (result - before).total_seconds() <= 25 + assert service._resolve_remote_limit({"remote_instance_limit": 2}, SimpleNamespace(supports_instances=False)) == (2, "workflow.remote_instance_limit") + from datetime import datetime, timezone + value = datetime.now(timezone.utc) + assert CompetitionService._instance_next_renewal({"expires_at": value}).tzinfo is not None + + +def test_member_message_job_wait_and_artifact_read_actions_are_bounded(): + import asyncio + + from backend.members.adapters import MemberAction + from backend.members.base_member import BaseMember + + class Logger: + def project(self, *_args, **_kwargs): pass + def tool(self, *_args, **_kwargs): pass + def memory(self, *_args, **_kwargs): pass + + sandbox = SimpleNamespace(read_page=lambda path, **kwargs: {"path": path, **kwargs}) + deps = SimpleNamespace( + sandbox=sandbox, logger=Logger(), db=None, memory=None, + registry=SimpleNamespace(search=lambda _query, **_kwargs: []), + mcps=SimpleNamespace(names=list), container_mcps={}, + runtime=SimpleNamespace(tool_output_bytes=4096), on_message=lambda *args: {"ok": True}, + on_fact=None, lease_owner=None, lease_token=None, competition_store=None, + ) + member = BaseMember("amber", SimpleNamespace(), deps) + member._jobs = lambda: SimpleNamespace(wait=lambda job_id, **kwargs: {"job_id": job_id, "state": "exited"}) + async def dispatch(action): + return await member._dispatch("project", "intent", "misc", action, 1, SimpleNamespace(), allow_intent=True) + message = asyncio.run(dispatch(MemberAction.from_obj({"action": "message", "receiver": "jade", "content": "check artifact"}))) + assert message.graph_action == "message" + waited = asyncio.run(dispatch(MemberAction.from_obj({"action": "job_wait", "job_id": "job1", "timeout": 2}))) + assert "exited" in waited.observation + page = asyncio.run(dispatch(MemberAction.from_obj({"action": "artifact_read", "path": "/workspace/shared/a", "offset": 0}))) + assert "workspace/shared/a" in page.observation + invalid = asyncio.run(dispatch(MemberAction.from_obj({"action": "message", "receiver": "amber", "content": "no"}))) + assert invalid.invalid_action is True + member._jobs = lambda: None + unavailable = asyncio.run(dispatch(MemberAction.from_obj({"action": "job_wait", "job_id": "job1"}))) + assert unavailable.invalid_action is True + bad_fact = asyncio.run(dispatch(MemberAction.from_obj({"action": "fact", "description": "", "evidence": ""}))) + assert bad_fact.invalid_action is True + bad_artifact = asyncio.run(dispatch(MemberAction.from_obj({ + "action": "fact", "description": "claim", "evidence": "evidence", + "artifacts": [{"path": "/tmp/out", "sha256": "bad"}], + }))) + assert bad_artifact.invalid_action is True + bad_install = asyncio.run(dispatch(MemberAction.from_obj({"action": "install", "manager": "unknown", "packages": ["x"]}))) + assert bad_install.invalid_action is True + searched = asyncio.run(dispatch(MemberAction.from_obj({"action": "tool_search", "query": "reverse"}))) + assert "tool_search:reverse" in searched.observation + bad_tool = asyncio.run(dispatch(MemberAction.from_obj({"action": "tool", "server": "", "tool": ""}))) + assert bad_tool.invalid_action is True + class MCP: + async def call_tool(self, *_args): raise RuntimeError("mcp unavailable") + mcp_error = asyncio.run(member._dispatch( + "project", "intent", "misc", MemberAction.from_obj({"action": "tool", "server": "browser", "tool": "fetch", "args": {}}), + 1, MCP(), allow_intent=True, + )) + assert "mcp unavailable" in mcp_error.observation + member._probe_cli_tools = lambda: {"readelf": True, "ghidra": False} + note = member._runtime_tool_inventory_note() + assert "available now: readelf" in note + assert "missing now: ghidra" in note + member.deps.sandbox = SimpleNamespace() + no_reader = asyncio.run(dispatch(MemberAction.from_obj({"action": "artifact_read", "path": "/workspace/shared/a"}))) + assert no_reader.invalid_action is True From bebb8fea1a80c694cb5df5d548b41ce5c39046e9 Mon Sep 17 00:00:00 2001 From: PureStream108 <1262364207@qq.com> Date: Sat, 17 Oct 2026 18:49:36 +0800 Subject: [PATCH 06/21] feat(ops): built-in workflow presets, TSecBench platform and question dismissal --- backend/api/ops_agent.py | 31 +- backend/api/questions.py | 13 +- backend/ops/ipc_mcp.py | 36 +- backend/ops/models.py | 10 +- backend/ops/presets.py | 123 ++++++ backend/ops/questions.py | 18 + backend/ops/service.py | 29 +- backend/platform/factory.py | 18 +- backend/platform/gzctf/adapter.py | 65 ++- backend/platform/mapping.py | 4 +- backend/platform/tsecbench/__init__.py | 17 + backend/platform/tsecbench/adapter.py | 554 +++++++++++++++++++++++++ tests/test_gzctf_adapter.py | 31 ++ tests/test_tsecbench.py | 321 ++++++++++++++ 14 files changed, 1240 insertions(+), 30 deletions(-) create mode 100644 backend/ops/presets.py create mode 100644 backend/platform/tsecbench/__init__.py create mode 100644 backend/platform/tsecbench/adapter.py create mode 100644 tests/test_tsecbench.py diff --git a/backend/api/ops_agent.py b/backend/api/ops_agent.py index 8e2daf5..780e1b5 100644 --- a/backend/api/ops_agent.py +++ b/backend/api/ops_agent.py @@ -22,6 +22,7 @@ from backend.core.state import AppState from backend.ops.attachments import MAX_UPLOAD_BYTES, OpsAttachmentStore from backend.ops.network import NetworkPolicyError +from backend.ops.presets import GZCTFWorkflowInput, TSECBenchWorkflowInput, workflow_templates from backend.ops.service import ( OpsAgentNotConfigured, OpsAgentService, @@ -108,7 +109,6 @@ def validate_select(cls, value: list[str] | None) -> list[str] | None: -# FastAPI resolves request values from these reusable declaration markers. _GET_STATE_DEPENDENCY = Depends(get_state) def get_ops_service(state: AppState = _GET_STATE_DEPENDENCY) -> OpsAgentService: @@ -124,7 +124,6 @@ def get_ops_service(state: AppState = _GET_STATE_DEPENDENCY) -> OpsAgentService: -# FastAPI resolves request values from these reusable declaration markers. _GET_OPS_SERVICE_DEPENDENCY = Depends(get_ops_service) @router.get("/config") @@ -200,7 +199,6 @@ def events(): -# FastAPI resolves request values from these reusable declaration markers. _REQUIRED_UPLOAD_FILE = File(...) @router.post("/uploads") @@ -235,6 +233,33 @@ def list_workflows(service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return {"workflows": service.list_workflows()} +@router.get("/workflow-templates") +def list_workflow_templates(): + return {"default": "gzctf", "templates": workflow_templates()} + + +@router.post("/workflows/gzctf", status_code=status.HTTP_201_CREATED) +def create_gzctf_workflow(body: GZCTFWorkflowInput, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): + return _call(service.configure_gzctf_workflow, {**body.model_dump(), "secrets": body.secrets}) + + +@router.put("/workflows/{workflow_id}/gzctf") +def update_gzctf_workflow(workflow_id: str, body: GZCTFWorkflowInput, + service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): + return _call(service.configure_gzctf_workflow, {**body.model_dump(), "secrets": body.secrets}, workflow_id=workflow_id) + + +@router.post("/workflows/tsecbench", status_code=status.HTTP_201_CREATED) +def create_tsecbench_workflow(body: TSECBenchWorkflowInput, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): + return _call(service.configure_tsecbench_workflow, {**body.model_dump(), "secrets": body.secrets}) + + +@router.put("/workflows/{workflow_id}/tsecbench") +def update_tsecbench_workflow(workflow_id: str, body: TSECBenchWorkflowInput, + service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): + return _call(service.configure_tsecbench_workflow, {**body.model_dump(), "secrets": body.secrets}, workflow_id=workflow_id) + + @router.post("/workflows", status_code=status.HTTP_201_CREATED) def create_workflow(body: WorkflowDraftRequest, service: OpsAgentService = _GET_OPS_SERVICE_DEPENDENCY): return _call( diff --git a/backend/api/questions.py b/backend/api/questions.py index 9c40770..74a7bc0 100644 --- a/backend/api/questions.py +++ b/backend/api/questions.py @@ -14,8 +14,11 @@ class Answer(BaseModel): value: str = Field(min_length=1, max_length=16384) +class Dismiss(BaseModel): + session_id: str + + -# FastAPI resolves request values from these reusable declaration markers. _GET_STATE_DEPENDENCY = Depends(get_state) @router.get("") @@ -23,6 +26,14 @@ def pending_questions(session_id: str, state=_GET_STATE_DEPENDENCY): return {"questions": QuestionStore(state).list(session_id)} +@router.post("/{question_id}/dismiss") +def dismiss_question(question_id: str, body: Dismiss, state=_GET_STATE_DEPENDENCY): + try: + return QuestionStore(state).dismiss(question_id, body.session_id) + except KeyError as exc: + raise HTTPException(404, "Question not found") from exc + + @router.post("/{question_id}/answer") def answer_question(question_id: str, body: Answer, state=_GET_STATE_DEPENDENCY): try: diff --git a/backend/ops/ipc_mcp.py b/backend/ops/ipc_mcp.py index 2dd5273..84b7086 100644 --- a/backend/ops/ipc_mcp.py +++ b/backend/ops/ipc_mcp.py @@ -26,7 +26,6 @@ from backend.ops.store import OpsStore from backend.ops.tools import OpsToolError, OpsToolExecutor -# Error boundaries keep their recovery behavior and retain debug diagnostics. _recovery_logger = logging.getLogger(__name__) _SESSION_ID_RE = re.compile(r"^ops_[a-f0-9]{16}$") @@ -61,7 +60,40 @@ def build_ipc_mcp(state_provider: Callable[[], AppState]) -> MCPServer: ) tools = _Tools(state_provider) - @server.tool(name="ipc_question", description="Ask for missing platform information. Return to the operator while pending; call again with the same operation key to read the answer. Credentials go into the workflow secret store; for native GZCTF use secret_name=gzctf_token (or gzctf_username/gzctf_password).") + @server.tool(name="ipc_gzctf_workflow", description=( + "Create or update the built-in default GZCTF workflow. Supply only platform base_url, " + "game_id and optional name/team_id/ends_at/remote_concurrency/attachment_base_url. " + "No HTTP mappings or platform probing are needed. Credentials must already be in the " + "workflow secret store or deployment environment; ask ipc_question for gzctf_token " + "after creating the draft when needed. Return the draft for normal confirmation." + )) + def gzctf_workflow(settings: dict[str, Any], workflow_id: str | None = None) -> dict[str, Any]: + from backend.ops.service import OpsAgentService + + if "secrets" in settings: + raise ValueError("use the structured workflow secret store for credentials") + state = state_provider() + service = getattr(state, "ops_agent_service", None) or OpsAgentService(state) + return service.configure_gzctf_workflow(settings, workflow_id=workflow_id) + + @server.tool(name="ipc_tsecbench_workflow", description=( + "Create or update the built-in default TSecBench benchmark workflow. Supply only " + "the platform base_url and optional name/team_id/remote_concurrency. No HTTP " + "mappings or platform probing are needed. The benchmark token goes into the " + "workflow secret store as benchmark_token; ask ipc_question with " + "secret_name=benchmark_token after creating the draft when it is missing. " + "Return the draft for normal confirmation." + )) + def tsecbench_workflow(settings: dict[str, Any], workflow_id: str | None = None) -> dict[str, Any]: + from backend.ops.service import OpsAgentService + + if "secrets" in settings: + raise ValueError("use the structured workflow secret store for credentials") + state = state_provider() + service = getattr(state, "ops_agent_service", None) or OpsAgentService(state) + return service.configure_tsecbench_workflow(settings, workflow_id=workflow_id) + + @server.tool(name="ipc_question", description="Ask for missing platform information. Return to the operator while pending; call again with the same operation key to read the answer. Credentials go into the workflow secret store; use secret_name=benchmark_token for a native TSecBench workflow, or secret_name=gzctf_token (or gzctf_username/gzctf_password) for native GZCTF.") def question(operation_key: str, title: str, options: list[str] | None = None, workflow_id: str | None = None, secret_name: str | None = None, ctx: Context | None = None) -> dict: diff --git a/backend/ops/models.py b/backend/ops/models.py index 4744114..36fd0a5 100644 --- a/backend/ops/models.py +++ b/backend/ops/models.py @@ -83,7 +83,7 @@ def validate_prefix(cls, value: str) -> str: class ChallengeMappingSpec(BaseModel): model_config = ConfigDict(extra="forbid") - platform: Literal["http_json", "ret2shell", "gzctf"] = "http_json" + platform: Literal["http_json", "ret2shell", "gzctf", "tsecbench"] = "http_json" game_id: int | None = None list_url: str = "" list_path: str = "data" @@ -118,6 +118,8 @@ def require_list_url_for_http_json(self) -> ChallengeMappingSpec: raise ValueError("list_url is required for the http_json platform") if self.platform == "gzctf" and self.game_id is None: raise ValueError("game_id is required for the gzctf platform") + if self.platform == "tsecbench" and not self.list_url.strip(): + raise ValueError("list_url is required for the tsecbench platform") return self @field_validator("attachment_base_url") @@ -243,11 +245,11 @@ class PlatformWorkflowSpec(BaseModel): model_config = ConfigDict(extra="forbid") name: str = Field(min_length=1, max_length=120) + template_id: Literal["", "gzctf", "tsecbench"] = "" + template_version: int = Field(default=1, ge=1, le=1) competition_id: str = Field(default="", max_length=256) team_id: str = Field(default="", max_length=256) ends_at: str = "" - # Maximum number of container challenges this run may execute in parallel. - # ``remote_instance_limit`` remains accepted for older workflow drafts. remote_concurrency: int = Field(default=0, ge=0, le=100) remote_instance_limit: int = Field(default=0, ge=0, le=100) challenges: ChallengeMappingSpec @@ -304,6 +306,8 @@ def allowed_secret_names(self) -> set[str]: "platform_token", } ) + if self.challenges.platform == "tsecbench": + names.update({"benchmark_token", "platform_token"}) return names diff --git a/backend/ops/presets.py b/backend/ops/presets.py new file mode 100644 index 0000000..1e157bf --- /dev/null +++ b/backend/ops/presets.py @@ -0,0 +1,123 @@ +from __future__ import annotations + +from urllib.parse import urlsplit + +from pydantic import BaseModel, ConfigDict, Field, field_validator + +from backend.ops.models import PlatformWorkflowSpec, _validate_http_url + +GZCTF_TEMPLATE_VERSION = 1 +TSECBENCH_TEMPLATE_VERSION = 1 +DEFAULT_WORKFLOW_TEMPLATE = "gzctf" + + +def workflow_templates() -> list[dict]: + return [ + { + "id": "gzctf", "name": "GZCTF", "version": GZCTF_TEMPLATE_VERSION, "default": True, + "required": ["base_url", "game_id"], + "optional": ["name", "team_id", "ends_at", "remote_concurrency", "attachment_base_url", "allow_private_networks"], + "secret_names": ["gzctf_token", "gzctf_username", "gzctf_password"], + "capabilities": ["challenges", "attachments", "submit", "query", "instances"], + }, + { + "id": "tsecbench", "name": "TSecBench", "version": TSECBENCH_TEMPLATE_VERSION, "default": False, + "required": ["base_url"], + "optional": ["name", "team_id", "remote_concurrency", "allow_private_networks"], + "secret_names": ["benchmark_token"], + "capabilities": ["challenges", "submit", "instances", "hint"], + }, + ] + + +class GZCTFWorkflowInput(BaseModel): + model_config = ConfigDict(extra="forbid") + + base_url: str = Field(max_length=2048) + game_id: int = Field(gt=0) + name: str = Field(default="", max_length=120) + team_id: str = Field(default="", max_length=256) + ends_at: str = "" + remote_concurrency: int = Field(default=0, ge=0, le=100) + attachment_base_url: str = "" + allow_private_networks: bool = False + max_attachment_bytes: int = Field(default=100 * 1024 * 1024, ge=1024, le=1024 * 1024 * 1024) + secrets: dict[str, str] = Field(default_factory=dict, repr=False, exclude=True) + + @field_validator("base_url") + @classmethod + def validate_base_url(cls, value: str) -> str: + value = _validate_http_url(value).rstrip("/") + parsed = urlsplit(value) + if parsed.query or parsed.path not in ("", "/"): + raise ValueError("base_url must be the GZCTF platform origin, for example https://ctf.example") + return value + + @field_validator("secrets") + @classmethod + def validate_secrets(cls, values: dict[str, str]) -> dict[str, str]: + allowed = {"gzctf_token", "gzctf_username", "gzctf_password", "platform_token"} + if set(values) - allowed: + raise ValueError("GZCTF credentials must use gzctf_token or gzctf_username/gzctf_password") + if any(not value.strip() or len(value) > 16384 for value in values.values()): + raise ValueError("credentials must contain 1 to 16384 characters") + return values + + def workflow_spec(self) -> PlatformWorkflowSpec: + return PlatformWorkflowSpec.model_validate({ + "name": self.name.strip() or f"GZCTF Game {self.game_id}", + "competition_id": str(self.game_id), "team_id": self.team_id, + "template_id": "gzctf", "template_version": GZCTF_TEMPLATE_VERSION, + "ends_at": self.ends_at, "remote_concurrency": self.remote_concurrency, + "allow_private_networks": self.allow_private_networks, + "max_attachment_bytes": self.max_attachment_bytes, + "challenges": {"platform": "gzctf", "game_id": self.game_id, + "list_url": self.base_url, "attachment_base_url": self.attachment_base_url}, + }) + + +class TSECBenchWorkflowInput(BaseModel): + """Personalization for one benchmark task; identity comes from the token. + + The task has no ids of its own, so ``competition_id`` and ``team_id`` get + stable operational defaults that keep run identity keys deterministic; + the token in the secret store is what actually scopes the challenge set. + """ + + model_config = ConfigDict(extra="forbid") + + base_url: str = Field(max_length=2048) + name: str = Field(default="", max_length=120) + team_id: str = Field(default="", max_length=256) + remote_concurrency: int = Field(default=0, ge=0, le=100) + allow_private_networks: bool = False + secrets: dict[str, str] = Field(default_factory=dict, repr=False, exclude=True) + + @field_validator("base_url") + @classmethod + def validate_base_url(cls, value: str) -> str: + value = _validate_http_url(value).rstrip("/") + parsed = urlsplit(value) + if parsed.query or parsed.path not in ("", "/"): + raise ValueError("base_url must be the TSecBench platform origin, for example https://tsecbench.example.com") + return value + + @field_validator("secrets") + @classmethod + def validate_secrets(cls, values: dict[str, str]) -> dict[str, str]: + allowed = {"benchmark_token", "platform_token"} + if set(values) - allowed: + raise ValueError("TSecBench credentials must use benchmark_token") + if any(not value.strip() or len(value) > 16384 for value in values.values()): + raise ValueError("credentials must contain 1 to 16384 characters") + return values + + def workflow_spec(self) -> PlatformWorkflowSpec: + return PlatformWorkflowSpec.model_validate({ + "name": self.name.strip() or "TSecBench Benchmark", + "competition_id": "tsecbench", "team_id": self.team_id.strip() or "benchmark", + "template_id": "tsecbench", "template_version": TSECBENCH_TEMPLATE_VERSION, + "remote_concurrency": self.remote_concurrency, + "allow_private_networks": self.allow_private_networks, + "challenges": {"platform": "tsecbench", "list_url": self.base_url}, + }) diff --git a/backend/ops/questions.py b/backend/ops/questions.py index f0e1e9f..3b26d05 100644 --- a/backend/ops/questions.py +++ b/backend/ops/questions.py @@ -23,6 +23,9 @@ def create(self, *, session_id: str, operation_key: str, title: str, secret_name = validate_secret_name(secret_name) if not workflow_id: raise ValueError("sensitive questions require a target workflow") + workflow = OpsStore(self.state.root, database=self.state.db).get_workflow(workflow_id) + if secret_name not in workflow["spec"].allowed_secret_names(): + raise ValueError("question secret_name is not allowed by the workflow") scoped_key = f"{session_id}:{operation_key}" with self.state.db.connect() as connection: if not connection.execute("SELECT id FROM sessions WHERE id=%s", (session_id,)).fetchone(): @@ -87,3 +90,18 @@ def result(self, question_id: str, session_id: str) -> dict: if not row: raise KeyError(question_id) return row + + def dismiss(self, question_id: str, session_id: str) -> dict: + with self.state.db.connect() as connection: + row = connection.execute( + """UPDATE competition_questions SET state='cancelled',answered_at=now() + WHERE id=%s AND ops_session_id=%s AND state='pending' RETURNING id,state""", + (question_id, session_id), + ).fetchone() + if row: + return row + row = connection.execute("SELECT id,state FROM competition_questions WHERE id=%s AND ops_session_id=%s", + (question_id, session_id)).fetchone() + if row is None: + raise KeyError(question_id) + return row diff --git a/backend/ops/service.py b/backend/ops/service.py index dca8d9c..d7871b5 100644 --- a/backend/ops/service.py +++ b/backend/ops/service.py @@ -37,7 +37,6 @@ from backend.platform.adapter import PlatformAdapter from backend.platform.factory import build_adapter -# Error boundaries keep their recovery behavior and retain debug diagnostics. _recovery_logger = logging.getLogger(__name__) _RUN_ID_RE = re.compile(r"^run_[A-Za-z0-9_-]{8,128}$") @@ -174,8 +173,6 @@ def __init__(self, state: AppState) -> None: self._run_condition = threading.Condition() self._run_threads: dict[str, threading.Thread] = {} self._run_threads_lock = threading.Lock() - # Remove only unreferenced historical drafts; session-bound and - # run-referenced workflows remain available for audit/replay. self.store.cleanup_duplicate_workflows() self._recover_stale_runs() @@ -830,6 +827,30 @@ def create_workflow( ) return self.workflow_view(workflow) + def configure_gzctf_workflow(self, data: dict[str, Any], *, workflow_id: str | None = None) -> dict[str, Any]: + from backend.ops.presets import GZCTFWorkflowInput + + settings = GZCTFWorkflowInput.model_validate(data) + spec = settings.workflow_spec() + if workflow_id: + existing = self.store.get_workflow(workflow_id) + if existing["spec"].challenges.platform != "gzctf": + raise ValueError("only a GZCTF workflow can be updated with the GZCTF template") + return self.update_workflow(workflow_id, spec.model_dump(), secrets_values=settings.secrets) + return self.create_workflow(spec.model_dump(), secrets_values=settings.secrets) + + def configure_tsecbench_workflow(self, data: dict[str, Any], *, workflow_id: str | None = None) -> dict[str, Any]: + from backend.ops.presets import TSECBenchWorkflowInput + + settings = TSECBenchWorkflowInput.model_validate(data) + spec = settings.workflow_spec() + if workflow_id: + existing = self.store.get_workflow(workflow_id) + if existing["spec"].challenges.platform != "tsecbench": + raise ValueError("only a TSecBench workflow can be updated with the TSecBench template") + return self.update_workflow(workflow_id, spec.model_dump(), secrets_values=settings.secrets) + return self.create_workflow(spec.model_dump(), secrets_values=settings.secrets) + def update_workflow( self, workflow_id: str, @@ -984,6 +1005,8 @@ def workflow_view(self, workflow: dict[str, Any]) -> dict[str, Any]: "updated_at": workflow["updated_at"], "spec": { "name": spec.name, + "template_id": spec.template_id, + "template_version": spec.template_version, "competition_id": spec.competition_id, "team_id": spec.team_id, "ends_at": spec.ends_at, diff --git a/backend/platform/factory.py b/backend/platform/factory.py index ac57201..558c6b3 100644 --- a/backend/platform/factory.py +++ b/backend/platform/factory.py @@ -1,4 +1,3 @@ -"""Construct platform adapters without leaking platform branches into IPC.""" from __future__ import annotations from collections.abc import Callable, Mapping @@ -11,6 +10,7 @@ from backend.platform.gzctf import GZCTFAdapter, GZCTFClient from backend.platform.mapping import FieldMapping from backend.platform.ret2shell import Ret2ShellAdapter, Ret2ShellClient +from backend.platform.tsecbench import TSECBenchAdapter, TSECBenchClient def build_adapter( @@ -34,6 +34,22 @@ def build_adapter( category_map=mapping.category_map, max_attachment_bytes=max_attachment_bytes, ) + if mapping.platform == "tsecbench": + resolved_base_url = base_url or mapping.list_url + if resolved_base_url: + parsed = urlsplit(resolved_base_url) + if parsed.scheme and parsed.netloc: + resolved_base_url = f"{parsed.scheme}://{parsed.netloc}" + return TSECBenchAdapter( + TSECBenchClient( + base_url=resolved_base_url, + token=(credentials.get("benchmark_token") or credentials.get("platform_token") or credentials.get("token") or ""), + ), + mapping, + max_attachment_bytes=max_attachment_bytes, + competition_id=competition_id, + team_id=team_id, + ) if mapping.platform == "gzctf": resolved_base_url = base_url or "" source_url = resolved_base_url or mapping.list_url diff --git a/backend/platform/gzctf/adapter.py b/backend/platform/gzctf/adapter.py index 337e4f0..c709e57 100644 --- a/backend/platform/gzctf/adapter.py +++ b/backend/platform/gzctf/adapter.py @@ -17,7 +17,6 @@ from backend.platform.adapter import PlatformAdapter from backend.platform.mapping import FieldMapping, PlatformChallenge -# Error boundaries keep their recovery behavior and retain debug diagnostics. _recovery_logger = logging.getLogger(__name__) class GZCTFError(RuntimeError): @@ -25,7 +24,16 @@ class GZCTFError(RuntimeError): class GZCTFLoginError(GZCTFError): - pass + reason = "auth_required" + + +class GZCTFInstanceError(GZCTFError): + """A classified lifecycle failure; a failed renewal never implies destruction.""" + + def __init__(self, message: str, *, reason: str, retry_after: int = 60): + super().__init__(message) + self.reason = reason + self.retry_after = max(5, min(3600, retry_after)) class GZCTFPreflightError(GZCTFError): @@ -85,11 +93,18 @@ def _find_level(track: dict[str, Any], level: int) -> dict[str, Any] | None: def _parse_time(value: Any) -> datetime | None: - if not value or not isinstance(value, str): + if value is None or isinstance(value, bool): return None + if isinstance(value, datetime): + return value if value.tzinfo else value.replace(tzinfo=UTC) try: - parsed = datetime.fromisoformat(value.replace("Z", "+00:00")) - except ValueError: + if isinstance(value, (int, float)) or str(value).strip().replace(".", "", 1).isdigit(): + seconds = float(value) + if seconds > 100_000_000_000: + seconds /= 1000 + return datetime.fromtimestamp(seconds, UTC) + parsed = datetime.fromisoformat(str(value).replace("Z", "+00:00")) + except (ValueError, TypeError, OverflowError, OSError): return None return parsed if parsed.tzinfo else parsed.replace(tzinfo=UTC) @@ -799,8 +814,10 @@ def _gz_instance_view(payload: Any) -> dict[str, Any]: if entry: view["entry"] = str(entry) view["url"] = str(entry) - if expires: - view["expires_at"] = str(expires) + expiry = _parse_time(expires) + if expiry is not None: + view["expires_at"] = expiry.isoformat().replace("+00:00", "Z") + view["renew_before_seconds"] = 300 return view @@ -818,22 +835,38 @@ def _gz_container_error(exc: requests.HTTPError, external_id: str) -> Exception: return GZCTFLoginError( "GZCTF container request was not authorized; provide a new token" ) - if status == 429: - return GZCTFError( - f"GZCTF rate limited the container request for challenge {external_id}" - ) - if status == 404: - return GZCTFError(f"GZCTF container challenge {external_id} does not exist") detail = "" try: detail = (response.text or "").strip()[:300] if response is not None else "" except Exception: _recovery_logger.debug('Error handled in _gz_container_error', exc_info=True) detail = "" + headers = getattr(response, "headers", {}) or {} + try: + retry_after = int(headers.get("Retry-After", "60")) + except (ValueError, TypeError): + retry_after = 60 + reason = "transient" + if status == 429: + reason = "rate_limited" + elif status == 404: + reason = "missing" + elif status == 400 and any(token in detail.casefold() for token in ( + "尚不可延长", "尚不能延长", "不可续期", "未到续期", "too early", "not yet", "cannot be extended yet", + )): + reason = "too_early" + elif any(token in detail.casefold() for token in ("expired", "not found", "not created", "已过期", "不存在")): + reason = "expired" suffix = f": {detail}" if detail else "" - return GZCTFError( - f"GZCTF container request for challenge {external_id} failed " - f"with status {status or 'unknown'}{suffix}" + if status == 429: + description = f"GZCTF rate limited the container request for challenge {external_id}" + elif status == 404: + description = f"GZCTF container challenge {external_id} does not exist" + else: + description = f"GZCTF container request for challenge {external_id} failed with status {status or 'unknown'}" + return GZCTFInstanceError( + f"{description}{suffix}", + reason=reason, retry_after=retry_after, ) diff --git a/backend/platform/mapping.py b/backend/platform/mapping.py index c05d767..c74d89a 100644 --- a/backend/platform/mapping.py +++ b/backend/platform/mapping.py @@ -8,7 +8,7 @@ class FieldMapping(BaseModel): model_config = ConfigDict(extra="forbid") - platform: Literal["http_json", "ret2shell", "gzctf"] = "http_json" + platform: Literal["http_json", "ret2shell", "gzctf", "tsecbench"] = "http_json" game_id: int | None = None list_url: str = "" list_path: str = "data" @@ -46,6 +46,8 @@ def require_list_url_for_http_json(self) -> FieldMapping: raise ValueError("list_url is required for the http_json platform") if self.platform == "gzctf" and self.game_id is None: raise ValueError("game_id is required for the gzctf platform") + if self.platform == "tsecbench" and not self.list_url: + raise ValueError("list_url is required for the tsecbench platform") return self @field_validator("level") diff --git a/backend/platform/tsecbench/__init__.py b/backend/platform/tsecbench/__init__.py new file mode 100644 index 0000000..e0655cf --- /dev/null +++ b/backend/platform/tsecbench/__init__.py @@ -0,0 +1,17 @@ +from backend.platform.tsecbench.adapter import ( + TSECBenchAdapter, + TSECBenchAuthError, + TSECBenchClient, + TSECBenchError, + TSECBenchInstanceError, + TSECBenchPreflightError, +) + +__all__ = [ + "TSECBenchAdapter", + "TSECBenchAuthError", + "TSECBenchClient", + "TSECBenchError", + "TSECBenchInstanceError", + "TSECBenchPreflightError", +] diff --git a/backend/platform/tsecbench/adapter.py b/backend/platform/tsecbench/adapter.py new file mode 100644 index 0000000..7c3aff0 --- /dev/null +++ b/backend/platform/tsecbench/adapter.py @@ -0,0 +1,554 @@ +from __future__ import annotations + +import hashlib +from pathlib import Path +from typing import Any + +import requests + +from backend.platform._common import PLATFORM_CATEGORIES +from backend.platform.adapter import PlatformAdapter +from backend.platform.mapping import FieldMapping, PlatformChallenge + +_DEFAULT_TIMEOUT = 30 + +_CATEGORY_KEYWORDS: tuple[tuple[str, tuple[str, ...]], ...] = ( + ("pwn", ( + "pwn", "pickle", "反序列化", "沙箱", "sandbox", "逃逸", "shellcode", + "内存破坏", "溢出", "overflow", "eval", "uaf", "heap", "rop", + "命令执行", "拿到服务器 shell", + )), + ("crypto", ( + "crypto", "rsa", "aes", "crc", "lcg", "csidh", "cipher", "mac", + "spn", "dsa", "otp", "口令", "密钥", "加密", "解密", "密码", "素数", + "背包", "置换群", "预言机", "bloom", "布隆", + )), + ("web", ( + "web", "http", "sql", "waf", "jwt", "spring", "flask", "博客", + "登录", "注册", "网站", "注入", "表单", "渲染", "ssti", "网关", + "cookie", "反向代理", "版本库", "git", + )), + ("reverse", ( + "逆向", "reverse", "加壳", "packed", "反调试", "二进制", "binary", + "可执行文件", "verilog", "固件", "文字冒险", "游戏", "crush", + )), + ("misc", ( + "取证", "应急响应", "forensics", "流量", "抓包", "邮件", "eml", + "日志", "隐写", "pcap", + )), +) + + +class TSECBenchError(RuntimeError): + """Classified platform failure; ``reason`` drives scheduler retries.""" + + def __init__( + self, message: str, *, reason: str = "transient", retry_after: int = 60 + ) -> None: + super().__init__(message) + self.reason = reason + self.retry_after = int(retry_after) + + +class TSECBenchAuthError(TSECBenchError): + """The benchmark token is missing or was rejected by the task.""" + + def __init__(self, message: str) -> None: + super().__init__(message, reason="auth") + + +class TSECBenchPreflightError(TSECBenchError): + """The task cannot be started as configured (no challenges, no base URL).""" + + def __init__(self, message: str) -> None: + super().__init__(message, reason="preflight") + + +class TSECBenchInstanceError(TSECBenchError): + """Container lifecycle failure with a scheduler-actionable reason.""" + + +def _classify_error(response: Any) -> TSECBenchError: + """Translate one HTTP failure into a classified error. + + The scheduler reacts differently per reason: a quota or rate limit is + retried later, an invalid token needs a new credential, a missing + challenge is permanent, and an ended task rejects the operation outright. + """ + + status = int(getattr(response, "status_code", 0) or 0) + code = "" + message = "" + try: + payload = response.json() + if isinstance(payload, dict): + code = str(payload.get("code") or "") + message = str(payload.get("message") or "") + except (ValueError, TypeError): + pass + detail = f": {message}" if message else "" + if status in (401, 403) or code == "task_not_found": + return TSECBenchAuthError( + f"the benchmark token was rejected (HTTP {status or 'unknown'}{detail})" + ) + headers = getattr(response, "headers", {}) or {} + try: + retry_after = max(1, int(headers.get("Retry-After", "60"))) + except (TypeError, ValueError): + retry_after = 60 + if status == 429: + return TSECBenchError( + f"the platform rate limited the request{detail}", + reason="rate_limited", retry_after=retry_after, + ) + if code == "challenge_not_found": + reason = "missing" + elif code == "duplicate": + reason = "duplicate" + elif code in ("resource_unavailable", "internal_error"): + reason = "transient" + elif code == "invalid_state": + if any(marker in message for marker in ("上限", "limit", "quota", "活跃")): + reason = "quota" + else: + reason = "ended" + elif status >= 500: + reason = "transient" + elif status == 404: + reason = "missing" + elif status == 409: + reason = "ended" + else: + reason = "rejected" + description = f"TSecBench request failed (HTTP {status or 'unknown'}" + description += f" {code})" if code else ")" + return TSECBenchError( + f"{description}{detail}", reason=reason, retry_after=retry_after + ) + + +class TSECBenchClient: + """Minimal OpenAPI client for one benchmark task. + + Authentication is a single ``BENCHMARK_TOKEN`` header; the token scopes + every request to exactly one task, so there is no login flow, game id or + session state to maintain. + """ + + PATH_CHALLENGES = "/openapi/v1/challenges" + PATH_START = "/openapi/v1/challenges/start" + PATH_HINT = "/openapi/v1/challenges/hint" + PATH_SUBMIT = "/openapi/v1/challenges/submit" + PATH_CLOSE = "/openapi/v1/challenges/close" + + def __init__( + self, + base_url: str = "", + token: str = "", + *, + timeout: float = _DEFAULT_TIMEOUT, + session: Any = None, + ) -> None: + self.base_url = (base_url or "").strip().rstrip("/") + self.token = (token or "").strip() + self.timeout = timeout + self.session = session or requests.Session() + + def _require_config(self) -> None: + if not self.base_url: + raise TSECBenchPreflightError("TSecBench base_url is not configured") + if not self.token: + raise TSECBenchAuthError("the benchmark token is not configured") + + def _request( + self, + method: str, + path: str, + *, + params: dict[str, Any] | None = None, + json_body: dict[str, Any] | None = None, + ) -> Any: + self._require_config() + try: + response = self.session.request( + method, + f"{self.base_url}{path}", + params=params, + json=json_body, + headers={ + "BENCHMARK_TOKEN": self.token, + "Accept": "application/json", + }, + timeout=self.timeout, + ) + except requests.RequestException as exc: + raise TSECBenchError( + f"TSecBench request failed: {exc}", reason="transient" + ) from exc + if int(getattr(response, "status_code", 0) or 0) >= 400: + raise _classify_error(response) + if not getattr(response, "content", b""): + return None + try: + return response.json() + except ValueError as exc: + raise TSECBenchError( + "TSecBench returned a non-JSON response", reason="transient" + ) from exc + + def list_challenges(self) -> list[dict[str, Any]]: + payload = self._request("GET", self.PATH_CHALLENGES) + if not isinstance(payload, list): + raise TSECBenchError( + "TSecBench challenge list was not a JSON array", reason="transient" + ) + return [item for item in payload if isinstance(item, dict)] + + def start_container(self, unique_code: str) -> dict[str, Any]: + payload = self._request( + "POST", self.PATH_START, params={"unique_code": unique_code} + ) + return payload if isinstance(payload, dict) else {} + + def close_container(self, unique_code: str) -> dict[str, Any]: + payload = self._request( + "POST", self.PATH_CLOSE, params={"unique_code": unique_code} + ) + return payload if isinstance(payload, dict) else {} + + def hint(self, unique_code: str) -> dict[str, Any]: + payload = self._request( + "GET", self.PATH_HINT, params={"unique_code": unique_code} + ) + return payload if isinstance(payload, dict) else {} + + def submit_flag(self, unique_code: str, flag: str) -> dict[str, Any]: + payload = self._request( + "POST", + self.PATH_SUBMIT, + json_body={"unique_code": unique_code, "flag": flag}, + ) + return payload if isinstance(payload, dict) else {} + + def close(self) -> None: + closer = getattr(self.session, "close", None) + if callable(closer): + closer() + + +def _positive_int(value: Any, default: int) -> int: + try: + number = int(value) + except (TypeError, ValueError): + return default + return number if number >= 0 else default + + +class TSECBenchAdapter(PlatformAdapter): + """Challenge/instance/submit adapter for a TSecBench benchmark task.""" + + DEFAULT_INSTANCE_LIMIT = 3 + + def __init__( + self, + client: TSECBenchClient, + mapping: FieldMapping, + *, + max_attachment_bytes: int | None = None, + competition_id: str = "", + team_id: str = "", + ) -> None: + if mapping.platform != "tsecbench": + raise ValueError("TSECBenchAdapter requires a tsecbench FieldMapping") + self.client = client + self.mapping = mapping + self.max_attachment_bytes = max_attachment_bytes + self.competition_id = str(competition_id or "") + self.team_id = str(team_id or "") + self._by_id: dict[str, PlatformChallenge] = {} + self._instance_views: dict[str, dict[str, Any]] = {} + self._task_identity = "" + + @property + def identity(self) -> str: + scope = f"{self.client.base_url}/benchmark" + if self.competition_id: + scope += f"/task/{self.competition_id}" + if self.team_id: + scope += f"/team/{self.team_id}" + if self._task_identity: + scope += f"/set/{self._task_identity}" + return scope + + @property + def supports_submit(self) -> bool: + return True + + @property + def supports_instances(self) -> bool: + return all( + callable(getattr(self.client, name, None)) + for name in ("start_container", "close_container") + ) + + def instance_limit(self) -> int | None: + """The platform's documented concurrent-container cap. + + The OpenAPI exposes no limit field, so the published cap (three + active containers per task) is the only truthful value. + """ + return self.DEFAULT_INSTANCE_LIMIT + + def _category_override(self, text: str) -> str: + for keyword, category in self.mapping.category_map.items(): + if str(keyword).casefold() in text: + value = str(category).strip().lower() + return value if value in PLATFORM_CATEGORIES else "misc" + return "" + + def _category(self, raw: dict[str, Any]) -> str: + field = str(self.mapping.category_field or "").strip() + if field and raw.get(field) not in (None, ""): + value = str(raw.get(field)).strip().lower() + mapped = self._category_override(value) or value + if mapped in PLATFORM_CATEGORIES: + return mapped + haystack = f"{raw.get('unique_code', '')} {raw.get('description', '')}".casefold() + override = self._category_override(haystack) + if override: + return override + for category, keywords in _CATEGORY_KEYWORDS: + if any(keyword in haystack for keyword in keywords): + return category + return "misc" + + def _normalise(self, raw: dict[str, Any]) -> PlatformChallenge | None: + external = raw.get("unique_code") or raw.get(self.mapping.id_field) + if external in (None, ""): + return None + container_status = str(raw.get("container_status") or "").strip().lower() + addresses = [str(item) for item in raw.get("container_addr") or [] if item] + platform_data: dict[str, Any] = { + "difficulty": str(raw.get("difficulty") or ""), + "level": _positive_int(raw.get("level"), 1), + "score": raw.get("total_score"), + "total_score": raw.get("total_score"), + "flag_count": _positive_int(raw.get("flag_count"), 0), + "correct_flag_count": _positive_int(raw.get("correct_flag_count"), 0), + "container_status": container_status, + } + if addresses: + platform_data["container_addr"] = addresses + return PlatformChallenge( + external_id=str(external), + title=str(external), + category=self._category(raw), + description=str(raw.get("description") or ""), + attachment_urls=[], + remote=bool(container_status) or bool(addresses), + solved=bool(raw.get("is_completed")), + hints=[], + platform_data=platform_data, + ) + + def fetch_challenges(self) -> list[PlatformChallenge]: + raw_challenges = self.client.list_challenges() + if self.mapping.max_challenges: + raw_challenges = raw_challenges[: self.mapping.max_challenges] + result: list[PlatformChallenge] = [] + seen: set[str] = set() + refreshed: dict[str, PlatformChallenge] = {} + for raw in raw_challenges: + challenge = self._normalise(raw) + if challenge is None: + continue + if challenge.external_id in seen: + raise TSECBenchError( + f"duplicate TSecBench challenge id: {challenge.external_id}" + ) + seen.add(challenge.external_id) + refreshed[challenge.external_id] = challenge + result.append(challenge) + self._by_id = refreshed + if seen: + digest = hashlib.sha256(",".join(sorted(seen)).encode()).hexdigest() + self._task_identity = digest[:12] + return result + + def challenges(self) -> list[PlatformChallenge]: + self.fetch_challenges() + return [item.model_copy(deep=True) for item in self._by_id.values()] + + def preflight(self) -> list[PlatformChallenge]: + raw = self.client.list_challenges() + if not raw: + raise TSECBenchPreflightError( + "the benchmark task exposes no challenges; verify the benchmark token" + ) + return self.fetch_challenges() + + def _challenge(self, external_id: str) -> PlatformChallenge: + if external_id not in self._by_id: + self.fetch_challenges() + challenge = self._by_id.get(str(external_id)) + if challenge is None: + raise TSECBenchError( + f"unknown TSecBench challenge: {external_id}", reason="missing" + ) + return challenge + + @staticmethod + def _instance_view(payload: Any) -> dict[str, Any]: + addresses = [ + str(item) for item in (payload or {}).get("container_addr") or [] if item + ] + view: dict[str, Any] = {"state": "ready" if addresses else "pending"} + if addresses: + view["entry"] = addresses[0] + view["url"] = addresses[0] + view["addresses"] = addresses + return view + + def instances(self) -> list[dict[str, Any]]: + """Report the containers this task currently holds. + + The list endpoint carries the live ``container_status`` for every + challenge, which is the only place TSecBench exposes an existing + instance; the reconciliation reader uses it to retire orphans. + """ + if not self.supports_instances: + return [] + found: list[dict[str, Any]] = [] + for challenge in self.challenges(): + data = challenge.platform_data or {} + addresses = [str(item) for item in data.get("container_addr") or [] if item] + if str(data.get("container_status") or "") == "available" and addresses: + found.append( + { + "external_id": challenge.external_id, + **self._instance_view({"container_addr": addresses}), + } + ) + return found + + def start_instance(self, external_id: str) -> dict[str, Any]: + self._challenge(external_id) + if not self.supports_instances: + raise ValueError("TSecBench client does not expose the container lifecycle") + try: + payload = self.client.start_container(external_id) + except TSECBenchError as exc: + raise TSECBenchInstanceError( + str(exc), reason=exc.reason, retry_after=exc.retry_after + ) from exc + view = self._instance_view(payload) + if view["state"] != "ready": + raise TSECBenchInstanceError( + f"TSecBench returned no container address for challenge {external_id}", + reason="transient", retry_after=30, + ) + self._instance_views[str(external_id)] = view + return dict(view) + + def stop_instance(self, external_id: str) -> None: + if not self.supports_instances: + return + try: + self.client.close_container(external_id) + except TSECBenchError as exc: + if exc.reason == "missing": + return + raise TSECBenchInstanceError( + str(exc), reason=exc.reason, retry_after=exc.retry_after + ) from exc + self._instance_views.pop(str(external_id), None) + + def renew_instance(self, external_id: str) -> dict[str, Any]: + """Confirm a running container; TSecBench has no lease to extend. + + Containers live until closed or the task ends, so renewal is a + truthful re-read of the challenge list instead: a container that + silently stopped is reported expired so the scheduler repairs it. + """ + if not self.supports_instances: + raise ValueError("TSecBench client does not expose the container lifecycle") + container_status = "" + addresses: list[str] = [] + for raw in self.client.list_challenges(): + if str(raw.get("unique_code") or "") == str(external_id): + container_status = str(raw.get("container_status") or "").strip().lower() + addresses = [ + str(item) for item in raw.get("container_addr") or [] if item + ] + break + if container_status == "available" and addresses: + view = self._instance_view({"container_addr": addresses}) + self._instance_views[str(external_id)] = view + return dict(view) + raise TSECBenchInstanceError( + f"TSecBench container for challenge {external_id} is " + f"{container_status or 'gone'}", + reason="expired", retry_after=30, + ) + + def rebuild_instance(self, external_id: str) -> dict[str, Any]: + """Replace a container that could not be confirmed as running.""" + try: + self.client.close_container(external_id) + except TSECBenchError: + pass + return self.start_instance(external_id) + + def submit(self, external_id: str, flag: str) -> dict[str, Any]: + try: + payload = self.client.submit_flag(external_id, flag) + except TSECBenchError as exc: + if exc.reason == "auth": + return {"verdict": "auth_required"} + if exc.reason == "duplicate": + return {"verdict": "correct", "reason": str(exc)} + if exc.reason == "rate_limited": + return { + "verdict": "rate_limited", + "retry_after": getattr(exc, "retry_after", 60), + } + if exc.reason == "transient": + return {"verdict": "unknown", "reason": str(exc)} + return {"verdict": "rejected", "reason": str(exc)} + return self._normalise_submission(payload) + + @staticmethod + def _normalise_submission(payload: Any) -> dict[str, Any]: + if not isinstance(payload, dict): + return {"verdict": "unknown"} + correct = payload.get("correct") + if correct is True: + return { + "verdict": "correct", + "awarded": payload.get("awarded"), + "cumulative_score": payload.get("cumulative_score"), + "correct_flag_count": payload.get("correct_flag_count"), + "total_flag_count": payload.get("total_flag_count"), + "matched_flag_index": payload.get("matched_flag_index"), + } + if correct is False: + return {"verdict": "wrong"} + return {"verdict": "unknown"} + + def hint(self, external_id: str) -> dict[str, Any]: + """Read the optional hint. Reading it discounts later flag scores.""" + try: + return self.client.hint(external_id) + except TSECBenchError as exc: + return {"error": str(exc), "reason": getattr(exc, "reason", "transient")} + + def download_attachments( + self, challenge: PlatformChallenge, dest_dir: str | Path + ) -> list[Path]: + """TSecBench exposes no attachment endpoint. + + Challenge material (scripts, captures, binaries) lives inside each + challenge container and is served from the live target after the + container starts, so the import stage has nothing to download. + """ + return [] diff --git a/tests/test_gzctf_adapter.py b/tests/test_gzctf_adapter.py index c85f7cf..c224ab2 100644 --- a/tests/test_gzctf_adapter.py +++ b/tests/test_gzctf_adapter.py @@ -5,6 +5,36 @@ import pytest + +@pytest.mark.parametrize("value", [1792069200000, "1792069200000", 1792069200, "1792069200"]) +def test_gzctf_instance_epoch_expiry_is_normalized(value): + from backend.platform.gzctf.adapter import _gz_instance_view + + view = _gz_instance_view({"context": {"instanceEntry": "target:31337", "closeTime": value}}) + assert view["expires_at"] == "2026-10-15T13:00:00Z" + assert view["renew_before_seconds"] == 300 + + +@pytest.mark.parametrize("status,detail,reason", [ + (400, "容器时间尚不可延长", "too_early"), + (429, "rate limited", "rate_limited"), + (404, "container missing", "missing"), + (503, "upstream unavailable", "transient"), +]) +def test_gzctf_instance_errors_preserve_classification(status, detail, reason): + import requests + + from backend.platform.gzctf.adapter import _gz_container_error + + response = requests.Response() + response.status_code = status + response._content = detail.encode("utf-8") + response.encoding = "utf-8" + response.headers["Retry-After"] = "90" + error = _gz_container_error(requests.HTTPError(response=response), "21") + assert error.reason == reason + assert error.retry_after == 90 + from backend.competition.platform import CompetitionPlatform from backend.ops.models import PlatformWorkflowSpec from backend.platform.gzctf import GZCTFAdapter, GZCTFPreflightError @@ -385,6 +415,7 @@ def test_instances_report_only_live_container_entries(): "entry": "10.0.0.5:30001", "url": "10.0.0.5:30001", "expires_at": "2026-10-10T12:00:00Z", + "renew_before_seconds": 300, }] client.entry = "" diff --git a/tests/test_tsecbench.py b/tests/test_tsecbench.py new file mode 100644 index 0000000..b0ad663 --- /dev/null +++ b/tests/test_tsecbench.py @@ -0,0 +1,321 @@ +from __future__ import annotations + +import json + +import pytest + +from backend.platform.factory import build_adapter +from backend.platform.mapping import FieldMapping +from backend.platform.tsecbench import ( + TSECBenchAdapter, + TSECBenchAuthError, + TSECBenchClient, + TSECBenchError, + TSECBenchInstanceError, + TSECBenchPreflightError, +) + + +class _Response: + def __init__(self, payload=None, status_code: int = 200, headers: dict | None = None): + self.status_code = status_code + self._payload = payload + self.headers = headers or {} + self.content = json.dumps(payload).encode("utf-8") if payload is not None else b"{}" + + def json(self): + if self._payload is None: + raise ValueError("no payload") + return self._payload + + +class _Session: + def __init__(self, responses: list[_Response]): + self.responses = list(responses) + self.calls: list[tuple[str, str, dict]] = [] + + def request(self, method, url, **kwargs): + self.calls.append((method, url, kwargs)) + if not self.responses: + raise AssertionError("unexpected request") + return self.responses.pop(0) + + def close(self): + return None + + +def _error_payload(code: str, message: str = "") -> dict: + return {"code": code, "message": message or code, "detail": {}} + + +class _FakeClient: + """Duck-typed client double mirroring TSECBenchClient's surface.""" + + base_url = "https://tsecbench.zc.tencent.com" + + def __init__( + self, + challenges: list[dict] | None = None, + *, + start_result=None, + submit_result=None, + close_error: Exception | None = None, + ): + self.challenges_payload = challenges or [] + self.start_result = start_result if start_result is not None else {"container_addr": ["10.0.0.8:8080"]} + self.submit_result = submit_result if submit_result is not None else {"correct": True, "awarded": 300, "cumulative_score": 300, "correct_flag_count": 1, "total_flag_count": 1, "matched_flag_index": 0} + self.close_error = close_error + self.start_calls: list[str] = [] + self.submit_calls: list[tuple[str, str]] = [] + + def list_challenges(self): + return list(self.challenges_payload) + + def start_container(self, unique_code): + self.start_calls.append(unique_code) + if isinstance(self.start_result, Exception): + raise self.start_result + return self.start_result + + def close_container(self, unique_code): + if self.close_error is not None: + raise self.close_error + return {"unique_code": unique_code, "closed": True} + + def submit_flag(self, unique_code, flag): + self.submit_calls.append((unique_code, flag)) + if isinstance(self.submit_result, Exception): + raise self.submit_result + return self.submit_result + + def hint(self, unique_code): + return {"unique_code": unique_code, "hint": "try harder"} + + +def _challenge(code: str, description: str = "", **extra) -> dict: + base = { + "unique_code": code, + "description": description, + "difficulty": "easy", + "level": 1, + "total_score": 300, + "flag_count": 1, + "correct_flag_count": 0, + "is_completed": False, + "container_status": "stopped", + "container_addr": [], + } + base.update(extra) + return base + + +def _mapping(**extra) -> FieldMapping: + return FieldMapping( + platform="tsecbench", + list_url="https://tsecbench.zc.tencent.com", + **extra, + ) + + +def test_client_sends_token_header_and_parses_the_challenge_list(): + session = _Session([_Response([_challenge("g-01")])]) + client = TSECBenchClient("https://tsecbench.zc.tencent.com/", "tok-1", session=session) + items = client.list_challenges() + assert items[0]["unique_code"] == "g-01" + method, url, kwargs = session.calls[0] + assert method == "GET" + assert url == "https://tsecbench.zc.tencent.com/openapi/v1/challenges" + assert kwargs["headers"]["BENCHMARK_TOKEN"] == "tok-1" + + +def test_client_submit_posts_unique_code_and_flag(): + session = _Session([_Response({"correct": False, "awarded": 0})]) + client = TSECBenchClient("https://tsecbench.zc.tencent.com", "tok", session=session) + client.submit_flag("g-05", "HTB{flag}") + _, url, kwargs = session.calls[0] + assert url.endswith("/openapi/v1/challenges/submit") + assert kwargs["json"] == {"unique_code": "g-05", "flag": "HTB{flag}"} + + +@pytest.mark.parametrize( + "status,code,message,reason", + [ + (404, "task_not_found", "token invalid", "auth"), + (404, "challenge_not_found", "missing", "missing"), + (409, "duplicate", "already accepted", "duplicate"), + (409, "invalid_state", "当前活跃的题目实例数已达到上限", "quota"), + (409, "invalid_state", "任务已结束", "ended"), + (503, "resource_unavailable", "exhausted", "transient"), + (500, "internal_error", "boom", "transient"), + (422, "", "bad body", "rejected"), + ], +) +def test_client_error_classification(status, code, message, reason): + session = _Session([_Response(_error_payload(code, message), status_code=status)]) + client = TSECBenchClient("https://tsecbench.zc.tencent.com", "tok", session=session) + with pytest.raises(TSECBenchError) as raised: + client.list_challenges() + assert raised.value.reason == reason + if reason == "auth": + assert isinstance(raised.value, TSECBenchAuthError) + + +def test_client_requires_base_url_and_token(): + with pytest.raises(TSECBenchPreflightError): + TSECBenchClient("", "tok", session=_Session([])).list_challenges() + with pytest.raises(TSECBenchAuthError): + TSECBenchClient("https://tsecbench.zc.tencent.com", "", session=_Session([])).list_challenges() + + +def test_adapter_normalises_challenges_and_derives_categories(): + client = _FakeClient([ + _challenge("g-05", "RSA 加密脚本 source.py 与输出 output.txt", total_score=300), + _challenge("g-02", "pickle 服务逃逸沙箱,拿到代码执行", difficulty="hard", total_score=700), + _challenge("g-34", "老网站版本库泄露,藏在历史里"), + _challenge("x-99", "完全看不懂的东西"), + ]) + adapter = TSECBenchAdapter(client, _mapping()) + challenges = {item.external_id: item for item in adapter.fetch_challenges()} + assert challenges["g-05"].category == "crypto" + assert challenges["g-02"].category == "pwn" + assert challenges["g-34"].category == "web" + assert challenges["x-99"].category == "misc" + assert challenges["g-05"].remote is True + assert challenges["g-05"].title == "g-05" + assert challenges["g-05"].platform_data["score"] == 300 + assert challenges["g-05"].attachment_urls == [] + + +def test_adapter_category_map_keywords_override_the_builtin_table(): + client = _FakeClient([_challenge("g-05", "RSA 加密脚本")]) + adapter = TSECBenchAdapter(client, _mapping(category_map={"rsa": "reverse"})) + challenge = adapter.fetch_challenges()[0] + assert challenge.category == "reverse" + + +def test_adapter_preflight_fails_loudly_on_an_empty_task(): + adapter = TSECBenchAdapter(_FakeClient([]), _mapping()) + with pytest.raises(TSECBenchPreflightError): + adapter.preflight() + + +def test_adapter_instance_lifecycle_start_reads_and_renews(): + client = _FakeClient([ + _challenge("g-01", container_status="available", container_addr=["10.0.0.8:8080"]), + _challenge("g-02"), + ]) + adapter = TSECBenchAdapter(client, _mapping()) + assert adapter.supports_instances is True + assert adapter.instance_limit() == 3 + + view = adapter.start_instance("g-01") + assert view["state"] == "ready" + assert view["entry"] == "10.0.0.8:8080" + assert client.start_calls == ["g-01"] + + live = adapter.instances() + assert [item["external_id"] for item in live] == ["g-01"] + + renewed = adapter.renew_instance("g-01") + assert renewed["state"] == "ready" + assert renewed["addresses"] == ["10.0.0.8:8080"] + + +def test_adapter_start_without_an_address_is_a_retryable_failure(): + client = _FakeClient([_challenge("g-01")], start_result={"container_addr": []}) + adapter = TSECBenchAdapter(client, _mapping()) + with pytest.raises(TSECBenchInstanceError) as raised: + adapter.start_instance("g-01") + assert raised.value.reason == "transient" + + +def test_adapter_renew_reports_a_stopped_container_as_expired(): + client = _FakeClient([_challenge("g-01", container_status="stopped")]) + adapter = TSECBenchAdapter(client, _mapping()) + with pytest.raises(TSECBenchInstanceError) as raised: + adapter.renew_instance("g-01") + assert raised.value.reason == "expired" + + +def test_adapter_stop_swallows_a_missing_challenge_but_raises_others(): + missing = _FakeClient([], close_error=TSECBenchError("gone", reason="missing")) + TSECBenchAdapter(missing, _mapping()).stop_instance("g-01") + + busy = _FakeClient([], close_error=TSECBenchError("busy", reason="transient")) + with pytest.raises(TSECBenchInstanceError): + TSECBenchAdapter(busy, _mapping()).stop_instance("g-01") + + +@pytest.mark.parametrize( + "outcome,verdict,extra", + [ + ({"correct": True, "awarded": 300, "cumulative_score": 300, "correct_flag_count": 1, "total_flag_count": 1, "matched_flag_index": 0}, "correct", {"awarded": 300}), + ({"correct": False, "awarded": 0}, "wrong", {}), + (TSECBenchError("dup", reason="duplicate"), "correct", {}), + (TSECBenchAuthError("bad token"), "auth_required", {}), + (TSECBenchError("flaky", reason="transient"), "unknown", {}), + (TSECBenchError("gone", reason="missing"), "rejected", {}), + (TSECBenchError("ended", reason="ended"), "rejected", {}), + ], +) +def test_adapter_submit_maps_platform_results_to_verdicts(outcome, verdict, extra): + client = _FakeClient([_challenge("g-01")], submit_result=outcome) + adapter = TSECBenchAdapter(client, _mapping()) + result = adapter.submit("g-01", "HTB{flag}") + assert result["verdict"] == verdict + for key, value in extra.items(): + assert result[key] == value + assert client.submit_calls == [("g-01", "HTB{flag}")] + + +def test_adapter_download_attachments_is_empty_by_design(tmp_path): + adapter = TSECBenchAdapter(_FakeClient([_challenge("g-01")]), _mapping()) + challenge = adapter.fetch_challenges()[0] + assert adapter.download_attachments(challenge, tmp_path) == [] + + +def test_factory_builds_a_tsecbench_adapter_with_the_benchmark_token(): + adapter = build_adapter( + FieldMapping( + platform="tsecbench", + list_url="https://tsecbench.zc.tencent.com/openapi/v1/challenges", + ), + credentials={"benchmark_token": "tok-2"}, + ) + assert isinstance(adapter, TSECBenchAdapter) + assert adapter.client.base_url == "https://tsecbench.zc.tencent.com" + assert adapter.client.token == "tok-2" + + +def test_tsecbench_workflow_preset_builds_a_template_spec(): + from backend.ops.presets import TSECBenchWorkflowInput, workflow_templates + + templates = {item["id"]: item for item in workflow_templates()} + assert "tsecbench" in templates + assert templates["tsecbench"]["secret_names"] == ["benchmark_token"] + + settings = TSECBenchWorkflowInput( + base_url="https://tsecbench.zc.tencent.com", + name="", + secrets={"benchmark_token": "tok"}, + ) + spec = settings.workflow_spec() + assert spec.template_id == "tsecbench" + assert spec.challenges.platform == "tsecbench" + assert spec.challenges.list_url == "https://tsecbench.zc.tencent.com" + assert spec.team_id == "benchmark" + assert "benchmark_token" in spec.allowed_secret_names() + assert "benchmark_token" not in spec.required_secret_names() + assert spec.challenges.game_id is None + + +def test_tsecbench_workflow_preset_rejects_foreign_credentials(): + from backend.ops.presets import TSECBenchWorkflowInput + + with pytest.raises(Exception): + TSECBenchWorkflowInput( + base_url="https://tsecbench.zc.tencent.com", + secrets={"gzctf_token": "nope"}, + ) + with pytest.raises(Exception): + TSECBenchWorkflowInput(base_url="https://tsecbench.zc.tencent.com/openapi", secrets={}) From c415f88dfb2ec54dc8590e691ab4bae1f300a559 Mon Sep 17 00:00:00 2001 From: PureStream108 <1262364207@qq.com> Date: Sat, 17 Oct 2026 18:49:36 +0800 Subject: [PATCH 07/21] feat(core): runtime telemetry, health details and paged log reads --- backend/api/logs.py | 10 +++-- backend/core/logging_util.py | 53 +++++++++++++++++++++++- backend/core/telemetry.py | 78 ++++++++++++++++++++++++++++++++++++ backend/server/app.py | 13 +++++- 4 files changed, 147 insertions(+), 7 deletions(-) create mode 100644 backend/core/telemetry.py diff --git a/backend/api/logs.py b/backend/api/logs.py index 031e1cf..7d449e7 100644 --- a/backend/api/logs.py +++ b/backend/api/logs.py @@ -1,6 +1,6 @@ from __future__ import annotations -from fastapi import APIRouter, Depends +from fastapi import APIRouter, Depends, Query from pydantic import BaseModel from backend.api.deps import get_state @@ -24,7 +24,6 @@ class LogToggle(BaseModel): -# FastAPI resolves request values from these reusable declaration markers. _GET_STATE_DEPENDENCY = Depends(get_state) @router.get("/logs/status") @@ -147,8 +146,13 @@ def derive_project_logs(state: AppState = _GET_STATE_DEPENDENCY): @router.get("/logs/{project_id}") -def read_logs(project_id: str, kind: str = "project", limit: int = 500, state: AppState = _GET_STATE_DEPENDENCY): +def read_logs(project_id: str, kind: str = "project", limit: int = Query(default=500, ge=1, le=1000), + after: int | None = Query(default=None, ge=0), file_id: str = "", state: AppState = _GET_STATE_DEPENDENCY): with state.db.connect() as conn: row = graph_store.get_project_row(conn, project_id) secret = row["flag"] if row else None + if after is not None: + page = state.logger.read_since(kind, project_id, after=after, limit=limit, file_id=file_id) + page["entries"] = [redact_object(entry, secret) for entry in page["entries"]] + return page return {"entries": [redact_object(entry, secret) for entry in state.logger.read_log(kind, project_id, limit)]} diff --git a/backend/core/logging_util.py b/backend/core/logging_util.py index f74348e..253bedc 100644 --- a/backend/core/logging_util.py +++ b/backend/core/logging_util.py @@ -135,8 +135,57 @@ def _read_jsonl(text: str) -> list[dict]: @staticmethod def _tail(path: Path, limit: int | None) -> list[dict]: - entries = IPCLogger._read_array(path) - return entries if limit is None else entries[-limit:] + if not path.is_file(): + return [] + if limit is None or path.suffix == ".json": + entries = IPCLogger._read_array(path) + return entries if limit is None else entries[-limit:] + if limit <= 0: + return [] + with path.open("rb") as handle: + handle.seek(0, 2) + position = handle.tell() + chunks = [] + newlines = 0 + while position and newlines <= limit: + size = min(position, 16384) + position -= size + handle.seek(position) + chunk = handle.read(size) + chunks.append(chunk) + newlines += chunk.count(b"\n") + data = b"".join(reversed(chunks)) + if position: + data = data.partition(b"\n")[2] + return IPCLogger._read_jsonl(data.decode("utf-8", "replace"))[-limit:] + + def read_since(self, kind: str, project_id: str, *, after: int = 0, + limit: int = 500, file_id: str = "") -> dict: + path = self._file(kind, project_id) + if not path.is_file(): + return {"entries": [], "next_offset": 0, "file_id": "", "has_more": False} + stat = path.stat() + identity = f"{stat.st_dev}:{stat.st_ino}" + if file_id and file_id != identity or after > stat.st_size: + after = 0 + records = [] + with path.open("rb") as handle: + handle.seek(max(0, after)) + while len(records) < max(1, min(1000, limit)): + position = handle.tell() + line = handle.readline() + if not line or not line.endswith(b"\n"): + handle.seek(position) + break + try: + record = json.loads(line) + except (ValueError, UnicodeError): + continue + if isinstance(record, dict): + records.append(record) + offset = handle.tell() + return {"entries": records, "next_offset": offset, "file_id": identity, + "has_more": offset < path.stat().st_size} @staticmethod def jsonl_text(entries: list[dict]) -> str: diff --git a/backend/core/telemetry.py b/backend/core/telemetry.py new file mode 100644 index 0000000..ae6d97b --- /dev/null +++ b/backend/core/telemetry.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +import asyncio +import faulthandler +import os +import threading +import time +from contextlib import suppress +from pathlib import Path + + +class RuntimeTelemetry: + def __init__(self, root: Path, *, stall_seconds: float = 10): + self.root = root + self.stall_seconds = stall_seconds + self.last_heartbeat = time.monotonic() + self.loop_lag_seconds = 0.0 + self.max_loop_lag_seconds = 0.0 + self._done = threading.Event() + self._task = None + self._thread = None + + def start(self): + self.last_heartbeat = time.monotonic() + self._task = asyncio.create_task(self._heartbeat()) + self._thread = threading.Thread(target=self._watch, name="ipc-loop-diagnostics", daemon=True) + self._thread.start() + + async def _heartbeat(self): + while not self._done.is_set(): + before = time.monotonic() + await asyncio.sleep(.5) + now = time.monotonic() + self.loop_lag_seconds = max(0, now - before - .5) + self.max_loop_lag_seconds = max(self.max_loop_lag_seconds, self.loop_lag_seconds) + self.last_heartbeat = now + + def _watch(self): + last_dump = 0.0 + while not self._done.wait(.5): + now = time.monotonic() + if now-self.last_heartbeat >= self.stall_seconds and now-last_dump >= 60: + last_dump = now + directory = self.root / "logs" / "runtime" + directory.mkdir(parents=True, exist_ok=True) + with (directory / "event-loop-stalls.log").open("ab") as stream: + stream.write(f"pid={os.getpid()} monotonic={now:.6f} stalled_seconds={now-self.last_heartbeat:.3f}\n".encode()) + stream.flush() + faulthandler.dump_traceback(file=stream, all_threads=True) + + def snapshot(self, state=None) -> dict: + result = {"pid": os.getpid(), "threads": threading.active_count(), + "cpu_seconds": round(time.process_time(), 6), + "event_loop_lag_seconds": round(self.loop_lag_seconds, 6), + "max_event_loop_lag_seconds": round(self.max_loop_lag_seconds, 6), + "heartbeat_age_seconds": round(time.monotonic()-self.last_heartbeat, 6)} + try: + import resource + result["peak_rss_kib"] = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss + except ImportError: + result["peak_rss_kib"] = None + orchestrator = getattr(state, "orchestrator", None) + for name in ("executor", "startup_executor"): + queue = getattr(getattr(orchestrator, name, None), "_work_queue", None) + if queue is not None: + result[f"{name}_queued"] = queue.qsize() + competition = getattr(state, "competition", None) + result["competition_phases"] = dict(getattr(competition, "phase_metrics", {})) + return result + + async def close(self): + self._done.set() + if self._task: + self._task.cancel() + with suppress(asyncio.CancelledError): + await self._task + if self._thread: + self._thread.join(timeout=1) diff --git a/backend/server/app.py b/backend/server/app.py index 81cad21..a510ee8 100644 --- a/backend/server/app.py +++ b/backend/server/app.py @@ -27,10 +27,10 @@ from backend.auth import AuthManager from backend.auth.middleware import AuthenticationMiddleware from backend.core.state import AppState +from backend.core.telemetry import RuntimeTelemetry from backend.ops.ipc_mcp import build_ipc_mcp from backend.sandbox.webui_proxy import webui_proxy_manager -# Error boundaries keep their recovery behavior and retain debug diagnostics. _recovery_logger = logging.getLogger(__name__) def _resolve_frontend_dir(app_root: Path) -> Path: @@ -67,6 +67,9 @@ def create_app(root: str | Path | None = None) -> FastAPI: async def lifespan(app: FastAPI): state = AppState(root=app_root) app.state.ipc = state + telemetry = RuntimeTelemetry(state.artifact_root) + app.state.telemetry = telemetry + telemetry.start() try: from backend.core.orchestrator import Orchestrator @@ -87,6 +90,7 @@ async def lifespan(app: FastAPI): async with ipc_mcp_app.router.lifespan_context(ipc_mcp_app): yield finally: + await telemetry.close() try: competition = getattr(state, "competition", None) if competition is not None: @@ -139,9 +143,14 @@ def index(): return FileResponse(frontend_dir / "index.html") @app.get("/health", include_in_schema=False) - def health(): + async def health(): return {"status": "ok", "setup_required": False} + @app.get("/health/details", include_in_schema=False) + async def health_details(): + telemetry = getattr(app.state, "telemetry", None) + return {"status": "ok", "runtime": telemetry.snapshot(getattr(app.state, "ipc", None)) if telemetry else {}} + if frontend_dir.exists(): app.mount("/static", StaticFiles(directory=str(frontend_dir)), name="static") From 1c78cb6f27b8037d7790be9672aca2f473ad1374 Mon Sep 17 00:00:00 2001 From: PureStream108 <1262364207@qq.com> Date: Sat, 17 Oct 2026 18:49:46 +0800 Subject: [PATCH 08/21] feat(frontend): GZCTF setup form, log search and log pagination --- frontend/index.html | 70 +++++++++++++++++++++++++++++++++++++++--- tests/test_frontend.py | 4 ++- 2 files changed, 69 insertions(+), 5 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 04a6d2a..533bbf7 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -522,6 +522,8 @@

Competition

+ +
@@ -540,6 +542,30 @@

Competition

+
+
GZCTF setup
+

Save your platform and competition once. Reuse the saved workflow for future runs.

+
+ + + + + + + + + + + + +
+
+ + + + +
+
@@ -871,6 +897,7 @@

Skill

Logs
+
- No workflow selected: IPC will individually adapt a new platform from your description. + No workflow selected: use the built-in GZCTF workflow setup, then provide only your platform and competition details.
-
No projects yet.
-
No project matches this filter.
+
No projects yet.
+
No project matches this filter.
@@ -260,6 +262,26 @@
+
+
+ + + + + + + + + + +
+
+ + +
+ +

+
Select or create a project to view its flow graph. @@ -268,6 +290,7 @@