diff --git a/.gitignore b/.gitignore index 7434051..132a836 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,4 @@ dist/ .venv/ venv/ env/ -skills/swarm/scripts/skills/ -skills/swarm/scripts/rules/ -skills/swarm/scripts/agents/ diff --git a/README.md b/README.md index 332619b..2f88c7c 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,10 @@ [![Python 3.11+](https://img.shields.io/badge/Python-3.11%2B-blue.svg)](./pyproject.toml) [![Bun 1.0+](https://img.shields.io/badge/Bun-1.0%2B-orange.svg)](https://bun.sh) -**agystack** is an agentic engineering framework for Google Antigravity, created by [Joel Taroreh](https://x.com/joeltaroreh). It equips autonomous agents with a set of rigorous skills, playbooks, and cloud swarms built on the anti-slop foundation of [poteto](https://x.com/poteto)'s Cursor pstack. +**agystack** is an agentic engineering framework for Google Antigravity, created by [Joel Taroreh](https://x.com/joeltaroreh). It equips autonomous agents with a set of rigorous skills, playbooks, and adversarial workflows built on the anti-slop foundation of [poteto](https://x.com/poteto)'s Cursor pstack. -Where pstack brought anti-slop rigor to editor chats, **agystack expands it into a distributed, multi-tier engineering fleet**: +Where pstack brought anti-slop rigor to editor chats, **agystack brings it natively to Google Antigravity**: -- **Google Cloud Run Fleets (`/swarm`).** When local machines hit limits, fan out across headless cloud containers. Fleet workers run in parallel, stream real-time milestones, and deliver isolated candidate patches to GCS without git worktree collisions. - **The `/loop` Hillclimb Engine.** Run automated hypothesis-and-verify loops against a concrete test command (`--verify ""`). agystack applies discrete edits, reverts regressions, and reactively iterates until green without manual babysitting. - **Automated PR Babysitting & Stack Shipping (`watch-pr`).** Eliminate GitHub PR friction. Dedicated tooling monitors CI checks, detects merge conflicts across Graphite stacks, and triages review comments. Real defects get fixed with runtime reproduction, while bot noise gets dismissed with concrete reasons. - **Adversarial Reviews & Bakeoffs (`/interrogate`, `/arena`).** Prevent single-agent blind spots. Dispatch concurrent reviewers to attack diffs from independent angles before shipping, or run competing candidate implementations in parallel worktrees and graft winning pieces sequentially. @@ -79,7 +78,7 @@ Restart Antigravity or open a new chat after install. two steps: -1. run [`/setup-agystack`](./skills/setup-agystack/SKILL.md) and choose which models you want, choose if you want to setup cloud swarm with Google Cloud auth. +1. run [`/setup-agystack`](./skills/setup-agystack/SKILL.md) and choose which models you want per role. 2. use [`/agystack`](./skills/agystack/SKILL.md) or [`/poteto-mode`](./skills/poteto-mode/SKILL.md) whenever you're doing anything that requires rigor. new here? the [agystack guide](./docs/guide/README.md) walks you through a first real task, from setup and prompting through verification and overnight runs. @@ -149,38 +148,11 @@ the full rules and playbooks live in [`skills/poteto-mode/SKILL.md`](./skills/po [`/agystack`](./skills/agystack/SKILL.md) and [`/poteto-mode`](./skills/poteto-mode/SKILL.md) are also sticky modes: once entered they stay on across turns, applying themselves when a playbook matches or the task needs rigor and staying out of the way otherwise. opt out any time by saying so. -they work seamlessly with Antigravity's `/goal` (for multi-hour overnight autonomy) and `/loop` (for inner-loop metric optimization and TDD hillclimbs). you can make agents work for many hours without sacrificing rigor. - -## cloud swarms (Cloud Run) - -local subagents work great for up to 8 workers. but when you want massive parallel exploration, parameter sweeps, or candidate bakeoffs, agystack fans out across Google Cloud Run instead. - -workers run in isolated containers, never push to git directly, and upload `patch.diff` artifacts and streaming milestones to GCS. the coordinator ranks the winning diffs so you can review and apply them locally. - -set it up with [`/setup-agystack`](./skills/setup-agystack/SKILL.md) with your Google Cloud auth and run [`/swarm`](./skills/swarm/SKILL.md) to dispatch. - -### summoning cloud agents (Gemini & DeepSeek) - -Cloud swarms run on Google Cloud Run with zero-friction serverless models: - -```bash -# list supported cloud models and tiers -python3 skills/swarm/scripts/cloud_dispatch.py --list-models - -# fan out 5 Gemini Argon agents -python3 skills/swarm/scripts/cloud_dispatch.py --tasks 5 --model gemini-4-argon - -# fan out 5 DeepSeek Flash 4.1 agents -python3 skills/swarm/scripts/cloud_dispatch.py --tasks 5 --model deepseek-v4.1-flash -``` - -Or trigger `/swarm` right in chat: -- `/swarm 5 workers using Gemini Argon to test src/` -- `/swarm 5 workers using DeepSeek Flash to explore hypotheses` +they work seamlessly with Antigravity's `/goal` (for multi-hour overnight autonomy), `/loop` (for inner-loop metric optimization and TDD hillclimbs), and built-in `/swarm` (for multi-slice parallel fan-out). you can make agents work for many hours without sacrificing rigor. ## skills -[`/poteto-mode`](./skills/poteto-mode/SKILL.md) runs most of these for you when a step needs them (`how`, `why`, `architect`, `arena`, `swarm`, `interrogate`, `unslop`, `no-comments`, `technical-writing`, `tdd`, and the principles). the table below is for when you want one directly: +[`/poteto-mode`](./skills/poteto-mode/SKILL.md) runs most of these for you when a step needs them (`how`, `why`, `architect`, `arena`, `interrogate`, `unslop`, `no-comments`, `technical-writing`, `tdd`, and the principles). the table below is for when you want one directly: @@ -206,7 +178,6 @@ Or trigger `/swarm` right in chat: | `/grill-me` | your requirements are underspecified or ambiguous and you want Socratic pressure testing before kicking off architecture or autonomous execution ([guide](./docs/guide/04-design.md#flesh-out-ambiguous-requirements-with-grill-me)). | | [`/architect`](./skills/architect/SKILL.md) | you're about to write code that crosses a function boundary and want the caller's usage, types, and module shape settled first. | | [`/arena`](./skills/arena/SKILL.md) | you want N parallel attempts at the same thing, then to grab the best parts of each. | -| [`/swarm`](./skills/swarm/SKILL.md) | you want N parallel workers across different slices or races, then one aggregated report. | | [`/interrogate`](./skills/interrogate/SKILL.md) | you have a diff and want several different models to try to break it, including a strict code-quality lens. | | [`/automate-me`](./skills/automate-me/SKILL.md) | you want your own `-mode` skill, drafted from how you've actually worked. | | [`/deslop`](./skills/deslop/SKILL.md) | you want to clean defensive code, redundant guards, and AI bloat out of diffs before commit. | @@ -262,8 +233,6 @@ architect: design this instrumentation to be high signal with no false p this first. arena: /arena take my prompt to the arena verbatim. i want to compare their proposals with yours. -swarm: /swarm check every package under packages/ against its check.sh. one worker per - package. one report. interrogate: /interrogate review this pr. tdd: /tdd implement unslop: can we unslop and tighten the new changes? diff --git a/agystack-models.md b/agystack-models.md index 89ca3bf..08700ef 100644 --- a/agystack-models.md +++ b/agystack-models.md @@ -19,7 +19,6 @@ reflect tooling: inherit reflect judgment, divergent, synthesizer: inherit arena runners: inherit, flash, pro arena cross-judge pool: inherit, flash, pro -swarm workers: flash architect runners: inherit, flash, pro interrogate reviewers: inherit, flash, pro diff --git a/agystack-runtime.json.example b/agystack-runtime.json.example deleted file mode 100644 index 27a14a5..0000000 --- a/agystack-runtime.json.example +++ /dev/null @@ -1,12 +0,0 @@ -{ - "runtime": "cloud-run", - "project_id": "your-gcp-project-id", - "region": "us-central1", - "job_name": "agystack-swarm-worker", - "image": "us-central1-docker.pkg.dev/your-gcp-project-id/agystack/worker:latest", - "parallelism": 16, - "model": "inherit", - "auth_mode": "vertex", - "vertex_location": "global", - "gcs_bucket": "your-gcp-project-id-swarm-results" -} diff --git a/docs/guide/01-setup.md b/docs/guide/01-setup.md index c534a1b..8449197 100644 --- a/docs/guide/01-setup.md +++ b/docs/guide/01-setup.md @@ -4,7 +4,7 @@ In this page you install the plugin, pick which models agystack uses, and run yo ## Prerequisites -- `bun` (v1.0+) is mandatory for PR babysitting (`watch-pr`) and multi-agent orchestration (`orch`). Node.js is not supported. +- `bun` (v1.0+) is mandatory for PR babysitting (`watch-pr`) and TypeScript script tests (Node.js is used for `check-plan.mjs`). - `gh` (GitHub CLI) is required for PR automation and preflight checks. - `gt` (Graphite CLI) is recommended for stacked PRs. @@ -54,7 +54,7 @@ Run: You only override what you care about. A role with no line in the rule keeps the skill's default. To restore a default later, delete that role's line, or just run `/setup-agystack` again. -You might be wondering what happens if you use Auto. Set a role to `inherit-parent` or `auto` and agystack omits the subagent `model` field, so the subagent inherits your parent chat model. Both values mean the same thing, and neither is a model slug. For a panel role the value is a list, and one subagent runs per entry, so the list length sets the panel size. Setup also configures `swarm workers`, the default model for every `/swarm` worker unless a race names a model for each arm. +You might be wondering what happens if you use Auto. Set a role to `inherit-parent` or `auto` and agystack omits the subagent `model` field, so the subagent inherits your parent chat model. Both values mean the same thing, and neither is a model slug. For a panel role the value is a list, and one subagent runs per entry, so the list length sets the panel size. ## Accept the verification offer, or don't diff --git a/docs/guide/04-design.md b/docs/guide/04-design.md index 90aa395..fe3f033 100644 --- a/docs/guide/04-design.md +++ b/docs/guide/04-design.md @@ -1,6 +1,6 @@ # Design before you write code -One attempt at a hard design locks in the first shape the model thought of. `/architect` settles types and boundaries before implementation. `/arena` runs several attempts at the same brief and merges the best parts. `/interrogate` has other models try to break the result. When the job is coverage rather than design synthesis, `/swarm` fans out slices or races and aggregates their results. +One attempt at a hard design locks in the first shape the model thought of. `/architect` settles types and boundaries before implementation. `/arena` runs several attempts at the same brief and merges the best parts. `/interrogate` has other models try to break the result. When the job is coverage rather than design synthesis, Antigravity's built-in `swarm` tool fans out slices or races and aggregates their results. ![Three robots draft competing bridge models at their own tables under /architect, /arena, and /interrogate panels, while a judge robot with a clipboard inspects skeptically.](./images/design.jpg) @@ -56,15 +56,15 @@ The panel comes from your [`/setup-agystack`](../../skills/setup-agystack/SKILL. /arena this, 5 candidates. the cache key format is expensive to change later. ``` -## Cover slices and races with `/swarm` +## Cover slices and races with Antigravity's built-in `swarm` ```text /swarm check every package under packages/ against its check.sh. one worker per package. one report. ``` -[`/swarm`](../../skills/swarm/SKILL.md) fans N workers across independent slices, coverage matrices, gauntlet lanes, exploration partitions, or declared race arms. Each worker gets its own scope and check, then reports `PASS`, `ISSUES`, or `BLOCKED`. The parent waits for the workers and returns one compact report with any gaps or dropouts. +Antigravity's built-in `swarm` tool fans N workers across independent slices, coverage matrices, gauntlet lanes, exploration partitions, or declared race arms. Each worker gets its own scope and check, then reports back through the shared swarm board so the parent returns one compact report with any gaps or dropouts. -Reach for it when parallelism buys coverage or lets independent checks race. `/arena` gives every worker the same design or code brief, then picks a base and grafts the best parts. `/swarm` covers slices or runs a race with a selection rule declared up front. It does not use the base-selection and grafting ceremony. +Reach for it when parallelism buys coverage or lets independent checks race. `/arena` gives every worker the same design or code brief, then picks a base and grafts the best parts. Built-in `swarm` covers slices or runs a race with a selection rule declared up front without the base-selection and grafting ceremony. ## Break it with `/interrogate` @@ -83,7 +83,7 @@ You might be wondering whether every change needs this. No. Most changes need no - A small, finished change you're unsure about needs `/interrogate` alone. - A change that crosses function boundaries or moves ownership earns `/architect`, which brings `/arena` with it. - A standalone decision where independent attempts would help, like naming, formats, or an algorithm, is `/arena` directly. -- A coverage matrix, set of parallel checks, or race with declared arms is `/swarm`. +- A coverage matrix, set of parallel checks, or race with declared arms fits Antigravity's built-in `swarm`. - A contested design that's expensive to reverse gets `/architect`, then `/interrogate` before shipping. `/poteto-mode` already applies this ladder. Boundary-crossing work triggers `/architect` on its own, so you reach for these directly mainly when you want more or less scrutiny than the default. diff --git a/docs/guide/06-verify-and-ship.md b/docs/guide/06-verify-and-ship.md index eb99aee..2d0cada 100644 --- a/docs/guide/06-verify-and-ship.md +++ b/docs/guide/06-verify-and-ship.md @@ -48,7 +48,7 @@ It writes `.agents/skills/verify-/`, agent-facing instructions with exact L From then on, "verify it in the app" is a step any agent can execute, in this repo, with no setup conversation. -Once the verify skill works, a [`/swarm`](../../skills/swarm/SKILL.md) can split a full pass by feature-map entry and aggregate the results. +Once the verify skill works, Antigravity's built-in `swarm` can split a full pass by feature-map entry and aggregate the results. ## Keep the verification skill honest diff --git a/docs/guide/10-recipes-and-pitfalls.md b/docs/guide/10-recipes-and-pitfalls.md index 8010e1c..aca06b5 100644 --- a/docs/guide/10-recipes-and-pitfalls.md +++ b/docs/guide/10-recipes-and-pitfalls.md @@ -26,7 +26,7 @@ Your current design becomes one candidate among several, and the synthesis tells /swarm check every package under packages/ against its check.sh. one worker per package. one report. ``` -Each worker owns one package. The parent waits for every slice and returns one `PASS`, `ISSUES`, or `BLOCKED` report instead of raw worker dumps. +Antigravity's built-in `swarm` assigns each worker one package, waits for every slice, and returns one compact report instead of raw worker dumps. ## Review a branch skeptically @@ -94,7 +94,7 @@ Whenever an agent uses `write_to_file`, the hook triggers `skills/poteto-mode/sc ## Destructive Command Guard with Antigravity PreToolUse Hooks -Prevent accidental catastrophic commands in interactive sessions without disrupting autonomous swarms or CI pipelines. Antigravity's `PreToolUse` lifecycle hook intercepts commands before execution and prompts for confirmation if a destructive command pattern is detected: +Prevent accidental catastrophic commands in interactive sessions without disrupting autonomous runs or CI pipelines. Antigravity's `PreToolUse` lifecycle hook intercepts commands before execution and prompts for confirmation if a destructive command pattern is detected: ```json { @@ -120,7 +120,7 @@ The hook evaluates `run_command` invocations for destructive signatures: - Force-pushing to protected trunk branches (`git push --force origin main`, `git push origin +master`), while explicitly allowing `--force-with-lease` on feature branches - Dropping databases (`drop database `) -When running in headless environments (`NON_INTERACTIVE="1"`, `CI="true"`, or `CLOUD_RUN_TASK_INDEX` in Cloud Run worker containers), the hook automatically rejects destructive commands (`"decision": "reject"`) to prevent catastrophic corruption in unattended runs or automated test suites. +When running in headless environments (`NON_INTERACTIVE="1"` or `CI="true"`), the hook automatically rejects destructive commands (`"decision": "deny"`) to prevent catastrophic corruption in unattended runs or automated test suites. To activate, copy or merge `hooks.json.example` into `.agents/hooks.json` (project-local) or `~/.gemini/config/hooks.json` (user-global). @@ -151,7 +151,7 @@ The hook intercepts `write_to_file` and `replace_file_content` to keep coordinat - Permits markdown deliverables (`*.md`, `*.markdown`) and scratch/slice files (`scratch/*`, `.slices/*`) immediately. - Permits trivial surgical edits (<= 50 lines of code on a single existing file) directly. - Bypasses checks for active subagents (`SUBAGENT=1`, `IS_SUBAGENT=1`, or child transcript detection). -- In headless/CI environments (`NON_INTERACTIVE="1"`, `CI="1"`, `CLOUD_RUN_TASK_INDEX`), rejects non-trivial direct code writes (`decision: reject`) unless subagents are disabled (`HEADLESS_NO_SUBAGENTS="1"`). +- In headless/CI environments (`NON_INTERACTIVE="1"`, `CI="1"`), rejects non-trivial direct code writes (`decision: reject`) unless subagents are disabled (`HEADLESS_NO_SUBAGENTS="1"` or `ALLOW_SUBAGENTS="false"`). - In interactive sessions, prompts the user (`decision: force_ask`) on non-trivial writes (>50 lines on single existing files or creating new source files), preventing accidental coordinator bloat while providing an override when direct execution is explicitly desired. ## The pitfalls @@ -159,7 +159,7 @@ The hook intercepts `write_to_file` and `replace_file_content` to keep coordinat - **Enumerating skills in the prompt.** "use /how then /architect then /arena" reorders steps the playbook already sequences. State the goal and constraints. Name a skill only to override a default. - **A vague finish condition.** "make it better" gives `/loop` or `/goal` nothing to check. `/loop` requires a command that exits 0. `/goal` requires a checkable predicate or artifact. Give a command or artifact that can pass or fail. - **Parallel agents in one worktree.** They overwrite each other and the diff becomes archaeology. Say "own worktree per attempt" and the isolation is free. -- **Using `/arena` for coverage.** `/arena` repeats one design or code brief, then picks a base and grafts the best parts. `/swarm` partitions slices or declared race arms and aggregates one report. +- **Using `/arena` for coverage.** `/arena` repeats one design or code brief, then picks a base and grafts the best parts. Antigravity's built-in `swarm` partitions slices or declared race arms and aggregates one report. - **Accepting every review comment.** Bots and humans both file real catches and noise in one list. `/interrogate` sorts findings into act-on and dismissed buckets with reasons, and you can override either way. - **Treating `auto` as a model slug.** `auto` and `inherit-parent` mean "omit the model field so the subagent inherits the parent chat model." [Setup](./01-setup.md) covers the roles. - **Reporting success off a green build.** A build proves it compiles. Ask for the real command, flow, stored value, or profile, and expect the evidence in the reply. diff --git a/docs/guide/README.md b/docs/guide/README.md index 2073029..c0ebb2d 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -7,7 +7,7 @@ Here's what you'll learn: 1. [Set up agystack](./01-setup.md). Install the plugin and pick your models. 2. [Route work through `/poteto-mode`](./02-poteto-mode.md). Give it a goal and watch it pick a playbook. 3. [Understand the code](./03-understand.md). `/how`, `/why`, `/teach`, and `/recall` before you edit anything. -4. [Design the change](./04-design.md). `/architect`, `/arena`, `/swarm`, and `/interrogate` before code locks in a shape. +4. [Design the change](./04-design.md). `/architect`, `/arena`, and `/interrogate` before code locks in a shape. 5. [Build and clean the change](./05-build-and-clean.md). The build playbooks, `/tdd`, `/deslop`, `/unslop`, and `/no-comments`. 6. [Verify and ship](./06-verify-and-ship.md). Prove behavior on the real app, then open a focused PR and drive it to merged. 7. [Run work while you sleep](./07-overnight.md). An overnight contract, a decision log you can audit, and the playbooks that scale past one agent. diff --git a/docs/marketplace-listing.md b/docs/marketplace-listing.md index 5885f82..fd8a1b3 100644 --- a/docs/marketplace-listing.md +++ b/docs/marketplace-listing.md @@ -15,7 +15,7 @@ This document defines the official catalog metadata, presentation copy, and deve ## Description -Rigorous agentic engineering framework for Google Antigravity: poteto-mode, playbooks, isolated subagents, adversarial reviews, and cloud swarms. Spinoff of poteto's pstack. +Rigorous agentic engineering framework for Google Antigravity: poteto-mode, playbooks, isolated subagents, and adversarial reviews. Spinoff of poteto's pstack. ## Suggested Prompts @@ -28,7 +28,6 @@ Rigorous agentic engineering framework for Google Antigravity: poteto-mode, play - **Twenty-Three Rigorous Playbooks:** Structured procedural engines for bug fixes, performance investigations, refactoring, autonomous loops, and stacked shipping. - **Twenty-Four Anti-Slop Principles:** Invariant rules that prevent speculative code, enforce domain data models, and mandate real-world runtime verification. - **Subagent Context Isolation:** Guard coordinator chat context windows by delegating code changes over 50 lines to isolated background workers. -- **Google Cloud Run Swarms (`/swarm`):** Scale beyond local machine concurrency with serverless container fleets executing parallel parameter sweeps and candidate patches. - **Multi-Model Adversarial Interrogation (`/interrogate`):** Dispatch concurrent reviewer panels across distinct model tiers to challenge diffs before merge. - **Native Antigravity Artifacts:** Structured deliverables (`implementation_plan.md`, `walkthrough.md`, `_report.md`) rendered directly in the IDE canvas. diff --git a/docs/marketplace-submission.json b/docs/marketplace-submission.json index c280a4d..0b57950 100644 --- a/docs/marketplace-submission.json +++ b/docs/marketplace-submission.json @@ -5,7 +5,7 @@ "displayName": "agystack", "version": "0.16.0", "category": "developer-tools", - "description": "Rigorous agentic engineering framework for Google Antigravity: poteto-mode, playbooks, isolated subagents, adversarial reviews, and cloud swarms. Spinoff of poteto's pstack.", + "description": "Rigorous agentic engineering framework for Google Antigravity: poteto-mode, playbooks, isolated subagents, and adversarial reviews. Spinoff of poteto's pstack.", "author": { "name": "Joel Taroreh", "url": "https://github.com/jtaroreh/agystack" @@ -26,7 +26,6 @@ "agentic-engineering", "anti-slop", "playbooks", - "subagents", - "swarms" + "subagents" ] } diff --git a/plugin.json b/plugin.json index 8afccba..8d7ec27 100644 --- a/plugin.json +++ b/plugin.json @@ -3,7 +3,7 @@ "name": "agystack", "displayName": "agystack", "version": "0.16.0", - "description": "Rigorous agentic engineering framework for Google Antigravity: poteto-mode, playbooks, isolated subagents, adversarial reviews, and cloud swarms. Spinoff of poteto's pstack.", + "description": "Rigorous agentic engineering framework for Google Antigravity: poteto-mode, playbooks, isolated subagents, and adversarial reviews. Spinoff of poteto's pstack.", "author": { "name": "Joel Taroreh", "url": "https://github.com/jtaroreh/agystack" diff --git a/pyproject.toml b/pyproject.toml index 865e354..acec6be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,20 +5,13 @@ build-backend = "hatchling.build" [project] name = "agystack" version = "0.16.0" -description = "Agentic swarm orchestration and poteto workflow plugin for Google Antigravity" +description = "Rigorous agentic engineering and poteto workflow plugin for Google Antigravity" readme = "README.md" requires-python = ">=3.11" license = { text = "MIT" } -dependencies = [ - "google-cloud-storage>=2.14.0,<3.0.0", - "google-cloud-run>=0.10.0,<1.0.0", - "google-genai>=0.1.0,<3.0.0", -] +dependencies = [] [project.optional-dependencies] -agent = [ - "google-antigravity>=0.1.0,<0.2.0", -] test = [ "pytest>=8.0.0", "pytest-mock>=3.12.0", diff --git a/rules/AGENTS.md b/rules/AGENTS.md index 557c98b..85fbdcf 100644 --- a/rules/AGENTS.md +++ b/rules/AGENTS.md @@ -6,7 +6,7 @@ This plugin is agystack. For any non-trivial engineering task (a bug, a feature, Mirroring pstack in Cursor, enforce strict separation between coordination and code execution: -1. **Mandatory Subagent Delegation for Code Writes:** You MUST delegate all non-trivial code modifications, feature implementations, bug fixes, and refactoring to a subagent (`invoke_subagent` with `TypeName: "poteto-agent"` or configured role model) in an isolated context window. The parent agent operates as coordinator: planning, reviewing the subagent's diffs, running verification, and communicating with the user using unslopped prose. Pass purely technical specs, interfaces, and test criteria to the subagent so its context remains unburdened by conversational prose guidelines. A subagent already running as a delegate, or executing in an environment where subagent spawning is disallowed (such as `allow_subagents=False` in cloud workers or subagents without nesting tools), satisfies this invariant by executing and owning the diff directly. +1. **Mandatory Subagent Delegation for Code Writes:** You MUST delegate all non-trivial code modifications, feature implementations, bug fixes, and refactoring to a subagent (`invoke_subagent` with `TypeName: "poteto-agent"` or configured role model) in an isolated context window. The parent agent operates as coordinator: planning, reviewing the subagent's diffs, running verification, and communicating with the user using unslopped prose. Pass purely technical specs, interfaces, and test criteria to the subagent so its context remains unburdened by conversational prose guidelines. A subagent already running as a delegate, or executing in an environment where subagent spawning is disallowed (such as subagents without nesting tools or headless workers with `ALLOW_SUBAGENTS=false`), satisfies this invariant by executing and owning the diff directly. - **Non-Trivial Delegation Threshold:** - **Trivial edits (permitted directly by coordinator):** <= 50 lines on a single file (existing or new file creation), single flag or constant adjustments, `.gitignore` entries, markdown documentation, and scratch scripts in `scratch/`. - **Non-trivial edits (mandatory delegation to `poteto-agent`):** > 50 lines on a single file, multi-file code modifications, core business logic changes. @@ -14,10 +14,10 @@ Mirroring pstack in Cursor, enforce strict separation between coordination and c 2. **Mandatory Subagent Fan-Out:** You MUST invoke distinct background subagents via `invoke_subagent` for: - **Code reviews and adversarial interrogation (`/interrogate`):** Dispatch concurrent reviewers across distinct model tiers (`pro`, `flash`, `inherit`). Simulating reviewer personas in the parent context is strictly forbidden. - **Multi-candidate design and code bakeoffs (`/arena`):** Dispatch parallel subagents in isolated workspaces or scratch paths. - - **High-volume exploration sweeps and test matrices (`/swarm`):** Offload large payload reads to subagents to guard the main context window. + - **High-volume exploration sweeps and test matrices:** Offload large payload reads and multi-slice checks to Antigravity's built-in `swarm` tool or `invoke_subagent` fan-outs to guard the main context window. - **Blinded behavioral evaluations (`/eval`):** Run candidate attempts through blinded subagents. - **Cross-model decision audits (`/show-me-your-work`):** Dispatch an independent subagent on a different model family to audit the decision log. -3. **Candidate Integration Invariant:** Parallel candidate diffs from swarms, arenas, or subagent fan-outs must never be bulk-merged. The coordinator must evaluate candidate branches in isolation, rank them by delta, and graft winning modifications sequentially—verifying and benchmarking each change independently before attempting the next (`principle-sequence-verifiable-units`). +3. **Candidate Integration Invariant:** Parallel candidate diffs from native swarms, arenas, or subagent fan-outs must never be bulk-merged. The coordinator must evaluate candidate branches in isolation, rank them by delta, and graft winning modifications sequentially—verifying and benchmarking each change independently before attempting the next (`principle-sequence-verifiable-units`). 4. **Subagent Reactive Wakeup and Watchdog Timeout Invariant:** Antigravity subagents run asynchronously in isolated background sessions. They do NOT stream chat text to the coordinator and will ONLY wake the parent when they explicitly invoke `send_message`. - **Mechanical Turn Yielding:** Immediately after dispatching local subagents via `invoke_subagent`, the coordinator MUST yield the turn by outputting a progress message with ZERO tool calls (`tool_calls: []`). - **Continuous Busy-Wait Prohibited:** The coordinator must NEVER run rapid status polling loops (`manage_subagents(list)` every few seconds), must NEVER tail child `transcript.jsonl` files during the wait phase, and must NEVER attach status tool calls to turns intended to wait. @@ -26,15 +26,11 @@ Mirroring pstack in Cursor, enforce strict separation between coordination and c Because `TimerCondition: "never"` is used, incremental completions wake the coordinator reactively without cancelling the timer. - **Quorum & Teardown Protocol:** On incremental worker completions, record findings and yield immediately (zero tool calls) if workers remain pending. Once all workers arrive, cancel the active watchdog timer via `manage_task(Action: "kill", TaskId: )` before synthesizing. - **Timeout Diagnosis:** The coordinator calls `manage_subagents(Action: "list")` ONLY when the watchdog timer fires or an explicit failure occurs. If a worker is in `error` or `idle` without messaging, terminate it (`manage_subagents(Action: "kill", ConversationIds: [])`) and proceed with partial results. Child transcripts may only be read for post-mortem diagnostics, never while waiting. - - **Primitive Boundary:** Active heartbeat polling (every 60-120s) applies strictly to external CLI/Cloud Run subprocesses (`run_command`, `cloud_dispatch.py`), NEVER to local Antigravity subagents (`invoke_subagent`). + - **Primitive Boundary:** Active heartbeat polling (every 60-120s) applies strictly to external CLI subprocesses (`run_command`), NEVER to local Antigravity subagents (`invoke_subagent`). 5. **Planning and Deliverable Artifact Scoping Matrix:** - **Interactive State-Changing Playbooks (`Feature`, `Refactoring`, `Multi-phase`):** Mandatory `implementation_plan.md` with `RequestFeedback: true` before coding; mandatory `walkthrough.md` with pass receipts upon completion. - - **Autonomous & Hillclimb Playbooks (`Autonomous run`, `Hillclimb`, `Swarm`, `/goal`, `/loop`):** Unattended throughput invariant. Use `RequestFeedback: false`. Domain deliverables (`decision_trail.md`, `score.json`, `receipts/`) take precedence without interactive blocking. + - **Autonomous & Hillclimb Playbooks (`Autonomous run`, `Hillclimb`, `/goal`, `/loop`):** Unattended throughput invariant. Use `RequestFeedback: false`. Domain deliverables (`decision_trail.md`, `score.json`, `receipts/`) take precedence without interactive blocking. - **Read-Only Investigation Playbooks (`Investigation`, `How`, `Why`, `Runtime Forensics`):** Produces `investigation_report.md` with `RequestFeedback: false`. -6. **Cloud Swarm Model Selection & Zero-Friction Fallback:** - - **Prefer Tier 1 Serverless Models:** Default to frictionless serverless models that require zero console forms: `gemini-3.8-flash`, `gemini-4-argon`, or `deepseek-v4.1-flash` (MaaS). - - **Gated Partner Gating Detection:** If a user requests an Anthropic partner model (`claude-3-opus`, `claude-3-5-sonnet`) that is not yet enabled in Vertex AI Model Garden, explain that Google enforces a one-time console form click-through that agents cannot accept programmatically, and immediately offer the Tier 1 zero-friction alternative. - - **Open-Weights vs. MaaS Distinction:** Models like `GLM 5.3` or `Llama 3.3` on Model Garden are deployable open-weights requiring dedicated GPU endpoints (8x H100/B200 instances), not on-demand serverless APIs. Never attempt to dispatch Cloud Run tasks against deploy-only models without an active dedicated endpoint. ## Surface Precedence Hierarchy diff --git a/scripts/package-plugin.sh b/scripts/package-plugin.sh index 862acbe..3449727 100755 --- a/scripts/package-plugin.sh +++ b/scripts/package-plugin.sh @@ -39,7 +39,6 @@ zip -r -q "${ARCHIVE}" \ agents/ \ skills/ \ agystack-models.md \ - agystack-runtime.json.example \ hooks.json.example \ -x "*.DS_Store" \ -x "*__pycache__*" \ diff --git a/skills/agystack/SKILL.md b/skills/agystack/SKILL.md index 246366d..c6eca26 100644 --- a/skills/agystack/SKILL.md +++ b/skills/agystack/SKILL.md @@ -1,6 +1,6 @@ --- name: agystack -description: agystack's agentic engineering framework and rigor mode. Runs poteto-mode playbooks, isolated subagents, and cloud swarms. Use for /agystack, agystack, or rigorous engineering on Antigravity. +description: agystack's agentic engineering framework and rigor mode. Runs poteto-mode playbooks, isolated subagents, and adversarial reviews. Use for /agystack, agystack, or rigorous engineering on Antigravity. mode: true icon: rocket color: blue diff --git a/skills/maintain-verification-skill/SKILL.md b/skills/maintain-verification-skill/SKILL.md index 53ef6b7..04b6215 100644 --- a/skills/maintain-verification-skill/SKILL.md +++ b/skills/maintain-verification-skill/SKILL.md @@ -30,7 +30,7 @@ Only edit the verification skill's own directory (its SKILL.md, features/, and a 3. **Reconcile.** Every feature file has a returned summary. Merge overlapping recipes into as few app states as practical. Spot-check cited drift; don't re-prove clean claims. Sweep recent churn for user-facing surfaces missing from the map — require a concrete source path before calling one missing. Reconcile metric baselines and submission gates: verify that score baselines and threshold constants documented in the skill body match the harness scripts, and ensure local dev metrics are never conflated with remote benchmark scales. -4. **Live pass.** Required even when source looks clean. The coordinator owns all driving; follow the verification skill's own launch model — one long-lived instance driven serially for servers and UIs, or a fresh isolated session per drive for short-lived CLIs (the skill's Launch section decides, not this one). Exercise every feature at least once, and hold three invariants the whole pass, whatever the failure: (1) never drive an instance you haven't health-checked since it last did something surprising — doctor before first drive, doctor on each fresh session where sessions are the unit, doctor again after any failed drive, and where doctor can't see the failure (a wedged UI state on a healthy process), reset to a known state or relaunch rather than hoping; doctor must decouple mandatory local build/purity checks from optional external infrastructure (cloud run jobs, remote grader queries) so missing cloud configs warn rather than blocking local driving; where the project supports worktrees, verify launch/drive recipes execute cleanly inside an isolated git worktree; (2) evidence captured so far survives every cleanup, checked at its named location, not assumed; (3) nothing a drive started outlives that drive's usefulness — failed-iteration residue is cleaned whether the session is stuck, exited, or shared (for a shared instance, clean the residue, not the instance; terminate in-flight background pollers and cloud jobs). A doctor failure caused by skill drift is drift: fix it under edit scope and retry once — restart whatever the fix invalidated, nothing more — before calling the pass `blocked`. A feature that can't be reached is `verified-unreachable` only with the concrete prerequisite (auth, entitlement, OS, external state) and the route attempted; if the map omits that prerequisite, that's drift. Any harness fix from triage gets re-driven live before it ships. Final teardown happens after the last drive of the run — including those re-proofs — so nothing outlives the run (evidence stays, per the skill). +4. **Live pass.** Required even when source looks clean. The coordinator owns all driving; follow the verification skill's own launch model — one long-lived instance driven serially for servers and UIs, or a fresh isolated session per drive for short-lived CLIs (the skill's Launch section decides, not this one). Exercise every feature at least once, and hold three invariants the whole pass, whatever the failure: (1) never drive an instance you haven't health-checked since it last did something surprising — doctor before first drive, doctor on each fresh session where sessions are the unit, doctor again after any failed drive, and where doctor can't see the failure (a wedged UI state on a healthy process), reset to a known state or relaunch rather than hoping; doctor must decouple mandatory local build/purity checks from optional external infrastructure (remote compute jobs, remote grader queries) so missing cloud configs warn rather than blocking local driving; where the project supports worktrees, verify launch/drive recipes execute cleanly inside an isolated git worktree; (2) evidence captured so far survives every cleanup, checked at its named location, not assumed; (3) nothing a drive started outlives that drive's usefulness — failed-iteration residue is cleaned whether the session is stuck, exited, or shared (for a shared instance, clean the residue, not the instance; terminate in-flight background pollers and cloud jobs). A doctor failure caused by skill drift is drift: fix it under edit scope and retry once — restart whatever the fix invalidated, nothing more — before calling the pass `blocked`. A feature that can't be reached is `verified-unreachable` only with the concrete prerequisite (auth, entitlement, OS, external state) and the route attempted; if the map omits that prerequisite, that's drift. Any harness fix from triage gets re-driven live before it ships. Final teardown happens after the last drive of the run — including those re-proofs — so nothing outlives the run (evidence stays, per the skill). 5. **Triage.** Wrong or missing user-POV description → doc drift, fix it. Working behavior the harness can't drive → harness gap, fix it; a harness fix follows the same helpers rule as generation (scripts executable, invocation documented in the skill body). Audit postmortems from recent failed submissions: when a candidate passed local verification but failed the remote grader (e.g. timeout on 2-vCPU runners, thread contention, dense fill explosion), classify this as a harness gap and encode the constraint into the local linter or timing probe before continuing. App behavior that's actually broken → product gap; record it for the user, keep it out of this PR. diff --git a/skills/poteto-mode/SKILL.md b/skills/poteto-mode/SKILL.md index 38c03fb..39ceb83 100644 --- a/skills/poteto-mode/SKILL.md +++ b/skills/poteto-mode/SKILL.md @@ -22,11 +22,11 @@ Remaining triggers: - Code modifications and delegation → delegate all non-trivial source code edits (> 50 lines on a single file, multi-file changes) to `poteto-agent` via `invoke_subagent`. Trivial edits (<= 50 lines on a single file, existing or new file creation, single flag adjustments, `.gitignore`, scratch scripts in `scratch/`) and markdown documentation are permitted directly by the coordinator. - Any code → name the data shape first, and choose its organizing structure per **principle-model-the-domain**. - Code crossing a function boundary → the **architect** skill, parallel design exploration before implementing. -- Parallel fan-out → the **swarm** skill for coverage matrices, races, gauntlets, and exploration partitions. Use **arena** for design or code bakeoffs with base selection and grafting. Dispatch real background subagents via `invoke_subagent`; never simulate candidates in-context. +- Parallel fan-out → Antigravity's built-in **swarm** tool (or `invoke_subagent`) for coverage matrices, races, gauntlets, and exploration partitions. Use **arena** for design or code bakeoffs with base selection and grafting. Dispatch real background workers; never simulate candidates in-context. - Code review or contested design → the **interrogate** skill (multi-model adversarial) before shipping. Dispatch concurrent review subagents via `invoke_subagent` across configured model tiers; never simulate reviewer personas in-context. - Nontrivial multi-step interactive work (`Feature`, `Refactoring`, `Multi-phase`) → write the throughput checkpoint (Feature step 3) and create or update the `implementation_plan.md` artifact (`/brain//implementation_plan.md`) with `ArtifactMetadata: { Summary: "...", UserFacing: true, RequestFeedback: true }` before coding. - Completed and verified work in state-changing playbooks → create or update the `walkthrough.md` artifact (`/brain//walkthrough.md`) recording changes made, verification commands, and pass receipts before closing. -- Autonomous runs, hillclimbs, and loops (`Autonomous run`, `Hillclimb`, `Swarm`, `/goal`, `/loop`) → unattended throughput invariant. Use `RequestFeedback: false`. Dedicated domain deliverables (`decision_trail.md`, `score.json`, `receipts/`) take precedence without interactive confirmation prompts. +- Autonomous runs, hillclimbs, and loops (`Autonomous run`, `Hillclimb`, `/goal`, `/loop`) → unattended throughput invariant. Use `RequestFeedback: false`. Dedicated domain deliverables (`decision_trail.md`, `score.json`, `receipts/`) take precedence without interactive confirmation prompts. - Read-only investigations, architecture packages, benchmarks, or forensic sweeps (`Investigation`, `How`, `Why`, `Runtime Forensics`) → write findings to a dedicated deliverable artifact (`investigation_report.md`, `architecture_design.md`, `perf_report.md`, `forensics_report.md`) with `RequestFeedback: false` and point to it in the reply. - Performance numbers, benchmarks, or perf reports → apply the **benchmark-checklist** skill and **principle-explain-the-number** before claiming speedups or publishing numbers. - Embedded media in artifacts → copy screenshots and recordings to `/brain//` first, then embed with `![caption](/absolute/path)`. @@ -96,11 +96,11 @@ Read the leaf skill in full for any principle you apply. Each entry names when i ## Subagents -**Use `TypeName: "poteto-agent"` for any subagent you spawn inside a playbook step** (code-writing delegates, ad-hoc helpers). `/poteto-mode` and `poteto-agent` route through the same wrapper. Routed workflow skills (`how`, `why`, `interrogate`, `reflect`, `swarm`) set their own `TypeName` (`research`, `self`, `poteto-agent`) and distinct model tiers for diverse review; respect what the skill prescribes, don't override to `poteto-agent`. +**Use `TypeName: "poteto-agent"` for any subagent you spawn inside a playbook step** (code-writing delegates, ad-hoc helpers). `/poteto-mode` and `poteto-agent` route through the same wrapper. Routed workflow skills (`how`, `why`, `interrogate`, `reflect`) set their own `TypeName` (`research`, `self`, `poteto-agent`) and distinct model tiers for diverse review; respect what the skill prescribes, don't override to `poteto-agent`. -**Defaults for every subagent call.** `Workspace: "inherit"` (or `"branch"` for isolated worktrees), file pointers not inlined context, explicit model per role (configurable via `/setup-agystack`; defaults `flash` for fast code and mechanical scans, `pro` for prose, judgment, and hard tasks). Code delegates tier by difficulty. The hardest changes (cross-cutting design, gnarly concurrency, subtle algorithms) go to your strongest judgment/reasoning model (`pro`) when the task needs judgment or the intent is vague, and to `pro` when the work is a precisely specified sequence of steps to execute to the letter; trivial mechanical edits go to your fast code model (`flash`). Per-role lines in the `/setup-agystack` rule override these defaults and the model choices in the routed skills (`how`, `why`, `arena`, `swarm`, `architect`, `interrogate`, `reflect`); a role with no line keeps its default, and a role line of `inherit` or `auto` runs that role on the parent chat model (omit subagent `Model` or pass `"inherit"`). +**Defaults for every subagent call.** `Workspace: "inherit"` (or `"branch"` for isolated worktrees), file pointers not inlined context, explicit model per role (configurable via `/setup-agystack`; defaults `flash` for fast code and mechanical scans, `pro` for prose, judgment, and hard tasks). Code delegates tier by difficulty. The hardest changes (cross-cutting design, gnarly concurrency, subtle algorithms) go to your strongest judgment/reasoning model (`pro`) when the task needs judgment or the intent is vague, and to `pro` when the work is a precisely specified sequence of steps to execute to the letter; trivial mechanical edits go to your fast code model (`flash`). Per-role lines in the `/setup-agystack` rule override these defaults and the model choices in the routed skills (`how`, `why`, `arena`, `architect`, `interrogate`, `reflect`); a role with no line keeps its default, and a role line of `inherit` or `auto` runs that role on the parent chat model (omit subagent `Model` or pass `"inherit"`). -You own every subagent's work. Review the diff and write your own summary, don't pass through what it said. Use `send_message` to iterate with an active worker on sequential adjustments to preserve context and reduce prompt overhead. When closing a major phase or starting a distinct unit of work, spawn a fresh subagent with consolidated scope rather than resume-chaining. A subagent already running as a delegate, or executing in an environment where subagent spawning is disallowed (such as `allow_subagents=False` in cloud workers or subagents without nesting tools), satisfies this invariant by executing and owning the diff directly. A second opinion is the same prompt against a different model. Agreement is high-signal. +You own every subagent's work. Review the diff and write your own summary, don't pass through what it said. Use `send_message` to iterate with an active worker on sequential adjustments to preserve context and reduce prompt overhead. When closing a major phase or starting a distinct unit of work, spawn a fresh subagent with consolidated scope rather than resume-chaining. A subagent already running as a delegate, or executing in an environment where subagent spawning is disallowed (such as subagents without nesting tools or headless workers with `ALLOW_SUBAGENTS=false`), satisfies this invariant by executing and owning the diff directly. A second opinion is the same prompt against a different model. Agreement is high-signal. ## Writing the reply @@ -143,7 +143,7 @@ A large or cross-cutting effort (a migration across many call sites, an ambitiou - **Shipping.** The half after Babysit. Independently verifying a green stack, then landing the contiguous verified run with Graphite merge-when-ready. `playbooks/shipping.md`. - **Autonomous run.** A long task to drive to completion without stopping ("run until done", "/goal" for overnight / long autonomous runs, "/loop" for inner-loop verification hillclimbs). `playbooks/autonomous-run.md`. - **Orchestrate.** A standing project handed to one coordinator chat: multi-day, many stacked PRs, dozens to hundreds of subagents, minimal human turns ("run this whole project", "own this migration until it lands"). Distinct from Autonomous run, which drives one task to a predicate; work one agent could finish inside the session's budget routes there, not here, however program-shaped the phrasing sounds. `playbooks/orchestrate.md`. -- **Autopilot-full.** A queue of independent PRs run to merged with full autonomy: one owner per PR carries build through merge, and the root swarm-verifies each merge-ready head before its owner merges ("autopilot this queue", "full autopilot", one-owner-per-PR programs). `playbooks/autopilot-full.md`. +- **Autopilot-full.** A queue of independent PRs run to merged with full autonomy: one owner per PR carries build through merge, and the root verifies each merge-ready head with parallel verifiers (using Antigravity's built-in `swarm` or `invoke_subagent`) before its owner merges ("autopilot this queue", "full autopilot", one-owner-per-PR programs). `playbooks/autopilot-full.md`. - **Autopilot-stack.** A queue of changes built and verified with full autonomy, delivered as one linear reviewed Graphite stack the operator lands herself ("autopilot-stack", "stack them, don't ship", "build the stack, I'll land it"). `playbooks/autopilot-stack.md`. - **Session pickup.** Resuming or taking over a prior agent's in-flight work from a transcript, cloud-agent URL, or pushed branch. `playbooks/session-pickup.md`. - **Pause safely.** Suspending in-flight work cleanly so it can be resumed, on an explicit pause, going offline, an Antigravity restart, or imminent context compaction. The complement to Session pickup. Full steps: `playbooks/pause-safely.md`. diff --git a/skills/poteto-mode/playbooks/autopilot-full.md b/skills/poteto-mode/playbooks/autopilot-full.md index 17cfa25..8a2dad9 100644 --- a/skills/poteto-mode/playbooks/autopilot-full.md +++ b/skills/poteto-mode/playbooks/autopilot-full.md @@ -5,7 +5,7 @@ 1. **Mark the operator's items and honor state-then-wait.** Items the operator names stay with the operator. The operator reviews and clicks, and no owner merges one. When the operator asks for the protocol or the plan to be stated, deliver the statement and stop. Execution starts only on the operator's explicit go. On that go, arm a `/goal` with the full program objective. The goal continues across turns until the queue is done. 2. **Spawn one owner per PR with the full lifecycle.** One subagent per PR owns build, gt registration, self-proof on the real artifact (the **prove-it-works** principle skill), skeptical Bugbot triage per `../references/bugbot-triage.md`, a slop-strip (the **deslop** skill (`/deslop`)), `/no-comments` (the **no-comments** skill), a restack onto current trunk, the babysit loop to green (`playbooks/babysit.md`), and the merge itself. The owner does the first rebase before the code-ready report and babysit, whether or not trunk has drifted. In fix rounds, the owner keeps that merge base. The owner rebases again only on merge conflicts, on a confirmed stale-base CI failure (`git fetch origin ` confirming `git merge-base --is-ancestor origin/ HEAD` exits 1), on a merge-prep rebase request from the root, or at merge prep (step 5). Every owner keeps a decisions.tsv trail per the **show-me-your-work** skill, never committed, returned with its reports. The merge is the one step an owner may not take alone; step 4 gates it. 3. **Run owners in true parallel and never stack.** Many owners at once when PRs are self-contained: one writer per branch, disjoint files, cross-PR drift absorbed by rebase. Only genuinely overlapping work serializes. Self-contained PRs branch straight off main, and sequenced work is merge-then-branch. Every PR is still gt-registered; the Graphite-metadata rule is about the UI, not stacks. One exception: an owner that must split a genuinely dependent change may hold a short private stack. -4. **Swarm-verify every round before its merge.** Pragmatism rules: Block PRs only on reproducible runtime failures or incorrect shipped documentation. Wording-only and documentation changes bypass the dedicated verifier subagent. Push each finished unit before starting the next. A round starts at the owner's code-ready head SHA and at each later push that changes the PR's patch. At that SHA, fan out parallel independent verifiers per the **swarm** skill and aggregate to one verdict. The merge needs a clean verdict from the round whose patch matches the merge-ready head. Audit the receipts in the owner's report for that round before the verdict. The lanes: re-run the gates at that SHA. Prove the load-bearing behavior live on the real surface the change touches (browser verification or CLI execution as the change demands). Audit the diff, distrusting the PR body. Run the audit as two or more review lanes with the full brief. Give each lane one main focus, such as consumer parity with trunk, lifetimes and races, or data and config safety. **Regression lane against trunk.** Run the same load-bearing scenario on current trunk. If trunk does not have the feature, record that fact and gate the behavior the diff adds plus the end state the user waits for instead of pretending trunk can produce it. The live lane is the floor, and a verdict without it is not clean. No merge without the root's clean verdict. When the lanes return, send every proven finding against the PR to the owner in one fix-forward. A defect that a lane filed as a note is a finding. For each behavior finding, ask for a red test that covers every site with the same defect. Where no test can show the defect, ask for a repro receipt instead. Add that defect to the next round's review brief. The new head gets a fresh swarm and a fresh verdict. A pure rebase with an unchanged patch-id preserves lane results per `playbooks/shipping.md`; any fix-forward modifying code or tests runs a fresh round. +4. **Swarm-verify every round before its merge.** Pragmatism rules: Block PRs only on reproducible runtime failures or incorrect shipped documentation. Wording-only and documentation changes bypass the dedicated verifier subagent. Push each finished unit before starting the next. A round starts at the owner's code-ready head SHA and at each later push that changes the PR's patch. At that SHA, fan out parallel independent verifiers using Antigravity's built-in `swarm` tool (or `invoke_subagent`) and aggregate to one verdict. The merge needs a clean verdict from the round whose patch matches the merge-ready head. Audit the receipts in the owner's report for that round before the verdict. The lanes: re-run the gates at that SHA. Prove the load-bearing behavior live on the real surface the change touches (browser verification or CLI execution as the change demands). Audit the diff, distrusting the PR body. Run the audit as two or more review lanes with the full brief. Give each lane one main focus, such as consumer parity with trunk, lifetimes and races, or data and config safety. **Regression lane against trunk.** Run the same load-bearing scenario on current trunk. If trunk does not have the feature, record that fact and gate the behavior the diff adds plus the end state the user waits for instead of pretending trunk can produce it. The live lane is the floor, and a verdict without it is not clean. No merge without the root's clean verdict. When the lanes return, send every proven finding against the PR to the owner in one fix-forward. A defect that a lane filed as a note is a finding. For each behavior finding, ask for a red test that covers every site with the same defect. Where no test can show the defect, ask for a repro receipt instead. Add that defect to the next round's review brief. The new head gets a fresh swarm and a fresh verdict. A pure rebase with an unchanged patch-id preserves lane results per `playbooks/shipping.md`; any fix-forward modifying code or tests runs a fresh round. 5. **On a clean verdict the owner merges and takes the next item.** The owner merges only from a head freshly rebased onto trunk. Merge prep never comes before a round's lanes start, and it ends with a rebase onto current trunk right before the merge. After the merge-prep rebase, the owner reports the new head SHA. CI must pass on that head before the merge, and the patch-id rule decides whether the round's verdict still holds. If trunk moves again before the merge, the patch-id rule in `playbooks/shipping.md` governs re-verification. A new head voids the verdict unless the patch-id is unchanged. The owner squash-merges its own PR through the resolved forge and picks up its next self-contained item from the queue. The operator's full-autonomy grant plus the root's clean verdict is the merge authorization that babysitting alone never has. Operator-named items stop at merge-ready and wait for the operator's click. 6. **Run the root layer.** A genuinely new raise of a pinned gate or budget value (a limit CI only lets tighten) needs your fresh countersign, granted only after verifier proof. Absorbing values that already landed on main is drift, not a raise. Run an audit tick over all owners roughly every 30 minutes or hourly. The root arms each tick via Antigravity's scheduled tasks (`schedule` tool / `/schedule`, e.g. `DurationSeconds="1800"` or recurring cron) or `/goal`. Never leave the cadence to memory or lossy completion notifications. At each tick, re-read this playbook from trunk with `git show origin/main:skills/poteto-mode/playbooks/autopilot-full.md`, then re-read the armed `/goal`. Audit the operation against both. Fix drift during that tick and treat it as urgent. Probe each owner with a generic liveness or status check, and collect the decision trails. Count only side effects as progress: commits, pushes, PR or check deltas, and store reports. Treat an owner or lane that errors, or that passes its expected runtime without a side effect, as stuck. Stand it down and dispatch a replacement at once. Do not wait for a polite return. Probe each owner's status via native platform agent lists or liveness messages. If an owner is stuck, terminate and replace the owner; root does not micromanage the owner's internal delegates. A stall never proves or drops the work. When merges batch, run a retro pass and a post-merge bot-comment sweep. Conclude each audit tick with a /ketchup status report summarizing queue progress under 100 words with linked artifacts and pending operator decisions. Disarm the scheduled audit cadence only when no delegated work is left, even after the last merge; each individual tick finishes its audit pass and yields the turn immediately. 7. **Stand down instantly on the operator's stop.** The operator's hold or stand-down reaches every owner as a zero-writes order immediately. Owners hold their briefs until the operator releases them. diff --git a/skills/poteto-mode/playbooks/autopilot-stack.md b/skills/poteto-mode/playbooks/autopilot-stack.md index 93e926b..1c77ec0 100644 --- a/skills/poteto-mode/playbooks/autopilot-stack.md +++ b/skills/poteto-mode/playbooks/autopilot-stack.md @@ -5,7 +5,7 @@ 1. **Run the owner loop unchanged.** One subagent per PR owns its change end to end: build, `gt` registration of its own PR, self-proof (gates, CI, receipts), skeptical Bugbot triage per `../references/bugbot-triage.md`, a slop-strip (the **deslop** skill (`/deslop`)), `/no-comments` (the **no-comments** skill), and babysit to green per `playbooks/babysit.md`. Owners parallelize when the work is self-contained. Every owner keeps a `decisions.tsv` trail per the **show-me-your-work** skill, never committed, returned in its report. 2. **Audit on the wake chain.** The root runs an audit tick roughly every 30 minutes or hourly. The root arms each tick via Antigravity's scheduled tasks (`schedule` tool / `/schedule`, e.g. `DurationSeconds="1800"` or recurring cron) or `/goal`. Never leave the cadence to memory or lossy completion notifications. At each tick, re-read this playbook from trunk with `git show origin/main:skills/poteto-mode/playbooks/autopilot-stack.md`, then re-read the armed `/goal`. Audit the operation against both. Fix drift during that tick and treat it as urgent. Probe each owner with a generic liveness or status check. Count only side effects as progress: commits, pushes, PR or check deltas, and store reports. Treat an owner or lane that errors, or that passes its expected runtime without a side effect, as stuck. Stand it down and dispatch a replacement at once. Do not wait for a polite return. Probe each owner's status via native platform agent lists or liveness messages. If an owner is stuck, terminate and replace the owner; root does not micromanage the owner's internal delegates. A stall never proves or drops the work. Conclude each audit tick with a /ketchup status report summarizing chain progress under 100 words with linked artifacts and pending operator decisions. Disarm the scheduled audit cadence only when no delegated work is left; each individual tick finishes its audit pass and yields the turn immediately. 3. **Hold the operator gates.** State-then-wait, so a request to state the plan is not a go. On the operator's explicit go, arm a `/goal` with the full program objective. The goal continues across turns until the chain is done. On the operator's stop, every owner takes an immediate zero-writes hold. -4. **Verify at STACK-READY.** The owner reports STACK-READY with the exact head SHA. The root swarm-verifies that SHA, fan-out per the **swarm** skill: parallel independent verifiers re-running the gates at that SHA, a live runtime floor over the load-bearing behavior, and a receipts-and-diff audit that distrusts the PR body. The swarm aggregates to one verdict. Findings go back to the owner, and nothing enters the stack unverified. +4. **Verify at STACK-READY.** The owner reports STACK-READY with the exact head SHA. The root verifies that SHA via Antigravity's built-in `swarm` tool (or parallel `invoke_subagent` verifiers): parallel independent verifiers re-running the gates at that SHA, a live runtime floor over the load-bearing behavior, and a receipts-and-diff audit that distrusts the PR body. The swarm aggregates to one verdict. Findings go back to the owner, and nothing enters the stack unverified. 5. **Append on a clean verdict, never ship.** No owner merges, arms auto-merge, or closes. A clean verdict appends the PR to the one linear Graphite stack, in verified order or an order the operator specified. 6. **Single writer on topology, parallel writers on builds.** Stack mechanics follow Graphite (`gt`), with the division of labor the cloud environment forces. An owner pushes only its own branch, `git push --force-with-lease` after an ls-remote check, and reports its tip and intended parent. The root owns stack topology and registers each append locally: `gt track -p `, then `gt submit --no-interactive --stack` from the tip. `gt submit` walks from trunk, and a cloud agent must never pull branches below its own into that walk; when instructed, it may set its bottom PR's base directly instead. 7. **Absorb drift at the root, then re-verify what moved.** The root absorbs trunk movement by restacking the chain (`gt restack`, `gt sync`); when a restack surfaces conflicts in an owner's files, that owner fixes its own slice and the root pushes the result. A restack rewrites every SHA above it and voids the verdicts at the old SHAs. Compare `git patch-id` at each verdict SHA against the new head. Anything that actually drifted goes back through step 4 before delivery. The countersign rule is unchanged from Autopilot-full. A genuinely new pin raises a stop for the root's fresh countersign; absorbing drift of landed values is not a raise. diff --git a/skills/poteto-mode/playbooks/multi-phase-plan.md b/skills/poteto-mode/playbooks/multi-phase-plan.md index 20226f6..0b1a5bf 100644 --- a/skills/poteto-mode/playbooks/multi-phase-plan.md +++ b/skills/poteto-mode/playbooks/multi-phase-plan.md @@ -10,7 +10,7 @@ 6. Run `node skills/poteto-mode/scripts/check-plan.mjs ` and fix every line it prints (the **encode-lessons-in-structure** principle skill). It enforces the skeleton's shape, the verification rule in every verification block, and the punctuation rules. 7. Hand back. Point to the `implementation_plan.md` artifact and post the script's output, then stop. Execution starts on the operator's explicit go, under the execution playbook the plan names. -**Verification.** Tests alone are not sufficient verification. A PR is verified only when its unit, live, and perf boxes are all checked (the **prove-it-works** principle skill). That sentence is the verification rule. Every verification block opens with it. The live block is mandatory. Parallel verification lanes at the PR head drive the real surface through the matching verification tool, per the **swarm** skill. Each lane is one box with a concrete scenario, the screenshot or recording it saves, and its pass predicate. The perf block names the metric, the probe, the trunk baseline measured first, and the rule with the number that fails. A PR that changes an interaction is review-gated. The operator reviews it in chat with screenshots and a video before merge. A PR that changes no interaction writes `**Review gate.** None. is not review-gated.` and no boxes under it. +**Verification.** Tests alone are not sufficient verification. A PR is verified only when its unit, live, and perf boxes are all checked (the **prove-it-works** principle skill). That sentence is the verification rule. Every verification block opens with it. The live block is mandatory. Parallel verification lanes at the PR head drive the real surface through the matching verification tool, using Antigravity's built-in `swarm` tool or parallel `invoke_subagent` workers. Each lane is one box with a concrete scenario, the screenshot or recording it saves, and its pass predicate. The perf block names the metric, the probe, the trunk baseline measured first, and the rule with the number that fails. A PR that changes an interaction is review-gated. The operator reviews it in chat with screenshots and a video before merge. A PR that changes no interaction writes `**Review gate.** None. is not review-gated.` and no boxes under it. **Control and Verification.** Pick by surface. Browser and web UIs use `browser_subagent` or Chrome DevTools MCP. CLIs and TUIs use `run_command` / `manage_task` or project-local verify skills (`verify-*` via `/create-verification-skill`). Native mobile uses simulator test runners. A PR that touches two surfaces gets lanes on both. A surface with no automated test harness is a risk in Appendix C, and its live block still names how each lane drives it. @@ -35,7 +35,6 @@ Tests alone are not sufficient verification. A PR is verified only when its unit - [ ] On the operator's go, arm a `/goal` with this exact text. "" - [ ] Read these from trunk at program start. Re-read them at every tick. - [ ] `git show origin/main:skills/poteto-mode/playbooks/.md` - - [ ] `git show origin/main:skills/swarm/SKILL.md` - [ ] `git show origin/main:` - [ ] `git show origin/main:skills/poteto-mode/playbooks/opening-a-pr.md` - [ ] `git show origin/main:skills/` @@ -62,7 +61,7 @@ Tests alone are not sufficient verification. A PR is verified only when its unit ### Verdict and merge, for every PR -- [ ] At the merge-ready head SHA, run the swarm per `skills/swarm/SKILL.md`. One gates lane. The ten live lanes from the PR's **Verify, live** block. The perf lane from its **Verify, perf** block. One audit lane that reads the diff and the receipts and distrusts the PR body. +- [ ] At the merge-ready head SHA, run parallel verification lanes via Antigravity's built-in `swarm` tool (or `invoke_subagent`). One gates lane. The ten live lanes from the PR's **Verify, live** block. The perf lane from its **Verify, perf** block. One audit lane that reads the diff and the receipts and distrusts the PR body. - [ ] Clean only when every lane is `PASS`. Findings go back to the owner. A new head gets a fresh swarm and a fresh verdict. - [ ] @@ -97,7 +96,7 @@ Each live lane runs on its own branch/worktree at the PR head. Drive through bro - [ ] Run ``. -**Verify, live.** Tests alone are not sufficient verification. A PR is verified only when its unit, live, and perf boxes are all checked. Ten lanes on `` at the PR head, per the boot recipe. +**Verify, live.** Tests alone are not sufficient verification. A PR is verified only when its unit, live, and perf boxes are all checked. Ten lanes on `` at the PR head, per the boot recipe. - [ ] Lane 1. Save `.png`. Pass when . - [ ] Lane 2. Save `.png`. Pass when . diff --git a/skills/poteto-mode/references/antigravity-tools.md b/skills/poteto-mode/references/antigravity-tools.md index aa92784..6021aa9 100644 --- a/skills/poteto-mode/references/antigravity-tools.md +++ b/skills/poteto-mode/references/antigravity-tools.md @@ -24,9 +24,7 @@ Always operate on the most direct, authoritative surface for the task: | Subagent workspace isolation | `Workspace: "branch"` (isolated git branch/worktree) or `Workspace: "share"` | | `environment: "local"` | `Workspace: "inherit"` (default parent workspace) | | Worker iteration / message passing | `send_message` with `Recipient` and `Message` | -| Parallel fan-out (Local N <= 8) | Single `invoke_subagent` call with multiple entries in `Subagents` array | -| Parallel fan-out (Cloud N > 8) | `python3 "$(find ~/.gemini/config/plugins/agystack .agents/plugins/agystack skills/swarm -name "cloud_dispatch.py" 2>/dev/null | head -1)" --manifest --parallelism 16` | -| Cloud container worker | `python skills/swarm/scripts/cloud_worker.py` entrypoint in Cloud Run | +| Parallel fan-out | Single `invoke_subagent` call with multiple entries, or Antigravity's built-in `swarm` tool (`swarm`, `post_message`, `read_board`, `swarm_wait`) | | `AskQuestion` | `ask_question` tool for interactive questions | | Background Wake / Scheduling | `schedule` tool (one-shot timer `DurationSeconds` or recurring `CronExpression`) | | Background processes | `run_command` (async) + `manage_task` (status/kill/input) with reactive wakeup | @@ -58,47 +56,6 @@ When a command encounters exit code 126/127 or sandbox permission denial (`Permi 2. **Check if the query is investigatory and can be satisfied via native read tools.** Read-only queries against repository contents, code symbols, files, or commit logs can be satisfied using native filesystem tools (`view_file`, `find_by_name`, `grep_search`). 3. **If external mutation is required, explain the exact required permission grant or present the command.** Explicitly state the missing grant under `permissioned-github` (e.g. `gh.create` or `git.update`) or present the exact command for the human operator to run directly on the host. -## Parallel Cloud Agent Execution (Cloud Run Runtime) - -When running massive swarms (N > 8) or when Cloud Run runtime is configured, agystack uses Google Cloud Run Jobs for serverless parallel execution. - -### Runtime Profile and Cost Model - -- **On-Demand Batch Runner Only:** Cloud Run does not run continuously and is never an always-on server. Containers spin up strictly on demand. -- **Zero Idle Cost:** Costs $0 when idle. Charges apply only to active container execution seconds during a swarm job. -- **Local Daily Work:** Daily tasks (pair programming, routine edits, bug fixes, refactoring, code reviews via `/interrogate`, and local subagents) always run locally on your machine. -- **Explicit Swarm Trigger:** Cloud Run only spins up containers when you explicitly trigger `/swarm` (or ask to swarm a task across many parallel workers). - -### Architecture - -1. **Coordinator:** Generates task briefs into a JSON manifest and invokes `cloud_dispatch.py` via dynamic discovery. -2. **Cloud Run Job:** Spawns up to 100+ container tasks concurrently across Google Cloud compute. -3. **Container Instances:** Each instance executes `cloud_worker.py`, index-matched to its `CLOUD_RUN_TASK_INDEX`. -4. **Zero-Push Patch Delivery:** Worker clones, executes task, uploads score.json and patch.diff if verified PASS under zero-push architecture. -5. **Aggregation:** The dispatcher aggregates container logs and outputs a structured execution report. - -### Runtime Configuration (`agystack-runtime.json`) - -Saved at `~/.gemini/config/plugins/agystack/agystack-runtime.json` or `.agents/plugins/agystack/agystack-runtime.json`: - -```json -{ - "runtime": "cloud-run", - "project_id": "my-gcp-project", - "region": "us-central1", - "job_name": "agystack-swarm-worker", - "image": "us-central1-docker.pkg.dev/my-gcp-project/agystack/worker:latest", - "parallelism": 16, - "model": "gemini-3.8-flash" -} -``` - -### Credentials & Security - -- `GH_TOKEN`: Automatically retrieved from local GitHub CLI (`gh auth token`) and passed to Cloud Run Job environment. -- `GEMINI_API_KEY`: Sourced from environment and forwarded to container workers for SDK initialization. -- All tokens are redacted from dry-run displays and error logs. - ## Antigravity Native Artifacts Antigravity stores native artifacts under `/brain//`. @@ -197,17 +154,15 @@ There is a strict boundary between user-facing slash commands and programmatic a ### agystack Skills vs Native Platform Modes -agystack skills (`/interrogate`, `/arena`, `/architect`, `/swarm`) build directly on Antigravity's programmatic primitives (`invoke_subagent`, `run_command`, `schedule`, artifacts). They orchestrate independent subagents across isolated context windows, diverse model tiers (`pro`, `flash`, `inherit`), and segregated workspaces with automated verification and synthesis. +agystack skills (`/interrogate`, `/arena`, `/architect`) build directly on Antigravity's programmatic primitives (`invoke_subagent`, `run_command`, `schedule`, artifacts). They orchestrate independent subagents across isolated context windows, diverse model tiers (`pro`, `flash`, `inherit`), and segregated workspaces with automated verification and synthesis. For multi-slice coverage sweeps or parallel worker swarms, use Antigravity's built-in `swarm` tool (`swarm`, `post_message`, `read_board`, `swarm_wait`). ## Paths | Artifact / Config | Antigravity Path | | --- | --- | | Role models configuration | `~/.gemini/config/plugins/agystack/agystack-models.md` | -| Runtime execution config | `~/.gemini/config/plugins/agystack/agystack-runtime.json` | | Agent conversation transcripts | `/brain//.system_generated/logs/transcript.jsonl` (discovered across `~/.gemini/antigravity/brain/` and `~/.gemini/antigravity-ide/brain/`) | | Session artifacts | `/brain//` | -| Cloud worker scripts | `skills/swarm/scripts/` | | Project-local skills | `.agents/skills/` in the project, or this plugin's `skills/` | | User global skills | `~/.gemini/config/skills/` or `~/.gemini/config/plugins/agystack/skills/` | @@ -220,12 +175,12 @@ agystack skills (`/interrogate`, `/arena`, `/architect`, `/swarm`) build directl agystack enforces strict separation between coordinator planning and subagent code execution: -1. **Mandatory Subagent Delegation for Code Writes:** Delegate all non-trivial code modifications, feature implementations, bug fixes, and refactoring to a subagent (`invoke_subagent` with `TypeName: "poteto-agent"` or configured role model) in an isolated context window. The parent agent operates as coordinator: planning, reviewing the subagent's diffs, running verification, and communicating with the user using unslopped prose. Pass purely technical specs, interfaces, and test criteria to the subagent so its context remains unburdened by conversational prose guidelines. A subagent already running as a delegate, or executing in an environment where subagent spawning is disallowed (such as `allow_subagents=False` in cloud workers or subagents without nesting tools), satisfies this invariant by executing and owning the diff directly. +1. **Mandatory Subagent Delegation for Code Writes:** Delegate all non-trivial code modifications, feature implementations, bug fixes, and refactoring to a subagent (`invoke_subagent` with `TypeName: "poteto-agent"` or configured role model) in an isolated context window. The parent agent operates as coordinator: planning, reviewing the subagent's diffs, running verification, and communicating with the user using unslopped prose. Pass purely technical specs, interfaces, and test criteria to the subagent so its context remains unburdened by conversational prose guidelines. A subagent already running as a delegate, or executing in an environment where subagent spawning is disallowed (such as subagents without nesting tools or headless workers with `ALLOW_SUBAGENTS=false`), satisfies this invariant by executing and owning the diff directly. 2. **Iterative Worker Loops vs Fresh Spawns:** Use `send_message` for tight iterative worker loops on sequential adjustments to preserve active worker context and avoid re-reading repository state. Reserve fresh subagent spawns for distinct phase boundaries or clean units of work. -3. **Mandatory Subagent Fan-Out:** Call `invoke_subagent` for: +3. **Mandatory Subagent Fan-Out:** Call `invoke_subagent` (or Antigravity's built-in `swarm` tool) for: - **Adversarial Code Review (`/interrogate`):** Dispatch concurrent reviewers across distinct model tiers (`pro`, `flash`, `inherit`). In-context persona emulation is strictly prohibited. - **Design & Candidate Bakeoffs (`/arena`):** Dispatch parallel subagents in isolated workspaces or scratch paths. - - **Large Payload Sweeps (`/swarm`):** Offload wide search matrices or multi-slice tests to subagents to guard the main context window. + - **Large Payload Sweeps:** Offload wide search matrices or multi-slice tests to Antigravity's built-in `swarm` tool or `invoke_subagent` workers to guard the main context window. - **Blinded Behavioral Evals (`/eval`):** Run candidate tasks blindly through isolated subagents. - **Cross-Model Trail Audits (`/show-me-your-work`):** Dispatch an independent subagent on a different model tier before closing. @@ -238,6 +193,6 @@ agystack enforces strict separation between coordinator planning and subagent co Because `TimerCondition: "never"` is used, incremental completions wake the coordinator reactively without cancelling the timer. Once all workers arrive, cancel the active watchdog timer via `manage_task(Action: "kill", TaskId: )`. - **Timeout Diagnosis:** Call `manage_subagents(Action: "list")` ONLY when the watchdog timer fires or an explicit error occurs. Child transcripts may only be read for post-mortem diagnostics, never while waiting. - **State-Aware Inspection:** Before calling `manage_subagents(kill)`, inspect `state` and `stateDetail`. If `state` is `running` and `stateDetail` shows an active tool execution (like test runs or compilation), do not kill. -- **Local Verification Before Teardown:** In candidate races (`/arena`, `/swarm`), verify the winning candidate's patch locally before tearing down surviving runners. +- **Local Verification Before Teardown:** In candidate races (`/arena` or native swarms), verify the winning candidate's patch locally before tearing down surviving runners. - **Phase-Boundary Teardown:** Restrict cancellations strictly to phase transitions (Synthesis or Abort). - **Subagent Context Guard Invariant:** `inheritCustomizations: false` is recommended for dedicated background worker agents (e.g. `comment-sicko` or ephemeral task delegates) to guard child context windows against injecting 50+ unrelated global skills and coordinator rules (`rules/AGENTS.md`), while the primary chat coordinator agent maintains access to skills. The coordinator passes pure technical specs, signatures, and test commands directly in the dispatch prompt. diff --git a/skills/poteto-mode/scripts/check-plan.mjs b/skills/poteto-mode/scripts/check-plan.mjs index 1a3a30c..4e67dce 100755 --- a/skills/poteto-mode/scripts/check-plan.mjs +++ b/skills/poteto-mode/scripts/check-plan.mjs @@ -165,7 +165,7 @@ for (const pr of prSections) { const live = block("Verify, live."); if (live) { - if (!LANES_PATTERN.test(live.rest)) fail(live.n, `${pr.title}: Verify, live lacks "Ten lanes on \`\` at the PR head" with the model filled in`); + if (!LANES_PATTERN.test(live.rest)) fail(live.n, `${pr.title}: Verify, live lacks "Ten lanes on \`\` at the PR head" with the model filled in`); const lanes = boxes(live.lines).map((b) => ({ ...b, m: b.text.match(/^Lane (\d+)\. /) })); const numbers = lanes.filter((b) => b.m).map((b) => Number(b.m[1])).sort((a, b) => a - b); if (numbers.join(",") !== "1,2,3,4,5,6,7,8,9,10") fail(live.n, `${pr.title}: lanes are [${numbers.join(",")}], expected 1 to 10`); diff --git a/skills/poteto-mode/scripts/hooks/pre_tool_delegation.py b/skills/poteto-mode/scripts/hooks/pre_tool_delegation.py index 61ab9c1..29492af 100755 --- a/skills/poteto-mode/scripts/hooks/pre_tool_delegation.py +++ b/skills/poteto-mode/scripts/hooks/pre_tool_delegation.py @@ -33,9 +33,6 @@ def is_subagent_environment() -> bool: return True if is_truthy(os.environ.get("IS_SUBAGENT")): return True - if os.environ.get("CLOUD_RUN_TASK_INDEX"): - # Cloud Run workers are task execution delegates (allow_subagents=False) - return True return False diff --git a/skills/poteto-mode/scripts/hooks/pre_tool_safety.py b/skills/poteto-mode/scripts/hooks/pre_tool_safety.py index e4c6725..21693a9 100644 --- a/skills/poteto-mode/scripts/hooks/pre_tool_safety.py +++ b/skills/poteto-mode/scripts/hooks/pre_tool_safety.py @@ -3,7 +3,7 @@ Antigravity PreToolUse lifecycle hook for scoped destructive command safety. Intercepts run_command calls and prompts confirmation for destructive patterns (root deletion, trunk force-push, database drop) in interactive sessions. -In headless/CI/Cloud Run environments, rejects destructive commands with decision: deny. +In headless/CI/automated environments, rejects destructive commands with decision: deny. Outputs {} and exits 0 on all safe code paths. Never crashes. """ @@ -419,7 +419,7 @@ def is_headless_environment() -> bool: return True if os.environ.get("CI", "").lower() in ("1", "true"): return True - return bool(os.environ.get("CLOUD_RUN_TASK_INDEX")) + return False def main() -> None: diff --git a/skills/setup-agystack/SKILL.md b/skills/setup-agystack/SKILL.md index b864ed9..ebcba0b 100644 --- a/skills/setup-agystack/SKILL.md +++ b/skills/setup-agystack/SKILL.md @@ -1,20 +1,19 @@ --- name: setup-agystack -description: Configure models and execution runtime for agystack. Configures Antigravity model tiers per role and Cloud Run runtime settings for up to 100+ parallel workers. +description: Configure Antigravity model tiers per role for agystack and run local environment doctor checks. --- # Setup agystack -Configure model tiers in `~/.gemini/config/plugins/agystack/agystack-models.md` and execution runtime in `~/.gemini/config/plugins/agystack/agystack-runtime.json` (or workspace `.agents/plugins/agystack/`). +Configure model tiers in `~/.gemini/config/plugins/agystack/agystack-models.md` (or workspace `.agents/plugins/agystack/agystack-models.md`). ## Prerequisites -- `bun` (v1.0+) is mandatory for PR babysitting (`watch-pr`) and multi-agent orchestration (`orch`). Node.js is not supported. +- `bun` (v1.0+) is mandatory for PR babysitting (`watch-pr`) and TypeScript script tests (Node.js is used for `check-plan.mjs`). - `gh` (GitHub CLI) is required for PR automation and preflight checks. - `gt` (Graphite CLI) is recommended for stacked PRs. -- `google-cloud-storage`, `google-genai`, and `google-cloud-run` are optional Python libraries for GCS artifact storage, preflight checks, and Cloud Run job monitoring. -During setup, verify dependencies automatically via `--doctor`: +During setup, verify dependencies and platform health automatically via `--doctor`: ```bash python3 "$(find ~/.gemini/config/plugins/agystack .agents/plugins/agystack skills/setup-agystack -name "setup_runtime.py" 2>/dev/null | head -1)" --doctor @@ -22,62 +21,27 @@ python3 "$(find ~/.gemini/config/plugins/agystack .agents/plugins/agystack skill ## Steps -### 1. Select execution runtime +### 1. Detect available models -Choose the execution runtime for parallel swarms: -- **Local Runtime (Default):** Runs via native `invoke_subagent` in Antigravity for up to 8 concurrent workers. Zero cloud setup required. -- **Cloud Run Runtime:** Runs via Google Cloud Run Jobs for 10 to 100+ parallel workers in isolated container instances. Cloud Run is strictly an on-demand batch runner. It only spins up containers when you explicitly trigger `/swarm` (or ask to swarm a task across many parallel workers). It does not run continuously and is never an always-on server. It costs $0 when idle. Daily tasks (pair programming, routine edits, bug fixes, refactoring, code reviews via `/interrogate`, and local subagents) always run locally on your machine. +Enumerate the Antigravity model tiers you can pass to `invoke_subagent`: -**CRITICAL INSTRUCTION FOR AI AGENT WHEN PRESENTING RUNTIME CHOICE:** -When presenting the runtime choice to the user, explicitly explain the cost and execution model before asking them to choose: -1. Explain that Cloud Run is strictly an on-demand batch runner. It only spins up containers when the user explicitly triggers `/swarm` (or asks to swarm a task across many parallel workers). -2. Clarify that Cloud Run does NOT run continuously and is never an always-on server. -3. State that Cloud Run costs $0 when idle. -4. Reassure the user that daily tasks (pair programming, routine edits, bug fixes, refactoring, code reviews via `/interrogate`, and local subagents) ALWAYS run locally on their machine. - -If Cloud Run is selected: -**CRITICAL INSTRUCTION FOR AI AGENT FOR PROVISIONING:** NEVER print manual bash commands with placeholders (like ``) for the user to run. You MUST directly execute the setup commands yourself using `python3 "$(find ~/.gemini/config/plugins/agystack .agents/plugins/agystack skills/setup-agystack -name "setup_runtime.py" 2>/dev/null | head -1)"` right here in the chat environment. - -1. **Verify Quotas and Permissions:** - - **Google AI Studio API Key:** If using `GEMINI_API_KEY`, verify that paid billing (Pay-as-you-go / Tier 1+) is enabled on the AI Studio project. Free-tier API keys (capped at 5 requests per minute) are strictly prohibited for swarms because parallel workers will hit immediate rate limits. - - **Vertex AI Mode:** If using Vertex AI mode, verify that the GCP project has the Vertex AI API enabled (`aiplatform.googleapis.com`) and that the active user or service account has the Vertex AI User role (`roles/aiplatform.user`). - - **Model Availability:** Gemini 3 series models (`gemini-3.8-flash`) require global routing (`aiplatform.googleapis.com` with `locations/global`). Regional endpoints return HTTP 404 for Gemini 3.x. -2. **Check Requirements**: Run `python3 skills/setup-agystack/scripts/setup_runtime.py --check` to verify `gcloud` is available and authenticated. -3. **Select Project**: - - Query available projects by running `python3 skills/setup-agystack/scripts/setup_runtime.py --list-projects`. - - Ask the user which project they want to use, or if they want you to create a new one. -4. **Provisioning**: Once a project ID is known, run the full provisioner (do this yourself, do not ask the user to do it!): - `python3 skills/setup-agystack/scripts/setup_runtime.py --project --auto-provision --scripts-dir skills/swarm/scripts` - (or use `--create-project ` instead of `--project` if creating a new one). - -Do not leave the user to do the work. Complete the deployment end-to-end for them. Ensure `GEMINI_API_KEY` is exported in the user's environment with paid tier enabled (Pay-as-you-go), or Vertex AI permissions and global endpoint access are verified. - -### 2. Detect available models - -Enumerate the model tiers you can pass to `invoke_subagent` (local) and `cloud_dispatch.py` (Cloud Run): - -**Local subagent tiers (`invoke_subagent`):** - `pro`: High-capability tier (maximum reasoning budget for complex code, architecture, and hard tasks) - `flash`: Balanced fast tier (fast execution for exploration and standard generation) - `flash_lite`: Lightweight tier (minimal latency for quick lookups) - `inherit` (or `auto`): Inherit parent chat model -**Cloud Run swarm model tiers (`cloud_dispatch.py`):** -- **Tier 1 (Zero-Friction MaaS):** `gemini-4-argon`, `gemini-3.8-flash`, `deepseek-v4.1-flash` (Instant on global Vertex endpoint, zero forms). -- **Tier 2 (Gated Partner MaaS):** `claude-3-7-sonnet`, `claude-3-5-sonnet`, `claude-3-opus` (Requires one-time Console agreement). -- **Tier 3 (Dedicated GPU Endpoint):** Open-weights models like `glm-5-3-flash` requiring dedicated 8x H100/B200 GPU instances. - -### 3. Load current state +### 2. Load current state -If `~/.gemini/config/plugins/agystack/agystack-models.md` exists, read its current role assignments. Otherwise start from skill defaults. +If `~/.gemini/config/plugins/agystack/agystack-models.md` exists (or `.agents/plugins/agystack/agystack-models.md` for a workspace-local install), read its current role assignments. Otherwise start from skill defaults. If upgrading from an older install, remove any obsolete `swarm workers` line when rewriting `agystack-models.md`. -### 4. Map and confirm +### 3. Map and confirm Show every role with its model tier and confirm: -- Single roles: `feature, refactoring`, `bug-fix`, `perf-issue`, `hillclimb`, `swarm workers` -- Panel roles: `arena runners`, `architect runners`, `interrogate reviewers` +- Single roles: `feature, refactoring`, `bug-fix`, `perf-issue`, `hillclimb`, `judgment and prose`, `hardest tasks` +- Workflow roles: `how explorer`, `how explainer`, `why investigators`, `why synthesizer`, `reflect tooling`, `reflect judgment, divergent, synthesizer` +- Panel roles: `arena runners`, `arena cross-judge pool`, `architect runners`, `interrogate reviewers` -### 5. Write the model rule +### 4. Write the model rule Write to `.agents/plugins/agystack/agystack-models.md` if installed workspace-locally, otherwise `~/.gemini/config/plugins/agystack/agystack-models.md`: @@ -103,15 +67,14 @@ reflect tooling: pro reflect judgment, divergent, synthesizer: pro arena runners: pro, flash, inherit arena cross-judge pool: pro, flash, inherit -swarm workers: flash architect runners: pro, flash, inherit interrogate reviewers: pro, flash, inherit ``` -### 6. Confirm +### 5. Confirm -Confirm that the model rule and runtime settings are active for new sessions. +Confirm that the model rule is active for new sessions and `--doctor` reports `"status": "OK"`. -### 7. Offer a verification skill (optional) +### 6. Offer a verification skill (optional) If the project lacks an end-to-end verification harness, offer `/create-verification-skill`. diff --git a/skills/setup-agystack/scripts/setup_runtime.py b/skills/setup-agystack/scripts/setup_runtime.py index 79ca468..8d52ead 100644 --- a/skills/setup-agystack/scripts/setup_runtime.py +++ b/skills/setup-agystack/scripts/setup_runtime.py @@ -2,34 +2,17 @@ import json import os import re -import shutil import subprocess import sys from pathlib import Path -def run_cmd(cmd, check=True, capture_output=True): + +def run_cmd(cmd, check=False, capture_output=True): try: - res = subprocess.run(cmd, check=check, capture_output=capture_output, text=True) - return res + return subprocess.run(cmd, check=False, capture_output=capture_output, text=True) except FileNotFoundError as e: - if check: - print(f"Command not found: {cmd[0]}", file=sys.stderr) - sys.exit(1) return subprocess.CompletedProcess(cmd, returncode=127, stdout="", stderr=str(e)) - except subprocess.CalledProcessError as e: - print(f"Command failed: {' '.join(cmd)}\nError: {e.stderr}", file=sys.stderr) - if check: - sys.exit(1) - return e - -def check_gcloud(): - res = run_cmd(["gcloud", "--version"], check=False) - if res.returncode != 0: - return {"installed": False, "account": None} - - res = run_cmd(["gcloud", "auth", "list", "--filter=status:ACTIVE", "--format=value(account)"], check=False) - account = res.stdout.strip() - return {"installed": True, "account": account if account else None} + def _parse_version(stdout): if not stdout: @@ -46,7 +29,7 @@ def _parse_version(stdout): "name": "bun", "cmd": ["bun", "--version"], "required": True, - "notes": "Mandatory runtime for orchestration and babysitting", + "notes": "Mandatory runtime for PR babysitting (watch-pr) and TypeScript script tests", "missing_error": "bun is not installed or not found on PATH", "min_major": 1, "min_error": "Bun version 1.0+ required, found {version_str}", @@ -65,157 +48,10 @@ def _parse_version(stdout): "notes": "Recommended for stacked PRs", "missing_error": "gt (Graphite CLI) is not installed", }, - { - "name": "gcloud", - "cmd": ["gcloud", "--version"], - "required": False, - "notes": "Required for Cloud Run parallel worker runtime", - "missing_error": "gcloud is not installed", - }, -) - -PYTHON_DEPENDENCY_SPECS = ( - { - "name": "google.cloud.storage", - "package": "google-cloud-storage", - "required": False, - "notes": "Required for GCS swarm artifact storage and patch harvesting", - }, - { - "name": "google.genai", - "package": "google-genai", - "required": False, - "notes": "Required for Gemini API preflight probes and standalone models", - }, - { - "name": "google.cloud.run_v2", - "package": "google-cloud-run", - "required": False, - "notes": "Optional client library for Cloud Run job monitoring", - }, - { - "name": "anthropic", - "package": "anthropic[vertex]", - "required": False, - "notes": "Required for Vertex AI Model Garden partner models (Claude, Fable)", - }, ) -def check_model_garden(project_id=None, region="us-central1", run_cmd_fn=None, import_fn=None): - if run_cmd_fn is None: - run_cmd_fn = run_cmd - if import_fn is None: - import importlib - import_fn = importlib.import_module - - project = project_id if project_id is not None else get_active_project() - result = { - "ok": True, - "project_id": project, - "region": region, - "anthropic_installed": False, - "serverless_models": [ - "gemini-4-argon", - "gemini-3.8-flash", - "gemini-3.1-pro", - "deepseek-v4.1-flash-maas", - ], - "partner_models": [ - "claude-3-7-sonnet@20250219", - "claude-3-5-sonnet-v2@20241022", - "claude-3-opus@20240229", - "fable-5-1", - ], - "error": None, - } - - if not project: - result["ok"] = False - result["error"] = "No active GCP project found or specified. Run: gcloud config set project " - return result - - try: - mod = import_fn("anthropic") - result["anthropic_installed"] = True - if hasattr(mod, "AnthropicVertex"): - try: - _ = mod.AnthropicVertex(project_id=project, region=region) - except Exception as init_exc: - result["ok"] = False - result["error"] = f"Failed to initialize AnthropicVertex client: {init_exc}" - return result - except ImportError: - result["anthropic_installed"] = False - result["partner_models_note"] = "Optional package 'anthropic[vertex]' not installed for Claude partner models." - except Exception as exc: - result["ok"] = False - result["error"] = f"Error importing 'anthropic': {exc}" - return result - - # Lightweight verification check for IAM permissions / Model Garden API - try: - cmd = ["gcloud", "ai", "models", "list", f"--project={project}", f"--region={region}", "--limit=1"] - probe_res = run_cmd_fn(cmd, check=False) - if probe_res and hasattr(probe_res, "returncode"): - if probe_res.returncode != 0: - err_msg = getattr(probe_res, "stderr", "") or getattr(probe_res, "stdout", "") or f"Exit code {probe_res.returncode}" - result["ok"] = False - result["error"] = f"Model Garden API check failed for project '{project}': {err_msg.strip()}" - return result - result["model_garden_verified"] = True - except Exception as exc: - result["ok"] = False - result["error"] = f"Model Garden API check exception for project '{project}': {exc}" - return result - - return result - - -def check_python_dependencies(import_fn=None): - if import_fn is None: - import importlib - import_fn = importlib.import_module - - deps = {} - for spec in PYTHON_DEPENDENCY_SPECS: - name = spec["name"] - pkg = spec["package"] - notes = spec.get("notes", "") - required = spec.get("required", False) - try: - mod = import_fn(name) - ver = getattr(mod, "__version__", "installed") - deps[pkg] = { - "installed": True, - "version": ver if isinstance(ver, str) else "installed", - "ok": True, - "error": None, - "notes": notes, - "required": required, - } - except ImportError: - deps[pkg] = { - "installed": False, - "version": None, - "ok": not required, - "error": f"Python package '{pkg}' is not installed (run: pip install {pkg})", - "notes": notes, - "required": required, - } - except Exception as exc: - deps[pkg] = { - "installed": False, - "version": None, - "ok": not required, - "error": f"Failed to import '{name}': {exc}", - "notes": notes, - "required": required, - } - return deps - - -def check_dependencies(run_cmd_fn=None, include_python=True, import_fn=None): +def check_dependencies(run_cmd_fn=None): if run_cmd_fn is None: run_cmd_fn = run_cmd @@ -264,7 +100,7 @@ def check_dependencies(run_cmd_fn=None, include_python=True, import_fn=None): if min_major is not None and major is not None and major < min_major: min_error_template = spec.get( "min_error", - f"{name.capitalize()} version {min_major}.0+ required, found {{version_str}}" + f"{name.capitalize()} version {min_major}.0+ required, found {{version_str}}", ) deps[name] = { "installed": True, @@ -311,10 +147,6 @@ def check_dependencies(run_cmd_fn=None, include_python=True, import_fn=None): "required": required, } - if include_python: - py_deps = check_python_dependencies(import_fn=import_fn) - deps.update(py_deps) - return deps @@ -325,7 +157,16 @@ def check_hook_contract(hook_path=None, run_cmd_fn=None): paths = [ Path("skills/poteto-mode/scripts/hooks/pre_tool_safety.py"), Path(__file__).resolve().parents[3] / "skills" / "poteto-mode" / "scripts" / "hooks" / "pre_tool_safety.py", - Path.home() / ".gemini" / "config" / "plugins" / "agystack" / "skills" / "poteto-mode" / "scripts" / "hooks" / "pre_tool_safety.py", + Path.home() + / ".gemini" + / "config" + / "plugins" + / "agystack" + / "skills" + / "poteto-mode" + / "scripts" + / "hooks" + / "pre_tool_safety.py", Path(".agents/plugins/agystack/skills/poteto-mode/scripts/hooks/pre_tool_safety.py"), ] @@ -345,12 +186,7 @@ def check_hook_contract(hook_path=None, run_cmd_fn=None): "required": True, } - payload = json.dumps({ - "toolCall": { - "name": "run_command", - "args": {"CommandLine": "rm -rf /"} - } - }) + payload = json.dumps({"toolCall": {"name": "run_command", "args": {"CommandLine": "rm -rf /"}}}) env = os.environ.copy() env["NON_INTERACTIVE"] = "1" @@ -412,12 +248,16 @@ def check_artifact_dir(brain_dir=None): candidates = [] if os.environ.get("ANTIGRAVITY_APP_DATA_DIR"): candidates.append(Path(os.environ["ANTIGRAVITY_APP_DATA_DIR"]) / "brain") - candidates.extend([ - Path.home() / ".gemini" / "antigravity" / "brain", - Path.home() / ".gemini" / "antigravity-ide" / "brain", - ]) + candidates.extend( + [ + Path.home() / ".gemini" / "antigravity" / "brain", + Path.home() / ".gemini" / "antigravity-ide" / "brain", + ] + ) if os.environ.get("ANTIGRAVITY_CONVERSATION_ID") and os.environ.get("ANTIGRAVITY_APP_DATA_DIR"): - candidates.append(Path(os.environ["ANTIGRAVITY_APP_DATA_DIR"]) / "brain" / os.environ["ANTIGRAVITY_CONVERSATION_ID"]) + candidates.append( + Path(os.environ["ANTIGRAVITY_APP_DATA_DIR"]) / "brain" / os.environ["ANTIGRAVITY_CONVERSATION_ID"] + ) target = None for cand in candidates: @@ -468,17 +308,17 @@ def parse_model_config(config_path=None): if config_path: paths = [Path(config_path)] else: + plugin_root = Path(__file__).resolve().parents[3] + global_root = Path.home() / ".gemini" / "config" / "plugins" / "agystack" paths = [ - # 1. Standard: Plugin root - Path.home() / ".gemini" / "config" / "plugins" / "agystack" / "agystack-models.md", - Path(__file__).resolve().parents[3] / "agystack-models.md", - Path("agystack-models.md"), Path(".agents/plugins/agystack/agystack-models.md"), - # 2. Legacy fallback: rules/ subdirectory - Path.home() / ".gemini" / "config" / "plugins" / "agystack" / "rules" / "agystack-models.md", - Path(__file__).resolve().parents[3] / "rules" / "agystack-models.md", - Path("rules/agystack-models.md"), + Path("agystack-models.md"), + plugin_root / "agystack-models.md", + global_root / "agystack-models.md", Path(".agents/plugins/agystack/rules/agystack-models.md"), + Path("rules/agystack-models.md"), + plugin_root / "rules" / "agystack-models.md", + global_root / "rules" / "agystack-models.md", ] target = None @@ -535,30 +375,59 @@ def parse_model_config(config_path=None): } -def check_platform(hook_path=None, brain_dir=None, model_config_path=None, run_cmd_fn=None): +def check_skill_collisions(plugin_root=None): + root = Path(plugin_root).resolve() if plugin_root else Path(__file__).resolve().parents[3] + swarm_path = root / "skills" / "swarm" + if swarm_path.exists(): + return { + "ok": False, + "path": str(swarm_path), + "collision": True, + "error": f"Legacy skills/swarm directory shadows Antigravity built-in swarm; remove {swarm_path}", + "required": True, + } + return { + "ok": True, + "path": str(swarm_path), + "collision": False, + "error": None, + "required": True, + } + + +def check_platform(hook_path=None, brain_dir=None, model_config_path=None, plugin_root=None, run_cmd_fn=None): hook_result = check_hook_contract(hook_path=hook_path, run_cmd_fn=run_cmd_fn) artifact_result = check_artifact_dir(brain_dir=brain_dir) model_result = parse_model_config(config_path=model_config_path) + collision_result = check_skill_collisions(plugin_root=plugin_root) checks = { "hook_contract": hook_result, "artifact_dir": artifact_result, "model_config": model_result, + "skill_collisions": collision_result, } all_ok = all(c.get("ok", False) for c in checks.values() if isinstance(c, dict) and c.get("required")) checks["ok"] = all_ok return checks -def run_doctor(run_cmd_fn=None, include_python=True, import_fn=None, hook_path=None, brain_dir=None, model_config_path=None): - deps = check_dependencies(run_cmd_fn=run_cmd_fn, include_python=include_python, import_fn=import_fn) - platform = check_platform(hook_path=hook_path, brain_dir=brain_dir, model_config_path=model_config_path, run_cmd_fn=run_cmd_fn) +def run_doctor(run_cmd_fn=None, hook_path=None, brain_dir=None, model_config_path=None, plugin_root=None): + deps = check_dependencies(run_cmd_fn=run_cmd_fn) + platform = check_platform( + hook_path=hook_path, + brain_dir=brain_dir, + model_config_path=model_config_path, + plugin_root=plugin_root, + run_cmd_fn=run_cmd_fn, + ) result = dict(deps) result["platform"] = platform result["safety_hook"] = platform["hook_contract"] result["artifact_dir"] = platform["artifact_dir"] result["model_config"] = platform["model_config"] + result["skill_collisions"] = platform["skill_collisions"] all_deps_ok = all(dep.get("ok", False) for dep in deps.values() if isinstance(dep, dict) and dep.get("required")) platform_ok = platform.get("ok", False) @@ -567,367 +436,23 @@ def run_doctor(run_cmd_fn=None, include_python=True, import_fn=None, hook_path=N return result, overall_ok -def get_active_project(): - res = run_cmd(["gcloud", "config", "get-value", "project"], check=False) - project = res.stdout.strip() - return project if project else None - -def list_projects(): - res = run_cmd(["gcloud", "projects", "list", "--format=json"], check=False) - if res.returncode != 0: - return [] - try: - projects = json.loads(res.stdout.strip()) - return [{"projectId": p.get("projectId"), "name": p.get("name")} for p in projects] - except json.JSONDecodeError: - return [] - -def create_project(project_id): - print(f"Creating project {project_id}...") - run_cmd(["gcloud", "projects", "create", project_id]) - print("Setting active project...") - run_cmd(["gcloud", "config", "set", "project", project_id]) - try: - res = run_cmd(["gcloud", "billing", "accounts", "list", "--format=json"], check=False) - if getattr(res, "returncode", 1) == 0: - accounts = json.loads(getattr(res, "stdout", "[]")) - open_accounts = [a for a in accounts if a.get("open", False)] - if open_accounts: - billing_id = open_accounts[0].get("name", "").split("/")[-1] - print(f"Linking billing account {billing_id} to project {project_id}...") - run_cmd(["gcloud", "billing", "projects", "link", project_id, f"--billing-account={billing_id}"], check=False) - except Exception: - pass - -def enable_apis(project_id): - print(f"Enabling APIs for {project_id}...") - run_cmd([ - "gcloud", "services", "enable", - "run.googleapis.com", - "artifactregistry.googleapis.com", - "cloudbuild.googleapis.com", - "aiplatform.googleapis.com", - "storage.googleapis.com", - "secretmanager.googleapis.com", - f"--project={project_id}" - ]) - -def ensure_gcs_bucket(bucket_name, project_id, region="us-central1"): - clean_name = bucket_name[5:] if bucket_name.startswith("gs://") else bucket_name - clean_name = clean_name.strip("/") - bucket_uri = f"gs://{clean_name}" - print(f"Checking if GCS bucket exists: {bucket_uri}...") - res = run_cmd(["gcloud", "storage", "buckets", "describe", bucket_uri], check=False) - if res.returncode != 0: - print(f"Bucket {bucket_uri} does not exist. Creating in {region} for project {project_id}...") - run_cmd([ - "gcloud", "storage", "buckets", "create", bucket_uri, - f"--project={project_id}", - f"--location={region}" - ]) - else: - print(f"Bucket {bucket_uri} already exists.") - return clean_name - -def get_project_number(project_id): - res = run_cmd(["gcloud", "projects", "describe", project_id, "--format=value(projectNumber)"], check=False) - if getattr(res, "returncode", 1) == 0: - stdout = getattr(res, "stdout", "") - if isinstance(stdout, str) and stdout.strip(): - return stdout.strip() - elif stdout and not isinstance(stdout, str): - val = str(stdout).strip() - if val and "MagicMock" not in val: - return val - return None - -def configure_iam_permissions(project_id, service_account=None): - if not service_account: - project_num = get_project_number(project_id) - if project_num: - service_account = f"{project_num}-compute@developer.gserviceaccount.com" - else: - service_account = f"{project_id}-compute@developer.gserviceaccount.com" - - member = service_account if service_account.startswith("serviceAccount:") else f"serviceAccount:{service_account}" - roles = ["roles/aiplatform.user", "roles/storage.objectAdmin", "roles/secretmanager.secretAccessor"] - for role in roles: - print(f"Binding IAM role {role} to {member} in project {project_id}...") - run_cmd([ - "gcloud", "projects", "add-iam-policy-binding", project_id, - f"--member={member}", - f"--role={role}" - ]) - return service_account - -def ensure_secret_manager(project_id, secret_name="agystack-gh-token", secret_val=None, service_account=None): - print(f"Ensuring Secret Manager secret: {secret_name}...") - res = run_cmd(["gcloud", "secrets", "describe", secret_name, f"--project={project_id}"], check=False) - if getattr(res, "returncode", 1) != 0: - print(f"Creating secret {secret_name} in project {project_id}...") - run_cmd([ - "gcloud", "secrets", "create", secret_name, - "--replication-policy=automatic", - f"--project={project_id}" - ]) - if secret_val: - print(f"Adding new version to secret {secret_name}...") - run_cmd([ - "gcloud", "secrets", "versions", "add", secret_name, - "--data-file=-", - f"--project={project_id}" - ], check=False) - if service_account: - member = service_account if service_account.startswith("serviceAccount:") else f"serviceAccount:{service_account}" - print(f"Binding roles/secretmanager.secretAccessor to {member} for {secret_name}...") - run_cmd([ - "gcloud", "secrets", "add-iam-policy-binding", secret_name, - f"--member={member}", - "--role=roles/secretmanager.secretAccessor", - f"--project={project_id}" - ], check=False) - return secret_name - -def build_and_deploy_worker(project_id, region, image_tag, scripts_dir, job_name="agystack-swarm-worker", service_account=None): - print(f"Creating Artifact Registry repository in {region}...") - res = run_cmd([ - "gcloud", "artifacts", "repositories", "describe", "agystack", - f"--location={region}", - f"--project={project_id}" - ], check=False) - - if res.returncode != 0: - run_cmd([ - "gcloud", "artifacts", "repositories", "create", "agystack", - "--repository-format=docker", - f"--location={region}", - f"--project={project_id}" - ]) - - staged_dirs = [] - scripts_path = Path(scripts_dir).resolve() - repo_root = scripts_path.parents[2] if len(scripts_path.parents) >= 3 else scripts_path - ignored_patterns = { - ".git", - "__pycache__", - ".pytest_cache", - ".ruff_cache", - "node_modules", - ".venv", - "venv", - } - try: - for folder in ("skills", "rules", "agents"): - src = repo_root / folder - dst = scripts_path / folder - if dst.exists(): - shutil.rmtree(dst, ignore_errors=True) - if src.is_dir(): - dst_resolved = dst.resolve() - - def _ignore_copy(directory, contents): - dir_p = Path(directory).resolve() - ignored = set() - for item in contents: - if item in ignored_patterns: - ignored.add(item) - continue - resolved_item = (dir_p / item).resolve() - if resolved_item == dst_resolved or resolved_item == scripts_path or scripts_path in resolved_item.parents or resolved_item in scripts_path.parents: - ignored.add(item) - return ignored - - shutil.copytree(src, dst, ignore=_ignore_copy) - staged_dirs.append(dst) - - print("Submitting Cloud Build...") - run_cmd([ - "gcloud", "builds", "submit", - f"--tag={image_tag}", - scripts_dir, - f"--project={project_id}", - f"--region={region}" - ], capture_output=False) - finally: - for staged in staged_dirs: - try: - shutil.rmtree(staged, ignore_errors=True) - except Exception: - pass - - print("Creating/Updating Cloud Run Job...") - res = run_cmd([ - "gcloud", "run", "jobs", "describe", job_name, - f"--region={region}", - f"--project={project_id}" - ], check=False) - - action = "update" if res.returncode == 0 else "create" - cmd = [ - "gcloud", "run", "jobs", action, job_name, - f"--image={image_tag}", - f"--region={region}", - f"--project={project_id}", - "--tasks=1", - "--task-timeout=30m", - "--memory=2Gi", - "--cpu=2", - "--parallelism=16", - "--max-retries=0", - ] - if service_account: - cmd.append(f"--service-account={service_account}") - run_cmd(cmd) - -def write_runtime_config(project_id, region, job_name, image_tag, auth_mode="vertex", gcs_bucket="", vertex_location="global", target_paths=None, service_account=None, secrets=None): - config = { - "runtime": "cloud-run", - "project_id": project_id, - "region": region, - "job_name": job_name, - "image": image_tag, - "parallelism": 16, - "model": "inherit", - "auth_mode": auth_mode, - "vertex_location": vertex_location, - "gcs_bucket": gcs_bucket if gcs_bucket is not None else "", - } - if service_account: - config["service_account"] = service_account - if secrets: - config["secrets"] = secrets - - paths = target_paths or [ - Path.home() / ".gemini" / "config" / "plugins" / "agystack" / "agystack-runtime.json" - ] - - for p in paths: - p = Path(p) - try: - p.parent.mkdir(parents=True, exist_ok=True) - with open(p, "w", encoding="utf-8") as f: - json.dump(config, f, indent=2) - print(f"Wrote configuration to {p}") - except Exception as e: - print(f"Notice: Could not write to {p}: {e}") - return config - -def run_provisioning( - project_id, - region="us-central1", - image_tag=None, - scripts_dir=".", - bucket_name=None, - service_account=None, - job_name="agystack-swarm-worker", - auth_mode="vertex", - gh_token=None, - secret_name=None, - secrets=None, -): - if image_tag and (Path(image_tag).is_dir() or ("/" in image_tag and not (":" in image_tag or "docker.pkg.dev" in image_tag or "gcr.io" in image_tag))): - scripts_dir = image_tag - image_tag = None - if not image_tag: - image_tag = f"{region}-docker.pkg.dev/{project_id}/agystack/worker:latest" - if not bucket_name: - bucket_name = f"{project_id}-swarm-results" - - if not scripts_dir or not (Path(scripts_dir) / "Dockerfile").is_file(): - candidate = Path(__file__).resolve().parents[2] / "swarm" / "scripts" - if (candidate / "Dockerfile").is_file(): - scripts_dir = str(candidate) - - print(f"Starting auto-provisioning for project: {project_id}") - enable_apis(project_id) - ensure_gcs_bucket(bucket_name, project_id, region) - sa_email = configure_iam_permissions(project_id, service_account) - - configured_secrets = dict(secrets) if isinstance(secrets, dict) else {} - if gh_token or secret_name: - sec_name = secret_name or "agystack-gh-token" - ensure_secret_manager(project_id, secret_name=sec_name, secret_val=gh_token, service_account=sa_email) - configured_secrets["GH_TOKEN"] = f"{sec_name}:latest" - - build_and_deploy_worker(project_id, region, image_tag, scripts_dir, job_name=job_name, service_account=sa_email) - write_runtime_config( - project_id=project_id, - region=region, - job_name=job_name, - image_tag=image_tag, - auth_mode=auth_mode, - gcs_bucket=bucket_name, - service_account=sa_email, - secrets=configured_secrets if configured_secrets else None, - ) - print("Auto-provisioning complete.") - return { - "project_id": project_id, - "region": region, - "job_name": job_name, - "image": image_tag, - "gcs_bucket": bucket_name, - "service_account": sa_email, - "secrets": configured_secrets if configured_secrets else None, - } - def main(): parser = argparse.ArgumentParser(description="AgyStack Runtime Setup Helper") - parser.add_argument("--doctor", action="store_true", help="Check dependencies and Antigravity platform health and report status") - parser.add_argument("--check", action="store_true", help="Check gcloud status") - parser.add_argument("--list-projects", action="store_true", help="List accessible GCP projects") - parser.add_argument("--project", type=str, help="Use existing project ID") - parser.add_argument("--create-project", type=str, help="Create a new project ID") - parser.add_argument("--region", type=str, default="us-central1", help="GCP Region (default us-central1)") - parser.add_argument("--auto-provision", action="store_true", help="Enable APIs, build, deploy, and configure") - parser.add_argument("--scripts-dir", type=str, default=".", help="Directory containing Dockerfile for worker") - parser.add_argument("--bucket", type=str, help="GCS bucket name for swarm results") - parser.add_argument("--service-account", type=str, help="Cloud Run compute service account") - parser.add_argument("--check-model-garden", action="store_true", help="Check Vertex AI Model Garden partner model availability and permissions") - + parser.add_argument( + "--doctor", + action="store_true", + help="Check dependencies and Antigravity platform health and report status", + ) + args = parser.parse_args() - - if args.check_model_garden: - proj = args.project or get_active_project() - status = check_model_garden(project_id=proj, region=args.region) - print(json.dumps(status, indent=2)) - sys.exit(0 if status.get("ok") else 1) if args.doctor: report, overall_ok = run_doctor() print(json.dumps(report, indent=2)) sys.exit(0 if overall_ok else 1) - if args.check: - status = check_gcloud() - status["active_project"] = get_active_project() - print(json.dumps(status, indent=2)) - return - - if args.list_projects: - projects = list_projects() - print(json.dumps(projects, indent=2)) - return - - project_id = args.project - if args.create_project: - create_project(args.create_project) - project_id = args.create_project - - if args.auto_provision: - if not project_id: - project_id = get_active_project() - if not project_id: - print("Error: No project specified and no active project found. Use --project or --create-project.") - sys.exit(1) - - run_provisioning( - project_id=project_id, - region=args.region, - scripts_dir=args.scripts_dir, - bucket_name=getattr(args, "bucket", None), - service_account=getattr(args, "service_account", None), - ) + parser.print_help() + if __name__ == "__main__": main() diff --git a/skills/swarm/SKILL.md b/skills/swarm/SKILL.md deleted file mode 100644 index 2fc9de5..0000000 --- a/skills/swarm/SKILL.md +++ /dev/null @@ -1,162 +0,0 @@ ---- -name: swarm -description: "Fan out N parallel workers, drain them, and return one report. Use for /swarm, 'swarm this', or parallel coverage, races, gauntlets, and exploration." ---- - -# Swarm - -Fan out N parallel workers locally or across Google Cloud Run. Workers cover separate slices or race the same brief. The parent coordinator waits, aggregates, and returns one consolidated report. - -## Start - -Open a todolist with one entry per phase before launching anything. - -1. Frame -2. Fan out -3. Aggregate -4. Report - -## Phase A: Frame - -1. State the done predicate and the deliverable artifact or report. -2. Choose the shape: partition into slices, race N workers on identical briefs, or mix both. For a race, declare `first pass`, `rank all`, or `best-of`. -3. Set N. N is total workers. -4. Pick worker model from `swarm workers` in `~/.gemini/config/plugins/agystack/agystack-models.md` (default: `flash`). -5. Check execution runtime: - - If `agystack-runtime.json` does not exist or specifies `"runtime": "local"`, use local subagents for N <= 8. - - If N > 8 or `agystack-runtime.json` specifies `"runtime": "cloud-run"`, use Cloud Run dispatch. - -## Phase B: Fan out - -### Local Subagents (N <= 8) - -Spawn all N workers in one `invoke_subagent` call with `TypeName: "poteto-agent"` (or `"self"`), `Role: "Swarm Worker ()"`, `Workspace: "branch"`, and the configured model. In each worker prompt, explicitly provide `{PARENT_CONVERSATION_ID}` and mandate that upon task completion, the worker MUST invoke `send_message` with `Recipient: "{PARENT_CONVERSATION_ID}"` to deliver its slice status and findings (mirroring `skills/interrogate/references/reviewer-prompt.md`) so the coordinator receives reactive wakeups without timing out. - -**Reactive Dispatch & Watchdog Protocol:** -- **Turn 1 (Dispatch & Arm):** Dispatch local workers via `invoke_subagent` and arm a single global watchdog deadline using `schedule(DurationSeconds: 300..600, Prompt="Watchdog: swarm workers timed out", TimerCondition: "never")`. -- **Turn 2 (Yield):** Output a status update with ZERO tool calls (`tool_calls: []`). Never run busy polling loops on local subagents. -- **Incremental Arrivals:** On each worker arrival via `send_message`, record slice results and yield immediately with ZERO tool calls if workers remain active. -- **Teardown & Completion:** Once all N workers complete, cancel the watchdog timer via `manage_task(Action: "kill", TaskId: )` and proceed to Phase C. If the watchdog fires, diagnose via `manage_subagents(Action: "list")`, terminate unresponsive workers (`manage_subagents(Action: "kill", ConversationIds: [])`), and aggregate available slice results. - -### Cloud Run Dispatch (N > 8 or Cloud Run Runtime) - -Cloud Run swarms enable parallel execution across dozens or hundreds of container tasks. - -**Model Selection & Friction Tiers:** - -Before launching cloud swarms, match the model to the project's Model Garden enablement status: - -| Tier | Models | Endpoint Type | Friction | Setup Required | -|---|---|---|---|---| -| **Tier 1: Native MaaS** | `gemini-4-argon`, `gemini-3.8-flash`, `deepseek-v4.1-flash` | Global Serverless | **Zero** | Instant via existing ADC / project IAM | -| **Tier 2: Gated Partner MaaS** | `claude-3-7-sonnet`, `claude-3-5-sonnet`, `claude-3-opus` | Regional Serverless | **Low / One-Time** | Console agreement click-through required | -| **Tier 3: Dedicated GPU** | `glm-5-3-flash`, `llama-3.3-70b` | Dedicated Endpoint | **High** | Dedicated 8x H100/B200 GPU instance provisioning | - -**Quota & Auth Prerequisites:** -- **Paid Tier API Key or Vertex AI:** Cloud Run swarms require either a paid Google AI Studio tier (Pay-as-you-go / Tier 1+) or verified Vertex AI permissions (`roles/aiplatform.user` on the target project). Free-tier API keys (5 RPM) are prohibited as parallel container workers will immediately exhaust quota and fail. -- **Git Authentication:** A valid GitHub token (`gh auth token` or `GH_TOKEN` / `GITHUB_TOKEN`) with repository clone access. Under the zero-push architecture, cloud containers do not require git push access. - -**Dispatch Workflow:** - -1. **Prepare Task Manifest:** - Create a manifest JSON array at `/brain//scratch/swarm-/manifest.json`. - The manifest supports both autonomous agent coding (`"type": "agent"`, default) and direct command execution (`"type": "command"` for sweeps/benchmarks), along with optional `"verify_command"` and `"candidate_files"`: - ```json - [ - { - "task_index": 0, - "type": "agent", - "branch": "worker-0", - "brief": "Implement hypothesis A in src/ordering/mod.rs and verify with test suite.", - "verify_command": "cargo test --release", - "candidate_files": ["src/ordering/mod.rs"] - }, - { - "task_index": 1, - "type": "command", - "command": "python3 evaluate_slice.py --slice 0..50" - } - ] - ``` - -2. **Execute Active Pre-Flight Check:** - Run active pre-flight validation to ensure credentials, git remotes, model endpoints, and GCS buckets are reachable before spinning up compute: - ```bash - python3 "${AGYSTACK_DISPATCH_SCRIPT:-$(find -L "$HOME/.gemini/config/plugins/agystack" ".agents/plugins/agystack" "skills/swarm/scripts" -name cloud_dispatch.py 2>/dev/null | head -n 1)}" --preflight --gcs-bucket --model gemini-3.8-flash --vertex - ``` - (Pre-flight runs automatically by default during dispatch unless `--no-preflight` is specified.) - -3. **Launch the Swarm & Stream Real-Time Milestones:** - Launch cloud dispatch CLI with unbuffered streaming and fail-fast candidate evaluation: - ```bash - python3 "${AGYSTACK_DISPATCH_SCRIPT:-$(find -L "$HOME/.gemini/config/plugins/agystack" ".agents/plugins/agystack" "skills/swarm/scripts" -name cloud_dispatch.py 2>/dev/null | head -n 1)}" \ - --manifest \ - --tasks \ - --gcs-bucket \ - --model gemini-3.8-flash \ - --vertex - ``` - Pass `--vertex` to enable Vertex AI mode (IAM / ADC authentication) instead of Google AI Studio API key. When `agystack-runtime.json` specifies `"auth_mode": "vertex"`, workers authenticate via Google Cloud IAM/ADC without requiring `GEMINI_API_KEY`. Concurrency (default 16) and fail-fast zero retries (`--max-retries=0`) are configured directly on the Cloud Run job template during `/setup-agystack` (`setup_runtime.py`). - - **Asynchronous Coordination & Detached Monitoring:** - When coordinating asynchronously, pass `--no-wait` to `cloud_dispatch.py` to prevent blocking the agent turn: - ```bash - # Dispatch asynchronously and return execution handle immediately - python3 "${AGYSTACK_DISPATCH_SCRIPT:-$(find -L "$HOME/.gemini/config/plugins/agystack" ".agents/plugins/agystack" "skills/swarm/scripts" -name cloud_dispatch.py 2>/dev/null | head -n 1)}" \ - --manifest \ - --tasks \ - --gcs-bucket \ - --no-wait - - # Harvest and rank candidate patches from an existing session without launching compute - python3 "${AGYSTACK_DISPATCH_SCRIPT:-$(find -L "$HOME/.gemini/config/plugins/agystack" ".agents/plugins/agystack" "skills/swarm/scripts" -name cloud_dispatch.py 2>/dev/null | head -n 1)}" \ - --harvest-session --gcs-bucket --baseline-score - - # Attach to a running execution to stream milestones and harvest upon completion - python3 "${AGYSTACK_DISPATCH_SCRIPT:-$(find -L "$HOME/.gemini/config/plugins/agystack" ".agents/plugins/agystack" "skills/swarm/scripts" -name cloud_dispatch.py 2>/dev/null | head -n 1)}" \ - --wait-execution --session --gcs-bucket - ``` - The dispatcher automatically executes pre-flight checks, retrieves `GH_TOKEN` via `gh auth token`, executes the Cloud Run Job, streams real-time unbuffered `[MILESTONE]` execution progress directly to stdout as events occur, and aggregates final candidate patches into a ranked summary report. Dispatchers and coordinators must never block passively on buffered command execution. - - **Observability, Loop Alarms & In-Flight Steering:** - - **Task-Attributed Milestones:** Workers emit streaming stdout milestones formatted as `[MILESTONE] [TASK ] [PHASE: ] `, standardizing progress tracking and capturing internal SDK lifecycle events. - - **Loop Alarms (StagnancyTracker):** Non-destructive repetitiveness detection alerts on 3 consecutive identical tool invocations (`[ALARM] [TASK ] [POTENTIAL_LOOP]`) and injects warnings into model context without terminating execution. - - **Conversational Mailbox Steering Protocol:** Orchestrators steer in-flight workers asynchronously via structured GCS mailbox envelopes (`MailboxEnvelope`) stored under `swarms//tasks/task-/inbox/_steer.json`. - - *Monotonic Sequences & Idempotency:* Envelopes carry strictly monotonic sequence numbers (`0001_steer.json`). Workers acknowledge envelopes (`status=acknowledged`) and record processed sequence numbers in `_seen_steer_seqs` to guarantee idempotent delivery without duplicate execution across reconnects or retries. - - *GCS Timeout Resilience & Retry Logic:* Storage messenger operations employ exponential backoff retry loops (`retry_gcs_operation`) to handle transient network timeouts and connection resets when interacting with Cloud Storage. - - *Session Mailbox Cleanup:* Upon session completion, `cleanup_session` purges ephemeral mailbox envelopes (`cleanup_mailboxes`) across worker inboxes and outboxes while preserving task shadow transcripts. - - **CLI Steering Commands:** - - *Directed Steering:* `python3 cloud_dispatch.py steer --task --instruction "" [--session ] [--gcs-bucket ]` - - *Broadcast Steering:* `python3 cloud_dispatch.py steer --task all --instruction "" [--session ] [--gcs-bucket ]` delivers steering instructions to every worker in the swarm session. - - *Dedicated Utility:* `python3 steer_cloud_task.py --task --instruction "" [--session ] [--gcs-bucket ] [--abort]` wraps steering calls with structured validation (validating task indices, non-empty instructions, monotonic sequences, and bounds checking with exit code 1 on out-of-range targets). - - *Standardized Log Output:* Steering tools emit `[STEER] Instruction delivered to task- mailbox in GCS`. - - **In-Flight Redirection & Hook Interception:** - - Workers poll their GCS inboxes inside the agent's pre-tool execution hook (`pre_tool_call_decide`). - - *Dynamic Focus Adaptation:* General instructions emit `[MILESTONE] [TASK ] [PHASE: STEER_APPLIED] ` and inject custom context into the LLM prompt via `HookResult(allow=True, custom_context=instruction)`. - - *Immediate Abort Directives:* Instructions starting with `ABORT` or `CANCEL` emit `[MILESTONE] [TASK ] [PHASE: ABORT_REQUESTED] ` and cleanly terminate execution via `HookResult(allow=False, error_message=...)`. - - *Dashboard Reflection:* `SwarmDashboardWriter` captures steering dispatches to display `STEER_PENDING: ` under `Active Phase / Tool` and clears the pending status once `STEER_APPLIED` is acknowledged. - - **Subprocess Timeout Guards:** Shell command execution and verification scripts are bounded by explicit environment timeouts (`COMMAND_TIMEOUT`, `VERIFY_TIMEOUT`), preventing hanging processes from stalling container lifecycle. - -Every brief stands alone. Include goal, scope, exact slice, verification command, and expected report format (`[STATUS: PASS]`, `[STATUS: ISSUES]`, or `[STATUS: BLOCKED]` with evidence). - -## Phase C: Aggregate & Early Harvest - -1. For local workers: collect terminal reports from `invoke_subagent`. -2. For cloud workers: `cloud_dispatch.py` automatically harvests candidate patches from GCS into `.slices//task-/` and displays candidate patch file locations in the execution summary. -3. Apply selection rule (first pass, rank all, best-of): rank candidates by score delta descending. -4. **Candidate Integration Protocol:** Apply the winning `patch.diff` to a local worktree (`git apply .slices//task-/patch.diff`), run local verification, and commit. If verified, re-baseline and evaluate subsequent candidates sequentially. Never merge or compose multiple candidate patches simultaneously without intermediate verification (`principle-sequence-verifiable-units`). -5. Build a compact result table, one-line evidenced issues, and explicit dropouts. - -## Phase D: Report - -Return one consolidated in-chat report with the table, issue one-liners, gaps or dropouts, and the race rule when used. - -## Cloud Run Swarm Invariants - -Cloud Run swarms orchestrate massive parallel worker execution across container instances: - -1. **Mandatory Pre-Flight Quota & Auth Check:** Cloud Run swarms must verify model availability and paid/unmetered quota tier before spinning up containers. Free-tier API keys (5 RPM) are prohibited. The dispatcher must verify that credentials can sustain the swarm workload without rate-limiting before incurring compute overhead. -2. **Model Endpoint Scoping:** Google hosts Gemini 3 series models (`gemini-3.8-flash`, `gemini-3.7-flash`, etc.) exclusively on the global Vertex AI endpoint (`aiplatform.googleapis.com` with `locations/global`). Regional endpoints return HTTP 404 for Gemini 3.x. Always route Gemini 3.x requests to `global` and supply the `X-Goog-User-Project` header. -3. **Patch-over-GCS Candidate Delivery & Ghost Commit Prohibition:** Cloud workers operate under a zero-push architecture and must never push to git remote branches directly. When execution yields a verified `PASS` with candidate source modifications outside bootstrap scaffolding, workers generate a `patch.diff` and upload run artifacts (`score.json`, `patch.diff`, `results.tsv`) directly to GCS under `swarms//task-/`. The coordinator harvests patches from GCS, ranks candidate solutions by score delta, and applies the winning `patch.diff` locally. Cloud workers must never upload unverified infrastructure scaffolding or error-state changes as candidate patches. -4. **Active Liveness & Non-Blocking Monitoring (Cloud Run Swarms Only):** Applies strictly to external detached jobs (`cloud_dispatch.py --no-wait`) monitored via background CLI tasks. This NEVER applies to native local Antigravity subagents (`invoke_subagent`), which must follow the event-driven reactive wakeup invariant (zero polling). Swarm dispatchers must never block synchronously on buffered command execution (`subprocess.run` with `--wait` and `capture_output=True`). The parent coordinator must maintain an active heartbeat schedule (every 60-120s), polling Cloud Run execution conditions, streaming milestone logs, and checking git remotes. Never remain passive behind a monolithic background task. -5. **Straggler Independence & Early Candidate Harvesting:** Speculative candidate swarms must configure zero retries (`--max-retries=0`) so broken hypotheses fail fast. Coordinators monitor Cloud Run task completion and inspect storage manifests (`gs:///swarms//task-*`). As soon as a candidate achieves a verified score win, the coordinator harvests the patch and advances it immediately rather than waiting for slow or hanging stragglers. diff --git a/skills/swarm/scripts/Dockerfile b/skills/swarm/scripts/Dockerfile deleted file mode 100644 index 0a36906..0000000 --- a/skills/swarm/scripts/Dockerfile +++ /dev/null @@ -1,55 +0,0 @@ -FROM python:3.11-slim - -ENV PYTHONUNBUFFERED=1 \ - DEBIAN_FRONTEND=noninteractive \ - RUSTUP_HOME=/usr/local/rustup \ - CARGO_HOME=/usr/local/cargo \ - PATH=/usr/local/cargo/bin:$PATH \ - GEMINI_HOME=/home/worker/.gemini \ - AGYSTACK_PLUGIN_DIR=/home/worker/.gemini/config/plugins/agystack - -RUN apt-get update && apt-get install -y --no-install-recommends \ - git \ - git-lfs \ - curl \ - ca-certificates \ - gnupg \ - build-essential \ - pkg-config \ - libssl-dev \ - bubblewrap \ - util-linux \ - && mkdir -p /etc/apt/keyrings \ - && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ - && apt-get install -y --no-install-recommends nodejs \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal \ - && chmod -R a+w /usr/local/cargo \ - && chmod -R a+w /usr/local/rustup - -RUN useradd -m -u 1000 -s /bin/bash worker - -RUN git lfs install --system - -WORKDIR /app - -COPY requirements.txt /app/requirements.txt -RUN pip install --no-cache-dir -r /app/requirements.txt - -COPY cloud_worker.py /app/cloud_worker.py -COPY storage_uploader.py /app/storage_uploader.py -COPY storage_messenger.py /app/storage_messenger.py -COPY worker /app/worker - -COPY skills /home/worker/.gemini/config/plugins/agystack/skills -COPY rules /home/worker/.gemini/config/plugins/agystack/rules -COPY agents /home/worker/.gemini/config/plugins/agystack/agents - -RUN mkdir -p /workspace /home/worker/.gemini/config/plugins/agystack \ - && chown -R worker:worker /workspace /app /home/worker - -USER worker - -ENTRYPOINT ["python", "/app/cloud_worker.py"] diff --git a/skills/swarm/scripts/cloud_dispatch.py b/skills/swarm/scripts/cloud_dispatch.py deleted file mode 100644 index bf9e957..0000000 --- a/skills/swarm/scripts/cloud_dispatch.py +++ /dev/null @@ -1,1974 +0,0 @@ -#!/usr/bin/env python3 -""" -CLI dispatcher script called by /swarm or /orchestrate to launch Cloud Run Job -for parallel swarm agent execution. -Constructs and executes gcloud run jobs execute, streams status, and aggregates results. -""" - -import argparse -import json -import os -import re -import subprocess -import sys -import time -import urllib.error -import urllib.parse -import urllib.request -from pathlib import Path -from typing import Any, Dict, List, Optional, Set, Union - -try: - from storage_messenger import StorageMessenger -except ImportError: - StorageMessenger = None - -try: - from worker.partner_engine import PARTNER_MODEL_ALIASES, is_partner_model -except ImportError: - try: - from skills.swarm.scripts.worker.partner_engine import PARTNER_MODEL_ALIASES, is_partner_model - except ImportError: - is_partner_model = None - PARTNER_MODEL_ALIASES = {} - -try: - from worker.execution import LIMIT_ENV, TERMINAL_STATES, resolve_execution_limits -except ImportError: - from skills.swarm.scripts.worker.execution import LIMIT_ENV, TERMINAL_STATES, resolve_execution_limits - - -TIER3_DEDICATED_MODELS = { - "glm-5-3-flash", - "glm-5.3-flash", - "glm-5.3", - "llama-3.3-70b", - "llama-3.3-70b-instruct", - "llama-3.3", -} -DEEPSEEK_CANONICAL_ALIASES = { - "deepseek", - "deepseek-flash", - "deepseek-4.1", - "deepseek-v4.1", - "deepseek-4.1-flash", - "deepseek-v4.1-flash-maas", - "deepseek-v4.1-flash-maas@001", -} - - -def find_runtime_config() -> Optional[Dict[str, Any]]: - paths_to_check = [ - Path("agystack-runtime.json"), - Path(".agents/plugins/agystack/agystack-runtime.json"), - Path(os.path.expanduser("~/.gemini/config/plugins/agystack/agystack-runtime.json")), - ] - for path in paths_to_check: - if path.is_file(): - try: - with open(path, "r", encoding="utf-8") as f: - return json.load(f) - except Exception as exc: - print(f"Warning: Failed to parse runtime config at {path}: {exc}", file=sys.stderr) - return None - - -def get_git_remote_url() -> str: - try: - res = subprocess.run( - ["git", "config", "--get", "remote.origin.url"], - capture_output=True, - text=True, - check=True, - ) - return res.stdout.strip() - except Exception: - return "" - - -def get_gh_token() -> str: - token = os.environ.get("GH_TOKEN") or os.environ.get("GITHUB_TOKEN") or "" - if token.strip(): - return token.strip() - try: - res = subprocess.run( - ["gh", "auth", "token"], - capture_output=True, - text=True, - check=True, - ) - token = res.stdout.strip() - if token: - return token - except Exception: - pass - return "" - - -def build_authenticated_git_url(repo_url: str, gh_token: str) -> str: - repo_clean = repo_url.strip() - if repo_clean.startswith("git@github.com:"): - path = repo_clean[len("git@github.com:") :] - return f"https://x-access-token:{gh_token}@github.com/{path}" - if repo_clean.startswith("https://"): - parsed = urllib.parse.urlsplit(repo_clean) - netloc = parsed.netloc - if "@" in netloc: - netloc = netloc.split("@")[-1] - return f"https://x-access-token:{gh_token}@{netloc}{parsed.path}" - if repo_clean.startswith("http://"): - parsed = urllib.parse.urlsplit(repo_clean) - netloc = parsed.netloc - if "@" in netloc: - netloc = netloc.split("@")[-1] - return f"http://x-access-token:{gh_token}@{netloc}{parsed.path}" - if "/" in repo_clean and not repo_clean.startswith("/"): - return f"https://x-access-token:{gh_token}@github.com/{repo_clean.rstrip('.git')}.git" - return repo_clean - - -def clean_repo_url(url: str) -> str: - """Removes any embedded username:password or token credentials from a repository URL.""" - if not url: - return "" - url_clean = url.strip() - if url_clean.startswith("git@"): - return url_clean - if "://" in url_clean: - parsed = urllib.parse.urlsplit(url_clean) - netloc = parsed.netloc - if "@" in netloc: - netloc = netloc.split("@")[-1] - return urllib.parse.urlunsplit((parsed.scheme, netloc, parsed.path, parsed.query, parsed.fragment)) - return url_clean - - -def load_manifest(manifest_path_or_str: str) -> List[Any]: - if not manifest_path_or_str: - return [] - p = Path(manifest_path_or_str) - if p.is_file(): - with open(p, "r", encoding="utf-8") as f: - data = json.load(f) - else: - data = json.loads(manifest_path_or_str) - - if isinstance(data, list): - return data - if isinstance(data, dict): - if "tasks" in data and isinstance(data["tasks"], list): - return data["tasks"] - if "briefs" in data and isinstance(data["briefs"], list): - return data["briefs"] - return [data] - return [data] - - -def stage_manifest( - manifest_data: Any, - bucket_name: str, - session_id: str, - dry_run: bool = False, -) -> Optional[str]: - """ - Uploads serialized manifest JSON to gs:///swarms//manifest.json. - Returns the gs:// URI if successful, or None on failure (falling back to TASK_MANIFEST). - """ - if not bucket_name: - return None - - if isinstance(manifest_data, str): - manifest_json = manifest_data - else: - manifest_json = json.dumps(manifest_data) - - if not manifest_json.strip(): - return None - - clean_bucket = bucket_name.strip() - object_name = f"swarms/{session_id}/manifest.json" - manifest_uri = f"gs://{clean_bucket}/{object_name}" - - if dry_run: - return manifest_uri - - # 1. Local testing mock directory - local_dir = os.environ.get("STORAGE_MESSENGER_LOCAL_DIR") - if local_dir: - local_path = Path(local_dir) / clean_bucket / object_name - local_path.parent.mkdir(parents=True, exist_ok=True) - local_path.write_text(manifest_json, encoding="utf-8") - return manifest_uri - - # 2. Try storage_uploader.upload_artifact or upload_to_gcs - try: - import storage_uploader - - if hasattr(storage_uploader, "upload_artifact"): - if storage_uploader.upload_artifact(clean_bucket, object_name, manifest_json, "application/json"): - return manifest_uri - except Exception: - pass - - # 3. Try google.cloud.storage - try: - from google.cloud import storage - - client = storage.Client() - bucket = client.bucket(clean_bucket) - blob = bucket.blob(object_name) - blob.upload_from_string(manifest_json, content_type="application/json") - return manifest_uri - except Exception: - pass - - # 4. Try storage_uploader.upload_to_gcs via tempfile - try: - import tempfile - import storage_uploader - - with tempfile.NamedTemporaryFile("w", encoding="utf-8", delete=False) as tf: - tf.write(manifest_json) - temp_path = Path(tf.name) - try: - if storage_uploader.upload_to_gcs(clean_bucket, object_name, temp_path): - return manifest_uri - finally: - temp_path.unlink(missing_ok=True) - except Exception: - pass - - # 5. Try gcloud storage cp - try: - import tempfile - - with tempfile.NamedTemporaryFile("w", encoding="utf-8", delete=False) as tf: - tf.write(manifest_json) - temp_path = Path(tf.name) - try: - res = subprocess.run( - ["gcloud", "storage", "cp", str(temp_path), manifest_uri], - capture_output=True, - text=True, - check=False, - timeout=15, - ) - if res.returncode == 0: - return manifest_uri - finally: - temp_path.unlink(missing_ok=True) - except Exception: - pass - - return None - - -def extract_secret_keys(*secret_sources: Any) -> Set[str]: - keys: Set[str] = set() - for source in secret_sources: - if not source: - continue - if isinstance(source, dict): - for k in source.keys(): - if k: - keys.add(str(k).strip()) - elif isinstance(source, (list, tuple, set)): - for item in source: - if not item: - continue - item_str = str(item).strip() - if "=" in item_str: - keys.add(item_str.split("=", 1)[0].strip()) - elif ":" in item_str: - keys.add(item_str.split(":", 1)[0].strip()) - elif item_str: - keys.add(item_str) - elif isinstance(source, str): - for part in source.split(","): - part = part.strip() - if not part: - continue - if "=" in part: - keys.add(part.split("=", 1)[0].strip()) - elif ":" in part: - keys.add(part.split(":", 1)[0].strip()) - elif part: - keys.add(part) - return keys - - -def build_gcloud_command( - job_name: str, - tasks_count: int, - parallelism: int, - region: str, - project: Optional[str], - env_vars: Dict[str, str], - wait: bool = True, - max_retries: int = 0, - secrets_mapping: Optional[Union[Dict[str, str], List[str], str]] = None, - set_secrets: Optional[Union[Dict[str, str], List[str], str]] = None, - auth_mode: Optional[str] = None, - use_vertex: bool = False, -) -> List[str]: - if env_vars is None: - env_vars = {} - cmd = ["gcloud", "run", "jobs", "execute", job_name] - cmd.append(f"--tasks={tasks_count}") - cmd.append(f"--region={region}") - if project: - cmd.append(f"--project={project}") - if wait: - cmd.append("--wait") - else: - cmd.append("--async") - cmd.append("--format=json") - - # In Vertex AI auth mode, workers use ambient credentials; do not pass GEMINI_API_KEY - is_vertex = ( - (auth_mode and auth_mode.lower() == "vertex") - or use_vertex - or env_vars.get("USE_VERTEX_AI") in ("1", "true", "True") - ) - clean_env_vars = dict(env_vars) - if is_vertex: - clean_env_vars.pop("GEMINI_API_KEY", None) - clean_env_vars.pop("gemini_api_key", None) - - # Strictly pop any secret key specified in secrets_mapping or set_secrets - secret_keys = extract_secret_keys(secrets_mapping, set_secrets) - for sec_key in secret_keys: - clean_env_vars.pop(sec_key, None) - clean_env_vars.pop(sec_key.upper(), None) - clean_env_vars.pop(sec_key.lower(), None) - - env_pairs = [] - for k, v in clean_env_vars.items(): - env_pairs.append(f"{k}={v}") - if env_pairs: - cmd.append(f"--update-env-vars=^##^{ '##'.join(env_pairs) }") - - return cmd - - -def parse_worker_logs(log_output: str) -> List[Dict[str, Any]]: - results = [] - current_status = "" - current_evidence: List[str] = [] - current_summary: List[str] = [] - mode = None - - def _flush(): - nonlocal current_status, current_evidence, current_summary - if current_status: - evidence_str = "\n".join(current_evidence) - summary_str = "\n".join(current_summary) - entry: Dict[str, Any] = { - "status": current_status, - "evidence": evidence_str, - "summary": summary_str, - } - m = re.search(r"-\s*Task Index:\s*(\d+)", evidence_str, re.IGNORECASE) - if m: - entry["task_index"] = int(m.group(1)) - results.append(entry) - - for line in log_output.splitlines(): - trimmed = line.strip() - if trimmed.startswith("[STATUS:"): - if not current_status and current_evidence: - current_status = trimmed.split("[STATUS:")[1].split("]")[0].strip() - _flush() - current_status = "" - current_evidence = [] - current_summary = [] - mode = None - continue - _flush() - current_status = trimmed.split("[STATUS:")[1].split("]")[0].strip() - current_evidence = [] - current_summary = [] - mode = None - elif trimmed == "Evidence:": - mode = "evidence" - elif trimmed == "Summary:": - mode = "summary" - elif trimmed.startswith("=" * 10): - mode = None - else: - if mode == "evidence": - current_evidence.append(line) - elif mode == "summary": - current_summary.append(line) - - _flush() - return results - - -try: - from transcript_projector import ( - TELEMETRY_REGEX, - ShadowTranscriptProjector, - cleanup_session, - format_conversation_url, - get_task_brain_dir, - get_task_conversation_id, - initialize_shadow_transcript, - is_telemetry_line, - parse_telemetry_line, - resolve_app_data_dir, - ) -except ImportError: - from skills.swarm.scripts.transcript_projector import ( - TELEMETRY_REGEX, - ShadowTranscriptProjector, - cleanup_session, - format_conversation_url, - get_task_brain_dir, - get_task_conversation_id, - initialize_shadow_transcript, - is_telemetry_line, - parse_telemetry_line, - resolve_app_data_dir, - ) - -try: - from swarm_dashboard import ( - MILESTONE_REGEX, - STATUS_BADGES, - SwarmDashboardWriter, - TaskDashboardState, - colorize, - format_cloud_logging_url, - format_cloud_run_execution_url, - format_cloud_run_url, - format_elapsed_time, - format_gcs_console_url, - format_gcs_url, - format_log_viewer_url, - format_monitored_line, - format_status_badge, - format_tool_snippet, - parse_milestone_log, - ) -except ImportError: - from skills.swarm.scripts.swarm_dashboard import ( - MILESTONE_REGEX, - STATUS_BADGES, - SwarmDashboardWriter, - TaskDashboardState, - colorize, - format_cloud_logging_url, - format_cloud_run_execution_url, - format_cloud_run_url, - format_elapsed_time, - format_gcs_console_url, - format_gcs_url, - format_log_viewer_url, - format_monitored_line, - format_status_badge, - format_tool_snippet, - parse_milestone_log, - ) - -__all__ = [ - "TELEMETRY_REGEX", - "ShadowTranscriptProjector", - "cleanup_session", - "format_conversation_url", - "get_task_brain_dir", - "get_task_conversation_id", - "initialize_shadow_transcript", - "is_telemetry_line", - "parse_telemetry_line", - "resolve_app_data_dir", - "STATUS_BADGES", - "MILESTONE_REGEX", - "SwarmDashboardWriter", - "TaskDashboardState", - "colorize", - "format_cloud_logging_url", - "format_cloud_run_execution_url", - "format_cloud_run_url", - "format_elapsed_time", - "format_gcs_console_url", - "format_gcs_url", - "format_log_viewer_url", - "format_monitored_line", - "format_status_badge", - "format_tool_snippet", - "parse_milestone_log", -] - - -class MonitorResult(tuple): - def __new__(cls, data: Optional[Dict[str, Any]], succeeded: bool, error: Optional[str]): - return tuple.__new__(cls, (data, succeeded, error)) - - @property - def data(self) -> Optional[Dict[str, Any]]: - return self[0] - - @property - def succeeded(self) -> bool: - return self[1] - - @property - def error(self) -> Optional[str]: - return self[2] - - def __getitem__(self, item: Any) -> Any: - if isinstance(item, str): - if item in ("data", "desc_data"): - return self[0] - elif item in ("succeeded", "execution_succeeded"): - return self[1] - elif item in ("error", "failure_msg"): - return self[2] - raise KeyError(item) - return tuple.__getitem__(self, item) - - def get(self, key: str, default: Any = None) -> Any: - try: - return self[key] - except KeyError: - return default - - -def recover_session_id_from_execution( - execution_name: str, - region: str, - project: Optional[str] = None, -) -> Optional[str]: - try: - cmd = [ - "gcloud", - "run", - "jobs", - "executions", - "describe", - execution_name, - f"--region={region}", - "--format=json", - ] - if project: - cmd.append(f"--project={project}") - res = subprocess.run(cmd, capture_output=True, text=True, check=False) - if res.returncode != 0 or not res.stdout: - return None - data = json.loads(res.stdout) - - def find_env_val(obj: Any) -> Optional[str]: - if isinstance(obj, dict): - if obj.get("name") in ("SWARM_SESSION_ID", "SESSION_ID"): - val = obj.get("value") - if val: - return str(val).strip() - for v in obj.values(): - found = find_env_val(v) - if found: - return found - elif isinstance(obj, list): - for item in obj: - found = find_env_val(item) - if found: - return found - return None - - return find_env_val(data) - except Exception: - return None - - -def _process_log_entries( - stdout: str, - seen_log_entries: Set[str], - last_seen_timestamp: Optional[str], - dashboard_writer: Optional[Any] = None, - projector: Optional[Any] = None, - print_lines: bool = True, -) -> Optional[str]: - """Parse JSON or text log lines, update last_seen_timestamp, deduplicate, and dispatch.""" - if not stdout: - return last_seen_timestamp - - entries = [] - try: - parsed = json.loads(stdout) - if isinstance(parsed, list): - entries = parsed - elif isinstance(parsed, dict): - entries = [parsed] - except Exception: - for line in stdout.splitlines(): - if line.strip(): - entries.append({"textPayload": line.strip()}) - - for entry in entries: - if not isinstance(entry, dict): - continue - ts = entry.get("timestamp") - if ts and isinstance(ts, str): - if last_seen_timestamp is None or ts > last_seen_timestamp: - last_seen_timestamp = ts - - raw_payload = entry.get("textPayload") or "" - insert_id = entry.get("insertId") - dedup_key = insert_id if insert_id else f"{ts or ''}:{raw_payload.strip()}" - if dedup_key in seen_log_entries: - continue - seen_log_entries.add(dedup_key) - - for line in raw_payload.splitlines(): - line_str = line.strip() - if not line_str: - continue - if is_telemetry_line(line_str): - if projector: - projector.process_log_line(line_str) - if dashboard_writer: - dashboard_writer.process_log_line(line_str) - else: - if dashboard_writer: - dashboard_writer.process_log_line(line_str) - if print_lines: - print(format_monitored_line(line_str), flush=True) - - return last_seen_timestamp - - -def monitor_execution( - execution_name: str, - project: Optional[str], - region: str, - task_count: int, - poll_interval: float = 4, - timeout: float = 2700.0, - projector: Optional[Any] = None, - session_id: Optional[str] = None, - dashboard_writer: Optional["SwarmDashboardWriter"] = None, -) -> MonitorResult: - seen_log_entries: Set[str] = set() - last_seen_timestamp: Optional[str] = None - last_counts = None - desc_data: Optional[Dict[str, Any]] = None - execution_succeeded = False - failure_msg: Optional[str] = None - start_time = time.time() - - while True: - if timeout > 0 and (time.time() - start_time) > timeout: - failure_msg = f"Cloud Run execution monitoring timed out after {timeout} seconds." - print(f"Warning: {failure_msg}", file=sys.stderr) - break - try: - describe_cmd = [ - "gcloud", - "run", - "jobs", - "executions", - "describe", - execution_name, - f"--region={region}", - "--format=json", - ] - if project: - describe_cmd.append(f"--project={project}") - - res = subprocess.run( - describe_cmd, - capture_output=True, - text=True, - check=False, - ) - if res.returncode != 0: - print(f"Warning: Execution describe failed (code {res.returncode}): {res.stderr.strip()}", file=sys.stderr) - time.sleep(poll_interval) - continue - - desc_data = json.loads(res.stdout) - status = desc_data.get("status", {}) if isinstance(desc_data, dict) else {} - - log_filter = f'labels."run.googleapis.com/execution_name"="{execution_name}" AND (textPayload:"[MILESTONE]" OR textPayload:"[STATUS:" OR textPayload:"[ALARM]" OR textPayload:"[TELEMETRY]")' - if last_seen_timestamp: - log_filter += f' AND timestamp > "{last_seen_timestamp}"' - log_cmd = [ - "gcloud", - "logging", - "read", - log_filter, - "--limit=1000", - "--format=json(textPayload,timestamp,insertId)", - "--order=asc", - ] - if project: - log_cmd.extend(["--project", project]) - - try: - log_res = subprocess.run( - log_cmd, - capture_output=True, - text=True, - check=False, - ) - if log_res.returncode == 0 and log_res.stdout: - last_seen_timestamp = _process_log_entries( - log_res.stdout, - seen_log_entries=seen_log_entries, - last_seen_timestamp=last_seen_timestamp, - dashboard_writer=dashboard_writer, - projector=projector, - print_lines=True, - ) - except Exception: - pass - - succeeded = status.get("succeededCount", 0) - running = status.get("runningCount", 0) - failed = status.get("failedCount", 0) - current_counts = (succeeded, running, failed) - if current_counts != last_counts: - last_counts = current_counts - print( - f"[Cloud Swarm] Progress: {succeeded}/{task_count} succeeded, {running} running, {failed} failed.", - flush=True, - ) - - conditions = status.get("conditions", []) if isinstance(status, dict) else [] - is_completed = False - for cond in conditions: - if not isinstance(cond, dict): - continue - c_type = cond.get("type") - c_status = str(cond.get("status", "")).strip() - c_msg = cond.get("message") or cond.get("reason") or "" - if c_type == "Completed": - if c_status == "True": - is_completed = True - execution_succeeded = True - break - elif c_status == "False": - is_completed = True - execution_succeeded = False - failure_msg = c_msg or "Cloud Run execution condition Completed is False" - break - elif c_type == "Failed" or "Fail" in str(c_type): - if c_status in ("True", "False"): - is_completed = True - execution_succeeded = False - failure_msg = c_msg or f"Cloud Run execution condition {c_type}={c_status}" - break - - if is_completed: - if failed > 0 and execution_succeeded: - execution_succeeded = False - if not failure_msg: - failure_msg = f"{failed} task(s) failed in Cloud Run execution" - - log_filter = f'labels."run.googleapis.com/execution_name"="{execution_name}" AND (textPayload:"[STATUS:" OR textPayload:"[MILESTONE]" OR textPayload:"Score:" OR textPayload:"PASS" OR textPayload:"[ALARM]")' - if last_seen_timestamp: - log_filter += f' AND timestamp > "{last_seen_timestamp}"' - log_cmd = [ - "gcloud", - "logging", - "read", - log_filter, - "--limit=2000", - "--format=json(textPayload,timestamp,insertId)", - "--order=asc", - ] - if project: - log_cmd.extend(["--project", project]) - try: - log_res = subprocess.run( - log_cmd, - capture_output=True, - text=True, - check=False, - ) - if log_res.returncode == 0 and log_res.stdout: - last_seen_timestamp = _process_log_entries( - log_res.stdout, - seen_log_entries=seen_log_entries, - last_seen_timestamp=last_seen_timestamp, - dashboard_writer=dashboard_writer, - projector=None, - print_lines=True, - ) - except Exception as exc: - print(f"Warning: Error reading completion logs: {exc}", file=sys.stderr) - break - - except Exception as exc: - print(f"Warning: Exception in monitor_execution: {exc}", file=sys.stderr) - - if dashboard_writer: - try: - dashboard_writer.write() - except Exception: - pass - - time.sleep(poll_interval) - - if not execution_succeeded and not failure_msg: - failure_msg = "Execution did not complete successfully or condition was not met." - - if dashboard_writer: - try: - dashboard_writer.write() - except Exception: - pass - - return MonitorResult(desc_data, execution_succeeded, failure_msg) - - -wait_for_execution = monitor_execution - - -def run_preflight( - repo_url: str, - gh_token: str, - use_vertex: bool, - gemini_api_key: str, - project: Optional[str], - region: str, - model: str, - dry_run: bool = False, - vertex_location: Optional[str] = None, - base_branch: Optional[str] = None, - gcs_bucket: Optional[str] = None, - runtime: str = "cloud-run", -) -> None: - print("[PRE-FLIGHT] Verifying cloud swarm credentials, quota tiers, repository access, and GCS bucket...", flush=True) - - # Tier 3 Dedicated Model Interception - if model and (model.lower().strip() in TIER3_DEDICATED_MODELS or model.lower().strip().replace(".", "-").replace("-instruct", "") in TIER3_DEDICATED_MODELS): - raise RuntimeError( - f"Model '{model}' is a Tier 3 open-weights model requiring a dedicated GPU cluster endpoint.\n" - "Serverless Cloud Run swarms cannot dispatch directly to deploy-only models without an active dedicated endpoint.\n" - "Recommended Tier 1 zero-friction alternatives: gemini-4-argon, gemini-3.8-flash, deepseek-v4.1-flash." - ) - - if not dry_run and runtime == "cloud-run" and not gcs_bucket: - raise RuntimeError( - "Cloud Run swarms require a GCS bucket to store and deliver candidate patches under the zero-push architecture.\n" - "Please specify --gcs-bucket or configure 'gcs_bucket' in agystack-runtime.json." - ) - - if not vertex_location: - vertex_location = "global" if (model and (model.startswith(("gemini-2.5", "gemini-3", "gemini-4")) or "deepseek" in model.lower())) else region - - # 1. Git Authentication & Repository Accessibility Check - if not repo_url: - raise RuntimeError("Git repo URL could not be determined.") - - if not gh_token: - raise RuntimeError( - "GH_TOKEN could not be resolved from environment or `gh auth token`.\n" - "Cloud swarm workers require a valid GitHub token to clone private repositories." - ) - - clean_url = clean_repo_url(repo_url) - cred_helper = f"!f() {{ echo password={gh_token}; }}; f" - probe_target = ["git", "-c", f"credential.helper={cred_helper}", "ls-remote"] - if base_branch: - probe_target.extend(["--heads", clean_url, base_branch]) - else: - probe_target.extend([clean_url, "HEAD"]) - try: - ls_res = subprocess.run( - probe_target, - capture_output=True, - text=True, - check=True, - timeout=15, - ) - if base_branch and not ls_res.stdout.strip(): - raise RuntimeError( - f"Base branch '{base_branch}' not found on remote origin '{clean_repo_url(repo_url)}'.\n" - f"Please verify the branch name and push it to remote before dispatching cloud swarm workers." - ) - target_desc = f"base branch '{base_branch}'" if base_branch else "HEAD" - print(f" [PASS] Git remote authentication & repository accessibility verified ({repo_url}, {target_desc}).") - except subprocess.CalledProcessError as exc: - err_msg = exc.stderr.replace(gh_token, "REDACTED") if gh_token in exc.stderr else exc.stderr - raise RuntimeError( - f"Git repository accessibility check failed for '{repo_url}'.\n" - f"git ls-remote exited with code {exc.returncode}: {err_msg.strip()}\n" - "Please verify GH_TOKEN permissions and repository URL." - ) from exc - except subprocess.TimeoutExpired as exc: - raise RuntimeError(f"Timed out connecting to git repository '{repo_url}'.") from exc - except Exception as exc: - raise RuntimeError(f"Git remote accessibility error: {exc}") from exc - - # 2. Model & Quota Tier Check: Auto-promote Vertex for Partner models and DeepSeek - if (is_partner_model and is_partner_model(model)) or (model and "deepseek" in model.lower()): - use_vertex = True - - if use_vertex: - token_cmd = subprocess.run( - ["gcloud", "auth", "print-access-token"], - capture_output=True, - text=True, - check=False, - timeout=10, - ) - if token_cmd.returncode != 0 or not token_cmd.stdout.strip(): - raise RuntimeError( - "Failed to obtain gcloud access token for Vertex AI mode.\n" - f"gcloud error: {token_cmd.stderr.strip()}\n" - "Run `gcloud auth login` or `gcloud auth application-default login`." - ) - access_token = token_cmd.stdout.strip() - - if not project: - raise RuntimeError( - "GCP project ID is required for Vertex AI mode (--project or agystack-runtime.json)." - ) - - target_loc = vertex_location or "global" - resolved_model = model - - if is_partner_model and is_partner_model(model) and "fable" not in model.lower(): - resolved_model = PARTNER_MODEL_ALIASES.get(model.lower(), model) - target_loc = vertex_location if vertex_location and vertex_location != "global" else (region if region and region != "global" else "us-east5") - probe_url = f"https://{target_loc}-aiplatform.googleapis.com/v1/projects/{project}/locations/{target_loc}/publishers/anthropic/models/{resolved_model}:rawPredict" - req_data = json.dumps({ - "anthropic_version": "vertex-2023-10-16", - "messages": [{"role": "user", "content": "ping"}], - "max_tokens": 1, - }).encode("utf-8") - elif model and "deepseek" in model.lower(): - target_loc = vertex_location or "global" - if model.startswith("publishers/"): - resolved_model = model.split("/")[-1] - probe_url = f"https://aiplatform.googleapis.com/v1/projects/{project}/locations/{target_loc}/{model}:generateContent" - else: - # Canonicalize aliases like 'deepseek', 'deepseek-flash', 'deepseek-4.1', 'deepseek-v4.1', 'deepseek-v4.1-flash' - resolved_model = "deepseek-v4.1-flash-maas" - probe_url = f"https://aiplatform.googleapis.com/v1/projects/{project}/locations/{target_loc}/publishers/deepseek-ai/models/{resolved_model}:generateContent" - req_data = json.dumps({ - "contents": [{"role": "user", "parts": [{"text": "ping"}]}], - "generationConfig": {"maxOutputTokens": 1}, - }).encode("utf-8") - elif target_loc == "global": - probe_url = f"https://aiplatform.googleapis.com/v1/projects/{project}/locations/global/publishers/google/models/{model}:generateContent" - req_data = json.dumps({ - "contents": [{"role": "user", "parts": [{"text": "ping"}]}], - "generationConfig": {"maxOutputTokens": 1}, - }).encode("utf-8") - else: - probe_url = f"https://{target_loc}-aiplatform.googleapis.com/v1/projects/{project}/locations/{target_loc}/publishers/google/models/{model}:generateContent" - req_data = json.dumps({ - "contents": [{"role": "user", "parts": [{"text": "ping"}]}], - "generationConfig": {"maxOutputTokens": 1}, - }).encode("utf-8") - - headers = { - "Authorization": f"Bearer {access_token}", - "Content-Type": "application/json", - "X-Goog-User-Project": project, - } - req = urllib.request.Request( - probe_url, - data=req_data, - headers=headers, - method="POST", - ) - try: - with urllib.request.urlopen(req, timeout=30) as resp: - pass - if is_partner_model and is_partner_model(model) and "fable" not in model.lower(): - print(f" [PASS] Vertex AI credentials and Model Garden partner model '{model}' ({resolved_model}) verified in {target_loc} (project: {project}).") - elif model and "deepseek" in model.lower(): - print(f" [PASS] Vertex AI credentials and DeepSeek MaaS model '{resolved_model}' verified in {target_loc} (project: {project}).") - else: - print(f" [PASS] Vertex AI credentials and publisher model '{model}' verified in {target_loc} (project: {project}).") - except urllib.error.HTTPError as exc: - err_body = exc.read().decode("utf-8", errors="replace") - if is_partner_model and is_partner_model(model) and "fable" not in model.lower() and exc.code == 404: - raise RuntimeError( - f"Vertex AI Model Garden partner model '{model}' (resolved to '{resolved_model}') not found or not enabled in location '{target_loc}' (404 Not Found).\n" - f"Server Response:\n{err_body}\n" - "Guidance to enable partner models in Vertex AI:\n" - "1. Open Google Cloud Console -> Vertex AI -> Model Garden.\n" - f"2. Search for the model ('{model}' or '{resolved_model}').\n" - "3. Click 'Enable' to accept the Model Garden terms for this project.\n" - f"4. Verify availability in region/location '{target_loc}'." - ) from exc - elif exc.code == 403: - raise RuntimeError( - f"Vertex AI probe returned 403 Forbidden for project '{project}' in location '{target_loc}'.\n" - f"Server Response:\n{err_body}\n" - "Required Permissions:\n" - "- Ensure active principal has the 'Vertex AI User' role (roles/aiplatform.user).\n" - f"- Ensure Vertex AI API (aiplatform.googleapis.com) is enabled on project '{project}'." - ) from exc - elif exc.code == 404: - raise RuntimeError( - f"Vertex AI publisher model '{model}' (resolved to '{resolved_model}') not found in location '{target_loc}' (404 Not Found).\n" - f"Server Response:\n{err_body}\n" - f"Verify that model '{model}' is supported and published in location '{target_loc}'." - ) from exc - else: - raise RuntimeError( - f"Vertex AI probe failed with HTTP {exc.code} for project '{project}' in location '{target_loc}':\n{err_body}" - ) from exc - except Exception as exc: - if isinstance(exc, RuntimeError): - raise - raise RuntimeError(f"Vertex AI connection error: {exc}") from exc - else: - if not gemini_api_key: - if dry_run: - print(" [DRY-RUN] GEMINI_API_KEY not set; skipping live quota ping during dry-run.") - return - raise RuntimeError( - "GEMINI_API_KEY environment variable is required when not in Vertex AI mode." - ) - - probe_url = f"https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={gemini_api_key}" - req_data = json.dumps({ - "contents": [{"parts": [{"text": "ping"}]}], - "generationConfig": {"maxOutputTokens": 1}, - }).encode("utf-8") - req = urllib.request.Request( - probe_url, - data=req_data, - headers={"Content-Type": "application/json"}, - method="POST", - ) - - free_tier_indicators = [ - "freetier", - "free_tier", - "free-tier", - "free_tier_requests", - "5 rpm", - "5rpm", - "rate limit <= 5 rpm", - "5 requests per minute", - ] - - try: - with urllib.request.urlopen(req, timeout=15) as resp: - resp_text = resp.read().decode("utf-8", errors="replace") - combined = (resp_text + " " + str(resp.headers)).lower() - matched = next((ind for ind in free_tier_indicators if ind in combined), None) - if matched: - raise RuntimeError( - f"Free-tier Gemini API key detected ('{matched}' found in response).\n" - "Free-tier keys are limited to 5 requests per minute (RPM) and cannot support parallel swarms.\n" - "Cloud Run swarms require a paid Google AI Studio tier (Pay-as-you-go / Tier 1+) or Vertex AI (--vertex)." - ) - print(f" [PASS] Gemini API key validated (paid tier / model '{model}' accessible).") - except urllib.error.HTTPError as exc: - err_body = exc.read().decode("utf-8", errors="replace") - combined_err = (err_body + " " + str(exc.headers)).lower() - matched = next((ind for ind in free_tier_indicators if ind in combined_err), None) - if matched or exc.code == 429: - detail_msg = f" ('{matched}' detected)" if matched else "" - raise RuntimeError( - f"Gemini API rate-limit/quota restriction detected{detail_msg} (HTTP {exc.code}).\n" - f"Details:\n{err_body}\n" - "Free-tier API keys (5 RPM) cannot support parallel swarms.\n" - "Upgrade your Google AI Studio key to paid/unmetered billing (Pay-as-you-go / Tier 1+) or use Vertex AI (--vertex)." - ) from exc - else: - raise RuntimeError( - f"Gemini API request failed with HTTP {exc.code}:\n{err_body}" - ) from exc - except Exception as exc: - if isinstance(exc, RuntimeError): - raise - raise RuntimeError(f"Gemini API ping failed: {exc}") from exc - - -def resolve_swarm_model( - cli_model: Optional[str] = None, - runtime_model: Optional[str] = None, - agystack_models_path: Optional[Path] = None, - parent_model: Optional[str] = None, -) -> str: - parent = ( - (parent_model and parent_model.strip()) - or os.environ.get("ANTIGRAVITY_MODEL", "").strip() - or os.environ.get("ACTIVE_PARENT_MODEL", "").strip() - or os.environ.get("GEMINI_MODEL", "").strip() - or None - ) - - if cli_model and cli_model.strip(): - chosen = cli_model.strip() - elif runtime_model and runtime_model.strip() and runtime_model.strip().lower() not in ( - "inherit", - "auto", - "inherit-parent", - "inherit_parent", - ): - chosen = runtime_model.strip() - else: - role_model = None - paths_to_check = [ - agystack_models_path, - Path(os.path.expanduser("~/.gemini/config/plugins/agystack/agystack-models.md")), - Path(__file__).resolve().parents[3] / "agystack-models.md", - Path("agystack-models.md"), - Path(".agents/plugins/agystack/agystack-models.md"), - Path(os.path.expanduser("~/.gemini/config/plugins/agystack/rules/agystack-models.md")), - Path(__file__).resolve().parents[3] / "rules" / "agystack-models.md", - Path("rules/agystack-models.md"), - Path(".agents/plugins/agystack/rules/agystack-models.md"), - ] - for p in paths_to_check: - if p and p.is_file(): - try: - for line in p.read_text(encoding="utf-8").splitlines(): - line = line.strip() - if line.startswith("#") or not line: - continue - if ":" in line: - role, m = line.split(":", 1) - if "swarm worker" in role.lower(): - role_model = m.strip().split(",")[0].strip() - break - if role_model: - break - except Exception: - pass - chosen = role_model or (runtime_model.strip() if runtime_model and runtime_model.strip() else "inherit") - - default_model = parent or "gemini-3.8-flash" - tier_map = { - "flash": "gemini-3.8-flash", - "pro": "gemini-3.1-pro", - "flash_lite": "gemini-3.1-flash-lite", - "flash-lite": "gemini-3.1-flash-lite", - "argon": "gemini-4-argon", - "gemini-argon": "gemini-4-argon", - "gemini-4": "gemini-4-argon", - "gemini": "gemini-3.8-flash", - "deepseek": "deepseek-v4.1-flash", - "deepseek-flash": "deepseek-v4.1-flash", - "deepseek-4.1": "deepseek-v4.1-flash", - "deepseek-v4.1": "deepseek-v4.1-flash", - "deepseek-4.1-flash": "deepseek-v4.1-flash", - "deepseek-v4.1-flash-maas": "deepseek-v4.1-flash", - "inherit": default_model, - "auto": default_model, - "inherit-parent": default_model, - "inherit_parent": default_model, - } - norm_chosen = chosen.lower().replace("_", "-") - if chosen.lower() in tier_map: - return tier_map[chosen.lower()] - if norm_chosen in tier_map: - return tier_map[norm_chosen] - return chosen - - -try: - from dispatch.mailbox_controller import ( - handle_mailbox_list, - handle_mailbox_reply, - handle_mailbox_steer, - ) -except ImportError: - try: - from skills.swarm.scripts.dispatch.mailbox_controller import ( - handle_mailbox_list, - handle_mailbox_reply, - handle_mailbox_steer, - ) - except ImportError: - _disp_dir = Path(__file__).resolve().parent / "dispatch" - if str(_disp_dir) not in sys.path: - sys.path.insert(0, str(_disp_dir)) - from mailbox_controller import ( # type: ignore - handle_mailbox_list, - handle_mailbox_reply, - handle_mailbox_steer, - ) - - -def failed_task_count(report_items: List[Dict[str, Any]], task_count: int) -> int: - reports = {} - invalid = 0 - for item in report_items: - index = item.get("task_index") - if type(index) is not int or not 0 <= index < task_count or index in reports: - invalid += 1 - continue - status = item.get("status") - reports[index] = status if isinstance(status, str) and status in TERMINAL_STATES else "UNKNOWN" - return invalid + sum(reports.get(index) != "PASS" for index in range(task_count)) - - -def print_candidate_patches_table( - harvested_patches: List[Dict[str, Any]], - baseline_score: Optional[float] = None, - exec_succeeded: bool = True, - failed_count: int = 0, - allow_partial: bool = False, -) -> None: - if not harvested_patches: - print("No candidate patches found.") - return - - is_partial_failure = (not exec_succeeded) or (failed_count > 0) - if is_partial_failure: - print("\n" + "*" * 80) - print(f"[WARNING: SWARM EXECUTION EXPERIENCED PARTIAL FAILURES: {failed_count} TASKS FAILED]") - print("Some worker tasks failed during execution. Candidate patches below are from a") - print("partial swarm run and should be carefully verified before promoting.") - print("*" * 80) - - has_passing = any( - p.get("status") == "PASS" and p.get("patch_file") and str(p.get("patch_file")) != "None" - for p in harvested_patches - ) - - print("\n" + "=" * 80) - print("CANDIDATE PATCHES (RANKED):") - print("=" * 80) - print(f"{'Rank':<6} | {'Task':<8} | {'Score':<8} | {'Delta':<10} | {'Status':<16} | {'Patch File'}") - print("-" * 80) - for idx, p in enumerate(harvested_patches): - is_winner = ( - idx == 0 - and p.get("status") == "PASS" - and bool(p.get("patch_file")) - and str(p.get("patch_file")) != "None" - ) - rank_str = f"{idx + 1}*" if (is_winner and not is_partial_failure) else str(idx + 1) - task_id = p.get("task_index", "?") - sc = p.get("score") - sc_str = f"{sc:.2f}" if isinstance(sc, (int, float)) else "N/A" - delta = p.get("score_delta") - delta_str = f"{delta:+.4f}" if delta is not None else "N/A" - st = p.get("status", "UNKNOWN") - if is_partial_failure and not allow_partial: - st = f"{st} [PARTIAL]" - pf = p.get("patch_file") or "None" - print(f"{rank_str:<6} | {task_id:<8} | {sc_str:<8} | {delta_str:<10} | {st:<16} | {pf}") - print("=" * 80) - if ( - harvested_patches - and harvested_patches[0].get("status") == "PASS" - and harvested_patches[0].get("patch_file") - and str(harvested_patches[0].get("patch_file")) != "None" - ): - if (not is_partial_failure) or allow_partial: - print(f"* Winning Candidate #1: {harvested_patches[0]['patch_file']} (apply and verify locally)") - print("=" * 80) - else: - print("Notice: Winning candidate auto-promotion suppressed due to partial swarm failure.") - print(f"Quarantined Candidate #1: {harvested_patches[0]['patch_file']} (review with caution)") - print("=" * 80) - elif not has_passing: - print("Notice: No passing candidate patches produced.") - - -def main() -> None: - parser = argparse.ArgumentParser(description="Dispatch parallel Cloud Run swarm workers.") - parser.add_argument("--manifest", type=str, help="Path to manifest JSON or JSON string.") - parser.add_argument("--seed-lottery", type=int, help="Generate N coprime seed lottery tasks.") - parser.add_argument("--gcs-bucket", type=str, help="GCS bucket name for run artifacts.") - parser.add_argument("--gcs-prefix", type=str, default=None, help="GCS object prefix.") - parser.add_argument("--harvest-gcs", type=str, help="GCS prefix to harvest results after execution.") - parser.add_argument("--harvest-session", type=str, default=None, help="Harvest and rank candidate patches for an existing session ID from GCS without launching a new Cloud Run job") - parser.add_argument("--wait-execution", type=str, default=None, help="Attach to a running Cloud Run execution, stream milestones, and harvest patches") - parser.add_argument("--baseline-score", type=float, default=None, help="Baseline score float to compute score delta ranking against") - parser.add_argument("--repo", type=str, help="Git repository URL.") - parser.add_argument("--tasks", type=int, help="Task count override.") - parser.add_argument("--parallelism", type=int, default=None, help="Concurrency limit (configured on Cloud Run Job template via setup_runtime.py; execute inherits template setting).") - parser.add_argument("--max-retries", type=int, default=0, help="Max retry attempts per task (configured on Cloud Run Job template via setup_runtime.py; execute inherits template setting).") - parser.add_argument("--job-name", type=str, help="Cloud Run Job name.") - parser.add_argument("--region", type=str, help="GCP region (e.g. us-central1).") - parser.add_argument("--project", type=str, help="GCP project ID.") - parser.add_argument("--model", type=str, help="Model override for workers (default: inherit).") - parser.add_argument("--parent-model", type=str, default=None, help="Parent session model to inherit in swarm workers.") - parser.add_argument("--vertex", action="store_true", help="Enable Vertex AI mode.") - parser.add_argument("--vertex-location", type=str, default=None, help="Vertex AI location (e.g. global or us-central1).") - parser.add_argument("--preflight", action="store_true", help="Run pre-flight quota, auth, and git connectivity checks.") - parser.add_argument("--no-preflight", action="store_true", help="Skip pre-flight checks.") - parser.add_argument("--dry-run", action="store_true", help="Print payload and command without executing.") - parser.add_argument("--wait", dest="wait", action="store_true", help="Wait for job completion, stream milestones, and harvest reports (default).") - parser.add_argument("--no-wait", dest="wait", action="store_false", help="Do not wait for job completion; dispatch asynchronously.") - parser.add_argument("--session", "--session-id", dest="session_id", type=str, help="Swarm session ID (default: swarm-).") - parser.add_argument("--orchestrator-timeout", type=float, default=600.0, help="Timeout in seconds for orchestrator replies (default: 600.0).") - parser.add_argument("--set-secrets", type=str, help="Comma-separated secrets mapping for Cloud Run Job (e.g. GEMINI_API_KEY=gemini-key:latest).") - parser.add_argument("--base-branch", type=str, default=None, help="Base branch for workers to checkout (default: remote default branch).") - parser.add_argument("--conversation-id", type=str, default=None, help="Coordinator conversation ID for swarm dashboard artifact.") - parser.add_argument("--ignore-partial-failures", action="store_true", help="Allow promotion of candidate patches from partially-failed swarm executions.") - parser.add_argument("--list-models", action="store_true", help="List supported cloud swarm models and their Model Garden friction tiers.") - parser.set_defaults(wait=True) - - subparsers = parser.add_subparsers(dest="subcommand", help="Optional subcommand") - steer_sub = subparsers.add_parser("steer", help="Send a steering instruction to worker(s)") - steer_sub.add_argument("--task", type=str, required=True, help="Task index or 'all' for broadcast") - steer_sub.add_argument("--instruction", "--text", dest="instruction", type=str, required=True, help="Steering instruction text") - steer_sub.add_argument("--session", "--session-id", dest="session", type=str, help="Session ID") - steer_sub.add_argument("--gcs-bucket", type=str, help="GCS bucket name") - steer_sub.add_argument("--task-count", "--max-tasks", dest="max_tasks", type=int, default=None, help="Total task count") - - mailbox_parser = subparsers.add_parser("mailbox", help="Interact with worker mailboxes") - mailbox_subparsers = mailbox_parser.add_subparsers(dest="mailbox_action", help="Mailbox action") - - # mailbox list - list_p = mailbox_subparsers.add_parser("list", help="List pending questions across workers") - list_p.add_argument("--session", type=str, help="Session ID") - list_p.add_argument("--gcs-bucket", type=str, help="GCS bucket name") - - # mailbox reply - reply_p = mailbox_subparsers.add_parser("reply", help="Reply to a worker question") - reply_p.add_argument("--task", type=int, required=True, help="Task index") - reply_p.add_argument("--seq", type=int, required=True, help="Sequence number of the question") - reply_p.add_argument("--text", type=str, required=True, help="Reply text") - reply_p.add_argument("--session", type=str, help="Session ID") - reply_p.add_argument("--gcs-bucket", type=str, help="GCS bucket name") - - # mailbox steer - steer_p = mailbox_subparsers.add_parser("steer", help="Send a steering instruction to a worker") - steer_p.add_argument("--task", type=str, required=True, help="Task index or 'all' for broadcast") - steer_p.add_argument("--instruction", "--text", dest="instruction", type=str, required=True, help="Steering instruction text") - steer_p.add_argument("--session", "--session-id", dest="session", type=str, help="Session ID") - steer_p.add_argument("--gcs-bucket", type=str, help="GCS bucket name") - steer_p.add_argument("--task-count", "--max-tasks", dest="max_tasks", type=int, default=None, help="Total task count") - - args = parser.parse_args() - - if getattr(args, "list_models", False): - print(""" -Vertex AI Model Garden Tiers for Cloud Swarms: ------------------------------------------------------------------------------------------ -Tier 1: Native MaaS (Instant Serverless, Zero Forms) - - gemini-4-argon Global Vertex AI endpoint, deep reasoning - - gemini-3.8-flash Global Vertex AI endpoint, balanced speed - - gemini-3.1-pro Global Vertex AI endpoint, high capability - - deepseek-v4.1-flash Global Vertex AI endpoint (deepseek-ai namespace) - -Tier 2: Gated Partner MaaS (One-Time Console Agreement Form Required) - - claude-3-7-sonnet Regional endpoint (us-east5/us-central1) - - claude-3-5-sonnet Regional endpoint (us-east5/us-central1) - - claude-3-opus Regional endpoint (us-east5/us-central1) - -Tier 3: Dedicated GPU Cluster Endpoints (Self-Hosted, Not Serverless) - - glm-5-3-flash Requires dedicated 8x H100/B200 GPU cluster - - llama-3.3-70b Requires dedicated multi-GPU cluster ------------------------------------------------------------------------------------------ -""".strip()) - return - - if args.subcommand == "steer": - runtime_cfg = find_runtime_config() or {} - session_id = args.session or os.environ.get("SWARM_SESSION_ID") or os.environ.get("SESSION_ID") or "default" - bkt = args.gcs_bucket or runtime_cfg.get("gcs_bucket") or os.environ.get("GCS_BUCKET") or os.environ.get("GCS_RESULTS_BUCKET") - handle_mailbox_steer( - task_index=args.task, - text=args.instruction, - session_id=session_id, - bucket_name=bkt, - max_tasks=getattr(args, "max_tasks", None), - ) - return - - if args.subcommand == "mailbox": - runtime_cfg = find_runtime_config() or {} - session_id = args.session or os.environ.get("SWARM_SESSION_ID") or os.environ.get("SESSION_ID") or "default" - bkt = args.gcs_bucket or runtime_cfg.get("gcs_bucket") or os.environ.get("GCS_BUCKET") or os.environ.get("GCS_RESULTS_BUCKET") - if args.mailbox_action == "list": - handle_mailbox_list(session_id=session_id, bucket_name=bkt) - elif args.mailbox_action == "reply": - handle_mailbox_reply(task_index=args.task, seq=args.seq, text=args.text, session_id=session_id, bucket_name=bkt) - elif args.mailbox_action == "steer": - handle_mailbox_steer( - task_index=args.task, - text=args.instruction, - session_id=session_id, - bucket_name=bkt, - max_tasks=getattr(args, "max_tasks", None), - ) - else: - mailbox_parser.print_help() - return - - runtime_cfg = find_runtime_config() or {} - - job_name = args.job_name or runtime_cfg.get("job_name") or "agystack-swarm-worker" - region = args.region or runtime_cfg.get("region") or "us-central1" - project = args.project or runtime_cfg.get("project_id") - parallelism = args.parallelism if args.parallelism is not None else runtime_cfg.get("parallelism", 16) - use_vertex = args.vertex or runtime_cfg.get("auth_mode") == "vertex" or runtime_cfg.get("vertex") is True - model = resolve_swarm_model( - cli_model=args.model, - runtime_model=runtime_cfg.get("model"), - parent_model=getattr(args, "parent_model", None), - ) - explicit_vertex_loc = args.vertex_location or runtime_cfg.get("vertex_location") - if explicit_vertex_loc: - vertex_location = explicit_vertex_loc - elif model and (model.startswith(("gemini-2.5", "gemini-3", "gemini-4")) or "deepseek" in model.lower()): - vertex_location = "global" - else: - vertex_location = region - - if is_partner_model and is_partner_model(model): - use_vertex = True - if not explicit_vertex_loc and vertex_location == "global": - vertex_location = region if region and region != "global" else "us-east5" - elif model and "deepseek" in model.lower(): - use_vertex = True - if not explicit_vertex_loc: - vertex_location = "global" - - gemini_api_key = os.environ.get("GEMINI_API_KEY", "").strip() - if not gemini_api_key and (project or (is_partner_model and is_partner_model(model)) or (model and "deepseek" in model.lower())): - use_vertex = True - gcs_bucket = args.gcs_bucket if args.gcs_bucket is not None else runtime_cfg.get("gcs_bucket", "") - - if args.harvest_session: - session_id = args.harvest_session.strip() - bkt = gcs_bucket or os.environ.get("GCS_BUCKET") or os.environ.get("GCS_RESULTS_BUCKET") - if not bkt: - print("Error: GCS bucket name must be specified via --gcs-bucket, GCS_BUCKET, or agystack-runtime.json", file=sys.stderr) - sys.exit(1) - prefix = args.gcs_prefix or f"swarms/{session_id}" - dest_dir = Path(".slices") / session_id - try: - from result_harvester import harvest_candidate_patches - harvested_patches = harvest_candidate_patches( - bucket_name=bkt, - prefix=prefix, - dest_dir=dest_dir, - baseline_score=args.baseline_score, - sort_by_delta=True, - ) - except Exception as exc: - print(f"Error: Failed to harvest GCS results for session {session_id}: {exc}", file=sys.stderr) - sys.exit(1) - - failed_count = failed_task_count(harvested_patches, args.tasks) if args.tasks and args.tasks > 0 else 1 - print_candidate_patches_table( - harvested_patches, baseline_score=args.baseline_score, failed_count=failed_count, - allow_partial=args.ignore_partial_failures, - ) - if not args.tasks: - print("Complete task coverage is unknown. Supply --tasks to verify the expected count.") - if failed_count: - sys.exit(1) - return - - if args.wait_execution: - execution_name = args.wait_execution.strip() - session_id = args.session_id or os.environ.get("SWARM_SESSION_ID") or os.environ.get("SESSION_ID") - if not session_id: - recovered_session = recover_session_id_from_execution( - execution_name=execution_name, - region=region, - project=project, - ) - if recovered_session: - session_id = recovered_session - else: - session_id = f"swarm-{int(time.time())}" - - bkt = gcs_bucket or os.environ.get("GCS_BUCKET") or os.environ.get("GCS_RESULTS_BUCKET") - task_count = args.tasks or 1 - dashboard_writer = SwarmDashboardWriter( - session_id=session_id, - conversation_id=args.conversation_id or os.environ.get("CONVERSATION_ID"), - task_count=task_count, - project=project, - region=region, - execution_name=execution_name, - gcs_bucket=bkt, - model=model, - ) - dashboard_writer.write() - print(f"Attaching to Cloud Run execution '{execution_name}' in region '{region}'...") - desc_data, exec_succeeded, failure_msg = wait_for_execution( - execution_name=execution_name, - project=project, - region=region, - task_count=task_count, - session_id=session_id, - dashboard_writer=dashboard_writer, - ) - if not exec_succeeded: - print(f"Error: Cloud Run execution '{execution_name}' failed: {failure_msg}", file=sys.stderr) - else: - print("Job execution completed.") - - harvest_target = args.harvest_gcs or (args.gcs_prefix or (f"swarms/{session_id}" if bkt else None)) - harvested_patches = [] - if harvest_target is not None and bkt: - try: - from result_harvester import harvest_candidate_patches - dest_dir = Path(".slices") / session_id - harvested_patches = harvest_candidate_patches( - bucket_name=bkt, - prefix=harvest_target, - dest_dir=dest_dir, - baseline_score=args.baseline_score, - sort_by_delta=True, - ) - except Exception as exc: - print(f"Warning: Failed to harvest GCS results: {exc}", file=sys.stderr) - - expected_count = args.tasks - if isinstance(desc_data, dict): - expected_count = desc_data.get("spec", {}).get("taskCount", desc_data.get("taskCount", expected_count)) - failed_cnt = failed_task_count(harvested_patches, expected_count) if type(expected_count) is int and expected_count > 0 else 1 - if not exec_succeeded: - failed_cnt = max(1, failed_cnt) - if harvested_patches: - print_candidate_patches_table( - harvested_patches, - baseline_score=args.baseline_score, - exec_succeeded=exec_succeeded, - failed_count=failed_cnt, - allow_partial=getattr(args, "ignore_partial_failures", False), - ) - - if not exec_succeeded or failed_cnt: - print("Execution lacks complete passing task status coverage.", file=sys.stderr) - sys.exit(1) - return - - tasks_list: List[Any] = [] - sys.path.insert(0, str(Path(__file__).parent)) - - if args.seed_lottery: - from manifest_generator import generate_seed_lottery - tasks_list = generate_seed_lottery(seeds_count=args.seed_lottery) - elif args.manifest: - try: - tasks_list = load_manifest(args.manifest) - except Exception as exc: - print(f"Error: Failed to load manifest: {exc}", file=sys.stderr) - sys.exit(1) - - try: - resolve_execution_limits() - for task in tasks_list: - if isinstance(task, dict): - resolve_execution_limits(task.get("execution_limits", {}), environ={}) - except ValueError as exc: - parser.error(str(exc)) - task_count = args.tasks or (len(tasks_list) if tasks_list else 1) - if tasks_list and task_count != len(tasks_list): - parser.error("--tasks must match the manifest task count") - manifest_serialized = json.dumps(tasks_list) if tasks_list else "" - - repo_url = args.repo or get_git_remote_url() - gh_token = get_gh_token() - gemini_api_key = os.environ.get("GEMINI_API_KEY", "").strip() - - should_run_preflight = args.preflight or (not args.no_preflight and not args.dry_run) - if should_run_preflight: - try: - run_preflight( - repo_url=repo_url, - gh_token=gh_token, - use_vertex=use_vertex, - gemini_api_key=gemini_api_key, - project=project, - region=region, - model=model, - dry_run=args.dry_run, - vertex_location=vertex_location, - base_branch=args.base_branch, - gcs_bucket=gcs_bucket, - runtime=runtime_cfg.get("runtime", "cloud-run"), - ) - except RuntimeError as exc: - print(f"Error [Pre-Flight]: {exc}", file=sys.stderr) - sys.exit(1) - if args.preflight and not args.dry_run: - print("Pre-flight checks passed successfully.") - return - - secrets_mapping: Optional[Dict[str, str]] = None - if getattr(args, "set_secrets", None): - secrets_mapping = {} - for part in args.set_secrets.split(","): - part = part.strip() - if "=" in part: - k, v = part.split("=", 1) - secrets_mapping[k.strip()] = v.strip() - elif part: - secrets_mapping[part] = part - elif runtime_cfg.get("secrets"): - cfg_sec = runtime_cfg.get("secrets") - if isinstance(cfg_sec, dict): - secrets_mapping = dict(cfg_sec) - elif isinstance(cfg_sec, str): - secrets_mapping = {} - for part in cfg_sec.split(","): - part = part.strip() - if "=" in part: - k, v = part.split("=", 1) - secrets_mapping[k.strip()] = v.strip() - elif part: - secrets_mapping[part] = part - elif isinstance(cfg_sec, (list, tuple)): - secrets_mapping = {} - for part in cfg_sec: - part = str(part).strip() - if "=" in part: - k, v = part.split("=", 1) - secrets_mapping[k.strip()] = v.strip() - elif part: - secrets_mapping[part] = part - elif runtime_cfg.get("secrets_mapping"): - cfg_sec = runtime_cfg.get("secrets_mapping") - if isinstance(cfg_sec, dict): - secrets_mapping = dict(cfg_sec) - - active_secret_keys = extract_secret_keys(secrets_mapping, getattr(args, "set_secrets", None)) - - if not repo_url: - print("Error: Git repo URL not provided and could not be inferred from remote.origin.url", file=sys.stderr) - sys.exit(1) - - if not gh_token and "GH_TOKEN" not in active_secret_keys and "gh_token" not in active_secret_keys: - if not args.dry_run: - print("Error: GH_TOKEN could not be resolved from environment or `gh auth token`", file=sys.stderr) - sys.exit(1) - gh_token = "DRY_RUN_GH_TOKEN" - - if not use_vertex and not gemini_api_key and not args.dry_run and "GEMINI_API_KEY" not in active_secret_keys and "gemini_api_key" not in active_secret_keys: - print("Error: GEMINI_API_KEY environment variable is required when not in Vertex AI mode.", file=sys.stderr) - sys.exit(1) - - env_vars = { - "REPO_URL": repo_url, - } - if "GH_TOKEN" not in active_secret_keys and "gh_token" not in active_secret_keys and gh_token: - env_vars["GH_TOKEN"] = gh_token - - if not use_vertex and "GEMINI_API_KEY" not in active_secret_keys and "gemini_api_key" not in active_secret_keys: - if gemini_api_key: - env_vars["GEMINI_API_KEY"] = gemini_api_key - elif args.dry_run: - env_vars["GEMINI_API_KEY"] = "DRY_RUN_KEY" - - if use_vertex: - env_vars["USE_VERTEX_AI"] = "1" - if project: - env_vars["VERTEXAI_PROJECT"] = project - env_vars["VERTEXAI_LOCATION"] = vertex_location - - session_id = args.session_id or f"swarm-{int(time.time())}" - env_vars["SWARM_SESSION_ID"] = session_id - env_vars["SESSION_ID"] = session_id - for name, env_key in LIMIT_ENV.items(): - if env_key in os.environ: - env_vars[env_key] = os.environ[env_key] - if args.orchestrator_timeout: - env_vars["ORCHESTRATOR_TIMEOUT"] = str(args.orchestrator_timeout) - if args.base_branch: - env_vars["BASE_BRANCH"] = args.base_branch - - gcs_bucket = args.gcs_bucket if args.gcs_bucket is not None else runtime_cfg.get("gcs_bucket", "") - gcs_prefix = args.gcs_prefix if args.gcs_prefix is not None else runtime_cfg.get("gcs_prefix") - if not gcs_prefix and session_id: - gcs_prefix = f"swarms/{session_id}" - if gcs_bucket: - env_vars["GCS_BUCKET"] = gcs_bucket - env_vars["GCS_RESULTS_BUCKET"] = gcs_bucket - if gcs_prefix: - env_vars["GCS_PREFIX"] = gcs_prefix - - manifest_uri = None - if gcs_bucket and manifest_serialized: - manifest_uri = stage_manifest( - manifest_data=tasks_list or manifest_serialized, - bucket_name=gcs_bucket, - session_id=session_id, - dry_run=args.dry_run, - ) - if manifest_uri: - env_vars["MANIFEST_URI"] = manifest_uri - if not args.dry_run: - print(f"Staged swarm manifest at {manifest_uri}", flush=True) - - if not manifest_uri and manifest_serialized: - env_vars["TASK_MANIFEST"] = manifest_serialized - - if model: - if model.lower().strip() in DEEPSEEK_CANONICAL_ALIASES: - env_vars["MODEL_OVERRIDE"] = "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas" - else: - env_vars["MODEL_OVERRIDE"] = model - - dispatch_cmd = build_gcloud_command( - job_name=job_name, - tasks_count=task_count, - parallelism=parallelism, - region=region, - project=project, - env_vars=env_vars, - wait=False, - max_retries=args.max_retries, - secrets_mapping=secrets_mapping, - set_secrets=getattr(args, "set_secrets", None), - auth_mode="vertex" if use_vertex else "api_key", - ) - - if args.dry_run: - display_env = dict(env_vars) - if display_env.get("GH_TOKEN"): - display_env["GH_TOKEN"] = "REDACTED" - if display_env.get("GEMINI_API_KEY"): - display_env["GEMINI_API_KEY"] = "REDACTED" - display_cmd = build_gcloud_command( - job_name=job_name, - tasks_count=task_count, - parallelism=parallelism, - region=region, - project=project, - env_vars=display_env, - wait=args.wait, - max_retries=args.max_retries, - secrets_mapping=secrets_mapping, - set_secrets=getattr(args, "set_secrets", None), - auth_mode="vertex" if use_vertex else "api_key", - ) - payload = { - "job_name": job_name, - "tasks_count": task_count, - "parallelism": parallelism, - "max_retries": args.max_retries, - "region": region, - "project": project, - "env_vars": display_env, - "gcloud_command": " ".join(display_cmd), - } - if secrets_mapping: - payload["secrets_mapping"] = secrets_mapping - print(json.dumps(payload, indent=2)) - return - - if getattr(args, "set_secrets", None) and not args.dry_run: - update_cmd = [ - "gcloud", "run", "jobs", "update", job_name, - f"--region={region}", - f"--set-secrets={args.set_secrets}", - ] - if project: - update_cmd.append(f"--project={project}") - try: - print(f"Updating Cloud Run Job template '{job_name}' with secrets: {args.set_secrets}...") - subprocess.run(update_cmd, capture_output=True, text=True, check=True) - except subprocess.CalledProcessError as exc: - print(f"Error updating job secrets: {exc.stderr.strip()}", file=sys.stderr) - sys.exit(exc.returncode) - - projector = ShadowTranscriptProjector(session_id=session_id, task_count=task_count) - dashboard_writer = SwarmDashboardWriter( - session_id=session_id, - conversation_id=getattr(args, "conversation_id", None) or os.environ.get("CONVERSATION_ID"), - task_count=task_count, - project=project, - region=region, - execution_name=None, - gcs_bucket=gcs_bucket, - model=model, - tasks_list=tasks_list, - ) - dashboard_writer.write() - - for t_idx in range(task_count): - brief_text = "" - if tasks_list and t_idx < len(tasks_list): - item = tasks_list[t_idx] - if isinstance(item, dict): - brief_text = item.get("brief") or item.get("task_brief") or item.get("command") or "" - elif isinstance(item, str): - brief_text = item - projector.init_task(t_idx, task_brief=brief_text) - task_conv_url = format_conversation_url(session_id, t_idx) - print(f"[Cloud Swarm] Task {t_idx} shadow session: {task_conv_url}", flush=True) - - print(f"Launching Cloud Run Job '{job_name}' with {task_count} tasks (parallelism: {parallelism})...") - try: - proc = subprocess.run( - dispatch_cmd, - capture_output=True, - text=True, - check=True, - ) - - execution_name = None - if proc.stdout: - try: - json_data = json.loads(proc.stdout) - if isinstance(json_data, dict): - execution_name = json_data.get("metadata", {}).get("name") or json_data.get("name") - except Exception: - pass - if not execution_name: - m = re.search(r"\[([a-zA-Z0-9_\-]+)\]", proc.stderr + " " + proc.stdout) - if m: - execution_name = m.group(1) - - if execution_name: - dashboard_writer.set_execution_name(execution_name) - dashboard_writer.write() - - if not args.wait: - if execution_name: - print(f"Execution: {execution_name}") - print(f"Session: {session_id}") - print(f"To attach: python3 cloud_dispatch.py --wait-execution {execution_name} --session-id {session_id}") - else: - print("Dispatched Cloud Run Job execution asynchronously.") - print(f"Session: {session_id}") - return - - exec_succeeded = True - exec_failure_msg = None - if execution_name: - print(f"Monitoring execution '{execution_name}' in region '{region}'...") - _, exec_succeeded, exec_failure_msg = monitor_execution( - execution_name=execution_name, - project=project, - region=region, - task_count=task_count, - projector=projector, - session_id=session_id, - dashboard_writer=dashboard_writer, - ) - if not exec_succeeded: - print(f"Error: Cloud Run execution '{execution_name}' failed: {exec_failure_msg}", file=sys.stderr) - else: - print("Job execution completed successfully.") - else: - print("Job execution completed.") - - logs_content = proc.stdout + "\n" + proc.stderr - log_cmd_str = "" - if execution_name: - time.sleep(5) - log_filter = f'resource.type="cloud_run_job" AND labels."run.googleapis.com/execution_name"="{execution_name}"' - log_read_args = [ - "gcloud", - "logging", - "read", - log_filter, - "--limit=2000", - "--format=value(textPayload)", - "--order=asc", - ] - log_cmd_str = f"gcloud logging read '{log_filter}' --limit=2000 --format=\"value(textPayload)\" --order=asc" - if project: - log_read_args.extend(["--project", project]) - log_cmd_str += f" --project={project}" - - for attempt in range(2): - try: - log_res = subprocess.run( - log_read_args, - capture_output=True, - text=True, - check=False, - ) - if log_res.stdout: - logs_content = log_res.stdout - break - time.sleep(5) - except Exception as exc: - print(f"Warning: Failed to fetch container logs: {exc}", file=sys.stderr) - - - harvest_target = args.harvest_gcs or (gcs_prefix if gcs_bucket else None) - harvested_patches = [] - if harvest_target is not None and gcs_bucket: - try: - from result_harvester import harvest_candidate_patches - - dest_dir = Path(".slices") / session_id - harvested_patches = harvest_candidate_patches( - bucket_name=gcs_bucket, - prefix=harvest_target, - dest_dir=dest_dir, - baseline_score=args.baseline_score, - sort_by_delta=True, - ) - except Exception as exc: - print(f"Warning: Failed to harvest GCS results: {exc}", file=sys.stderr) - - # Prioritize assembling report from harvested status.json files on GCS - harvested_with_status = [p for p in harvested_patches if p.get("status_file") and p.get("status") != "UNKNOWN"] - if harvested_with_status: - report_items = harvested_patches - else: - report_items = parse_worker_logs(logs_content) - - print("\n" + "=" * 80) - print(f"SWARM EXECUTION REPORT: {job_name}") - print("=" * 80) - print(f"{'Task':<8} | {'Status':<10} | {'Summary'}") - print("-" * 80) - pass_count = 0 - issues_count = 0 - blocked_count = 0 - - for i, item in enumerate(report_items): - task_id = item.get("task_index", i) - st = item.get("status", "UNKNOWN") - sm = item.get("summary", "").replace("\n", " ")[:60] - if st == "PASS": - pass_count += 1 - elif st == "ISSUES": - issues_count += 1 - elif st == "BLOCKED": - blocked_count += 1 - print(f"{task_id:<8} | {st:<10} | {sm}") - - if not report_items: - print(f"Total tasks: {task_count}.") - if execution_name: - print(f"Execution: {execution_name}") - print(f"No container logs returned yet. Run the following command to view traces:\n {log_cmd_str}") - else: - print("Review Cloud Run console logs for per-container traces.") - else: - print("=" * 80) - print(f"Total: {len(report_items)} | PASS: {pass_count} | ISSUES: {issues_count} | BLOCKED: {blocked_count}") - print("=" * 80) - - failed_tasks_count = failed_task_count(report_items, task_count) - if not exec_succeeded and failed_tasks_count == 0: - failed_tasks_count = 1 - - if harvested_patches: - print_candidate_patches_table( - harvested_patches, - baseline_score=args.baseline_score, - exec_succeeded=exec_succeeded, - failed_count=failed_tasks_count, - allow_partial=getattr(args, "ignore_partial_failures", False), - ) - - if not exec_succeeded or failed_tasks_count > 0: - print(f"\n[STATUS: EXECUTION_FAILED] ({failed_tasks_count}/{len(report_items) or task_count} tasks failed; patches harvested with quarantine)") - else: - print(f"\n[STATUS: EXECUTION_SUCCESS] (All {len(report_items) or task_count} tasks succeeded)") - - cleanup_session(session_id=session_id, bucket_name=gcs_bucket) - - if not exec_succeeded or failed_tasks_count > 0: - sys.exit(1) - - except subprocess.CalledProcessError as exc: - err_out = exc.stderr.replace(gh_token, "REDACTED") if gh_token in exc.stderr else exc.stderr - print(f"Error executing Cloud Run job: {err_out}", file=sys.stderr) - sys.exit(exc.returncode) - - -if __name__ == "__main__": - main() diff --git a/skills/swarm/scripts/cloud_worker.py b/skills/swarm/scripts/cloud_worker.py deleted file mode 100644 index 3f61849..0000000 --- a/skills/swarm/scripts/cloud_worker.py +++ /dev/null @@ -1,1327 +0,0 @@ -#!/usr/bin/env python3 -""" -Cloud worker entrypoint executed inside Cloud Run Job container instances. -Reads task parameters from environment, clones the repo on an isolated branch, -executes the task brief via Google Antigravity SDK Agent or direct command runner, -validates changes via verification command, commits candidate changes locally, -delivers candidate patches via GCS under zero-push architecture, -and outputs a structured report. -""" - -import json -import os -import shutil -import subprocess -import sys -import tempfile -import time -import urllib.error -import urllib.parse -import urllib.request -from pathlib import Path -from typing import Any, Dict, List, Optional, Tuple - -try: - from storage_messenger import StorageMessenger -except ImportError: - StorageMessenger = None - -POTETO_WORKER_SYSTEM_PROMPT = """You are a specialized poteto coding delegate for agystack executing inside an isolated cloud worker container. -You implement surgical code edits, run test suites, verify outputs, and keep code and diffs clean and unslopped. - -Guidelines: -1. Implement the requested task directly and surgically in the workspace. -2. Maintain high engineering rigor: run test suites and verification commands before completing. -3. Keep diffs minimal and clean. Avoid narrating comments or speculative code. -4. End your final response with exactly one standalone unquoted status line outside code fences, [STATUS: PASS], [STATUS: ISSUES], or [STATUS: BLOCKED]. -""" - - -def emit_milestone(task_index: int, phase: str, detail: str = "") -> None: - msg = f"[MILESTONE] [TASK {task_index}] [PHASE: {phase}]" - if detail: - msg += f" {detail}" - print(msg, flush=True) - - -def emit_telemetry( - task_index: int, - event_type: str, - data: Optional[Dict[str, Any]] = None, - timestamp: Optional[float] = None, - stream: Optional[Any] = None, -) -> None: - ts = timestamp if timestamp is not None else time.time() - payload = { - "timestamp": ts, - "event": event_type, - "task_index": task_index, - } - if data: - payload.update(data) - line = f"[TELEMETRY] [TASK {task_index}] {json.dumps(payload, default=str)}" - target = stream if stream is not None else sys.stderr - try: - print(line, file=target, flush=True) - except Exception: - pass - - -def emit_thought( - task_index_or_thought: Any, - thought: Optional[str] = None, - timestamp: Optional[float] = None, - stream: Optional[Any] = None, -) -> None: - if thought is None and isinstance(task_index_or_thought, str): - task_idx = 0 - th = task_index_or_thought - elif isinstance(task_index_or_thought, int): - task_idx = task_index_or_thought - th = thought or "" - else: - task_idx = 0 - th = str(task_index_or_thought) - emit_telemetry( - task_idx, - "thought", - {"thought": th}, - timestamp=timestamp, - stream=stream, - ) - - -def emit_tool_invocation( - task_index: int, - tool_name: str, - args: Any = None, - call_id: Optional[str] = None, - timestamp: Optional[float] = None, - stream: Optional[Any] = None, -) -> None: - tool_args = args if isinstance(args, dict) else ({"args": str(args)} if args is not None else {}) - emit_telemetry( - task_index, - "tool_call", - { - "tool_name": tool_name, - "args": tool_args, - "call_id": call_id or "", - }, - timestamp=timestamp, - stream=stream, - ) - - -def emit_tool_result( - task_index: int, - tool_name: str, - output: Any = "", - success: bool = True, - call_id: Optional[str] = None, - duration_s: float = 0.0, - timestamp: Optional[float] = None, - stream: Optional[Any] = None, -) -> None: - emit_telemetry( - task_index, - "tool_result", - { - "tool_name": tool_name, - "output": output, - "success": success, - "call_id": call_id or "", - "duration_s": duration_s, - }, - timestamp=timestamp, - stream=stream, - ) - - -def emit_user_input( - task_index: int, - content: str, - timestamp: Optional[float] = None, - stream: Optional[Any] = None, -) -> None: - emit_telemetry( - task_index, - "user_input", - {"content": content}, - timestamp=timestamp, - stream=stream, - ) - - -def emit_agent_response( - task_index: int, - content: str, - timestamp: Optional[float] = None, - stream: Optional[Any] = None, -) -> None: - emit_telemetry( - task_index, - "agent_response", - {"content": content}, - timestamp=timestamp, - stream=stream, - ) - - -try: - from worker.execution import CREDENTIAL_PATTERNS as CREDENTIAL_PATTERNS, scrub_credentials -except ImportError: - from skills.swarm.scripts.worker.execution import CREDENTIAL_PATTERNS as CREDENTIAL_PATTERNS, scrub_credentials - - -class TokenShield: - def __init__( - self, - task_index: int = 0, - target_stream: Optional[Any] = None, - telemetry_stream: Optional[Any] = None, - ): - self.task_index = task_index - self.target_stream = target_stream - self.telemetry_stream = telemetry_stream or sys.stderr - self.captured_thoughts: List[str] = [] - self._orig_stdout: Optional[Any] = None - self._buffer = "" - - def __enter__(self) -> "TokenShield": - self._orig_stdout = sys.stdout - self.target_stream = self.target_stream or self._orig_stdout - sys.stdout = self - return self - - def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: - try: - if self._buffer.strip(): - self._handle_non_milestone(self._buffer) - self._buffer = "" - finally: - if self._orig_stdout is not None: - sys.stdout = self._orig_stdout - - def write(self, s: str) -> int: - if not s: - return 0 - self._buffer += s - while "\n" in self._buffer: - line, self._buffer = self._buffer.split("\n", 1) - self._process_line(line) - return len(s) - - def _process_line(self, line: str) -> None: - stripped = line.strip() - if not stripped: - return - if stripped.startswith("[MILESTONE]"): - out = self.target_stream or self._orig_stdout or sys.__stdout__ - out.write(line + "\n") - if hasattr(out, "flush"): - out.flush() - else: - self._handle_non_milestone(stripped) - - def _handle_non_milestone(self, text: str) -> None: - scrubbed = scrub_credentials(text) - self.captured_thoughts.append(scrubbed) - emit_thought(self.task_index, scrubbed, stream=self.telemetry_stream) - - def flush(self) -> None: - out = self.target_stream or self._orig_stdout or sys.__stdout__ - if hasattr(out, "flush"): - out.flush() - - def emit_milestone(self, phase: str, detail: str = "") -> None: - emit_milestone(self.task_index, phase, detail) - - def emit_thought(self, thought: str) -> None: - scrubbed = scrub_credentials(thought) - self.captured_thoughts.append(scrubbed) - emit_thought(self.task_index, scrubbed, stream=self.telemetry_stream) - - def emit_tool_invocation( - self, - tool_name: str, - args: Any = None, - call_id: Optional[str] = None, - ) -> None: - emit_tool_invocation(self.task_index, tool_name, args, call_id=call_id, stream=self.telemetry_stream) - - def emit_tool_result( - self, - tool_name: str, - output: Any = "", - success: bool = True, - call_id: Optional[str] = None, - duration_s: float = 0.0, - ) -> None: - emit_tool_result(self.task_index, tool_name, output, success=success, call_id=call_id, duration_s=duration_s, stream=self.telemetry_stream) - - - -try: - from worker.agent_hooks import ( - StagnancyTracker as StagnancyTracker, - ToolInvocationRecord as ToolInvocationRecord, - create_agent_hooks as create_agent_hooks, - create_ask_orchestrator_tool as create_ask_orchestrator_tool, - ) -except ImportError: - from skills.swarm.scripts.worker.agent_hooks import ( - StagnancyTracker as StagnancyTracker, - ToolInvocationRecord as ToolInvocationRecord, - create_agent_hooks as create_agent_hooks, - create_ask_orchestrator_tool as create_ask_orchestrator_tool, - ) - - -def get_env_var(name: str, default: Optional[str] = None, required: bool = False) -> str: - val = os.environ.get(name, default) - if required and (val is None or val.strip() == ""): - print(f"Error: Missing required environment variable: {name}", file=sys.stderr) - sys.exit(1) - return val if val is not None else "" - - -def download_manifest(manifest_uri: str) -> str: - """ - Downloads manifest JSON content from a storage URI (e.g. gs:///swarms//manifest.json) - or local path. - """ - uri = manifest_uri.strip() - if uri.startswith("file://"): - return Path(uri[7:]).read_text(encoding="utf-8") - if os.path.isfile(uri): - return Path(uri).read_text(encoding="utf-8") - - if not uri.startswith("gs://"): - raise ValueError(f"Unsupported manifest URI scheme: {manifest_uri}") - - path_part = uri[5:] - if "/" not in path_part: - raise ValueError(f"Invalid GCS URI: {manifest_uri}") - bucket_name, object_name = path_part.split("/", 1) - - # 1. Check local testing mock directory - local_dir = os.environ.get("STORAGE_MESSENGER_LOCAL_DIR") - if local_dir: - local_file = Path(local_dir) / bucket_name / object_name - if local_file.is_file(): - return local_file.read_text(encoding="utf-8") - - # 2. Try google.cloud.storage - try: - from google.cloud import storage - - client = storage.Client() - bucket = client.bucket(bucket_name) - blob = bucket.blob(object_name) - return blob.download_as_text() - except Exception: - pass - - # 3. Try StorageMessenger client if available - if StorageMessenger is not None: - try: - messenger = StorageMessenger( - bucket_name=bucket_name, - session_id="manifest-loader", - is_worker=False, - ) - blob = messenger.bucket.blob(object_name) - if blob.exists(): - return blob.download_as_text() - except Exception: - pass - - # 4. Try REST with oauth token from storage_uploader - token = None - try: - import storage_uploader - - token = storage_uploader.get_oauth_token() - except Exception: - pass - - if token: - encoded_bucket = urllib.parse.quote(bucket_name, safe="") - encoded_name = urllib.parse.quote(object_name, safe="") - url = f"https://storage.googleapis.com/storage/v1/b/{encoded_bucket}/o/{encoded_name}?alt=media" - req = urllib.request.Request( - url, - headers={"Authorization": f"Bearer {token}"}, - method="GET", - ) - try: - with urllib.request.urlopen(req, timeout=15) as resp: - if 200 <= resp.status < 300: - return resp.read().decode("utf-8") - except Exception: - pass - - # 5. Try gcloud storage cp - try: - res = subprocess.run( - ["gcloud", "storage", "cp", uri, "-"], - capture_output=True, - text=True, - check=False, - timeout=15, - ) - if res.returncode == 0 and res.stdout: - return res.stdout - except Exception: - pass - - raise RuntimeError(f"Failed to download manifest from {manifest_uri}") - - -def parse_task_manifest( - manifest_raw: Optional[str] = None, - task_index: int = 0, - manifest_uri: Optional[str] = None, -) -> Tuple[Any, str]: - if manifest_uri is None: - manifest_uri = os.environ.get("MANIFEST_URI", "").strip() - - if manifest_uri and not (manifest_raw and manifest_raw.strip()): - manifest_raw = download_manifest(manifest_uri) - - if manifest_raw is None: - manifest_raw = os.environ.get("TASK_MANIFEST", "") - - if not manifest_raw.strip(): - task_brief_env = os.environ.get("TASK_BRIEF", "").strip() - if task_brief_env: - return task_brief_env, task_brief_env - raise ValueError("Neither MANIFEST_URI, TASK_MANIFEST, nor TASK_BRIEF environment variable was set.") - - data = None - if os.path.isfile(manifest_raw): - with open(manifest_raw, "r", encoding="utf-8") as f: - data = json.load(f) - else: - try: - data = json.loads(manifest_raw) - except json.JSONDecodeError as exc: - raise ValueError(f"Failed to parse TASK_MANIFEST as JSON: {exc}") from exc - - if isinstance(data, list): - if task_index < 0 or task_index >= len(data): - raise IndexError( - f"Task index {task_index} out of bounds for manifest containing {len(data)} tasks." - ) - item = data[task_index] - elif isinstance(data, dict): - if "tasks" in data and isinstance(data["tasks"], list): - tasks_list = data["tasks"] - if task_index < 0 or task_index >= len(tasks_list): - raise IndexError( - f"Task index {task_index} out of bounds for data['tasks'] ({len(tasks_list)} tasks)." - ) - item = tasks_list[task_index] - elif "briefs" in data and isinstance(data["briefs"], list): - briefs_list = data["briefs"] - if task_index < 0 or task_index >= len(briefs_list): - raise IndexError( - f"Task index {task_index} out of bounds for data['briefs'] ({len(briefs_list)} tasks)." - ) - item = briefs_list[task_index] - else: - item = data - else: - item = data - - if isinstance(item, str): - return item, item - if isinstance(item, dict): - brief = item.get("brief") or item.get("prompt") or item.get("command") or json.dumps(item, indent=2) - return item, brief - return item, str(item) - - -def clean_repo_url(url: str) -> str: - """Removes any embedded username:password or token credentials from a repository URL.""" - if not url: - return "" - url_clean = url.strip() - if url_clean.startswith("git@"): - return url_clean - if "://" in url_clean: - parsed = urllib.parse.urlsplit(url_clean) - netloc = parsed.netloc - if "@" in netloc: - netloc = netloc.split("@")[-1] - return urllib.parse.urlunsplit((parsed.scheme, netloc, parsed.path, parsed.query, parsed.fragment)) - return url_clean - - -def resolve_worker_branch( - task_item: Any, - task_index: int, - session_id: Optional[str] = None, -) -> str: - explicit_branch = task_item.get("branch") if isinstance(task_item, dict) else None - if explicit_branch and str(explicit_branch).strip(): - return str(explicit_branch).strip() - - if session_id is None: - session_id = ( - os.environ.get("SWARM_SESSION_ID") - or os.environ.get("SESSION_ID") - or "" - ).strip() - else: - session_id = str(session_id).strip() - - if session_id: - return f"agystack/{session_id}/worker-{task_index}" - return f"worker-{task_index}" - - -def build_authenticated_git_url(repo_url: str, gh_token: str) -> str: - repo_clean = repo_url.strip() - if repo_clean.startswith("git@github.com:"): - path = repo_clean[len("git@github.com:") :] - return f"https://x-access-token:{gh_token}@github.com/{path}" - if repo_clean.startswith("https://"): - parsed = urllib.parse.urlsplit(repo_clean) - netloc = parsed.netloc - if "@" in netloc: - netloc = netloc.split("@")[-1] - return f"https://x-access-token:{gh_token}@{netloc}{parsed.path}" - if repo_clean.startswith("http://"): - parsed = urllib.parse.urlsplit(repo_clean) - netloc = parsed.netloc - if "@" in netloc: - netloc = netloc.split("@")[-1] - return f"http://x-access-token:{gh_token}@{netloc}{parsed.path}" - if "/" in repo_clean and not repo_clean.startswith("/"): - return f"https://x-access-token:{gh_token}@github.com/{repo_clean.rstrip('.git')}.git" - return repo_clean - - -def clone_and_checkout_task( - repo_url: str, - gh_token: str, - branch_name: str, - repo_dir: Path, - depth: int = 50, - base_branch: Optional[str] = None, -) -> None: - """ - Clones the repository using authenticated credentials, scrubs credentials from remote.origin.url - so tokens are not retained in plaintext in .git/config, configures git identity, and checks out the task branch. - """ - repo_path = Path(repo_dir) - clean_url = clean_repo_url(repo_url) - git_env = os.environ.copy() - if gh_token: - git_env["GH_TOKEN"] = gh_token - cred_helper = '!f() { echo "username=x-access-token"; echo "password=$GH_TOKEN"; }; f' - cmd = [ - "git", - "-c", f"credential.helper={cred_helper}", - "clone", - f"--depth={depth}", - ] - else: - cmd = ["git", "clone", f"--depth={depth}"] - if base_branch: - cmd.extend(["--branch", base_branch]) - cmd.extend([clean_url, str(repo_path)]) - run_command(cmd, env=git_env, check=True) - run_command(["git", "remote", "set-url", "origin", clean_url], cwd=repo_path, check=True) - run_command(["git", "config", "user.name", "Antigravity Cloud Worker"], cwd=repo_path, check=False) - run_command(["git", "config", "user.email", "bot@antigravity.google"], cwd=repo_path, check=False) - run_command(["git", "checkout", "-B", branch_name], cwd=repo_path, check=True) - - -def run_command( - cmd: List[str], - cwd: Optional[Path] = None, - check: bool = True, - env: Optional[Dict[str, str]] = None, -) -> subprocess.CompletedProcess: - return subprocess.run( - cmd, - cwd=cwd, - capture_output=True, - text=True, - check=check, - env=env, - ) - - -class ScoreMetricsResult(tuple): - def __new__(cls, score: Optional[float], accuracy: Optional[float], latency_ms: Optional[float]): - return super().__new__(cls, (score, accuracy, latency_ms)) - - @property - def score(self) -> Optional[float]: - return self[0] - - @property - def accuracy(self) -> Optional[float]: - return self[1] - - @property - def latency_ms(self) -> Optional[float]: - return self[2] - - def get(self, key: str, default: Any = None) -> Any: - if key == "score": - return self[0] if self[0] is not None else default - elif key == "accuracy": - return self[1] if self[1] is not None else default - elif key == "latency_ms": - return self[2] if self[2] is not None else default - return default - - -def parse_score_metrics( - repo_dir: Path, -) -> Tuple[Optional[float], Optional[float], Optional[float]]: - score_file = repo_dir / "score.json" - if not score_file.is_file(): - return ScoreMetricsResult(None, None, None) - try: - with open(score_file, "r", encoding="utf-8") as f: - data = json.load(f) - score = data.get("score") - metrics = data.get("metrics", {}) if isinstance(data.get("metrics"), dict) else {} - if score is None and "score" in metrics: - score = metrics.get("score") - accuracy = ( - data.get("accuracy") - if data.get("accuracy") is not None - else metrics.get("accuracy") - ) - latency_ms = ( - data.get("latency_ms") - if data.get("latency_ms") is not None - else metrics.get("latency_ms") - ) - return ScoreMetricsResult(score, accuracy, latency_ms) - except Exception: - return ScoreMetricsResult(None, None, None) - - -DEFAULT_EXCLUDED_EXACT = { - ".git", - ".agystack", - ".agents", -} - -DEFAULT_EXCLUDED_DIRS = ( - ".git", - ".agents", - ".agystack", - "node_modules", - "target", - "vendor", - ".cargo", - "dist", - "build", - ".venv", - "__pycache__", -) - - -def is_candidate_file( - path: str, - explicit_candidates: Optional[List[str]] = None, - explicit_excludes: Optional[List[str]] = None, -) -> bool: - clean = path.strip().strip('"').replace("\\", "/") - if clean.startswith("./"): - clean = clean[2:] - - # Check explicit excludes first if provided - if explicit_excludes: - for ex in explicit_excludes: - clean_ex = ex.strip().strip('"').replace("\\", "/") - if clean_ex.startswith("./"): - clean_ex = clean_ex[2:] - clean_ex = clean_ex.rstrip("/") - if clean == clean_ex or clean.startswith(f"{clean_ex}/"): - return False - - # Check explicit candidates if provided - if explicit_candidates is not None: - matched = False - for cand in explicit_candidates: - clean_cand = cand.strip().strip('"').replace("\\", "/") - if clean_cand.startswith("./"): - clean_cand = clean_cand[2:] - clean_cand = clean_cand.rstrip("/") - if clean == clean_cand or clean.startswith(f"{clean_cand}/"): - matched = True - break - if not matched: - return False - - # Check default exact excluded files - if clean in DEFAULT_EXCLUDED_EXACT: - return False - - # Check default excluded directory prefixes - for d in DEFAULT_EXCLUDED_DIRS: - if clean == d or clean.startswith(f"{d}/"): - return False - - return True - - -def parse_porcelain_status(stdout: str) -> List[str]: - modified_files: List[str] = [] - if not stdout or not stdout.strip(): - return modified_files - for line in stdout.splitlines(): - if len(line) > 3: - raw_path = line[3:].strip() - if " -> " in raw_path: - raw_path = raw_path.split(" -> ")[-1].strip() - if raw_path: - modified_files.append(raw_path) - return modified_files - - -try: - from worker.execution import ExecutionLimits, evaluate_agent_status, limits_for_task, run_bounded_shell, write_diagnostic -except ImportError: - from skills.swarm.scripts.worker.execution import ExecutionLimits, evaluate_agent_status, limits_for_task, run_bounded_shell, write_diagnostic - - -try: - from worker.partner_engine import ( - PARTNER_MODEL_ALIASES as PARTNER_MODEL_ALIASES, - PARTNER_MODELS as PARTNER_MODELS, - WORKSPACE_TOOLS as WORKSPACE_TOOLS, - execute_claude_model_agent as execute_claude_model_agent, - execute_deepseek_model_agent as execute_deepseek_model_agent, - execute_fable_model_agent as execute_fable_model_agent, - execute_partner_model_agent as execute_partner_model_agent, - execute_workspace_tool as execute_workspace_tool, - is_deepseek_model as is_deepseek_model, - is_fable_model as is_fable_model, - is_partner_model as is_partner_model, - measure_partner_client_startup as measure_partner_client_startup, - ) -except ImportError: - from skills.swarm.scripts.worker.partner_engine import ( - PARTNER_MODEL_ALIASES as PARTNER_MODEL_ALIASES, - PARTNER_MODELS as PARTNER_MODELS, - WORKSPACE_TOOLS as WORKSPACE_TOOLS, - execute_claude_model_agent as execute_claude_model_agent, - execute_deepseek_model_agent as execute_deepseek_model_agent, - execute_fable_model_agent as execute_fable_model_agent, - execute_partner_model_agent as execute_partner_model_agent, - execute_workspace_tool as execute_workspace_tool, - is_deepseek_model as is_deepseek_model, - is_fable_model as is_fable_model, - is_partner_model as is_partner_model, - measure_partner_client_startup as measure_partner_client_startup, - ) -def resolve_worker_model(raw_model: Optional[str] = None, task_item: Any = None) -> str: - """ - Resolves the worker model for a task, respecting per-task overrides in task_item, - explicit raw_model / MODEL_OVERRIDE, and resolving tier aliases ('auto', 'inherit', - 'inherit-parent', 'flash', 'flash_lite', 'flash-lite', 'pro', and partner models). - """ - candidate = "" - if ( - isinstance(task_item, dict) - and task_item.get("model") - and isinstance(task_item["model"], str) - and task_item["model"].strip() - ): - candidate = task_item["model"].strip() - elif raw_model and raw_model.strip(): - candidate = raw_model.strip() - else: - candidate = os.environ.get("MODEL_OVERRIDE", "").strip() - - default_model = ( - os.environ.get("DEFAULT_SWARM_MODEL", "").strip() - or os.environ.get("DEFAULT_MODEL", "").strip() - or "gemini-3.8-flash" - ) - - alias_map = { - "flash": "gemini-3.8-flash", - "pro": "gemini-3.1-pro", - "flash_lite": "gemini-3.1-flash-lite", - "flash-lite": "gemini-3.1-flash-lite", - "argon": "gemini-4-argon", - "gemini-argon": "gemini-4-argon", - "gemini-4": "gemini-4-argon", - "gemini": "gemini-3.8-flash", - "deepseek": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "deepseek-flash": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "deepseek-4.1": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "deepseek-v4.1": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "deepseek-4.1-flash": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "deepseek-v4.1-flash-maas": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "deepseek-v4.1-flash-maas@001": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "auto": default_model, - "inherit": default_model, - "inherit-parent": default_model, - "inherit_parent": default_model, - "": default_model, - } - alias_map.update(PARTNER_MODEL_ALIASES) - - norm = candidate.lower() - if norm in alias_map: - return alias_map[norm] - norm_hyphen = norm.replace("_", "-") - if norm_hyphen in alias_map: - return alias_map[norm_hyphen] - return candidate - - -def execute_task( - task_item: Any, - task_brief: str, - repo_dir: Path, - model_override: str, - api_key: str, - use_vertex: bool = False, - project: Optional[str] = None, - location: Optional[str] = None, - task_index: int = 0, - messenger: Optional[Any] = None, - orchestrator_timeout: float = 600.0, - *, - limits: Optional[ExecutionLimits] = None, -) -> Tuple[str, str]: - task_type = "agent" - if isinstance(task_item, dict): - task_type = task_item.get("type", "agent") - - limits = limits or limits_for_task(task_item, command_default=900 if task_type == "command" else 300) - - # Command execution runner - if task_type == "command": - cmd_str = "" - if isinstance(task_item, dict): - cmd_str = task_item.get("command", "") - if not cmd_str: - cmd_str = task_brief - - emit_user_input(task_index, cmd_str) - emit_tool_invocation(task_index, "run_command", {"command": cmd_str}) - emit_milestone(task_index, "RUNNING_COMMAND", cmd_str) - print(f"Executing command task: {cmd_str}", flush=True) - res, output = run_bounded_shell(cmd_str, repo_dir, limits.command_timeout_s) - emit_tool_result(task_index, "run_command", output, success=res.returncode == 0) - return ("PASS" if res.returncode == 0 else "ISSUES"), output - - resolved_model = resolve_worker_model(raw_model=model_override, task_item=task_item) - if is_deepseek_model(resolved_model): - location_override = "global" if (not location or location == "us-central1" or not os.environ.get("VERTEXAI_LOCATION")) else location - emit_milestone(task_index, "RUNNING_AGENT", f"Vertex Model Garden agent ({resolved_model})") - return execute_deepseek_model_agent( - model=resolved_model, - task_brief=task_brief, - repo_dir=repo_dir, - task_item=task_item, - task_index=task_index, - project=project, - location=location_override, - messenger=messenger, - limits=limits, - ) - - if is_partner_model(resolved_model): - emit_milestone(task_index, "RUNNING_AGENT", f"Vertex Model Garden agent ({resolved_model})") - return execute_partner_model_agent( - model=resolved_model, - task_brief=task_brief, - repo_dir=repo_dir, - task_item=task_item, - task_index=task_index, - project=project, - location=location, - messenger=messenger, - limits=limits, - ) - - # General Agent Execution using Google Antigravity SDK - emit_milestone(task_index, "RUNNING_AGENT", f"Antigravity SDK agent ({resolved_model})") - try: - import asyncio - from google.antigravity import Agent, LocalAgentConfig, CapabilitiesConfig, policy - try: - from google.antigravity.hooks import hooks - from google.antigravity import types - except (ImportError, AttributeError): - hooks = None - types = None - - capabilities = CapabilitiesConfig( - allow_file_write=True, - allow_shell_commands=True, - allow_subagents=False, - ) - policies = [policy.allow_all()] - - tracker = StagnancyTracker() - custom_tools = [] - if messenger: - ask_tool = create_ask_orchestrator_tool( - messenger=messenger, - task_index=task_index, - timeout_seconds=orchestrator_timeout, - ) - custom_tools.append(ask_tool) - - config_kwargs = { - "model": resolved_model, - "capabilities": capabilities, - "workspace_dir": str(repo_dir), - "policies": policies, - "system_prompt": os.environ.get("AGYSTACK_WORKER_SYSTEM_PROMPT") or POTETO_WORKER_SYSTEM_PROMPT, - } - if custom_tools: - config_kwargs["custom_tools"] = custom_tools - - if hooks is not None and types is not None: - agent_hooks = create_agent_hooks( - messenger=messenger, - task_index=task_index, - tracker=tracker, - hooks_module=hooks, - types_module=types, - ) - if agent_hooks: - config_kwargs["hooks"] = agent_hooks - - if use_vertex: - resolved_project = ( - project - or os.environ.get("VERTEXAI_PROJECT") - or os.environ.get("GCP_PROJECT") - or os.environ.get("PROJECT_ID") - ) - resolved_location = ( - location - or os.environ.get("VERTEXAI_LOCATION") - or os.environ.get("GCP_REGION") - or os.environ.get("REGION") - or "us-central1" - ) - config_kwargs["vertex"] = True - config_kwargs["project"] = resolved_project - config_kwargs["location"] = resolved_location - if api_key: - config_kwargs["api_key"] = api_key - else: - config_kwargs["api_key"] = api_key - - try: - config = LocalAgentConfig(**config_kwargs) - except TypeError as exc: - emit_milestone(task_index, "AGENT_FALLBACK", f"Dropped optional capabilities: {exc}") - print( - f"Warning: LocalAgentConfig initialization failed with TypeError ({exc}). " - "Dropping custom_tools, system_prompt, and hooks for fallback compatibility.", - file=sys.stderr, - ) - config_kwargs.pop("custom_tools", None) - config_kwargs.pop("system_prompt", None) - config_kwargs.pop("hooks", None) - config = LocalAgentConfig(**config_kwargs) - - emit_user_input(task_index, task_brief) - - async def _run_agent_turn() -> str: - async with Agent(config=config) as agent: - resp = await agent.chat(task_brief) - if hasattr(resp, "thinking") and resp.thinking: - emit_thought(task_index, str(resp.thinking)) - elif hasattr(resp, "thoughts") and resp.thoughts: - emit_thought(task_index, str(resp.thoughts)) - if hasattr(resp, "text"): - res = resp.text() if callable(resp.text) else resp.text - text = await res if asyncio.iscoroutine(res) else str(res) - else: - text = str(resp) - emit_agent_response(task_index, text) - return text - - with TokenShield(task_index=task_index): - agent_text = asyncio.run(_run_agent_turn()) - return evaluate_agent_status(agent_text) - except ImportError: - return "BLOCKED", "Missing dependency: google.antigravity Python package is not installed." - except Exception as exc: - return "ISSUES", f"Agent execution exception: {exc}" - - -def main() -> None: - task_index_str = os.environ.get("CLOUD_RUN_TASK_INDEX", "0") - try: - task_index = int(task_index_str) - except ValueError: - task_index = 0 - - import logging - - logging.basicConfig( - level=logging.INFO, - format=f"[MILESTONE] [TASK {task_index}] [PHASE: %(levelname)s] %(name)s: %(message)s", - force=True, - ) - - emit_milestone(task_index, "BOOTING") - - manifest_uri = os.environ.get("MANIFEST_URI", "").strip() - manifest_raw = os.environ.get("TASK_MANIFEST", "") - repo_url = get_env_var("REPO_URL", required=True) - gh_token = os.environ.get("GH_TOKEN") or os.environ.get("GITHUB_TOKEN") or "" - if not gh_token: - print("Warning: Missing GH_TOKEN. Proceeding with unauthenticated git operations.", file=sys.stderr) - - project = os.environ.get("VERTEXAI_PROJECT") or os.environ.get("GCP_PROJECT") or os.environ.get("PROJECT_ID") - location = os.environ.get("VERTEXAI_LOCATION") or os.environ.get("GCP_REGION") or os.environ.get("REGION") - model_override = os.environ.get("MODEL_OVERRIDE", "") - - try: - task_item, task_brief = parse_task_manifest( - manifest_raw=manifest_raw, - task_index=task_index, - manifest_uri=manifest_uri, - ) - except Exception as exc: - emit_milestone(task_index, "COMPLETE", "BLOCKED") - print( - f"[STATUS: BLOCKED]\nEvidence: Failed to parse task brief for index {task_index}: {exc}\nSummary: Manifest resolution failure.", - flush=True, - ) - sys.exit(1) - - limits = limits_for_task(task_item, command_default=900 if isinstance(task_item, dict) and task_item.get("type") == "command" else 300) - - task_model = resolve_worker_model(raw_model=model_override, task_item=task_item) - use_vertex = ( - os.environ.get("USE_VERTEX_AI", "").lower() in ("1", "true", "yes") - or bool(os.environ.get("VERTEXAI_PROJECT")) - or bool(os.environ.get("GCP_PROJECT")) - or is_partner_model(task_model) - or is_deepseek_model(task_model) - ) - gemini_api_key = os.environ.get("GEMINI_API_KEY", "").strip() - if not use_vertex and not gemini_api_key: - emit_milestone(task_index, "COMPLETE", "BLOCKED") - print( - "[STATUS: BLOCKED]\nEvidence: Missing authentication. Neither USE_VERTEX_AI nor GEMINI_API_KEY is provided.\nSummary: Authentication configuration error.", - flush=True, - ) - sys.exit(1) - - branch_name = resolve_worker_branch(task_item, task_index) - - base_branch = os.environ.get("BASE_BRANCH", "").strip() or None - - work_base = Path("/workspace") if Path("/workspace").exists() else Path(tempfile.gettempdir()) - repo_dir = work_base / f"repo-task-{task_index}" - if repo_dir.exists(): - shutil.rmtree(repo_dir, ignore_errors=True) - repo_dir.mkdir(parents=True, exist_ok=True) - - emit_milestone(task_index, "CLONING_REPO") - try: - clone_and_checkout_task( - repo_url=repo_url, - gh_token=gh_token, - branch_name=branch_name, - repo_dir=repo_dir, - base_branch=base_branch, - ) - except subprocess.CalledProcessError as exc: - emit_milestone(task_index, "COMPLETE", "BLOCKED") - err_msg = exc.stderr.replace(gh_token, "REDACTED") if gh_token in exc.stderr else exc.stderr - print( - f"[STATUS: BLOCKED]\nEvidence: git clone failed with code {exc.returncode}: {err_msg.strip()}\nSummary: Failed to clone repository.", - flush=True, - ) - sys.exit(1) - - os.chdir(repo_dir) - emit_milestone(task_index, "REPO_READY") - - # Scrub credentials from environment before running bootstrap hooks or agent commands - for tok_var in ("GH_TOKEN", "GITHUB_TOKEN"): - if tok_var in os.environ: - del os.environ[tok_var] - - # Repository bootstrap hook: check for .agystack/setup.sh or .agents/scripts/bootstrap-worker.sh - bootstrap_hooks = [ - repo_dir / ".agystack" / "setup.sh", - repo_dir / ".agents" / "scripts" / "bootstrap-worker.sh", - ] - for hook in bootstrap_hooks: - if hook.is_file(): - emit_milestone(task_index, "BOOTSTRAP_HOOK", str(hook.relative_to(repo_dir))) - print(f"Executing repository bootstrap hook: {hook}", flush=True) - hook_proc = subprocess.run( - ["bash", str(hook)], - cwd=repo_dir, - capture_output=True, - text=True, - ) - if hook_proc.returncode != 0: - print(f"Warning: Bootstrap hook {hook.name} exited with code {hook_proc.returncode}:\n{hook_proc.stderr}", file=sys.stderr) - else: - print(f"Bootstrap hook {hook.name} completed successfully.", flush=True) - break - - gcs_bucket = ( - os.environ.get("GCS_BUCKET", "").strip() - or os.environ.get("GCS_RESULTS_BUCKET", "").strip() - ) - session_id = ( - os.environ.get("SWARM_SESSION_ID", "").strip() - or os.environ.get("SESSION_ID", "").strip() - or "default" - ) - timeout_str = os.environ.get("ORCHESTRATOR_TIMEOUT", "").strip() - try: - orchestrator_timeout = float(timeout_str) if timeout_str else 600.0 - except ValueError: - orchestrator_timeout = 600.0 - - messenger = None - if gcs_bucket and StorageMessenger is not None: - try: - messenger = StorageMessenger( - bucket_name=gcs_bucket, - session_id=session_id, - task_index=task_index, - is_worker=True, - ) - except Exception as exc: - print(f"Warning: Failed to initialize StorageMessenger: {exc}", file=sys.stderr) - - agent_status, agent_summary = execute_task( - task_item=task_item, - task_brief=task_brief, - repo_dir=repo_dir, - model_override=model_override, - api_key=gemini_api_key, - use_vertex=use_vertex, - project=project, - location=location, - task_index=task_index, - messenger=messenger, - orchestrator_timeout=orchestrator_timeout, - limits=limits, - ) - - agent_summary = scrub_credentials(agent_summary) - write_diagnostic(repo_dir, "agent-result", agent_summary) - - score, accuracy, latency_ms = parse_score_metrics(repo_dir) - gcs_bucket = os.environ.get("GCS_RESULTS_BUCKET", "").strip() - gcs_prefix = os.environ.get("GCS_PREFIX", "").strip() - gcs_uris: Dict[str, str] = {} - - commit_sha = "" - diff_stat = "" - changes_pushed = False - - # Inspect git modifications - status_res = run_command(["git", "status", "--porcelain"], cwd=repo_dir, check=False) - modified_files = parse_porcelain_status(status_res.stdout) if status_res.returncode == 0 else [] - - explicit_candidates = None - explicit_excludes = None - if isinstance(task_item, dict): - explicit_candidates = task_item.get("candidate_files") - explicit_excludes = task_item.get("exclude_files") - - candidate_files = [ - f for f in modified_files - if is_candidate_file(f, explicit_candidates=explicit_candidates, explicit_excludes=explicit_excludes) - ] - - verify_cmd_str = None - if isinstance(task_item, dict): - verify_cmd_str = task_item.get("verify_command") - if not verify_cmd_str: - verify_cmd_str = os.environ.get("DEFAULT_VERIFY_COMMAND", "").strip() or None - - # Check steering messages before verification and commit - steer_messages: List[str] = [] - if messenger: - try: - steer_envelopes = messenger.check_steer_instructions() - for s_env in steer_envelopes: - instruction = s_env.payload.get("instruction") or s_env.payload.get("text") or "" - if instruction: - steer_messages.append(instruction) - emit_milestone(task_index, "STEER_RECEIVED", instruction[:80]) - except Exception as exc: - print(f"Warning: Failed to check steer instructions: {exc}", file=sys.stderr) - - if steer_messages: - steer_summary = "; ".join(steer_messages) - agent_summary += f"\n[Steering Instructions Applied]: {steer_summary}" - print(f"Notice: Applied {len(steer_messages)} steering instruction(s): {steer_summary}", flush=True) - - if agent_status == "PASS" and verify_cmd_str: - emit_milestone(task_index, "VALIDATING_CANDIDATE") - test_check, verify_output = run_bounded_shell( - verify_cmd_str, repo_dir, limits.verify_timeout_s, label="verification", - ) - agent_summary += f"\nVerification:\n{verify_output}" - if test_check.returncode != 0: - agent_status = "ISSUES" - diff_stat = f"Commit rejected: Candidate failed verification command (exit code {test_check.returncode})." - - if agent_status == "PASS" and candidate_files: - try: - for cand_file in candidate_files: - run_command(["git", "add", "--", cand_file], cwd=repo_dir, check=True) - cached_diff = run_command(["git", "diff", "--cached", "--name-only"], cwd=repo_dir, check=False) - if not cached_diff.stdout.strip(): - diff_stat = "Commit skipped: No candidate changes staged." - print("Notice: No candidate changes staged; skipping git commit.", file=sys.stderr) - else: - commit_msg = f"worker-{task_index}: execute swarm brief" - run_command(["git", "commit", "-m", commit_msg], cwd=repo_dir, check=True) - commit_res = run_command(["git", "rev-parse", "HEAD"], cwd=repo_dir, check=True) - commit_sha = commit_res.stdout.strip() - diff_res = run_command(["git", "diff", "--stat", "HEAD~1", "HEAD"], cwd=repo_dir, check=False) - diff_stat = diff_res.stdout.strip() - except subprocess.CalledProcessError as exc: - agent_status = "ISSUES" - commit_sha = None - err_text = (exc.stderr or str(exc)).strip() - diff_stat = f"Commit failed: {err_text}" - err_msg = exc.stderr.replace(gh_token, "REDACTED") if gh_token and gh_token in exc.stderr else err_text - print(f"Warning: Git commit preparation failed: {err_msg}", file=sys.stderr) - elif agent_status != "PASS": - diff_stat = f"Commit skipped: worker status is {agent_status} (PASS required; ghost commits prohibited)." - print(f"Notice: Agent status is {agent_status}. Skipping git commit.", file=sys.stderr) - else: - diff_stat = "Commit skipped: No candidate files modified outside bootstrap scaffolding." - print("Notice: No candidate modifications outside bootstrap files; skipping git commit.", file=sys.stderr) - - final_status = agent_status - status_payload = { - "task_index": task_index, - "status": final_status, - "summary": agent_summary.strip(), - "score": score, - "candidate_files": candidate_files, - "session_id": session_id, - } - status_file = repo_dir / "status.json" - status_file.write_text(json.dumps(status_payload, indent=2), encoding="utf-8") - - effective_bucket = gcs_bucket or os.environ.get("GCS_BUCKET", "").strip() - is_cloud = bool(os.environ.get("CLOUD_RUN_TASK_INDEX") or os.environ.get("SWARM_SESSION_ID") or os.environ.get("K_SERVICE")) - - if is_cloud and candidate_files and not effective_bucket: - final_status = "ISSUES" - fail_evidence = "Fail-closed: No GCS bucket configured for cloud swarm worker. Candidate patch cannot be delivered under zero-push architecture." - agent_summary += f"\n{fail_evidence}" - print(f"Warning: {fail_evidence}", file=sys.stderr) - status_payload["status"] = final_status - status_payload["summary"] = agent_summary.strip() - status_payload["evidence"] = fail_evidence - status_file.write_text(json.dumps(status_payload, indent=2), encoding="utf-8") - - upload_failed = False - gcs_uris = {} - if effective_bucket: - try: - sys.path.insert(0, str(Path(__file__).parent)) - import storage_uploader - - gcs_uris = storage_uploader.upload_run_artifacts( - bucket_name=effective_bucket, - prefix=gcs_prefix, - repo_dir=repo_dir, - task_index=task_index, - status=final_status, - candidate_files=candidate_files, - commit_sha=commit_sha, - evidence_files=task_item.get("evidence_files", []) if isinstance(task_item, dict) else [], - ) - if gcs_uris: - emit_milestone(task_index, "ARTIFACTS_UPLOADED") - print("[MILESTONE] ARTIFACTS_UPLOADED", flush=True) - except Exception as exc: - print(f"Warning: GCS upload failed: {exc}", file=sys.stderr) - upload_failed = True - - # Synchronize local status if storage_uploader overrode it - if status_file.is_file(): - try: - disk_status = json.loads(status_file.read_text(encoding="utf-8")) - if disk_status.get("status") and disk_status.get("status") != final_status: - final_status = disk_status.get("status") - except Exception: - pass - - if final_status == "PASS": - if upload_failed or "status.json" not in gcs_uris or (candidate_files and "patch.diff" not in gcs_uris): - final_status = "ISSUES" - fail_evidence = "Artifact upload to GCS failed; candidate patch could not be preserved." - agent_summary += f"\n{fail_evidence}" - print(f"Warning: {fail_evidence}", file=sys.stderr) - status_payload["status"] = final_status - status_payload["summary"] = agent_summary.strip() - status_payload["evidence"] = fail_evidence - status_file.write_text(json.dumps(status_payload, indent=2), encoding="utf-8") - - # Zero-push container architecture: cloud workers never push candidate branches to git remote. - changes_pushed = False - - emit_milestone(task_index, "COMPLETE", final_status) - print("=" * 80) - print("Evidence:") - print(f"- Task Index: {task_index}") - print(f"- Branch: {branch_name}") - print(f"- Commit SHA: {commit_sha or 'N/A'}") - print(f"- Changes Pushed: {changes_pushed}") - if score is not None: - print(f"- Score: {score}") - if accuracy is not None: - print(f"- Accuracy: {accuracy}") - if latency_ms is not None: - print(f"- Latency: {latency_ms}ms") - score_file = repo_dir / "score.json" - if score_file.is_file(): - try: - score_data = score_file.read_text(encoding="utf-8").strip() - print(f"- Slice JSON: {json.dumps(json.loads(score_data))}") - except Exception: - pass - if gcs_uris: - print(f"- GCS Artifacts: {json.dumps(gcs_uris)}") - if "status.json" in gcs_uris: - print(f"- GCS Status: {gcs_uris['status.json']}") - if "patch.diff" in gcs_uris: - print(f"- GCS Patch: {gcs_uris['patch.diff']}") - if "score.json" in gcs_uris: - print(f"- GCS Score: {gcs_uris['score.json']}") - print(f"- Diff Stat:\n{diff_stat}") - print("Summary:") - for summary_line in agent_summary.strip().splitlines(): - print(f"> {summary_line}") - print("=" * 80) - print(f"[STATUS: {final_status}]", flush=True) - if final_status != "PASS": - sys.exit(1) - - -if __name__ == "__main__": - main() diff --git a/skills/swarm/scripts/dispatch/__init__.py b/skills/swarm/scripts/dispatch/__init__.py deleted file mode 100644 index 036da0f..0000000 --- a/skills/swarm/scripts/dispatch/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Dispatch subsystem modules for Cloud Run swarm orchestration.""" diff --git a/skills/swarm/scripts/dispatch/mailbox_controller.py b/skills/swarm/scripts/dispatch/mailbox_controller.py deleted file mode 100644 index 2b205fd..0000000 --- a/skills/swarm/scripts/dispatch/mailbox_controller.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python3 -""" -Mailbox CLI administration and orchestration controller for Cloud Run swarm workers. -Provides commands for listing pending questions, replying to worker questions, -and delivering conversational steering directives to worker mailboxes in GCS. -""" - -import json -import os -from pathlib import Path -import sys -import time -from typing import Any, Dict, List, Optional, Union - -SCRIPT_DIR = Path(__file__).resolve().parent.parent -if str(SCRIPT_DIR) not in sys.path: - sys.path.insert(0, str(SCRIPT_DIR)) - -try: - from storage_messenger import StorageMessenger -except ImportError: - StorageMessenger = None # type: ignore - - -def find_runtime_config() -> Optional[Dict[str, Any]]: - paths_to_check = [ - Path("agystack-runtime.json"), - Path(".agents/plugins/agystack/agystack-runtime.json"), - Path(os.path.expanduser("~/.gemini/config/plugins/agystack/agystack-runtime.json")), - ] - for path in paths_to_check: - if path.is_file(): - try: - with open(path, "r", encoding="utf-8") as f: - return json.load(f) - except Exception as exc: - print(f"Warning: Failed to parse runtime config at {path}: {exc}", file=sys.stderr) - return None - - -def handle_mailbox_list( - session_id: str, - bucket_name: Optional[str] = None, - messenger: Optional[Any] = None, -) -> List[Any]: - if messenger is None: - if not bucket_name: - runtime_cfg = find_runtime_config() or {} - bucket_name = runtime_cfg.get("gcs_bucket") or os.environ.get("GCS_BUCKET") or os.environ.get("GCS_RESULTS_BUCKET") - if not bucket_name: - print("Error: GCS bucket name must be specified via --gcs-bucket, GCS_BUCKET, or agystack-runtime.json", file=sys.stderr) - sys.exit(1) - if StorageMessenger is None: - print("Error: StorageMessenger is not available", file=sys.stderr) - sys.exit(1) - messenger = StorageMessenger(bucket_name=bucket_name, session_id=session_id, is_worker=False) - - pending = messenger.list_pending_questions() - if not pending: - print(f"No pending questions for session \x27{session_id}\x27.") - else: - print(f"\nPending questions for session \x27{session_id}\x27:") - print(f"{'TASK':<6} | {'SEQ':<5} | {'TIMESTAMP':<20} | {'QUESTION'}") - print("-" * 75) - for q in pending: - q_text = q.payload.get("question", "") - ts_str = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(q.timestamp)) - print(f"{q.task_index:<6} | {q.seq:<5} | {ts_str:<20} | {q_text}") - return pending - - -def handle_mailbox_reply( - task_index: int, - seq: int, - text: str, - session_id: str, - bucket_name: Optional[str] = None, - messenger: Optional[Any] = None, -) -> Any: - if messenger is None: - if not bucket_name: - runtime_cfg = find_runtime_config() or {} - bucket_name = runtime_cfg.get("gcs_bucket") or os.environ.get("GCS_BUCKET") or os.environ.get("GCS_RESULTS_BUCKET") - if not bucket_name: - print("Error: GCS bucket name must be specified via --gcs-bucket, GCS_BUCKET, or agystack-runtime.json", file=sys.stderr) - sys.exit(1) - if StorageMessenger is None: - print("Error: StorageMessenger is not available", file=sys.stderr) - sys.exit(1) - messenger = StorageMessenger(bucket_name=bucket_name, session_id=session_id, is_worker=False) - - reply_env = messenger.send_reply(task_index=task_index, seq=seq, reply_text=text) - print(f"Reply sent to task {task_index} (seq {seq}): {text}") - return reply_env - - -def handle_mailbox_steer( - task_index: Union[int, str], - text: str, - session_id: str, - bucket_name: Optional[str] = None, - messenger: Optional[Any] = None, - dashboard_writer: Optional[Any] = None, - max_tasks: Optional[int] = None, -) -> Any: - if messenger is None: - if not bucket_name: - runtime_cfg = find_runtime_config() or {} - bucket_name = runtime_cfg.get("gcs_bucket") or os.environ.get("GCS_BUCKET") or os.environ.get("GCS_RESULTS_BUCKET") - if not bucket_name: - print("Error: GCS bucket name must be specified via --gcs-bucket, GCS_BUCKET, or agystack-runtime.json", file=sys.stderr) - sys.exit(1) - if StorageMessenger is None: - print("Error: StorageMessenger is not available", file=sys.stderr) - sys.exit(1) - messenger = StorageMessenger(bucket_name=bucket_name, session_id=session_id, is_worker=False) - - try: - from steer_cloud_task import steer_task - envs = steer_task( - task=task_index, - instruction=text, - session_id=session_id, - bucket_name=bucket_name, - messenger=messenger, - max_tasks=max_tasks, - dashboard_writer=dashboard_writer, - ) - for env in envs: - print(f"Steer instruction sent to task {env.task_index} (seq {env.seq}): {text}") - if isinstance(task_index, str) and task_index.strip().lower() == "all": - return envs - return envs[0] if envs else None - except ValueError as exc: - print(f"Error: {exc}", file=sys.stderr) - sys.exit(1) - except Exception as exc: - print(f"Error delivering steering instruction: {exc}", file=sys.stderr) - sys.exit(1) diff --git a/skills/swarm/scripts/manifest_generator.py b/skills/swarm/scripts/manifest_generator.py deleted file mode 100644 index 8af8f7d..0000000 --- a/skills/swarm/scripts/manifest_generator.py +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/env python3 -import argparse -import json -import math -from typing import Any, Dict, List - - -def generate_range_slices( - total_items: int, - num_slices: int, - item_label: str = "item", - base_brief: str = "", -) -> List[Dict[str, Any]]: - if total_items < 0: - raise ValueError(f"total_items must be non-negative, got {total_items}") - if num_slices <= 0: - raise ValueError(f"num_slices must be positive, got {num_slices}") - - slices: List[Dict[str, Any]] = [] - base_size = total_items // num_slices - remainder = total_items % num_slices - current_idx = 0 - - for i in range(num_slices): - count = base_size + (1 if i < remainder else 0) - start_idx = current_idx - end_idx = start_idx + count - current_idx = end_idx - - if base_brief: - brief = f"{base_brief} ({item_label}s {start_idx} to {end_idx}, count {count})" - else: - brief = f"Process {item_label}s from index {start_idx} to {end_idx} (count {count})." - - task: Dict[str, Any] = { - "slice_id": f"slice_{i}", - "start_idx": start_idx, - "end_idx": end_idx, - "count": count, - "item_label": item_label, - "brief": brief, - } - slices.append(task) - - return slices - - -def generate_matrix_slices( - total_matrices: int = 300, - num_slices: int = 30, - repo_url: str = "", -) -> List[Dict[str, Any]]: - slices = generate_range_slices( - total_items=total_matrices, - num_slices=num_slices, - item_label="matrix", - base_brief="Evaluate matrices against baseline AMD and record flop and fill ratios", - ) - if repo_url: - for s in slices: - s["repo_url"] = repo_url - return slices - - -def generate_seed_lottery( - seeds_count: int = 100, - base_seed: int = 42, - coprime_stride: int = 17, -) -> List[Dict[str, Any]]: - if seeds_count <= 0: - raise ValueError(f"seeds_count must be positive, got {seeds_count}") - modulus = 1_000_000 - if math.gcd(coprime_stride, modulus) != 1: - raise ValueError( - f"coprime_stride ({coprime_stride}) must be coprime to {modulus}" - ) - - lottery: List[Dict[str, Any]] = [] - for i in range(seeds_count): - seed = (base_seed + i * coprime_stride) % modulus - task: Dict[str, Any] = { - "seed_id": f"seed_{i}", - "seed": seed, - "brief": f"Execute trial with random seed {seed}.", - } - lottery.append(task) - - return lottery - - -def generate_parameter_sweep( - param_name: str, - values: List[Any], - base_brief: str, -) -> List[Dict[str, Any]]: - tasks: List[Dict[str, Any]] = [] - for i, val in enumerate(values): - task: Dict[str, Any] = { - "sweep_id": f"{param_name}_{i}", - "param_name": param_name, - "param_value": val, - "brief": f"{base_brief} with {param_name}={val}", - } - tasks.append(task) - return tasks - - -def main() -> None: - parser = argparse.ArgumentParser(description="Generic manifest generator for swarm dispatch.") - subparsers = parser.add_subparsers(dest="command", required=True) - - slice_parser = subparsers.add_parser("slices", help="Generate range partition manifest.") - slice_parser.add_argument("--total-items", type=int, required=True) - slice_parser.add_argument("--num-slices", type=int, required=True) - slice_parser.add_argument("--label", type=str, default="item") - slice_parser.add_argument("--brief", type=str, default="") - - seed_parser = subparsers.add_parser("seeds", help="Generate seed lottery manifest.") - seed_parser.add_argument("--seeds-count", type=int, default=100) - seed_parser.add_argument("--base-seed", type=int, default=42) - seed_parser.add_argument("--coprime-stride", type=int, default=17) - - sweep_parser = subparsers.add_parser("sweep", help="Generate parameter sweep manifest.") - sweep_parser.add_argument("--param-name", type=str, required=True) - sweep_parser.add_argument("--values", type=str, nargs="+", required=True) - sweep_parser.add_argument("--base-brief", type=str, required=True) - - args = parser.parse_args() - - if args.command == "slices": - manifest = generate_range_slices( - total_items=args.total_items, - num_slices=args.num_slices, - item_label=args.label, - base_brief=args.brief, - ) - elif args.command == "seeds": - manifest = generate_seed_lottery( - seeds_count=args.seeds_count, - base_seed=args.base_seed, - coprime_stride=args.coprime_stride, - ) - elif args.command == "sweep": - manifest = generate_parameter_sweep( - param_name=args.param_name, - values=args.values, - base_brief=args.base_brief, - ) - else: - manifest = [] - - print(json.dumps(manifest, indent=2)) - - -if __name__ == "__main__": - main() diff --git a/skills/swarm/scripts/requirements.txt b/skills/swarm/scripts/requirements.txt deleted file mode 100644 index 99de04f..0000000 --- a/skills/swarm/scripts/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -google-cloud-storage==2.18.2 -google-genai>=0.3.0 -google-antigravity>=0.1.0,<0.2.0 -anthropic[vertex]>=0.40.0 diff --git a/skills/swarm/scripts/result_harvester.py b/skills/swarm/scripts/result_harvester.py deleted file mode 100644 index 48eb40a..0000000 --- a/skills/swarm/scripts/result_harvester.py +++ /dev/null @@ -1,304 +0,0 @@ -#!/usr/bin/env python3 -import json -import math -import os -import re -import shutil -import subprocess -import sys -from pathlib import Path -from typing import Any, Dict, List, Optional, Union - - -def _extract_metric_value(trial: Dict[str, Any], key: str) -> Optional[float]: - if key in trial and trial[key] is not None: - try: - return float(trial[key]) - except (ValueError, TypeError): - pass - metrics = trial.get("metrics") - if isinstance(metrics, dict) and key in metrics and metrics[key] is not None: - try: - return float(metrics[key]) - except (ValueError, TypeError): - pass - return None - - -def extract_pareto_frontier( - trials: List[Dict[str, Any]], - metric_key: str = "score", - secondary_key: str = "fill_ratio", - maximize: bool = True, -) -> List[Dict[str, Any]]: - candidates: List[Dict[str, Any]] = [] - points: List[tuple] = [] - - for trial in trials: - if not isinstance(trial, dict): - continue - m = _extract_metric_value(trial, metric_key) - s = _extract_metric_value(trial, secondary_key) - if m is not None and s is not None and not math.isnan(m) and not math.isnan(s): - candidates.append(trial) - points.append((m, s)) - - frontier: List[Dict[str, Any]] = [] - for i, trial_a in enumerate(candidates): - ma, sa = points[i] - dominated = False - for j, trial_b in enumerate(candidates): - if i == j: - continue - mb, sb = points[j] - if maximize: - if mb >= ma and sb >= sa and (mb > ma or sb > sa): - dominated = True - break - else: - if mb <= ma and sb <= sa and (mb < ma or sb < sa): - dominated = True - break - if not dominated: - frontier.append(trial_a) - - frontier.sort( - key=lambda t: ( - _extract_metric_value(t, metric_key), - _extract_metric_value(t, secondary_key), - ), - reverse=maximize, - ) - return frontier - - -def harvest_gcs_results( - bucket_name: str, - prefix: str, - target_filename: str = "score.json", -) -> List[Dict[str, Any]]: - clean_prefix = prefix.strip("/") - storage_prefix = f"{clean_prefix}/" if clean_prefix else "" - try: - from google.cloud import storage - - client = storage.Client() - bucket = client.bucket(bucket_name) - blobs = bucket.list_blobs(prefix=storage_prefix) - results: List[Dict[str, Any]] = [] - for blob in blobs: - if not blob.name.startswith(storage_prefix): - continue - if blob.name.endswith(target_filename): - payload = json.loads(blob.download_as_text(encoding="utf-8")) - results.append(payload) - return results - except ImportError: - pass - except Exception as exc: - print(f"Notice: GCS client listing failed ({exc}), falling back to gcloud CLI", file=sys.stderr) - - ls_target = f"gs://{bucket_name}/{clean_prefix}/**/{target_filename}" if clean_prefix else f"gs://{bucket_name}/**/{target_filename}" - cmd = ["gcloud", "storage", "cat", ls_target] - try: - proc = subprocess.run(cmd, capture_output=True, text=True, check=True) - results = [] - decoder = json.JSONDecoder() - content = proc.stdout.strip() - idx = 0 - while idx < len(content): - while idx < len(content) and content[idx].isspace(): - idx += 1 - if idx >= len(content): - break - obj, end_idx = decoder.raw_decode(content[idx:]) - results.append(obj) - idx += end_idx - return results - except Exception: - return [] - - -def harvest_candidate_patches( - bucket_name: str, - prefix: str, - dest_dir: Union[Path, str], - baseline_score: Optional[float] = None, - sort_by_delta: bool = True, -) -> List[Dict[str, Any]]: - dest = Path(dest_dir) - dest.mkdir(parents=True, exist_ok=True) - clean_prefix = prefix.strip("/") - storage_prefix = f"{clean_prefix}/" if clean_prefix else "" - tasks_found: Dict[int, Dict[str, Any]] = {} - - local_dir = os.environ.get("STORAGE_MESSENGER_LOCAL_DIR") - if local_dir: - src_base = Path(local_dir) / bucket_name / clean_prefix - if src_base.is_dir(): - for task_folder in sorted(src_base.iterdir()): - if not task_folder.is_dir(): - continue - m = re.fullmatch(r"task-(\d+)", task_folder.name) - if not m: - continue - task_idx = int(m.group(1)) - target_task_dir = dest / f"task-{task_idx}" - target_task_dir.mkdir(parents=True, exist_ok=True) - score_src = task_folder / "score.json" - patch_src = task_folder / "patch.diff" - status_src = task_folder / "status.json" - sf = None - pf = None - stf = None - if score_src.is_file(): - target_score = target_task_dir / "score.json" - shutil.copy2(score_src, target_score) - sf = target_score - if patch_src.is_file(): - target_patch = target_task_dir / "patch.diff" - shutil.copy2(patch_src, target_patch) - pf = target_patch - if status_src.is_file(): - target_status = target_task_dir / "status.json" - shutil.copy2(status_src, target_status) - stf = target_status - for filename in ("partial.patch.diff", "results.tsv"): - source = task_folder / filename - if source.is_file(): - shutil.copy2(source, target_task_dir / filename) - if (task_folder / "evidence").is_dir(): - shutil.copytree(task_folder / "evidence", target_task_dir / "evidence", dirs_exist_ok=True) - tasks_found[task_idx] = {"score_file": sf, "patch_file": pf, "status_file": stf} - - if not tasks_found: - try: - from google.cloud import storage - - client = storage.Client() - bucket = client.bucket(bucket_name) - blobs = bucket.list_blobs(prefix=storage_prefix) - for blob in blobs: - if not blob.name.startswith(storage_prefix): - continue - rel_name = blob.name[len(storage_prefix):] - m = re.match(r"^task-(\d+)/(.+)$", rel_name) - if not m: - continue - task_idx = int(m.group(1)) - filename = m.group(2) - relative = Path(filename) - if relative.is_absolute() or ".." in relative.parts: - continue - if filename not in ("score.json", "patch.diff", "partial.patch.diff", "status.json", "results.tsv") and not filename.startswith("evidence/"): - continue - if task_idx not in tasks_found: - tasks_found[task_idx] = {} - target_task_dir = dest / f"task-{task_idx}" - target_task_dir.mkdir(parents=True, exist_ok=True) - target_file = target_task_dir / filename - target_file.parent.mkdir(parents=True, exist_ok=True) - blob.download_to_filename(str(target_file)) - if filename == "score.json": - tasks_found[task_idx]["score_file"] = target_file - elif filename == "patch.diff": - tasks_found[task_idx]["patch_file"] = target_file - elif filename == "status.json": - tasks_found[task_idx]["status_file"] = target_file - except Exception: - pass - - if not tasks_found: - src_uri = f"gs://{bucket_name}/{clean_prefix}/*" - try: - subprocess.run( - ["gcloud", "storage", "cp", "-r", src_uri, str(dest)], - capture_output=True, - check=False, - ) - for item in dest.glob("task-*"): - if item.is_dir(): - m = re.fullmatch(r"task-(\d+)", item.name) - if m: - task_idx = int(m.group(1)) - sf = item / "score.json" - pf = item / "patch.diff" - stf = item / "status.json" - tasks_found[task_idx] = { - "score_file": sf if sf.is_file() else None, - "patch_file": pf if pf.is_file() else None, - "status_file": stf if stf.is_file() else None, - } - except Exception: - pass - - results = [] - for task_idx in sorted(tasks_found.keys()): - info = tasks_found[task_idx] - score_file = info.get("score_file") - patch_file = info.get("patch_file") - status_file = info.get("status_file") - score = None - status = "UNKNOWN" - summary = "" - candidate_files = [] - - if score_file and Path(score_file).is_file(): - try: - data = json.loads(Path(score_file).read_text(encoding="utf-8")) - score = data.get("score") - except Exception: - pass - - if status_file and Path(status_file).is_file(): - try: - st_data = json.loads(Path(status_file).read_text(encoding="utf-8")) - if "status" in st_data and st_data["status"]: - status = st_data["status"] - if "score" in st_data and st_data["score"] is not None: - score = st_data["score"] - summary = st_data.get("summary", "") - candidate_files = st_data.get("candidate_files", []) - except Exception: - pass - - score_delta = None - if isinstance(score, (int, float)) and isinstance(baseline_score, (int, float)): - score_delta = round(float(score) - float(baseline_score), 4) - - if status != "PASS": - patch_file = None - partial_patch = dest / f"task-{task_idx}" / "partial.patch.diff" - results.append({ - "task_index": task_idx, - "partial_patch_file": str(partial_patch) if partial_patch.is_file() else None, - "evidence_dir": str(dest / f"task-{task_idx}" / "evidence"), - "score": score, - "score_delta": score_delta, - "status": status, - "summary": summary, - "candidate_files": candidate_files, - "patch_file": str(patch_file) if patch_file else None, - "score_file": str(score_file) if score_file else None, - "status_file": str(status_file) if status_file else None, - }) - - if sort_by_delta: - def sort_key(r): - is_pass = 1 if r.get("status") == "PASS" else 0 - metric = r.get("score_delta") if r.get("score_delta") is not None else r.get("score") - has_metric = 0 - metric_val = float("-inf") - if isinstance(metric, (int, float)): - try: - if not math.isnan(metric): - has_metric = 1 - metric_val = float(metric) - except Exception: - pass - task_idx = r.get("task_index") if isinstance(r.get("task_index"), int) else 999999 - return (-is_pass, -has_metric, -metric_val, task_idx) - - results.sort(key=sort_key) - - return results diff --git a/skills/swarm/scripts/simulate_cloud_swarm.py b/skills/swarm/scripts/simulate_cloud_swarm.py deleted file mode 100644 index 38dc71d..0000000 --- a/skills/swarm/scripts/simulate_cloud_swarm.py +++ /dev/null @@ -1,580 +0,0 @@ -#!/usr/bin/env python3 -""" -End-to-end simulation scenario for Google Antigravity Cloud Run Swarms. -Exercises Vertex AI pre-flight probing, simulated pipeline codebase setup, -manifest generation, cloud_worker milestone lifecycles, StorageMessenger -bidirectional question/reply and steering, candidate guardrail enforcement, -verification testing, and score harvesting. -""" - -import argparse -import io -import json -import os -from pathlib import Path -import subprocess -import sys -import tempfile -import time -from typing import Any, Dict, List, Optional, Tuple -import urllib.error -import urllib.parse -import urllib.request - -SCRIPTS_DIR = Path(__file__).resolve().parent -if str(SCRIPTS_DIR) not in sys.path: - sys.path.insert(0, str(SCRIPTS_DIR)) - -from cloud_worker import ( - emit_milestone, - is_candidate_file, - parse_porcelain_status, -) -from cloud_dispatch import ( - handle_mailbox_reply, - handle_mailbox_steer, - parse_milestone_log, - parse_worker_logs, -) -from storage_messenger import StorageMessenger - - -def probe_vertex_ai( - project: str, - model: str, - location: str = "global", - timeout: float = 15.0, -) -> bool: - token_cmd = subprocess.run( - ["gcloud", "auth", "print-access-token"], - capture_output=True, - text=True, - check=False, - timeout=10, - ) - if token_cmd.returncode != 0 or not token_cmd.stdout.strip(): - raise RuntimeError( - "Failed to obtain gcloud access token for Vertex AI live probe.\n" - f"gcloud error: {token_cmd.stderr.strip()}" - ) - access_token = token_cmd.stdout.strip() - - if location == "global": - probe_url = f"https://aiplatform.googleapis.com/v1/projects/{project}/locations/global/publishers/google/models/{model}:generateContent" - else: - probe_url = f"https://{location}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models/{model}:generateContent" - - req_data = json.dumps({ - "contents": [{"role": "user", "parts": [{"text": "ping"}]}], - "generationConfig": {"maxOutputTokens": 1}, - }).encode("utf-8") - - headers = { - "Authorization": f"Bearer {access_token}", - "Content-Type": "application/json", - "X-Goog-User-Project": project, - } - req = urllib.request.Request( - probe_url, - data=req_data, - headers=headers, - method="POST", - ) - try: - with urllib.request.urlopen(req, timeout=timeout): - pass - print(f"[PASS] Vertex AI credentials and publisher model '{model}' verified in {location} (project: {project}).", flush=True) - return True - except urllib.error.HTTPError as exc: - err_body = exc.read().decode("utf-8", errors="replace") - raise RuntimeError( - f"Vertex AI probe failed with HTTP {exc.code} for project '{project}' in location '{location}':\n{err_body}" - ) from exc - - -def setup_simulation_repo(base_dir: Path) -> Tuple[Path, Path]: - origin_dir = base_dir / "origin.git" - work_dir = base_dir / "work" - work_dir.mkdir(parents=True, exist_ok=True) - - subprocess.run(["git", "init", "-b", "main"], cwd=work_dir, check=True, capture_output=True) - subprocess.run(["git", "config", "user.name", "Antigravity Simulation"], cwd=work_dir, check=True, capture_output=True) - subprocess.run(["git", "config", "user.email", "bot@antigravity.google"], cwd=work_dir, check=True, capture_output=True) - - pipeline_dir = work_dir / "src" / "pipeline" - tests_dir = work_dir / "tests" - pipeline_dir.mkdir(parents=True, exist_ok=True) - tests_dir.mkdir(parents=True, exist_ok=True) - - (pipeline_dir / "__init__.py").write_text("", encoding="utf-8") - (tests_dir / "__init__.py").write_text("", encoding="utf-8") - - (pipeline_dir / "packet_filter.py").write_text( - "class PacketFilter:\n" - " def __init__(self, allowed_ports=None):\n" - " self.allowed_ports = set(allowed_ports or [80, 443, 8080])\n\n" - " def filter_packets(self, packets):\n" - " accepted = []\n" - " for pkt in packets:\n" - " port = pkt.get('port')\n" - " if port in self.allowed_ports:\n" - " accepted.append(pkt)\n" - " return accepted\n", - encoding="utf-8", - ) - (tests_dir / "test_packet_filter.py").write_text( - "import unittest\n" - "from src.pipeline.packet_filter import PacketFilter\n\n" - "class TestPacketFilter(unittest.TestCase):\n" - " def test_filter_allowed_ports(self):\n" - " pf = PacketFilter(allowed_ports=[80, 443])\n" - " packets = [{'id': 1, 'port': 80}, {'id': 2, 'port': 22}, {'id': 3, 'port': 443}]\n" - " result = pf.filter_packets(packets)\n" - " self.assertEqual(len(result), 2)\n" - " self.assertEqual([p['id'] for p in result], [1, 3])\n\n" - "if __name__ == '__main__':\n" - " unittest.main()\n", - encoding="utf-8", - ) - - (pipeline_dir / "transform.py").write_text( - "class PacketTransform:\n" - " def __init__(self, scale=1.0):\n" - " self.scale = scale\n\n" - " def transform_payload(self, values):\n" - " return [int(v * self.scale) for v in values]\n", - encoding="utf-8", - ) - (tests_dir / "test_transform.py").write_text( - "import unittest\n" - "from src.pipeline.transform import PacketTransform\n\n" - "class TestPacketTransform(unittest.TestCase):\n" - " def test_transform_payload(self):\n" - " pt = PacketTransform(scale=2.0)\n" - " values = [1, 2, 3, 4]\n" - " self.assertEqual(pt.transform_payload(values), [2, 4, 6, 8])\n\n" - "if __name__ == '__main__':\n" - " unittest.main()\n", - encoding="utf-8", - ) - - (pipeline_dir / "router.py").write_text( - "class PacketRouter:\n" - " def __init__(self, routes=None):\n" - " self.routes = routes or {'internal': 'node-1', 'external': 'gateway-1'}\n\n" - " def route_packet(self, packet):\n" - " dest_type = packet.get('type', 'external')\n" - " if dest_type in self.routes:\n" - " return self.routes[dest_type]\n" - " return 'drop'\n", - encoding="utf-8", - ) - (tests_dir / "test_router.py").write_text( - "import unittest\n" - "from src.pipeline.router import PacketRouter\n\n" - "class TestPacketRouter(unittest.TestCase):\n" - " def test_route_packet(self):\n" - " router = PacketRouter()\n" - " self.assertEqual(router.route_packet({'type': 'internal'}), 'node-1')\n" - " self.assertEqual(router.route_packet({'type': 'external'}), 'gateway-1')\n" - " self.assertEqual(router.route_packet({'type': 'unknown'}), 'drop')\n\n" - "if __name__ == '__main__':\n" - " unittest.main()\n", - encoding="utf-8", - ) - - subprocess.run(["git", "add", "."], cwd=work_dir, check=True, capture_output=True) - subprocess.run(["git", "commit", "-m", "Initial pipeline codebase"], cwd=work_dir, check=True, capture_output=True) - - subprocess.run(["git", "clone", "--bare", str(work_dir), str(origin_dir)], check=True, capture_output=True) - subprocess.run(["git", "remote", "add", "origin", str(origin_dir)], cwd=work_dir, check=True, capture_output=True) - - return origin_dir, work_dir - - -def build_simulation_manifest(tasks_count: int = 3) -> List[Dict[str, Any]]: - tasks = [ - { - "task_index": 0, - "brief": "Cache-locality optimization for packet_filter.py", - "candidate_files": ["src/pipeline/packet_filter.py"], - "exclude_files": [".agystack/", ".git/"], - "verify_command": "python3 -m unittest discover tests", - "optimization_type": "cache_locality", - }, - { - "task_index": 1, - "brief": "SIMD vectorized loop unrolling for transform.py", - "candidate_files": ["src/pipeline/transform.py"], - "exclude_files": [".agystack/", ".git/"], - "verify_command": "python3 -m unittest discover tests", - "optimization_type": "simd_unroll", - }, - { - "task_index": 2, - "brief": "Branch-pruning early exit for router.py", - "candidate_files": ["src/pipeline/router.py"], - "exclude_files": [".agystack/", ".git/"], - "verify_command": "python3 -m unittest discover tests", - "optimization_type": "branch_pruning", - }, - ] - return tasks[:tasks_count] - - -def check_gcs_accessible(bucket_name: str, session_id: str) -> bool: - try: - test_msg = StorageMessenger( - bucket_name=bucket_name, - session_id=session_id, - task_index=0, - is_worker=True, - ) - probe_blob = test_msg.bucket.blob(f"swarm-{session_id}/probe.txt") - probe_blob.upload_from_string("probe_ok") - return probe_blob.exists() - except Exception: - return False - - -def execute_simulated_task( - task_item: Dict[str, Any], - origin_repo_url: str, - base_dir: Path, - session_id: str, - gcs_bucket: str, - orchestrator_messenger: StorageMessenger, - use_local_storage: bool = False, -) -> str: - task_index = task_item["task_index"] - branch_name = f"worker-{task_index}" - worker_repo_dir = base_dir / f"worker-repo-{task_index}" - - log_buffer = io.StringIO() - - def log_and_emit(phase: str, detail: str = "") -> None: - emit_milestone(task_index, phase, detail) - line = f"[MILESTONE] [TASK {task_index}] [PHASE: {phase}]" - if detail: - line += f" {detail}" - log_buffer.write(line + "\n") - - log_and_emit("BOOTING") - - subprocess.run(["git", "clone", origin_repo_url, str(worker_repo_dir)], check=True, capture_output=True) - subprocess.run(["git", "config", "user.name", "Antigravity Cloud Worker"], cwd=worker_repo_dir, check=True, capture_output=True) - subprocess.run(["git", "config", "user.email", "bot@antigravity.google"], cwd=worker_repo_dir, check=True, capture_output=True) - subprocess.run(["git", "checkout", "-B", branch_name], cwd=worker_repo_dir, check=True, capture_output=True) - - log_and_emit("REPO_READY") - log_and_emit("RUNNING_AGENT", f"Worker executing brief: {task_item['brief']}") - - worker_messenger = StorageMessenger( - bucket_name=gcs_bucket, - session_id=session_id, - task_index=task_index, - is_worker=True, - ) - - opt_type = task_item.get("optimization_type") - if opt_type == "cache_locality": - target_file = worker_repo_dir / "src" / "pipeline" / "packet_filter.py" - target_file.write_text( - "class PacketFilter:\n" - " def __init__(self, allowed_ports=None):\n" - " self._allowed_ports_cache = frozenset(allowed_ports or [80, 443, 8080])\n\n" - " def filter_packets(self, packets):\n" - " cache = self._allowed_ports_cache\n" - " return [pkt for pkt in packets if pkt.get('port') in cache]\n", - encoding="utf-8", - ) - elif opt_type == "simd_unroll": - steer_text = "Align vectors to 64-byte boundaries and unroll loop by factor 4" - handle_mailbox_steer( - task_index=task_index, - text=steer_text, - session_id=session_id, - bucket_name=gcs_bucket, - messenger=orchestrator_messenger, - ) - steer_envelopes = worker_messenger.check_steer_instructions() - for s_env in steer_envelopes: - instruction = s_env.payload.get("instruction") or s_env.payload.get("text") or "" - log_and_emit("STEER_RECEIVED", instruction[:80]) - - target_file = worker_repo_dir / "src" / "pipeline" / "transform.py" - target_file.write_text( - "class PacketTransform:\n" - " def __init__(self, scale=1.0):\n" - " self.scale = scale\n\n" - " def transform_payload(self, values):\n" - " scale = self.scale\n" - " length = len(values)\n" - " result = [0] * length\n" - " rem = length % 4\n" - " limit = length - rem\n" - " for i in range(0, limit, 4):\n" - " result[i] = int(values[i] * scale)\n" - " result[i + 1] = int(values[i + 1] * scale)\n" - " result[i + 2] = int(values[i + 2] * scale)\n" - " result[i + 3] = int(values[i + 3] * scale)\n" - " for i in range(limit, length):\n" - " result[i] = int(values[i] * scale)\n" - " return result\n", - encoding="utf-8", - ) - elif opt_type == "branch_pruning": - q_text = "Should unroutable packets drop immediately or fallback?" - log_and_emit("WAITING_FOR_ORCHESTRATOR", q_text[:80]) - q_env = worker_messenger.send_question(question=q_text, context="router early exit") - reply_text = "Drop unknown packets immediately with early exit return." - handle_mailbox_reply( - task_index=task_index, - seq=q_env.seq, - text=reply_text, - session_id=session_id, - bucket_name=gcs_bucket, - messenger=orchestrator_messenger, - ) - delivered_reply = worker_messenger.wait_for_reply(seq=q_env.seq, timeout_seconds=10.0) - assert delivered_reply == reply_text, "Failed to receive matching reply from orchestrator" - log_and_emit("ORCHESTRATOR_REPLY_RECEIVED", f"Seq {q_env.seq}") - - target_file = worker_repo_dir / "src" / "pipeline" / "router.py" - target_file.write_text( - "class PacketRouter:\n" - " def __init__(self, routes=None):\n" - " self.routes = routes or {'internal': 'node-1', 'external': 'gateway-1'}\n\n" - " def route_packet(self, packet):\n" - " if not packet:\n" - " return 'drop'\n" - " dest_type = packet.get('type')\n" - " if not dest_type:\n" - " return 'drop'\n" - " return self.routes.get(dest_type, 'drop')\n", - encoding="utf-8", - ) - - for cand in task_item["candidate_files"]: - assert is_candidate_file(cand, explicit_candidates=task_item["candidate_files"], explicit_excludes=task_item["exclude_files"]) - assert not is_candidate_file(".agystack/runtime.json", explicit_candidates=task_item["candidate_files"], explicit_excludes=task_item["exclude_files"]) - assert not is_candidate_file(".git/config", explicit_candidates=task_item["candidate_files"], explicit_excludes=task_item["exclude_files"]) - - log_and_emit("VALIDATING_CANDIDATE") - run_env = dict(os.environ, PYTHONPATH=str(worker_repo_dir)) - verify_proc = subprocess.run( - task_item["verify_command"], - shell=True, - cwd=worker_repo_dir, - capture_output=True, - text=True, - env=run_env, - ) - if verify_proc.returncode != 0: - raise RuntimeError(f"Task {task_index} verification failed:\n{verify_proc.stderr}") - - score_val = 98.0 + (task_index * 0.5) - score_data = { - "task_index": task_index, - "score": score_val, - "fill_ratio": 1.0, - "status": "PASS", - "metrics": { - "score": score_val, - "fill_ratio": 1.0, - }, - } - score_file = worker_repo_dir / "score.json" - score_file.write_text(json.dumps(score_data, indent=2), encoding="utf-8") - - status_res = subprocess.run(["git", "status", "--porcelain"], cwd=worker_repo_dir, capture_output=True, text=True, check=True) - modified_files = parse_porcelain_status(status_res.stdout) - for m_file in modified_files: - if is_candidate_file(m_file, explicit_candidates=task_item["candidate_files"], explicit_excludes=task_item["exclude_files"]): - subprocess.run(["git", "add", "--", m_file], cwd=worker_repo_dir, check=True, capture_output=True) - - subprocess.run(["git", "commit", "-m", f"worker-{task_index}: {task_item['brief']}"], cwd=worker_repo_dir, check=True, capture_output=True) - subprocess.run(["git", "push", "-u", "origin", branch_name, "--force"], cwd=worker_repo_dir, check=True, capture_output=True) - - commit_sha = subprocess.run(["git", "rev-parse", "HEAD"], cwd=worker_repo_dir, capture_output=True, text=True, check=True).stdout.strip()[:7] - diff_stat = subprocess.run(["git", "diff", "--stat", "HEAD~1", "HEAD"], cwd=worker_repo_dir, capture_output=True, text=True, check=True).stdout.strip() - - log_and_emit("COMPLETE", "PASS") - - report_block = ( - "\n================================================================================\n" - "[STATUS: PASS]\n" - "Evidence:\n" - f"- Task Index: {task_index}\n" - f"- Branch: {branch_name}\n" - f"- Commit SHA: {commit_sha}\n" - "- Changes Pushed: True\n" - f"- Score: {score_val}\n" - "- Fill Ratio: 1.0\n" - f"- Slice JSON: {json.dumps(score_data)}\n" - f"- Diff Stat:\n{diff_stat}\n" - "Summary:\n" - f"{task_item['brief']} completed and verified cleanly.\n" - "================================================================================\n" - ) - print(report_block, flush=True) - log_buffer.write(report_block) - - return log_buffer.getvalue() - - -def run_simulation( - model: str = "gemini-2.5-flash", - project: str = "example-agystack-project", - gcs_bucket: str = "example-swarm-results", - tasks: int = 3, - skip_live_probe: bool = True, - temp_base_dir: Optional[Path] = None, -) -> Dict[str, Any]: - print("=" * 80) - print("STARTING CLOUD RUN SWARM SIMULATION SCENARIO") - print(f"Model: {model} | Project: {project} | GCS Bucket: {gcs_bucket} | Tasks: {tasks}") - print("=" * 80) - - if not skip_live_probe: - print("[PRE-FLIGHT] Initiating live Vertex AI publisher model availability probe...") - try: - probe_vertex_ai(project=project, model=model, location="global") - except Exception as exc: - print(f"Warning: Live Vertex AI probe failed ({exc}).", file=sys.stderr) - raise - else: - print("[PRE-FLIGHT] Live Vertex AI probe skipped (--skip-live-probe).", flush=True) - - cleanup_dir = False - if temp_base_dir is None: - temp_dir_obj = tempfile.TemporaryDirectory(prefix="swarm-sim-") - base_dir = Path(temp_dir_obj.name) - cleanup_dir = True - else: - base_dir = temp_base_dir - - try: - origin_dir, _ = setup_simulation_repo(base_dir) - manifest = build_simulation_manifest(tasks_count=tasks) - - session_id = f"sim-{int(time.time())}" - use_local_storage = False - prev_local_storage = os.environ.get("STORAGE_MESSENGER_LOCAL_DIR") - if not check_gcs_accessible(gcs_bucket, session_id): - use_local_storage = True - local_storage_dir = base_dir / "simulated_gcs" - local_storage_dir.mkdir(parents=True, exist_ok=True) - os.environ["STORAGE_MESSENGER_LOCAL_DIR"] = str(local_storage_dir) - print(f"Notice: GCS bucket '{gcs_bucket}' not directly accessible; using StorageMessenger local adapter.", flush=True) - - orchestrator_messenger = StorageMessenger( - bucket_name=gcs_bucket, - session_id=session_id, - is_worker=False, - ) - - all_worker_logs = [] - for task_item in manifest: - task_log = execute_simulated_task( - task_item=task_item, - origin_repo_url=str(origin_dir), - base_dir=base_dir, - session_id=session_id, - gcs_bucket=gcs_bucket, - orchestrator_messenger=orchestrator_messenger, - use_local_storage=use_local_storage, - ) - all_worker_logs.append(task_log) - - combined_logs = "\n".join(all_worker_logs) - parsed_results = parse_worker_logs(combined_logs) - - harvested_slices = [] - for item in parsed_results: - for ev_line in item.get("evidence", "").splitlines(): - if ev_line.strip().startswith("- Slice JSON:"): - raw_json = ev_line.strip().split("- Slice JSON:", 1)[1].strip() - try: - harvested_slices.append(json.loads(raw_json)) - except Exception: - pass - - out_slices_file = Path(".slices/harvested_scores.json") - out_slices_file.parent.mkdir(parents=True, exist_ok=True) - out_slices_file.write_text(json.dumps(harvested_slices, indent=2), encoding="utf-8") - print(f"\nHarvested {len(harvested_slices)} slice scores to {out_slices_file}") - - milestones = [] - for line in combined_logs.splitlines(): - pm = parse_milestone_log(line) - if pm: - milestones.append(pm) - - print("\n" + "=" * 80) - print(f"WORKER MILESTONE SUMMARY ({len(milestones)} events captured)") - print("=" * 80) - print(f"{'Task':<6} | {'Phase':<28} | {'Detail'}") - print("-" * 80) - for m in milestones: - print(f"{m['task_index']:<6} | {m['phase']:<28} | {m['detail']}") - - print("\n" + "=" * 80) - print("SWARM SIMULATION REPORT: Cloud Run Agent Swarm") - print("=" * 80) - print(f"{'Task':<8} | {'Status':<10} | {'Summary'}") - print("-" * 80) - pass_count = 0 - for i, item in enumerate(parsed_results): - st = item.get("status", "UNKNOWN") - sm = item.get("summary", "").replace("\n", " ")[:60] - if st == "PASS": - pass_count += 1 - print(f"{i:<8} | {st:<10} | {sm}") - print("=" * 80) - print(f"Total: {len(parsed_results)} | PASS: {pass_count} | ISSUES: 0 | BLOCKED: 0") - print("=" * 80) - - return { - "status": "PASS" if pass_count == len(manifest) else "ISSUES", - "tasks": len(manifest), - "harvested_scores": harvested_slices, - "parsed_results": parsed_results, - "milestones": milestones, - } - finally: - if 'prev_local_storage' in locals() and prev_local_storage is not None: - os.environ["STORAGE_MESSENGER_LOCAL_DIR"] = prev_local_storage - elif "STORAGE_MESSENGER_LOCAL_DIR" in os.environ: - del os.environ["STORAGE_MESSENGER_LOCAL_DIR"] - if cleanup_dir: - temp_dir_obj.cleanup() - - -def main() -> None: - parser = argparse.ArgumentParser(description="Simulate Cloud Run agent swarm execution.") - parser.add_argument("--model", type=str, default="gemini-2.5-flash", help="Model override (default: gemini-2.5-flash).") - parser.add_argument("--project", type=str, default="example-agystack-project", help="GCP project ID (default: example-agystack-project).") - parser.add_argument("--gcs-bucket", type=str, default="example-swarm-results", help="GCS bucket name (default: example-swarm-results).") - parser.add_argument("--tasks", type=int, default=3, help="Number of tasks to simulate (default: 3).") - parser.add_argument("--skip-live-probe", action="store_true", default=True, help="Skip live Vertex AI network probe (default: True).") - parser.add_argument("--live-probe", dest="skip_live_probe", action="store_false", help="Run live Vertex AI network probe.") - - args = parser.parse_args() - - result = run_simulation( - model=args.model, - project=args.project, - gcs_bucket=args.gcs_bucket, - tasks=args.tasks, - skip_live_probe=args.skip_live_probe, - ) - - if result["status"] == "PASS": - sys.exit(0) - else: - sys.exit(1) - - -if __name__ == "__main__": - main() diff --git a/skills/swarm/scripts/steer_cloud_task.py b/skills/swarm/scripts/steer_cloud_task.py deleted file mode 100755 index 1045122..0000000 --- a/skills/swarm/scripts/steer_cloud_task.py +++ /dev/null @@ -1,250 +0,0 @@ -#!/usr/bin/env python3 -""" -CLI utility and programmatic helper for conversational mailbox steering. -Provides structured envelope validation (task index, instruction text, -ABORT commands, sequence numbers) and dispatches steering instructions -to in-flight Cloud Run swarm worker mailboxes in GCS. -""" - -import argparse -import os -from pathlib import Path -import sys -from typing import Any, List, Optional, Union - -# Ensure sibling scripts directory is on sys.path -SCRIPT_DIR = Path(__file__).resolve().parent -if str(SCRIPT_DIR) not in sys.path: - sys.path.insert(0, str(SCRIPT_DIR)) - -try: - from storage_messenger import MailboxEnvelope, StorageMessenger -except ImportError: - StorageMessenger = None # type: ignore - MailboxEnvelope = None # type: ignore - - -def validate_task_target( - task: Union[int, str], - max_tasks: Optional[int] = None, -) -> Union[int, str]: - """ - Validates the target task parameter. - Accepts positive integers or 'all' for broadcast steering. - Raises ValueError on out-of-range or negative indices. - """ - if isinstance(task, str): - cleaned = task.strip().lower() - if cleaned == "all": - return "all" - try: - task_idx = int(cleaned) - except ValueError: - raise ValueError(f"Invalid task target '{task}': must be an integer index or 'all'") - elif isinstance(task, int): - task_idx = task - else: - raise ValueError(f"Invalid task target type: {type(task)}") - - if task_idx < 0: - raise ValueError(f"Task index cannot be negative: {task_idx}") - - if max_tasks is not None and task_idx >= max_tasks: - raise ValueError(f"Target task index {task_idx} is out of range (total tasks: {max_tasks})") - - return task_idx - - -def validate_instruction(instruction: str) -> str: - """ - Validates steering instruction text. - Ensures non-empty and trimmed string. - """ - if not isinstance(instruction, str) or not instruction.strip(): - raise ValueError("Steering instruction text must be a non-empty string") - return instruction.strip() - - -def is_abort_command(instruction: str) -> bool: - """ - Checks if the instruction represents an abort or cancel command. - """ - trimmed = instruction.strip().upper() - return trimmed.startswith("ABORT") or trimmed.startswith("CANCEL") - - -def validate_seq(seq: int) -> int: - """ - Validates sequence numbers to enforce monotonicity. - """ - if not isinstance(seq, int) or seq < 1: - raise ValueError(f"Sequence number must be a positive integer >= 1, got {seq}") - return seq - - -def steer_task( - task: Union[int, str], - instruction: str, - session_id: str, - bucket_name: Optional[str] = None, - messenger: Optional[Any] = None, - max_tasks: Optional[int] = None, - dashboard_writer: Optional[Any] = None, -) -> List[Any]: - """ - Programmatic helper to deliver conversational steering instructions. - Validates inputs, connects to worker mailboxes via GCS, logs standardized - delivery messages, updates dashboard if present, and returns the delivered envelopes. - """ - valid_target = validate_task_target(task, max_tasks=max_tasks) - valid_instruction = validate_instruction(instruction) - - if messenger is None: - if not bucket_name: - bucket_name = ( - os.environ.get("GCS_BUCKET") - or os.environ.get("GCS_RESULTS_BUCKET") - or "" - ) - if not bucket_name: - raise ValueError("GCS bucket name must be specified via bucket_name or GCS_BUCKET environment variable") - if StorageMessenger is None: - raise RuntimeError("StorageMessenger is not available") - messenger = StorageMessenger( - bucket_name=bucket_name, - session_id=session_id, - is_worker=False, - ) - - delivered_envelopes: List[Any] = [] - - if valid_target == "all": - # Broadcast to all tasks - target_tasks: List[int] = [] - if hasattr(messenger, "discover_tasks"): - target_tasks = messenger.discover_tasks() - - if not target_tasks and max_tasks is not None: - target_tasks = list(range(max_tasks)) - - if not target_tasks: - raise RuntimeError("Broadcast steering failed: No tasks discovered") - - for t_idx in target_tasks: - env = messenger.send_steer(task_index=t_idx, instruction=valid_instruction) - validate_seq(env.seq) - print(f"[STEER] Instruction delivered to task-{t_idx} mailbox in GCS") - if dashboard_writer and hasattr(dashboard_writer, "update_task_steer"): - dashboard_writer.update_task_steer(t_idx, valid_instruction) - if hasattr(dashboard_writer, "write"): - try: - dashboard_writer.write() - except Exception: - pass - delivered_envelopes.append(env) - else: - task_idx = int(valid_target) - env = messenger.send_steer(task_index=task_idx, instruction=valid_instruction) - validate_seq(env.seq) - print(f"[STEER] Instruction delivered to task-{task_idx} mailbox in GCS") - if dashboard_writer and hasattr(dashboard_writer, "update_task_steer"): - dashboard_writer.update_task_steer(task_idx, valid_instruction) - if hasattr(dashboard_writer, "write"): - try: - dashboard_writer.write() - except Exception: - pass - delivered_envelopes.append(env) - - return delivered_envelopes - - -def main() -> None: - parser = argparse.ArgumentParser( - description="Steer Cloud Run swarm workers via conversational GCS mailboxes.", - ) - parser.add_argument( - "--task", - type=str, - required=True, - help="Task index (e.g. 0, 1) or 'all' to broadcast to all workers", - ) - parser.add_argument( - "--instruction", - "--text", - dest="instruction", - type=str, - default=None, - help="Steering instruction string (or ABORT/CANCEL directive)", - ) - parser.add_argument( - "--abort", - action="store_true", - help="Shortcut to send an ABORT directive", - ) - parser.add_argument( - "--session", - "--session-id", - dest="session_id", - type=str, - default=None, - help="Swarm session ID", - ) - parser.add_argument( - "--gcs-bucket", - type=str, - default=None, - help="GCS bucket name for run artifacts", - ) - parser.add_argument( - "--task-count", - "--max-tasks", - dest="max_tasks", - type=int, - default=None, - help="Total task count in the swarm run (for out-of-range bounds checking)", - ) - - args = parser.parse_args() - - instruction = args.instruction - if args.abort: - instruction = instruction or "ABORT immediately requested by orchestrator" - - if not instruction: - print("Error: Steering instruction must be specified via --instruction or --abort", file=sys.stderr) - sys.exit(1) - - session_id = ( - args.session_id - or os.environ.get("SWARM_SESSION_ID") - or os.environ.get("SESSION_ID") - or "default" - ) - - bucket_name = ( - args.gcs_bucket - or os.environ.get("GCS_BUCKET") - or os.environ.get("GCS_RESULTS_BUCKET") - ) - - try: - steer_task( - task=args.task, - instruction=instruction, - session_id=session_id, - bucket_name=bucket_name, - max_tasks=args.max_tasks, - ) - except ValueError as exc: - print(f"Error: {exc}", file=sys.stderr) - sys.exit(1) - except Exception as exc: - print(f"Error delivering steering instruction: {exc}", file=sys.stderr) - sys.exit(1) - - sys.exit(0) - - -if __name__ == "__main__": - main() diff --git a/skills/swarm/scripts/storage_messenger.py b/skills/swarm/scripts/storage_messenger.py deleted file mode 100644 index d4169e5..0000000 --- a/skills/swarm/scripts/storage_messenger.py +++ /dev/null @@ -1,691 +0,0 @@ -#!/usr/bin/env python3 -""" -Storage messenger for bidirectional orchestrator-to-cloud-agent communication. -Provides mailbox envelope domain models, atomic outbox/inbox object routing over GCS, -and a local directory adapter for unit testing. -""" - -from dataclasses import dataclass -from enum import Enum -import json -import os -from pathlib import Path -import re -import time -from typing import Any, Dict, List, Optional, Union -import urllib.error -import urllib.parse -import urllib.request - - - -try: - from google.api_core.exceptions import PreconditionFailed -except ImportError: - class PreconditionFailed(Exception): - """Fallback PreconditionFailed exception matching Google Cloud storage exceptions.""" - pass - - -def _is_precondition_or_collision_error(exc: Exception) -> bool: - """Checks whether an exception indicates a GCS generation precondition failure or file collision.""" - if isinstance(exc, (FileExistsError, PreconditionFailed)): - return True - if isinstance(exc, urllib.error.HTTPError) and exc.code == 412: - return True - code = getattr(exc, "code", None) or getattr(exc, "status_code", None) - if code == 412: - return True - exc_type_name = type(exc).__name__ - if exc_type_name in ("PreconditionFailed", "Conflict", "FileExistsError"): - return True - exc_str = str(exc).lower() - if "precondition" in exc_str or "412" in exc_str or "already exists" in exc_str: - return True - return False - -class MessageType(str, Enum): - QUESTION = "question" - REPLY = "reply" - STEER = "steer" - STATUS = "status" - - -class MessageStatus(str, Enum): - PENDING = "pending" - DELIVERED = "delivered" - ACKNOWLEDGED = "acknowledged" - TIMED_OUT = "timed_out" - - -@dataclass -class MailboxEnvelope: - session_id: str - task_index: int - seq: int - msg_type: MessageType - sender: str - recipient: str - timestamp: float - payload: Dict[str, Any] - status: MessageStatus = MessageStatus.PENDING - reply_to_seq: Optional[int] = None - - def to_dict(self) -> Dict[str, Any]: - return { - "session_id": self.session_id, - "task_index": self.task_index, - "seq": self.seq, - "msg_type": self.msg_type.value if isinstance(self.msg_type, Enum) else str(self.msg_type), - "sender": self.sender, - "recipient": self.recipient, - "timestamp": self.timestamp, - "payload": self.payload, - "status": self.status.value if isinstance(self.status, Enum) else str(self.status), - "reply_to_seq": self.reply_to_seq, - } - - def to_json(self) -> str: - return json.dumps(self.to_dict(), indent=2) - - @classmethod - def from_dict(cls, data: Dict[str, Any]) -> "MailboxEnvelope": - raw_type = data.get("msg_type", MessageType.QUESTION) - msg_type = MessageType(raw_type) if isinstance(raw_type, str) else raw_type - raw_status = data.get("status", MessageStatus.PENDING) - status = MessageStatus(raw_status) if isinstance(raw_status, str) else raw_status - - return cls( - session_id=str(data.get("session_id", "")), - task_index=int(data.get("task_index", 0)), - seq=int(data.get("seq", 0)), - msg_type=msg_type, - sender=str(data.get("sender", "")), - recipient=str(data.get("recipient", "")), - timestamp=float(data.get("timestamp", time.time())), - payload=dict(data.get("payload", {})), - status=status, - reply_to_seq=data.get("reply_to_seq"), - ) - - @classmethod - def from_json(cls, json_str: str) -> "MailboxEnvelope": - return cls.from_dict(json.loads(json_str)) - - -def retry_gcs_operation( - func: Any, - max_retries: int = 3, - initial_delay: float = 0.05, - backoff_factor: float = 1.5, -) -> Any: - """Executes a callable with retries on network timeouts or transient errors.""" - delay = initial_delay - last_exc = None - for attempt in range(max_retries + 1): - try: - return func() - except (TimeoutError, urllib.error.URLError, ConnectionError, OSError) as exc: - if _is_precondition_or_collision_error(exc): - raise - last_exc = exc - if attempt >= max_retries: - raise - time.sleep(delay) - delay *= backoff_factor - except Exception as exc: - if _is_precondition_or_collision_error(exc): - raise - exc_str = str(exc).lower() - if "timeout" in exc_str or "timed out" in exc_str or "connection" in exc_str: - last_exc = exc - if attempt >= max_retries: - raise - time.sleep(delay) - delay *= backoff_factor - else: - raise - if last_exc: - raise last_exc - - -class _GcsRestBlob: - def __init__(self, bucket_name: str, name: str, token: str): - self.bucket_name = bucket_name - self.name = name.replace("\\", "/") - self.token = token - - def exists(self) -> bool: - encoded_bkt = urllib.parse.quote(self.bucket_name, safe="") - encoded_name = urllib.parse.quote(self.name, safe="") - url = f"https://storage.googleapis.com/storage/v1/b/{encoded_bkt}/o/{encoded_name}" - req = urllib.request.Request(url, headers={"Authorization": f"Bearer {self.token}"}, method="GET") - try: - with urllib.request.urlopen(req, timeout=10) as resp: - return resp.status == 200 - except urllib.error.HTTPError as exc: - if exc.code == 404: - return False - return False - except Exception: - return False - - def upload_from_string( - self, - data: str, - content_type: str = "application/json", - if_generation_match: Optional[int] = None, - **kwargs: Any, - ) -> None: - encoded_bkt = urllib.parse.quote(self.bucket_name, safe="") - encoded_name = urllib.parse.quote(self.name, safe="") - url = f"https://storage.googleapis.com/upload/storage/v1/b/{encoded_bkt}/o?uploadType=media&name={encoded_name}" - if if_generation_match is not None: - url += f"&ifGenerationMatch={if_generation_match}" - headers = {"Authorization": f"Bearer {self.token}", "Content-Type": content_type} - if if_generation_match is not None: - headers["if-generation-match"] = str(if_generation_match) - req = urllib.request.Request( - url, - data=data.encode("utf-8"), - headers=headers, - method="POST", - ) - with urllib.request.urlopen(req, timeout=15) as resp: - if resp.status not in (200, 201): - raise RuntimeError(f"GCS upload failed with status {resp.status}") - - def download_as_text(self) -> str: - encoded_bkt = urllib.parse.quote(self.bucket_name, safe="") - encoded_name = urllib.parse.quote(self.name, safe="") - url = f"https://storage.googleapis.com/storage/v1/b/{encoded_bkt}/o/{encoded_name}?alt=media" - req = urllib.request.Request(url, headers={"Authorization": f"Bearer {self.token}"}, method="GET") - with urllib.request.urlopen(req, timeout=15) as resp: - return resp.read().decode("utf-8") - - def delete(self) -> None: - encoded_bkt = urllib.parse.quote(self.bucket_name, safe="") - encoded_name = urllib.parse.quote(self.name, safe="") - url = f"https://storage.googleapis.com/storage/v1/b/{encoded_bkt}/o/{encoded_name}" - req = urllib.request.Request(url, headers={"Authorization": f"Bearer {self.token}"}, method="DELETE") - try: - with urllib.request.urlopen(req, timeout=15): - pass - except urllib.error.HTTPError as exc: - if exc.code == 404: - return - raise - except Exception: - pass - - -class _GcsRestBucket: - def __init__(self, name: str, token: str): - self.name = name - self.token = token - - def blob(self, name: str) -> _GcsRestBlob: - return _GcsRestBlob(self.name, name, self.token) - - def list_blobs(self, prefix: str = "") -> List[_GcsRestBlob]: - encoded_bkt = urllib.parse.quote(self.name, safe="") - url = f"https://storage.googleapis.com/storage/v1/b/{encoded_bkt}/o" - if prefix: - encoded_prefix = urllib.parse.quote(prefix, safe="") - url += f"?prefix={encoded_prefix}" - req = urllib.request.Request(url, headers={"Authorization": f"Bearer {self.token}"}, method="GET") - with urllib.request.urlopen(req, timeout=15) as resp: - data = json.loads(resp.read().decode("utf-8")) - items = data.get("items", []) - blobs = [] - for it in items: - name = it.get("name", "") - blobs.append(_GcsRestBlob(self.name, name, self.token)) - return sorted(blobs, key=lambda b: b.name) - - -class _GcsRestClient: - def __init__(self, token: str): - self.token = token - - def bucket(self, name: str) -> _GcsRestBucket: - return _GcsRestBucket(name, self.token) - - -class _LocalBlob: - def __init__(self, root: Path, name: str): - self.root = root - self.name = name.replace("\\", "/") - self.path = root / self.name - - def exists(self) -> bool: - return self.path.is_file() - - def upload_from_string( - self, - data: str, - content_type: str = "application/json", - if_generation_match: Optional[int] = None, - **kwargs: Any, - ) -> None: - self.path.parent.mkdir(parents=True, exist_ok=True) - if if_generation_match == 0: - flags = os.O_CREAT | os.O_EXCL | os.O_WRONLY - try: - fd = os.open(str(self.path), flags, 0o666) - except FileExistsError: - raise FileExistsError(f"Target object already exists: {self.path}") - with open(fd, "w", encoding="utf-8") as f: - f.write(data) - else: - self.path.write_text(data, encoding="utf-8") - - def download_as_text(self) -> str: - return self.path.read_text(encoding="utf-8") - - def delete(self) -> None: - if self.path.is_file(): - try: - self.path.unlink() - except OSError: - pass - - -class _LocalBucket: - def __init__(self, root: Path): - self.root = root - - def blob(self, name: str) -> _LocalBlob: - return _LocalBlob(self.root, name) - - def list_blobs(self, prefix: str = "") -> List[_LocalBlob]: - if not self.root.exists(): - return [] - clean_prefix = prefix.strip("/") - blobs: List[_LocalBlob] = [] - pattern = f"{clean_prefix}*" if clean_prefix else "*" - for p in self.root.glob(pattern): - if p.is_file(): - rel = str(p.relative_to(self.root)).replace("\\", "/") - blobs.append(_LocalBlob(self.root, rel)) - recursive_pattern = f"{clean_prefix}/**/*" if clean_prefix else "**/*" - for p in self.root.glob(recursive_pattern): - if p.is_file(): - rel = str(p.relative_to(self.root)).replace("\\", "/") - if not any(b.name == rel for b in blobs): - blobs.append(_LocalBlob(self.root, rel)) - return sorted(blobs, key=lambda b: b.name) - - -class _LocalClient: - def __init__(self, local_dir: Union[str, Path]): - self.root = Path(local_dir) - - def bucket(self, name: str) -> _LocalBucket: - return _LocalBucket(self.root / name) - - -class StorageMessenger: - def __init__( - self, - bucket_name: str, - session_id: str, - task_index: int = 0, - is_worker: bool = True, - storage_client: Optional[Any] = None, - local_dir: Optional[Union[str, Path]] = None, - ): - self.bucket_name = bucket_name.strip() - self.session_id = session_id.strip() or "default" - self.task_index = task_index - self.is_worker = is_worker - self._seen_steer_seqs: set = set() - self._current_question_seq = 0 - - # Setup client - env_local = os.environ.get("STORAGE_MESSENGER_LOCAL_DIR") - if local_dir: - self.client = _LocalClient(local_dir) - elif storage_client is not None: - self.client = storage_client - elif env_local: - self.client = _LocalClient(env_local) - else: - try: - from google.cloud import storage - self.client = storage.Client() - except Exception: - token = None - try: - import storage_uploader - token = storage_uploader.get_oauth_token() - except Exception: - pass - if token: - self.client = _GcsRestClient(token) - else: - if bool(os.environ.get("K_SERVICE") or os.environ.get("CLOUD_RUN_TASK_INDEX")): - raise RuntimeError("GCS credentials unavailable in Cloud Run environment; cannot use local fallback") - import tempfile - self.client = _LocalClient(Path(tempfile.gettempdir()) / "agystack_storage") - - self.bucket = self.client.bucket(self.bucket_name) - - if self.is_worker: - self._sync_existing_question_seq() - - def _session_prefix(self) -> str: - clean_id = self.session_id.strip() - if clean_id.startswith("swarms/"): - clean_id = clean_id[len("swarms/"):] - elif clean_id.startswith("swarm-"): - clean_id = clean_id[len("swarm-"):] - return f"swarms/{clean_id}" - - def _outbox_question_path(self, task_index: int, seq: int) -> str: - return f"{self._session_prefix()}/tasks/task-{task_index}/outbox/{seq:04d}_question.json" - - def _inbox_reply_path(self, task_index: int, seq: int) -> str: - return f"{self._session_prefix()}/tasks/task-{task_index}/inbox/{seq:04d}_reply.json" - - def _inbox_steer_path(self, task_index: int, seq: int) -> str: - return f"{self._session_prefix()}/tasks/task-{task_index}/inbox/{seq:04d}_steer.json" - - def _sync_existing_question_seq(self) -> None: - prefix = f"{self._session_prefix()}/tasks/task-{self.task_index}/outbox/" - try: - blobs = self.bucket.list_blobs(prefix=prefix) - max_seq = 0 - for b in blobs: - name = getattr(b, "name", "") - if "_question.json" in name: - base = name.split("/")[-1] - try: - seq_val = int(base.split("_")[0]) - if seq_val > max_seq: - max_seq = seq_val - except ValueError: - pass - self._current_question_seq = max_seq - except Exception: - pass - - def send_question(self, question: str, context: str = "") -> MailboxEnvelope: - self._current_question_seq += 1 - seq = self._current_question_seq - - envelope = MailboxEnvelope( - session_id=self.session_id, - task_index=self.task_index, - seq=seq, - msg_type=MessageType.QUESTION, - sender=f"worker-{self.task_index}", - recipient="orchestrator", - timestamp=time.time(), - payload={"question": question, "context": context}, - status=MessageStatus.PENDING, - ) - - obj_path = self._outbox_question_path(self.task_index, seq) - blob = self.bucket.blob(obj_path) - blob.upload_from_string(envelope.to_json(), content_type="application/json") - return envelope - - def wait_for_reply( - self, - seq: int, - timeout_seconds: float = 600.0, - poll_interval: float = 1.0, - ) -> Optional[str]: - obj_path = self._inbox_reply_path(self.task_index, seq) - start_time = time.time() - - while (time.time() - start_time) < timeout_seconds: - blob = self.bucket.blob(obj_path) - if blob.exists(): - try: - content = blob.download_as_text() - envelope = MailboxEnvelope.from_json(content) - reply_text = ( - envelope.payload.get("reply") - or envelope.payload.get("text") - or envelope.payload.get("answer") - or "" - ) - try: - ack_env = MailboxEnvelope( - session_id=envelope.session_id, - task_index=envelope.task_index, - seq=envelope.seq, - msg_type=envelope.msg_type, - sender=envelope.sender, - recipient=envelope.recipient, - timestamp=envelope.timestamp, - payload=envelope.payload, - status=MessageStatus.ACKNOWLEDGED, - reply_to_seq=envelope.reply_to_seq, - ) - blob.upload_from_string(ack_env.to_json(), content_type="application/json") - except Exception: - pass - return str(reply_text) - except Exception: - pass - time.sleep(poll_interval) - - return None - - def check_steer_instructions(self) -> List[MailboxEnvelope]: - prefix = f"{self._session_prefix()}/tasks/task-{self.task_index}/inbox/" - try: - blobs = self.bucket.list_blobs(prefix=prefix) - except Exception: - return [] - - steer_envelopes: List[MailboxEnvelope] = [] - for b in blobs: - name = getattr(b, "name", "") - if name.endswith("_steer.json"): - try: - content = b.download_as_text() - envelope = MailboxEnvelope.from_json(content) - if ( - envelope.seq not in self._seen_steer_seqs - and envelope.status != MessageStatus.ACKNOWLEDGED - ): - self._seen_steer_seqs.add(envelope.seq) - steer_envelopes.append(envelope) - try: - ack_env = MailboxEnvelope( - session_id=envelope.session_id, - task_index=envelope.task_index, - seq=envelope.seq, - msg_type=envelope.msg_type, - sender=envelope.sender, - recipient=envelope.recipient, - timestamp=envelope.timestamp, - payload=envelope.payload, - status=MessageStatus.ACKNOWLEDGED, - reply_to_seq=envelope.reply_to_seq, - ) - b.upload_from_string(ack_env.to_json(), content_type="application/json") - except Exception: - pass - elif envelope.status == MessageStatus.ACKNOWLEDGED: - self._seen_steer_seqs.add(envelope.seq) - except Exception: - continue - - steer_envelopes.sort(key=lambda env: env.seq) - return steer_envelopes - - def list_pending_questions(self) -> List[MailboxEnvelope]: - prefix = f"{self._session_prefix()}/tasks/" - try: - blobs = self.bucket.list_blobs(prefix=prefix) - except Exception: - return [] - - question_blobs = [b for b in blobs if getattr(b, "name", "").endswith("_question.json")] - pending_questions: List[MailboxEnvelope] = [] - - for qb in question_blobs: - try: - content = qb.download_as_text() - envelope = MailboxEnvelope.from_json(content) - reply_path = self._inbox_reply_path(envelope.task_index, envelope.seq) - reply_blob = self.bucket.blob(reply_path) - if not reply_blob.exists() and envelope.status != MessageStatus.TIMED_OUT: - pending_questions.append(envelope) - except Exception: - continue - - pending_questions.sort(key=lambda env: (env.task_index, env.seq)) - return pending_questions - - def send_reply(self, task_index: int, seq: int, reply_text: str) -> MailboxEnvelope: - envelope = MailboxEnvelope( - session_id=self.session_id, - task_index=task_index, - seq=seq, - msg_type=MessageType.REPLY, - sender="orchestrator", - recipient=f"worker-{task_index}", - timestamp=time.time(), - payload={"reply": reply_text, "text": reply_text}, - status=MessageStatus.PENDING, - reply_to_seq=seq, - ) - - obj_path = self._inbox_reply_path(task_index, seq) - blob = self.bucket.blob(obj_path) - blob.upload_from_string(envelope.to_json(), content_type="application/json") - return envelope - - def send_steer( - self, - task_index: int, - instruction: str, - max_retries: int = 3, - retry_delay: float = 0.05, - ) -> MailboxEnvelope: - prefix = f"{self._session_prefix()}/tasks/task-{task_index}/inbox/" - delay = retry_delay - - for attempt in range(max_retries + 1): - max_seq = 0 - - def _resolve_max_seq(): - nonlocal max_seq - blobs = self.bucket.list_blobs(prefix=prefix) - for b in blobs: - name = getattr(b, "name", "") - if "_steer.json" in name: - base = name.split("/")[-1] - try: - seq_val = int(base.split("_")[0]) - if seq_val > max_seq: - max_seq = seq_val - except ValueError: - pass - - try: - retry_gcs_operation(_resolve_max_seq, max_retries=max_retries, initial_delay=retry_delay) - except Exception as exc: - raise RuntimeError("GCS sequence resolution failed") from exc - - steer_seq = max_seq + 1 - envelope = MailboxEnvelope( - session_id=self.session_id, - task_index=task_index, - seq=steer_seq, - msg_type=MessageType.STEER, - sender="orchestrator", - recipient=f"worker-{task_index}", - timestamp=time.time(), - payload={"instruction": instruction, "text": instruction}, - status=MessageStatus.PENDING, - ) - - obj_path = self._inbox_steer_path(task_index, steer_seq) - blob = self.bucket.blob(obj_path) - - def _upload_blob(): - try: - blob.upload_from_string( - envelope.to_json(), - content_type="application/json", - if_generation_match=0, - ) - except TypeError: - blob.upload_from_string( - envelope.to_json(), - content_type="application/json", - ) - - try: - retry_gcs_operation( - _upload_blob, - max_retries=max_retries, - initial_delay=retry_delay, - ) - return envelope - except Exception as exc: - if _is_precondition_or_collision_error(exc): - if attempt >= max_retries: - raise - time.sleep(delay) - delay *= 1.5 - continue - raise - - def discover_tasks(self) -> List[int]: - """Discovers active or existing task indices for this session from storage.""" - prefix = f"{self._session_prefix()}/tasks/" - task_indices = set() - try: - blobs = self.bucket.list_blobs(prefix=prefix) - for b in blobs: - name = getattr(b, "name", "") - match = re.search(r"/tasks/task-(\d+)/", name) - if match: - task_indices.add(int(match.group(1))) - except Exception: - pass - - if not task_indices: - for manifest_path in (f"{self._session_prefix()}/manifest.json", f"swarms/{self.session_id}/manifest.json"): - try: - blob = self.bucket.blob(manifest_path) - if blob.exists(): - data = json.loads(blob.download_as_text()) - tasks = data.get("tasks", []) - if tasks: - return list(range(len(tasks))) - except Exception: - pass - - return sorted(task_indices) - - def cleanup_mailboxes(self, task_index: Optional[int] = None) -> int: - """Removes all outbox and inbox envelope objects for the session (or a specific task).""" - if task_index is not None: - prefix = f"{self._session_prefix()}/tasks/task-{task_index}/" - else: - prefix = f"{self._session_prefix()}/tasks/" - - cleaned = 0 - try: - blobs = self.bucket.list_blobs(prefix=prefix) - for b in blobs: - name = getattr(b, "name", "") - if "/inbox/" in name or "/outbox/" in name: - try: - if hasattr(b, "delete"): - b.delete() - cleaned += 1 - except Exception: - pass - except Exception: - pass - return cleaned diff --git a/skills/swarm/scripts/storage_uploader.py b/skills/swarm/scripts/storage_uploader.py deleted file mode 100644 index aa766c2..0000000 --- a/skills/swarm/scripts/storage_uploader.py +++ /dev/null @@ -1,444 +0,0 @@ -#!/usr/bin/env python3 -import fnmatch -import json -import os -import subprocess -import sys -import urllib.error -import urllib.parse -import urllib.request -from pathlib import Path -from typing import Dict, List, Optional, Union - -try: - from worker.execution import CREDENTIAL_PATTERNS -except ImportError: - from skills.swarm.scripts.worker.execution import CREDENTIAL_PATTERNS - - -def is_sensitive_path(path: Path, root: Path) -> bool: - try: - p = Path(path) - root_path = Path(root) - full_path = p if p.is_absolute() else (root_path / p) - if os.path.islink(full_path) or full_path.is_symlink(): - return True - r = root_path.resolve() - resolved = full_path.resolve() - curr = full_path.parent - while curr != root_path and curr.resolve() != r and curr != curr.parent: - if os.path.islink(curr) or curr.is_symlink(): - return True - curr = curr.parent - if r != resolved and r not in resolved.parents: - return True - parts = resolved.relative_to(r).parts - if ".git" in parts or ".git" in p.parts or ".git" in full_path.parts: - return True - sensitive_patterns = [ - ".env", - ".env.*", - "*.pem", - "*.key", - "id_rsa*", - "id_ed25519*", - "credentials.json", - "token.json", - ] - for pattern in sensitive_patterns: - if fnmatch.fnmatch(full_path.name.lower(), pattern.lower()): - return True - if fnmatch.fnmatch(resolved.name.lower(), pattern.lower()): - return True - for part in parts: - for pattern in sensitive_patterns: - if fnmatch.fnmatch(part.lower(), pattern.lower()): - return True - return False - except Exception: - return True - - -def file_contains_credentials(path: Path) -> bool: - p = Path(path) - if not p.is_file(): - return False - try: - content = p.read_text(encoding="utf-8", errors="ignore") - except Exception: - try: - content = p.read_bytes().decode("utf-8", errors="ignore") - except Exception: - return False - for pat in CREDENTIAL_PATTERNS: - if pat.search(content): - return True - return False - - -def get_oauth_token() -> Optional[str]: - env_token = os.environ.get("GCS_OAUTH_TOKEN") or os.environ.get("GOOGLE_OAUTH_ACCESS_TOKEN") - if env_token and env_token.strip(): - return env_token.strip() - - try: - req = urllib.request.Request( - "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token", - headers={"Metadata-Flavor": "Google"}, - ) - with urllib.request.urlopen(req, timeout=1.5) as resp: - if resp.status == 200: - payload = json.loads(resp.read().decode("utf-8")) - token = payload.get("access_token") - if token: - return token - except Exception: - pass - - try: - import google.auth - import google.auth.transport.requests - - credentials, _ = google.auth.default(scopes=["https://www.googleapis.com/auth/devstorage.read_write"]) - credentials.refresh(google.auth.transport.requests.Request()) - if credentials.token: - return credentials.token - except Exception: - pass - - try: - res = subprocess.run( - ["gcloud", "auth", "print-access-token"], - capture_output=True, - text=True, - timeout=3, - check=True, - ) - token = res.stdout.strip() - if token: - return token - except Exception: - pass - - return None - - -def upload_to_gcs(bucket_name: str, object_name: str, local_file_path: Path) -> bool: - path = Path(local_file_path) - if not path.is_file(): - return False - - local_dir = os.environ.get("STORAGE_MESSENGER_LOCAL_DIR") - if local_dir: - dest = Path(local_dir) / bucket_name / object_name - dest.parent.mkdir(parents=True, exist_ok=True) - import shutil - - shutil.copy2(path, dest) - return True - - try: - from google.cloud import storage - - client = storage.Client() - bucket = client.bucket(bucket_name) - blob = bucket.blob(object_name) - blob.upload_from_filename(str(path)) - return True - except ImportError: - pass - except Exception as exc: - print( - f"Warning: google.cloud.storage upload failed: {exc}, falling back to REST API", - file=sys.stderr, - ) - - token = get_oauth_token() - if not token: - print("Error: Unable to acquire GCP OAuth token for GCS upload", file=sys.stderr) - return False - - encoded_bucket = urllib.parse.quote(bucket_name, safe="") - encoded_name = urllib.parse.quote(object_name, safe="") - url = f"https://storage.googleapis.com/upload/storage/v1/b/{encoded_bucket}/o?uploadType=media&name={encoded_name}" - - try: - data = path.read_bytes() - req = urllib.request.Request( - url, - data=data, - headers={ - "Authorization": f"Bearer {token}", - "Content-Type": "application/octet-stream", - }, - method="POST", - ) - with urllib.request.urlopen(req, timeout=30) as resp: - return 200 <= resp.status < 300 - except Exception as exc: - print( - f"Error uploading {path} to gs://{bucket_name}/{object_name}: {exc}", - file=sys.stderr, - ) - return False - - -def upload_artifact( - bucket_name: str, - object_name: str, - content: Union[str, bytes, Path], - content_type: str = "application/json", -) -> bool: - """Uploads an artifact (string content, bytes, or file path) to GCS.""" - if isinstance(content, Path) or (isinstance(content, str) and os.path.isfile(content)): - return upload_to_gcs(bucket_name, object_name, Path(content)) - - data_bytes = content.encode("utf-8") if isinstance(content, str) else content - - local_dir = os.environ.get("STORAGE_MESSENGER_LOCAL_DIR") - if local_dir: - dest = Path(local_dir) / bucket_name / object_name - dest.parent.mkdir(parents=True, exist_ok=True) - dest.write_bytes(data_bytes) - return True - - try: - from google.cloud import storage - - client = storage.Client() - bucket = client.bucket(bucket_name) - blob = bucket.blob(object_name) - blob.upload_from_string(data_bytes, content_type=content_type) - return True - except Exception: - pass - - token = get_oauth_token() - if token: - encoded_bucket = urllib.parse.quote(bucket_name, safe="") - encoded_name = urllib.parse.quote(object_name, safe="") - url = f"https://storage.googleapis.com/upload/storage/v1/b/{encoded_bucket}/o?uploadType=media&name={encoded_name}" - try: - req = urllib.request.Request( - url, - data=data_bytes, - headers={ - "Authorization": f"Bearer {token}", - "Content-Type": content_type, - }, - method="POST", - ) - with urllib.request.urlopen(req, timeout=30) as resp: - if 200 <= resp.status < 300: - return True - except Exception: - pass - - try: - import tempfile - - with tempfile.NamedTemporaryFile("wb", delete=False) as tf: - tf.write(data_bytes) - tf_path = Path(tf.name) - try: - res = subprocess.run( - ["gcloud", "storage", "cp", str(tf_path), f"gs://{bucket_name}/{object_name}"], - capture_output=True, - check=False, - timeout=15, - ) - if res.returncode == 0: - return True - finally: - tf_path.unlink(missing_ok=True) - except Exception: - pass - - return False - - -def _generate_git_patch( - repo_dir: Path, - candidate_files: Optional[List[str]] = None, - commit_sha: Optional[str] = None, -) -> str: - if not (repo_dir / ".git").exists(): - return "" - try: - add_cmd = ["git", "add", "-N"] - if candidate_files: - add_cmd.extend(["--"] + candidate_files) - else: - add_cmd.append(".") - subprocess.run( - add_cmd, - cwd=repo_dir, - capture_output=True, - text=True, - check=False, - timeout=10, - ) - except Exception: - pass - - scope = ["--"] + candidate_files if candidate_files else [] - if commit_sha and str(commit_sha).strip(): - sha = str(commit_sha).strip() - commands = [ - ["git", "diff", f"{sha}~1", sha] + scope, - ] - else: - # If commit_sha is NOT provided (commit failed or uncommitted changes), - # do NOT diff HEAD~1 HEAD to avoid leaking unrelated commits. - commands = [ - ["git", "diff", "HEAD"] + scope, - ["git", "diff", "--cached"] + scope, - ["git", "diff"] + scope, - ] - - for cmd in commands: - try: - res = subprocess.run( - cmd, - cwd=repo_dir, - capture_output=True, - text=True, - check=False, - timeout=10, - ) - if res.returncode == 0 and res.stdout.strip(): - return res.stdout - except Exception: - continue - return "" - - -def upload_run_artifacts( - bucket_name: str, - prefix: str, - repo_dir: Path, - task_index: int, - status: str = "UNKNOWN", - candidate_files: Optional[List[str]] = None, - commit_sha: Optional[str] = None, - *, - evidence_files: Optional[List[str]] = None, -) -> Dict[str, str]: - repo = Path(repo_dir) - clean_prefix = prefix.strip().strip("/") - target_prefix = f"{clean_prefix}/task-{task_index}" if clean_prefix else f"task-{task_index}" - - uploaded: Dict[str, str] = {} - delivery_errors: List[str] = [] - root = repo.resolve() - - def _upload_checked(path: Path, name: str) -> bool: - if is_sensitive_path(path, root): - delivery_errors.append(f"{name} is sensitive or outside repository") - return False - if file_contains_credentials(path): - delivery_errors.append(f"{name} contains credentials") - return False - dest = f"{target_prefix}/{name}" - if upload_to_gcs(bucket_name, dest, path): - uploaded[name] = f"gs://{bucket_name}/{dest}" - return True - delivery_errors.append(f"{name} upload failed") - return False - - evidence_paths: List[Path] = [] - for relative in evidence_files or []: - raw_path = root / relative - if is_sensitive_path(raw_path, root): - delivery_errors.append(f"Evidence path is sensitive or outside repository: {relative}") - continue - if raw_path.is_dir(): - for child in sorted(raw_path.rglob("*")): - if is_sensitive_path(child, root): - rel = child.relative_to(root).as_posix() if root in child.resolve().parents else child.name - delivery_errors.append(f"Evidence path is sensitive or outside repository: {rel}") - elif child.is_file(): - evidence_paths.append(child) - elif raw_path.is_file(): - evidence_paths.append(raw_path) - else: - delivery_errors.append(f"Evidence file missing: {relative}") - - diagnostics = root / ".agystack/diagnostics" - if diagnostics.is_dir(): - if is_sensitive_path(diagnostics, root): - delivery_errors.append(f"Diagnostic path is sensitive or outside repository: {diagnostics.name}") - else: - for diag in sorted(diagnostics.glob("*.log")): - if is_sensitive_path(diag, root): - delivery_errors.append(f"Diagnostic path is sensitive or outside repository: {diag.name}") - elif diag.is_file(): - evidence_paths.append(diag) - - for path in sorted(set(evidence_paths)): - resolved = path.resolve() - if not resolved.is_file(): - continue - rel_name = path.relative_to(root).as_posix() if root in resolved.parents else path.name - _upload_checked(path, f"evidence/{rel_name}") - - if delivery_errors and status == "PASS": - status = "ISSUES" - - patch_uploaded = False - if candidate_files or (status == "PASS" and candidate_files is None): - patch_name = "patch.diff" if status == "PASS" else "partial.patch.diff" - patch_path = repo / patch_name - if is_sensitive_path(patch_path, root): - delivery_errors.append(f"Candidate patch path is sensitive: {patch_name}") - if status == "PASS": - status = "ISSUES" - else: - if candidate_files or not patch_path.is_file(): - patch_content = _generate_git_patch(repo, candidate_files=candidate_files, commit_sha=commit_sha) - if patch_content: - patch_path.write_text(patch_content, encoding="utf-8") - - if patch_path.is_file() and patch_path.stat().st_size > 0: - patch_uploaded = _upload_checked(patch_path, patch_name) - - if candidate_files and not patch_uploaded: - delivery_errors.append("Candidate patch failed to upload or is missing under zero-push delivery.") - if status == "PASS": - status = "ISSUES" - - score_path = repo / "score.json" - if score_path.is_file(): - _upload_checked(score_path, "score.json") - - results_path = repo / "results.tsv" - if results_path.is_file(): - _upload_checked(results_path, "results.tsv") - - if delivery_errors and status == "PASS": - status = "ISSUES" - - status_path = repo / "status.json" - status_data = {} - if status_path.is_file(): - try: - status_data = json.loads(status_path.read_text(encoding="utf-8")) - except Exception: - status_data = {} - status_data["task_index"] = task_index - status_data["status"] = status - status_data["artifacts"] = uploaded - if delivery_errors: - status_data["evidence"] = "\n".join(delivery_errors) - status_data["delivery_errors"] = delivery_errors - else: - status_data.pop("delivery_errors", None) - status_path.write_text(json.dumps(status_data, indent=2), encoding="utf-8") - - dest = f"{target_prefix}/status.json" - if upload_to_gcs(bucket_name, dest, status_path): - uploaded["status.json"] = f"gs://{bucket_name}/{dest}" - else: - delivery_errors.append("status.json upload failed") - - return uploaded diff --git a/skills/swarm/scripts/swarm_dashboard.py b/skills/swarm/scripts/swarm_dashboard.py deleted file mode 100644 index 2be587e..0000000 --- a/skills/swarm/scripts/swarm_dashboard.py +++ /dev/null @@ -1,688 +0,0 @@ -#!/usr/bin/env python3 -""" -Swarm Dashboard module for tracking cloud execution progress, state badges, -console deep links, and live dashboard markdown generation. -""" - -import json -import os -import re -import sys -import tempfile -import threading -import time -import urllib.parse -from dataclasses import dataclass, field -from datetime import datetime, timezone -from pathlib import Path -from typing import Any, Dict, List, Optional, Union - -try: - from transcript_projector import ( - format_conversation_url, - is_telemetry_line, - parse_telemetry_line, - resolve_app_data_dir, - ) -except ImportError: - from skills.swarm.scripts.transcript_projector import ( - format_conversation_url, - is_telemetry_line, - parse_telemetry_line, - resolve_app_data_dir, - ) - -STATUS_BADGES: Dict[str, str] = { - "QUEUED": "⏳ Queued", - "Queued": "⏳ Queued", - "queued": "⏳ Queued", - "PENDING": "⏳ Queued", - "Pending": "⏳ Queued", - "RUNNING": "🔄 Running", - "Running": "🔄 Running", - "running": "🔄 Running", - "IN_PROGRESS": "🔄 Running", - "PASS": "🟢 PASS", - "Pass": "🟢 PASS", - "pass": "🟢 PASS", - "PASSED": "🟢 PASS", - "SUCCESS": "🟢 PASS", - "ISSUES": "⚠️ ISSUES", - "Issues": "⚠️ ISSUES", - "issues": "⚠️ ISSUES", - "WARNING": "⚠️ ISSUES", - "FAILED": "⚠️ ISSUES", - "FAILURE": "⚠️ ISSUES", - "BLOCKED": "🔴 BLOCKED", - "Blocked": "🔴 BLOCKED", - "blocked": "🔴 BLOCKED", -} - - -def colorize(text: str, color_code: str, use_color: Optional[bool] = None) -> str: - """Wrap text in ANSI color escape codes if color is enabled.""" - if use_color is None: - use_color = ( - sys.stdout.isatty() - and not os.environ.get("NO_COLOR") - and os.environ.get("TERM") != "dumb" - ) - if not use_color: - return text - return f"{color_code}{text}\033[0m" - - -def format_status_badge(status: str) -> str: - cleaned = (status or "").strip() - return STATUS_BADGES.get(cleaned, STATUS_BADGES.get(cleaned.upper(), f"❓ {cleaned}")) - - -def format_elapsed_time(seconds: float) -> str: - if seconds < 0: - seconds = 0.0 - sec_int = int(seconds) - if sec_int < 60: - return f"{sec_int}s" - minutes = sec_int // 60 - rem_secs = sec_int % 60 - if minutes < 60: - return f"{minutes}m {rem_secs:02d}s" - hours = minutes // 60 - rem_mins = minutes % 60 - return f"{hours}h {rem_mins:02d}m {rem_secs:02d}s" - - -def format_tool_snippet(tool_name: str, args: Any = None, max_len: int = 60) -> str: - if not tool_name: - return "-" - if not args: - snippet = f"{tool_name}()" - elif isinstance(args, dict): - primary_keys = [ - "CommandLine", - "command", - "cmd", - "AbsolutePath", - "TargetFile", - "path", - "Query", - "pattern", - "query", - "toolAction", - ] - picked = None - for k in primary_keys: - if k in args and args[k] is not None: - val = str(args[k]).strip() - picked = f"{k}={repr(val)}" - break - if not picked: - items = [] - for k, v in args.items(): - items.append(f"{k}={repr(str(v).strip())}") - picked = ", ".join(items) - snippet = f"{tool_name}({picked})" - elif isinstance(args, str): - snippet = f"{tool_name}({args})" - else: - snippet = f"{tool_name}({json.dumps(args, default=str)})" - - snippet = snippet.replace("\n", " ").replace("|", "\\|").strip() - if len(snippet) > max_len: - snippet = snippet[: max_len - 3] + "..." - return f"`{snippet}`" - - -def format_cloud_run_execution_url( - execution_name: str, - project: Optional[str] = None, - region: Optional[str] = None, -) -> str: - exec_clean = (execution_name or "").strip() - if region: - url = f"https://console.cloud.google.com/run/jobs/executions/details/{region.strip()}/{exec_clean}" - else: - url = f"https://console.cloud.google.com/run/jobs/executions/details/{exec_clean}" - if project: - url += f"?project={project.strip()}" - return url - - -format_cloud_run_url = format_cloud_run_execution_url - - -def format_cloud_logging_url( - execution_name: Optional[str] = None, - project: Optional[str] = None, - query: Optional[str] = None, -) -> str: - if query: - query_str = query.strip() - elif execution_name: - query_str = f'labels."run.googleapis.com/execution_name"="{execution_name.strip()}"' - else: - query_str = 'resource.type="cloud_run_job"' - encoded_query = urllib.parse.quote(query_str, safe="") - url = f"https://console.cloud.google.com/logs/query;query={encoded_query}" - if project: - url += f"?project={project.strip()}" - return url - - -format_log_viewer_url = format_cloud_logging_url - - -def format_gcs_console_url( - bucket: str, - prefix: str = "", - project: Optional[str] = None, -) -> str: - clean_bucket = (bucket or "").strip().removeprefix("gs://").strip("/") - clean_prefix = (prefix or "").strip().removeprefix("gs://") - if clean_prefix.startswith(clean_bucket + "/"): - clean_prefix = clean_prefix[len(clean_bucket) + 1 :] - clean_prefix = clean_prefix.strip("/") - - # Normalize legacy prefixes: ensure swarms/ formatting - if clean_prefix.startswith("swarm-"): - clean_prefix = f"swarms/{clean_prefix[len('swarm-'):]}" - elif clean_prefix.startswith("swarm/"): - clean_prefix = f"swarms/{clean_prefix[len('swarm/'):]}" - - if clean_prefix: - url = f"https://console.cloud.google.com/storage/browser/{clean_bucket}/{clean_prefix}" - else: - url = f"https://console.cloud.google.com/storage/browser/{clean_bucket}" - if project: - url += f"?project={project.strip()}" - return url - - -format_gcs_url = format_gcs_console_url - - -def format_monitored_line(line_str: str, use_color: Optional[bool] = None) -> str: - """Format a monitored Cloud Run log line with alert banners and terminal styling.""" - if use_color is None: - use_color = ( - sys.stdout.isatty() - and not os.environ.get("NO_COLOR") - and os.environ.get("TERM") != "dumb" - ) - - is_alarm = line_str.startswith("[ALARM]") - is_loop_milestone = line_str.startswith("[MILESTONE]") and "[PHASE: POTENTIAL_LOOP]" in line_str - if is_alarm: - content = line_str[len("[ALARM]"):].strip() - if content.startswith(">>>") and content.endswith("<<<"): - banner = f"[ALARM] {content}" - elif content: - banner = f"[ALARM] >>> {content} <<<" - else: - banner = "[ALARM]" - return colorize(banner, "\033[91;1m", use_color=use_color) - - if is_loop_milestone: - banner = f"[ALARM] >>> {line_str} <<<" - return colorize(banner, "\033[91;1m", use_color=use_color) - - is_waiting = ( - line_str.startswith("[WAITING_FOR_ORCHESTRATOR]") - or line_str.startswith("WAITING_FOR_ORCHESTRATOR") - or bool(re.match(r"^\[TASK\s+\d+\]\s+WAITING_FOR_ORCHESTRATOR\b", line_str)) - ) - if is_waiting: - if line_str.startswith("[WAITING_FOR_ORCHESTRATOR]"): - content = line_str[len("[WAITING_FOR_ORCHESTRATOR]"):].strip() - if content.startswith(">>>") and content.endswith("<<<"): - banner = line_str - elif content: - banner = f"[WAITING_FOR_ORCHESTRATOR] >>> {content} <<<" - else: - banner = "[WAITING_FOR_ORCHESTRATOR]" - else: - banner = f"[WAITING_FOR_ORCHESTRATOR] >>> {line_str} <<<" - return colorize(banner, "\033[93;1m", use_color=use_color) - - return line_str - - -MILESTONE_REGEX = re.compile( - r"\[MILESTONE\]\s+\[TASK\s+(\d+)\]\s+\[PHASE:\s*([^\]]+)\](?:\s+(.*))?" -) - - -def parse_milestone_log(line: str) -> Optional[Dict[str, str]]: - m = MILESTONE_REGEX.search(line) - if not m: - return None - return { - "task_index": m.group(1), - "phase": m.group(2).strip(), - "detail": m.group(3).strip() if m.group(3) else "", - } - - -@dataclass -class TaskDashboardState: - task_index: int - model: str = "default" - status: str = "Queued" - phase: str = "Queued" - active_tool: Optional[str] = None - tool_args: Optional[Any] = None - tool_snippet: Optional[str] = None - start_time: Optional[float] = None - end_time: Optional[float] = None - created_at: float = field(default_factory=time.time) - pending_steer: Optional[str] = None - - @property - def is_steer_pending(self) -> bool: - return bool(self.pending_steer) - - def get_badge(self) -> str: - return format_status_badge(self.status) - - def get_elapsed_seconds(self, now: Optional[float] = None) -> float: - if self.start_time is None: - return 0.0 - current = self.end_time if self.end_time is not None else (now if now is not None else time.time()) - return max(0.0, current - self.start_time) - - def get_active_display(self) -> str: - if self.pending_steer: - return f"STEER_PENDING: {self.pending_steer}" - if self.active_tool: - if self.tool_snippet: - return self.tool_snippet - return format_tool_snippet(self.active_tool, self.tool_args) - if self.phase and self.phase not in ("Queued", "QUEUED"): - return self.phase - return "-" - - -class SwarmDashboardWriter: - def __init__( - self, - session_id: str, - conversation_id: Optional[str] = None, - app_data_dir: Optional[Union[str, Path]] = None, - task_count: int = 1, - project: Optional[str] = None, - region: Optional[str] = None, - execution_name: Optional[str] = None, - gcs_bucket: Optional[str] = None, - model: Optional[str] = None, - tasks_list: Optional[List[Any]] = None, - ): - self.session_id = session_id - # Precedence: explicit argument > CONVERSATION_ID env > ANTIGRAVITY_CONVERSATION_ID env > session_id > default - self.conversation_id = ( - conversation_id - or os.environ.get("CONVERSATION_ID") - or os.environ.get("ANTIGRAVITY_CONVERSATION_ID") - or session_id - or "default" - ) - self.app_data_dir = resolve_app_data_dir(app_data_dir) - self.dashboard_path = self.app_data_dir / "brain" / self.conversation_id / "swarm_dashboard.md" - self.output_path = self.dashboard_path - self.task_count = max(1, task_count) - self.project = project - self.region = region - self.execution_name = execution_name - self.gcs_bucket = gcs_bucket - self.default_model = model or "default" - self.tasks_list = tasks_list or [] - self._lock = threading.Lock() - self._states: Dict[int, TaskDashboardState] = {} - self._init_tasks() - - def _init_tasks(self) -> None: - for idx in range(self.task_count): - task_model = self.default_model - if self.tasks_list and idx < len(self.tasks_list): - item = self.tasks_list[idx] - if isinstance(item, dict): - task_model = item.get("model") or item.get("worker_model") or self.default_model - self._states[idx] = TaskDashboardState( - task_index=idx, - model=task_model, - status="Queued", - phase="Queued", - ) - - def set_execution_name(self, execution_name: str) -> None: - with self._lock: - self.execution_name = execution_name - - def format_cloud_run_execution_url(self, execution_name: Optional[str] = None) -> Optional[str]: - name = execution_name or self.execution_name - if not name: - return None - return format_cloud_run_execution_url(name, project=self.project, region=self.region) - - def format_cloud_logging_url(self, execution_name: Optional[str] = None) -> str: - name = execution_name or self.execution_name - return format_cloud_logging_url(name, project=self.project) - - def format_gcs_console_url(self, prefix: Optional[str] = None) -> Optional[str]: - if not self.gcs_bucket: - return None - pref = prefix if prefix is not None else f"swarms/{self.session_id}" - return format_gcs_console_url(self.gcs_bucket, pref, project=self.project) - - def get_cloud_run_execution_url(self) -> Optional[str]: - return self.format_cloud_run_execution_url() - - def get_cloud_logging_url(self) -> str: - return self.format_cloud_logging_url() - - def get_gcs_console_url(self) -> Optional[str]: - return self.format_gcs_console_url() - - def get_task_state(self, task_index: int) -> Optional[TaskDashboardState]: - with self._lock: - return self._states.get(task_index) - - def get_task_status(self, task_index: int) -> str: - with self._lock: - state = self._states.get(task_index) - return state.status if state else "Queued" - - def get_task_badge(self, task_index: int) -> str: - with self._lock: - state = self._states.get(task_index) - return state.get_badge() if state else "⏳ Queued" - - def update_task_phase(self, task_index: int, phase: str, detail: str = "") -> None: - with self._lock: - if task_index not in self._states: - self._states[task_index] = TaskDashboardState( - task_index=task_index, - model=self.default_model, - ) - state = self._states[task_index] - state.phase = phase - if phase in ( - "RUNNING_AGENT", - "RUNNING", - "STARTING", - "PREPARING_WORKSPACE", - "WORKSPACE_PREPARED", - "BOOTSTRAP", - "VERIFYING", - "CLEANUP", - ): - if state.status in ("Queued", "QUEUED"): - state.status = "Running" - if state.start_time is None: - state.start_time = time.time() - elif phase in ("COMPLETED", "FINISHED", "PASS"): - if state.status not in ("ISSUES", "BLOCKED"): - state.status = "PASS" - if state.end_time is None: - state.end_time = time.time() - if phase in ("STEER_APPLIED", "ABORT_REQUESTED"): - state.pending_steer = None - - def update_task_steer(self, task_index: int, instruction: str) -> None: - with self._lock: - if task_index not in self._states: - self._states[task_index] = TaskDashboardState( - task_index=task_index, - model=self.default_model, - ) - self._states[task_index].pending_steer = instruction - - def clear_task_steer(self, task_index: int) -> None: - with self._lock: - if task_index in self._states: - self._states[task_index].pending_steer = None - - def update_task_tool( - self, - task_index: int, - tool_name: str, - args: Any = None, - snippet: Optional[str] = None, - ) -> None: - with self._lock: - if task_index not in self._states: - self._states[task_index] = TaskDashboardState( - task_index=task_index, - model=self.default_model, - ) - state = self._states[task_index] - state.active_tool = tool_name - state.tool_args = args - state.tool_snippet = snippet or format_tool_snippet(tool_name, args) - if state.status in ("Queued", "QUEUED"): - state.status = "Running" - if state.start_time is None: - state.start_time = time.time() - - def update_task_status(self, task_index: int, status: str) -> None: - with self._lock: - if task_index not in self._states: - self._states[task_index] = TaskDashboardState( - task_index=task_index, - model=self.default_model, - ) - state = self._states[task_index] - cleaned = status.strip() - state.status = cleaned - if cleaned.upper() in ("PASS", "PASSED", "SUCCESS", "ISSUES", "WARNING", "BLOCKED", "FAILED"): - if state.end_time is None: - state.end_time = time.time() - if state.start_time is None: - state.start_time = state.created_at - elif cleaned.upper() in ("RUNNING", "RUN"): - if state.start_time is None: - state.start_time = time.time() - - def process_log_line(self, line: str) -> bool: - if not line or not isinstance(line, str): - return False - s = line.strip() - if not s: - return False - - m = parse_milestone_log(s) - if m: - try: - t_idx = int(m["task_index"]) - phase = m["phase"] - detail = m.get("detail", "") - self.update_task_phase(t_idx, phase, detail) - if phase in ("STEER_APPLIED", "ABORT_REQUESTED"): - self.clear_task_steer(t_idx) - return True - except Exception: - pass - - # Check for [STEER] log lines: - # e.g. "[STEER] Instruction delivered to task-0 mailbox in GCS" - # e.g. "[STEER] [TASK 0] Abort search" - if "[STEER]" in s: - m_steer = re.search( - r"\[STEER\](?:\s+\[TASK\s+(\d+)\]|\s+Instruction delivered to task-(\d+)|\s+task-(\d+)|\s+Task\s+(\d+))?(?:\s*[:\-]\s*(.*?)(?:\s+mailbox in GCS)?|\s+mailbox in GCS)?$", - s, - re.IGNORECASE, - ) - if m_steer: - try: - idx_str = m_steer.group(1) or m_steer.group(2) or m_steer.group(3) or m_steer.group(4) - if idx_str is not None: - t_idx = int(idx_str) - instruction = (m_steer.group(5) or "").strip() - with self._lock: - curr = self._states.get(t_idx) - inst = instruction or (curr.pending_steer if curr and curr.pending_steer else "Pending") - self.update_task_steer(t_idx, inst) - return True - except Exception: - pass - - if "STEER_APPLIED" in s or "ABORT_REQUESTED" in s: - m_steer_act = re.search(r"\b(STEER_APPLIED|ABORT_REQUESTED)\b", s) - if m_steer_act: - act = m_steer_act.group(1) - m_t = re.search(r"\[TASK\s+(\d+)\]", s, re.IGNORECASE) or re.search(r"task-(\d+)", s, re.IGNORECASE) - if m_t: - try: - t_idx = int(m_t.group(1)) - self.clear_task_steer(t_idx) - self.update_task_phase(t_idx, act) - return True - except Exception: - pass - - if is_telemetry_line(s): - try: - payload = parse_telemetry_line(s) - if payload: - task_idx = int(payload.get("task_index", 0)) - event = payload.get("event") or payload.get("type", "") - if event in ("tool_call", "TOOL_CALL"): - t_name = payload.get("tool_name", "tool") - t_args = payload.get("args") or payload.get("tool_args", {}) - self.update_task_tool(task_idx, t_name, t_args) - return True - elif event in ("tool_result", "TOOL_RESPONSE", "tool_response"): - with self._lock: - if task_idx in self._states: - self._states[task_idx].active_tool = None - return True - elif event in ("thought", "THOUGHT"): - with self._lock: - if task_idx in self._states and self._states[task_idx].status in ("Queued", "QUEUED"): - self._states[task_idx].status = "Running" - if self._states[task_idx].start_time is None: - self._states[task_idx].start_time = time.time() - return True - except Exception: - pass - - m_status = re.search(r"\[STATUS:\s*([A-Za-z_]+)\s*\]", s, re.IGNORECASE) - if m_status: - status_word = m_status.group(1).upper() - m_task = re.search(r"\[TASK\s+(\d+)\]", s, re.IGNORECASE) or re.search( - r"-\s*Task Index:\s*(\d+)", s, re.IGNORECASE - ) - task_idx = int(m_task.group(1)) if m_task else 0 - self.update_task_status(task_idx, status_word) - return True - - return False - - def render(self, now: Optional[float] = None) -> str: - with self._lock: - cr_url = self.format_cloud_run_execution_url() - log_url = self.format_cloud_logging_url() - gcs_url = self.format_gcs_console_url() - - lines = [] - lines.append(f"# Swarm Dashboard: `{self.session_id}`\n") - lines.append("### Google Cloud Console Deep Links\n") - if cr_url and self.execution_name: - lines.append(f"- **Cloud Run Execution:** [{self.execution_name}]({cr_url})") - else: - lines.append("- **Cloud Run Execution:** `(pending dispatch)`") - lines.append(f"- **Cloud Logging:** [Pre-filtered Logs]({log_url})") - if gcs_url and self.gcs_bucket: - lines.append(f"- **GCS Artifacts:** [gs://{self.gcs_bucket}/swarms/{self.session_id}]({gcs_url})") - else: - lines.append("- **GCS Artifacts:** `(pending)`") - lines.append("") - - counts: Dict[str, int] = {"Queued": 0, "Running": 0, "PASS": 0, "ISSUES": 0, "BLOCKED": 0} - for state in self._states.values(): - st = state.status.upper() - if st in ("PASS", "PASSED", "SUCCESS"): - counts["PASS"] += 1 - elif st in ("ISSUES", "WARNING", "FAILED", "FAILURE"): - counts["ISSUES"] += 1 - elif st in ("BLOCKED",): - counts["BLOCKED"] += 1 - elif st in ("RUNNING", "IN_PROGRESS"): - counts["Running"] += 1 - else: - counts["Queued"] += 1 - - summary_parts = [ - f"**Total Tasks:** {len(self._states)}", - f"**Queued:** {counts['Queued']}", - f"**Running:** {counts['Running']}", - f"**PASS:** {counts['PASS']}", - f"**ISSUES:** {counts['ISSUES']}", - f"**BLOCKED:** {counts['BLOCKED']}", - ] - lines.append(" | ".join(summary_parts) + "\n") - - lines.append( - "| Task Index | Model | Active Phase / Tool | Elapsed Time | Status Badge | Conversation Deep Link |" - ) - lines.append("|:---:|:---:|:---|:---:|:---:|:---|") - - sorted_indices = sorted(self._states.keys()) - for idx in sorted_indices: - st = self._states[idx] - model = st.model - active_disp = st.get_active_display() - elapsed_str = format_elapsed_time(st.get_elapsed_seconds(now=now)) - badge = st.get_badge() - conv_url = format_conversation_url(self.session_id, idx) - conv_link = f"[{conv_url}]({conv_url})" - lines.append(f"| {idx} | {model} | {active_disp} | {elapsed_str} | {badge} | {conv_link} |") - - lines.append("") - ts_str = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S UTC") - lines.append(f"*Last updated: {ts_str}*") - return "\n".join(lines) + "\n" - - def write(self, now: Optional[float] = None) -> Path: - content = self.render(now=now) - target_path = self.dashboard_path - target_path.parent.mkdir(parents=True, exist_ok=True) - - fd, temp_path = tempfile.mkstemp( - dir=str(target_path.parent), - prefix=".swarm_dashboard_", - suffix=".tmp", - ) - try: - with os.fdopen(fd, "w", encoding="utf-8") as f: - f.write(content) - f.flush() - os.fsync(f.fileno()) - os.replace(temp_path, target_path) - except Exception: - if os.path.exists(temp_path): - try: - os.unlink(temp_path) - except Exception: - pass - raise - return target_path - - -__all__ = [ - "STATUS_BADGES", - "MILESTONE_REGEX", - "SwarmDashboardWriter", - "TaskDashboardState", - "colorize", - "format_cloud_logging_url", - "format_cloud_run_execution_url", - "format_cloud_run_url", - "format_elapsed_time", - "format_gcs_console_url", - "format_gcs_url", - "format_log_viewer_url", - "format_monitored_line", - "format_status_badge", - "format_tool_snippet", - "parse_milestone_log", -] diff --git a/skills/swarm/scripts/transcript_projector.py b/skills/swarm/scripts/transcript_projector.py deleted file mode 100644 index e773fda..0000000 --- a/skills/swarm/scripts/transcript_projector.py +++ /dev/null @@ -1,499 +0,0 @@ -#!/usr/bin/env python3 -""" -Shadow Transcript Projector for Cloud Swarm. - -Projects real-time container log telemetry streams into Antigravity session -transcripts located in /brain/cloud--task-/. -Provides per-task locking, atomic file replacement, and telemetry event deduplication. -""" - -from datetime import datetime, timezone -import json -import os -from pathlib import Path -import re -import shutil -import tempfile -import threading -import time -from typing import Any, Dict, List, Optional, Set, Tuple, Union - -TELEMETRY_REGEX = re.compile(r"^\[TELEMETRY\](?:\s+\[TASK\s+(\d+)\])?\s+(.*)$") - - -def resolve_app_data_dir(custom_path: Optional[Union[str, Path]] = None) -> Path: - if custom_path: - return Path(custom_path).expanduser().resolve() - env_app_dir = os.environ.get("ANTIGRAVITY_APP_DATA_DIR") or os.environ.get("APP_DATA_DIR") - if env_app_dir: - return Path(env_app_dir).expanduser().resolve() - for cand in [ - Path(os.path.expanduser("~/.gemini/antigravity")), - Path(os.path.expanduser("~/.gemini/antigravity-ide")), - ]: - if cand.exists(): - return cand.resolve() - return Path(os.path.expanduser("~/.gemini/antigravity")).resolve() - - -def format_conversation_url(session_id: str, task_index: int) -> str: - return f"conversation://cloud-{session_id}-task-{task_index}" - - -def get_task_conversation_id(session_id: str, task_index: int) -> str: - return f"cloud-{session_id}-task-{task_index}" - - -def get_task_brain_dir( - session_id: str, - task_index: int, - app_data_dir: Optional[Union[str, Path]] = None, -) -> Path: - return resolve_app_data_dir(app_data_dir) / "brain" / get_task_conversation_id(session_id, task_index) - - -def initialize_shadow_transcript( - session_id: str, - task_index: int, - task_brief: str = "", - app_data_dir: Optional[Union[str, Path]] = None, -) -> Tuple[Path, Path]: - task_dir = get_task_brain_dir(session_id, task_index, app_data_dir) - logs_dir = task_dir / ".system_generated" / "logs" - logs_dir.mkdir(parents=True, exist_ok=True) - primary_file = task_dir / "transcript.jsonl" - system_file = logs_dir / "transcript.jsonl" - - content = "" - if task_brief: - user_entry = { - "step_index": 0, - "source": "USER", - "type": "USER_INPUT", - "status": "DONE", - "created_at": datetime.now(timezone.utc).isoformat(), - "content": task_brief, - } - content = json.dumps(user_entry) + "\n" - - primary_file.write_text(content, encoding="utf-8") - system_file.write_text(content, encoding="utf-8") - return primary_file, system_file - - -def cleanup_session( - session_id: str, - app_data_dir: Optional[Union[str, Path]] = None, - preserve_transcripts: bool = True, - temp_dir: Optional[Union[str, Path]] = None, - bucket_name: Optional[str] = None, - messenger: Optional[Any] = None, - clean_mailboxes: bool = True, -) -> Dict[str, Any]: - app_dir = resolve_app_data_dir(app_data_dir) - brain_dir = app_dir / "brain" - preserved_dirs: List[str] = [] - if brain_dir.exists(): - pattern = f"cloud-{session_id}-task-*" - for task_dir in brain_dir.glob(pattern): - if task_dir.is_dir(): - preserved_dirs.append(str(task_dir)) - if temp_dir and Path(temp_dir).exists(): - try: - shutil.rmtree(temp_dir) - except Exception: - pass - - mailboxes_cleaned = 0 - if clean_mailboxes: - if messenger is not None and hasattr(messenger, "cleanup_mailboxes"): - try: - mailboxes_cleaned = messenger.cleanup_mailboxes() - except Exception: - pass - elif bucket_name: - try: - from storage_messenger import StorageMessenger - msg = StorageMessenger( - bucket_name=bucket_name, - session_id=session_id, - is_worker=False, - ) - mailboxes_cleaned = msg.cleanup_mailboxes() - except Exception: - pass - - return { - "session_id": session_id, - "transcripts_preserved": preserve_transcripts, - "preserved_directories": preserved_dirs, - "mailboxes_cleaned": mailboxes_cleaned, - } - - -def is_telemetry_line(line: str) -> bool: - if not line or not isinstance(line, str): - return False - s = line.strip() - return "[TELEMETRY]" in s or '"event":' in s or '"type": "PLANNER_RESPONSE"' in s or '"type":"PLANNER_RESPONSE"' in s - - -def parse_telemetry_line(line: str) -> Optional[Dict[str, Any]]: - if not line or not isinstance(line, str): - return None - s = line.strip() - if not s: - return None - - m = TELEMETRY_REGEX.search(s) - if m: - raw_task_idx, json_str = m.group(1), m.group(2) - try: - payload = json.loads(json_str) - if not isinstance(payload, dict): - return None - if raw_task_idx is not None and "task_index" not in payload: - try: - payload["task_index"] = int(raw_task_idx) - except ValueError: - return None - return payload - except Exception: - return None - - if s.startswith("{") and s.endswith("}"): - try: - payload = json.loads(s) - if isinstance(payload, dict) and ("event" in payload or "type" in payload): - return payload - except Exception: - return None - - return None - - -class ShadowTranscriptProjector: - def __init__( - self, - session_id: str, - app_data_dir: Optional[Union[str, Path]] = None, - task_count: int = 1, - ): - self.session_id = session_id - self.app_data_dir = resolve_app_data_dir(app_data_dir) - self.task_count = task_count - self.projection_latencies: List[float] = [] - self._last_entries: Dict[int, Dict[str, Any]] = {} - self._states: Dict[int, Dict[str, Any]] = {} - self._task_locks: Dict[int, threading.Lock] = {} - self._lock = threading.Lock() - self._seen_events: Set[Tuple[int, str, Any, Any]] = set() - - def _get_task_lock(self, task_index: int) -> threading.Lock: - with self._lock: - if task_index not in self._task_locks: - self._task_locks[task_index] = threading.Lock() - return self._task_locks[task_index] - - def get_task_dir(self, task_index: int) -> Path: - return get_task_brain_dir(self.session_id, task_index, self.app_data_dir) - - def get_transcript_files(self, task_index: int) -> Tuple[Path, Path]: - task_dir = self.get_task_dir(task_index) - return task_dir / "transcript.jsonl", task_dir / ".system_generated" / "logs" / "transcript.jsonl" - - def init_task(self, task_index: int, task_brief: str = "") -> Tuple[Path, Path]: - with self._get_task_lock(task_index): - primary, system = initialize_shadow_transcript( - session_id=self.session_id, - task_index=task_index, - task_brief=task_brief, - app_data_dir=self.app_data_dir, - ) - self._states[task_index] = { - "step_index": 0 if task_brief else -1, - "primary_file": primary, - "system_file": system, - "task_dir": primary.parent, - } - return primary, system - - def _get_or_init_state(self, task_index: int, *, acquire_lock: bool = True) -> Dict[str, Any]: - if acquire_lock: - with self._get_task_lock(task_index): - return self._get_or_init_state(task_index, acquire_lock=False) - - if task_index not in self._states: - primary, system = self.get_transcript_files(task_index) - if not primary.exists() or not system.exists(): - initialize_shadow_transcript(self.session_id, task_index, app_data_dir=self.app_data_dir) - step_idx = -1 - if primary.exists(): - try: - for line in primary.read_text(encoding="utf-8").splitlines(): - if line.strip(): - e = json.loads(line) - step_idx = max(step_idx, e.get("step_index", -1)) - except Exception: - pass - self._states[task_index] = { - "step_index": step_idx, - "primary_file": primary, - "system_file": system, - "task_dir": primary.parent, - } - return self._states[task_index] - - def _write_entry(self, task_index: int, entry: Dict[str, Any], *, acquire_lock: bool = True) -> None: - if acquire_lock: - with self._get_task_lock(task_index): - return self._write_entry(task_index, entry, acquire_lock=False) - - self._last_entries[task_index] = entry - primary, system = self.get_transcript_files(task_index) - line = json.dumps(entry) + "\n" - for p in (primary, system): - p.parent.mkdir(parents=True, exist_ok=True) - with open(p, "a", encoding="utf-8") as f: - f.write(line) - f.flush() - - def _update_last_entry(self, task_index: int, entry: Dict[str, Any], *, acquire_lock: bool = True) -> None: - if acquire_lock: - with self._get_task_lock(task_index): - return self._update_last_entry(task_index, entry, acquire_lock=False) - - self._last_entries[task_index] = entry - primary, system = self.get_transcript_files(task_index) - for p in (primary, system): - if not p.exists(): - continue - lines = [line for line in p.read_text(encoding="utf-8").splitlines() if line.strip()] - if lines: - lines[-1] = json.dumps(entry) - p.parent.mkdir(parents=True, exist_ok=True) - tmp_path = None - try: - with tempfile.NamedTemporaryFile( - dir=p.parent, delete=False, mode="w", encoding="utf-8" - ) as tmp: - tmp_path = tmp.name - tmp.write("\n".join(lines) + "\n") - tmp.flush() - os.fsync(tmp.fileno()) - os.replace(tmp_path, p) - except Exception: - if tmp_path and os.path.exists(tmp_path): - try: - os.unlink(tmp_path) - except OSError: - pass - raise - - def _read_last_entry(self, task_index: int, *, acquire_lock: bool = True) -> Optional[Dict[str, Any]]: - if acquire_lock: - with self._get_task_lock(task_index): - return self._read_last_entry(task_index, acquire_lock=False) - - if task_index in self._last_entries: - return self._last_entries[task_index] - - primary, _ = self.get_transcript_files(task_index) - if not primary.exists(): - return None - lines = [line for line in primary.read_text(encoding="utf-8").splitlines() if line.strip()] - if not lines: - return None - try: - return json.loads(lines[-1]) - except Exception: - return None - - def process_log_line(self, line: str) -> Optional[Dict[str, Any]]: - try: - payload = parse_telemetry_line(line) - if not payload: - return None - - task_idx = int(payload.get("task_index", 0)) - event = payload.get("event") or payload.get("type", "") - event_ts = payload.get("timestamp") - - step_index_or_id = payload.get("step_index") - if step_index_or_id is None: - step_index_or_id = payload.get("call_id") or payload.get("id") or "" - if isinstance(step_index_or_id, (dict, list)): - step_index_or_id = json.dumps(step_index_or_id, sort_keys=True) - - event_key = (task_idx, event, step_index_or_id, event_ts) - - with self._get_task_lock(task_idx): - with self._lock: - if event_key in self._seen_events: - return None - self._seen_events.add(event_key) - - if event_ts is not None: - try: - if isinstance(event_ts, (int, float)): - t_log = float(event_ts) - else: - t_log = datetime.fromisoformat(str(event_ts).replace("Z", "+00:00")).timestamp() - latency = max(0.0, time.time() - t_log) - with self._lock: - self.projection_latencies.append(latency) - except Exception: - pass - - created_at = datetime.now(timezone.utc).isoformat() - state = self._get_or_init_state(task_idx, acquire_lock=False) - projected_entry = None - - if event in ("user_input", "USER_INPUT"): - last_entry = self._read_last_entry(task_idx, acquire_lock=False) - if last_entry and last_entry.get("type") == "USER_INPUT": - return last_entry - state["step_index"] += 1 - projected_entry = { - "step_index": state["step_index"], - "source": "USER", - "type": "USER_INPUT", - "status": "DONE", - "created_at": created_at, - "content": payload.get("content", ""), - } - self._write_entry(task_idx, projected_entry, acquire_lock=False) - - elif event in ("thought", "THOUGHT"): - thought_text = payload.get("thought") or payload.get("content", "") - last_entry = self._read_last_entry(task_idx, acquire_lock=False) - if last_entry and last_entry.get("type") == "PLANNER_RESPONSE" and not last_entry.get("tool_calls"): - existing_thought = last_entry.get("thinking", "") - last_entry["thinking"] = ( - f"{existing_thought}\n{thought_text}".strip() if existing_thought else thought_text - ) - self._update_last_entry(task_idx, last_entry, acquire_lock=False) - projected_entry = last_entry - else: - state["step_index"] += 1 - projected_entry = { - "step_index": state["step_index"], - "source": "MODEL", - "type": "PLANNER_RESPONSE", - "status": "DONE", - "created_at": created_at, - "thinking": thought_text, - "tool_calls": [], - "content": "", - } - self._write_entry(task_idx, projected_entry, acquire_lock=False) - - elif event in ("tool_call", "TOOL_CALL"): - tool_name = payload.get("tool_name", "tool") - tool_args = payload.get("args") or payload.get("tool_args", {}) - call_id = payload.get("call_id") or f"call_{state['step_index'] + 1}" - tool_call_obj = {"name": tool_name, "args": tool_args, "id": call_id} - last_entry = self._read_last_entry(task_idx, acquire_lock=False) - if last_entry and last_entry.get("type") == "PLANNER_RESPONSE": - calls = last_entry.get("tool_calls", []) - calls.append(tool_call_obj) - last_entry["tool_calls"] = calls - self._update_last_entry(task_idx, last_entry, acquire_lock=False) - projected_entry = last_entry - else: - state["step_index"] += 1 - projected_entry = { - "step_index": state["step_index"], - "source": "MODEL", - "type": "PLANNER_RESPONSE", - "status": "DONE", - "created_at": created_at, - "thinking": "", - "tool_calls": [tool_call_obj], - "content": "", - } - self._write_entry(task_idx, projected_entry, acquire_lock=False) - - elif event in ("tool_result", "TOOL_RESPONSE", "tool_response"): - tool_name = payload.get("tool_name", "tool") - output = payload.get("output", payload.get("result", "")) - success = bool(payload.get("success", True)) - call_id = payload.get("call_id", "") - state["step_index"] += 1 - projected_entry = { - "step_index": state["step_index"], - "source": "TOOL", - "type": "TOOL_RESPONSE", - "status": "DONE", - "created_at": created_at, - "tool_name": tool_name, - "content": output if isinstance(output, str) else json.dumps(output, default=str), - "output": output, - "success": success, - "call_id": call_id, - } - self._write_entry(task_idx, projected_entry, acquire_lock=False) - - elif event in ("agent_response", "AGENT_RESPONSE"): - resp_content = payload.get("content", "") - last_entry = self._read_last_entry(task_idx, acquire_lock=False) - if last_entry and last_entry.get("type") == "PLANNER_RESPONSE" and not last_entry.get("tool_calls"): - last_entry["content"] = resp_content - self._update_last_entry(task_idx, last_entry, acquire_lock=False) - projected_entry = last_entry - else: - state["step_index"] += 1 - projected_entry = { - "step_index": state["step_index"], - "source": "MODEL", - "type": "PLANNER_RESPONSE", - "status": "DONE", - "created_at": created_at, - "thinking": "", - "tool_calls": [], - "content": resp_content, - } - self._write_entry(task_idx, projected_entry, acquire_lock=False) - - elif event in ("PLANNER_RESPONSE", "planner_response"): - state["step_index"] += 1 - projected_entry = { - "step_index": state["step_index"], - "source": "MODEL", - "type": "PLANNER_RESPONSE", - "status": "DONE", - "created_at": created_at, - "thinking": payload.get("thinking", ""), - "tool_calls": payload.get("tool_calls", []), - "content": payload.get("content", ""), - } - self._write_entry(task_idx, projected_entry, acquire_lock=False) - - return projected_entry - except Exception: - return None - - def measure_projection_latency(self, line: str) -> Optional[float]: - self.process_log_line(line) - return self.get_last_latency() - - def get_last_latency(self) -> Optional[float]: - with self._lock: - return self.projection_latencies[-1] if self.projection_latencies else None - - def get_conversation_url(self, task_index: int) -> str: - return format_conversation_url(self.session_id, task_index) - - -__all__ = [ - "TELEMETRY_REGEX", - "ShadowTranscriptProjector", - "cleanup_session", - "format_conversation_url", - "get_task_brain_dir", - "get_task_conversation_id", - "initialize_shadow_transcript", - "is_telemetry_line", - "parse_telemetry_line", - "resolve_app_data_dir", -] diff --git a/skills/swarm/scripts/worker/__init__.py b/skills/swarm/scripts/worker/__init__.py deleted file mode 100644 index 0b00ac1..0000000 --- a/skills/swarm/scripts/worker/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Worker modular components.""" diff --git a/skills/swarm/scripts/worker/agent_hooks.py b/skills/swarm/scripts/worker/agent_hooks.py deleted file mode 100644 index 6ac6f44..0000000 --- a/skills/swarm/scripts/worker/agent_hooks.py +++ /dev/null @@ -1,367 +0,0 @@ -#!/usr/bin/env python3 -""" -Agent hooks and loop stagnancy tracking for Cloud Run worker container. -""" - -from dataclasses import dataclass, field -import hashlib -import json -import sys -import time -from typing import Any, Dict, List, Optional, Tuple - - -def emit_milestone(task_index: int, phase: str, detail: str = "") -> None: - cw = sys.modules.get("cloud_worker") - if cw and hasattr(cw, "emit_milestone") and cw.emit_milestone is not emit_milestone: - return cw.emit_milestone(task_index, phase, detail) - msg = f"[MILESTONE] [TASK {task_index}] [PHASE: {phase}]" - if detail: - msg += f" {detail}" - print(msg, flush=True) - - -def emit_thought(task_index_or_thought: Any, thought: Optional[str] = None, *args: Any, **kwargs: Any) -> None: - cw = sys.modules.get("cloud_worker") - if cw and hasattr(cw, "emit_thought"): - return cw.emit_thought(task_index_or_thought, thought, *args, **kwargs) - - -def emit_tool_invocation( - task_index: int, - tool_name: str, - args: Any = None, - call_id: Optional[str] = None, - *extra_args: Any, - **kwargs: Any, -) -> None: - cw = sys.modules.get("cloud_worker") - if cw and hasattr(cw, "emit_tool_invocation"): - return cw.emit_tool_invocation(task_index, tool_name, args, call_id=call_id, *extra_args, **kwargs) - - -def emit_tool_result( - task_index: int, - tool_name: str, - output: Any = "", - success: bool = True, - call_id: Optional[str] = None, - duration_s: float = 0.0, - *extra_args: Any, - **kwargs: Any, -) -> None: - cw = sys.modules.get("cloud_worker") - if cw and hasattr(cw, "emit_tool_result"): - return cw.emit_tool_result( - task_index, - tool_name, - output, - success=success, - call_id=call_id, - duration_s=duration_s, - *extra_args, - **kwargs, - ) - - -@dataclass -class ToolInvocationRecord: - tool_name: str - args_hash: str - output_hash: str = "" - timestamp: float = field(default_factory=time.time) - duration_s: float = 0.0 - success: bool = True - args_summary: str = "" - - @classmethod - def create(cls, tool_name: str, args: Any = None) -> "ToolInvocationRecord": - args = args if args is not None else {} - try: - canonical = json.dumps(args, sort_keys=True, default=str) - except Exception: - canonical = str(args) - args_hash = hashlib.sha256(canonical.encode("utf-8")).hexdigest()[:12] - if isinstance(args, dict): - args_summary = ", ".join(f"{k}={v!r}" for k, v in args.items()) - else: - args_summary = str(args) - return cls( - tool_name=tool_name, - args_hash=args_hash, - output_hash="", - timestamp=time.time(), - duration_s=0.0, - success=True, - args_summary=args_summary, - ) - - -class StagnancyTracker: - def __init__(self, window_size: int = 10): - self.window_size = window_size - self.window: List[ToolInvocationRecord] = [] - self._last_key: Optional[Tuple[str, str]] = None - self._consecutive_count: int = 0 - - def record_start(self, record: Any) -> Tuple[bool, int, str]: - try: - if not isinstance(record, ToolInvocationRecord): - return False, 1, "" - - key = (record.tool_name, record.args_hash) - if self._last_key == key: - self._consecutive_count += 1 - else: - self._last_key = key - self._consecutive_count = 1 - - self.window.append(record) - if len(self.window) > self.window_size: - self.window.pop(0) - - is_stagnant = self._consecutive_count >= 3 - warning = "" - if is_stagnant: - warning = ( - f"Warning: Tool \x27{record.tool_name}\x27 has been executed {self._consecutive_count} " - f"consecutive times with identical arguments. You may be stuck in a loop; " - f"consider trying an alternative tool or different parameters." - ) - return is_stagnant, self._consecutive_count, warning - except Exception: - return False, 1, "" - - def record_result( - self, - tool_name: str, - args_hash: str, - output: Any, - success: bool, - duration_s: float, - ) -> None: - try: - out_str = output if isinstance(output, str) else str(output) - out_hash = hashlib.sha256(out_str.encode("utf-8")).hexdigest()[:12] - for rec in reversed(self.window): - if rec.tool_name == tool_name and rec.args_hash == args_hash: - rec.output_hash = out_hash - rec.success = success - rec.duration_s = duration_s - break - except Exception: - pass - - -def create_agent_hooks( - messenger: Optional[Any], - task_index: int, - tracker: StagnancyTracker, - hooks_module: Optional[Any] = None, - types_module: Optional[Any] = None, -) -> List[Any]: - h = hooks_module - t = types_module - if h is None or t is None: - try: - from google.antigravity.hooks import hooks as mod_hooks - from google.antigravity import types as mod_types - - h = h or mod_hooks - t = t or mod_types - except (ImportError, AttributeError): - pass - - if h is None or t is None: - return [] - - in_flight: List[Dict[str, Any]] = [] - - @h.pre_tool_call_decide - async def pre_tool_call_decide(tool_call: Any) -> Any: - steer_context = None - if messenger and hasattr(messenger, "check_steer_instructions"): - try: - steer_envelopes = messenger.check_steer_instructions() or [] - except Exception: - steer_envelopes = [] - for item in steer_envelopes: - instruction = "" - if isinstance(item, str): - instruction = item - elif isinstance(item, dict): - instruction = item.get("instruction") or item.get("text") or "" - elif hasattr(item, "payload") and isinstance(item.payload, dict): - instruction = item.payload.get("instruction") or item.payload.get("text") or "" - elif hasattr(item, "instruction"): - instruction = getattr(item, "instruction", "") - - if not instruction: - continue - - trimmed = instruction.strip() - if trimmed.startswith("ABORT") or trimmed.startswith("CANCEL"): - emit_milestone(task_index, "ABORT_REQUESTED", instruction) - try: - return t.HookResult( - allow=False, - error_message=f"Execution aborted by orchestrator: {instruction}", - ) - except TypeError: - return t.HookResult(allow=False) - else: - emit_milestone(task_index, "STEER_APPLIED", instruction) - steer_context = instruction - - tool_name = getattr(tool_call, "name", "tool") - tool_args = getattr(tool_call, "args", {}) - record = ToolInvocationRecord.create(tool_name, tool_args) - is_stagnant, count, warning = tracker.record_start(record) - in_flight.append({ - "tool_name": tool_name, - "args_hash": record.args_hash, - "t0": time.time(), - "id": id(tool_call), - }) - - emit_milestone(task_index, "TOOL_START", f"{tool_name}: {record.args_summary[:60]}") - emit_tool_invocation(task_index, tool_name, tool_args, call_id=str(record.args_hash)) - - if is_stagnant: - emit_milestone(task_index, "POTENTIAL_LOOP", f"{tool_name} (repeated {count}x)") - print( - f"[ALARM] [TASK {task_index}] [POTENTIAL_LOOP] Tool '{tool_name}' repeated {count} times with identical inputs.", - flush=True, - ) - combined_context = f"{steer_context}\n\n{warning}" if steer_context else warning - try: - return t.HookResult(allow=True, custom_context=combined_context) - except TypeError: - return t.HookResult(allow=True) - - if steer_context: - try: - return t.HookResult(allow=True, custom_context=steer_context) - except TypeError: - return t.HookResult(allow=True) - - return t.HookResult(allow=True) - - @h.post_tool_call - async def post_tool_call(data: Any) -> None: - matched = None - call_obj = getattr(data, "call", None) - data_id = getattr(data, "id", None) or (getattr(call_obj, "id", None) if call_obj else None) - data_name = getattr(data, "name", getattr(data, "tool_name", None)) - if data_name is None and call_obj is not None: - data_name = getattr(call_obj, "name", getattr(call_obj, "tool_name", None)) - - match_idx = -1 - for idx, entry in enumerate(in_flight): - if data_id is not None and entry.get("id") == data_id: - match_idx = idx - break - if entry.get("id") == id(data) or (call_obj is not None and entry.get("id") == id(call_obj)): - match_idx = idx - break - if data_name and entry.get("tool_name") == data_name: - match_idx = idx - break - - if match_idx != -1: - matched = in_flight.pop(match_idx) - elif in_flight: - matched = in_flight.pop(0) - - if matched: - tool_name = matched["tool_name"] - args_hash = matched["args_hash"] - t0 = matched.get("t0") - duration_s = max(0.0, time.time() - t0) if t0 is not None else 0.0 - else: - tool_name = getattr(data, "name", getattr(data, "tool_name", "tool")) - args_hash = "" - duration_s = 0.0 - - output = getattr(data, "output", getattr(data, "result", data)) - error = getattr(data, "error", None) - success = (error is None) and not isinstance(data, Exception) - - tracker.record_result(tool_name, args_hash, output, success, duration_s) - emit_milestone(task_index, "TOOL_END", f"{tool_name} in {duration_s:.1f}s") - emit_tool_result( - task_index, - tool_name, - output, - success=success, - call_id=str(matched.get("id", "")) if matched else "", - duration_s=duration_s, - ) - - hooks_to_register = [pre_tool_call_decide, post_tool_call] - if hasattr(h, "on_tool_error"): - @h.on_tool_error - async def on_tool_error(error: Any) -> Any: - if in_flight: - matched = in_flight.pop(0) - t0 = matched.get("t0") - duration_s = max(0.0, time.time() - t0) if t0 is not None else 0.0 - tracker.record_result( - matched["tool_name"], - matched["args_hash"], - str(error), - False, - duration_s, - ) - emit_milestone(task_index, "TOOL_ERROR", f"{matched['tool_name']}: {str(error)[:60]}") - emit_tool_result( - task_index, - matched["tool_name"], - str(error), - success=False, - call_id=str(matched.get("id", "")), - duration_s=duration_s, - ) - else: - emit_milestone(task_index, "TOOL_ERROR", str(error)[:80]) - emit_tool_result(task_index, "tool", str(error), success=False) - return None - hooks_to_register.append(on_tool_error) - - if hasattr(h, "on_thought"): - @h.on_thought - async def on_thought(thought_content: Any) -> None: - emit_thought(task_index, str(thought_content)) - hooks_to_register.append(on_thought) - elif hasattr(h, "on_model_thought"): - @h.on_model_thought - async def on_model_thought(thought_content: Any) -> None: - emit_thought(task_index, str(thought_content)) - hooks_to_register.append(on_model_thought) - - return hooks_to_register - - -def create_ask_orchestrator_tool( - messenger: Any, - task_index: int, - timeout_seconds: float = 600.0, -): - async def ask_orchestrator(question: str, context: str = "") -> str: - emit_milestone(task_index, "WAITING_FOR_ORCHESTRATOR", question[:80]) - envelope = messenger.send_question(question=question, context=context) - reply = messenger.wait_for_reply(seq=envelope.seq, timeout_seconds=timeout_seconds) - if reply is None: - emit_milestone( - task_index, - "ORCHESTRATOR_TIMEOUT", - f"Seq {envelope.seq} timed out. Proceeding autonomously.", - ) - return ( - "Orchestrator did not respond within timeout. " - "Use your best autonomous judgment and document your assumptions." - ) - emit_milestone(task_index, "ORCHESTRATOR_REPLY_RECEIVED", f"Seq {envelope.seq}") - return reply - - return ask_orchestrator diff --git a/skills/swarm/scripts/worker/execution.py b/skills/swarm/scripts/worker/execution.py deleted file mode 100644 index 6ae710b..0000000 --- a/skills/swarm/scripts/worker/execution.py +++ /dev/null @@ -1,183 +0,0 @@ -import os -import re -import signal -import subprocess -import threading -import time -import uuid -from collections.abc import Mapping -from dataclasses import dataclass, fields -from pathlib import Path - -LIMIT_ENV = { - "max_agent_turns": "AGYSTACK_MAX_AGENT_TURNS", - "command_timeout_s": "COMMAND_TIMEOUT", - "verify_timeout_s": "VERIFY_TIMEOUT", -} -TERMINAL_STATES = frozenset({"PASS", "ISSUES", "BLOCKED"}) -_UNSET = object() - - -def _positive_int(value, name): - if isinstance(value, str) and re.fullmatch(r"[0-9]+", value): - value = int(value) - if type(value) is not int or value <= 0: - raise ValueError(f"{name} must be a positive integer") - return value - - -@dataclass(frozen=True) -class ExecutionLimits: - max_agent_turns: int = 30 - command_timeout_s: int = 300 - verify_timeout_s: int = 300 - - def __post_init__(self): - for field in fields(self): - if type(getattr(self, field.name)) is not int: - raise ValueError(f"{field.name} must be a positive integer") - _positive_int(getattr(self, field.name), field.name) - - -def _limit_fields(value): - if not isinstance(value, Mapping): - raise ValueError("execution_limits must be an object") - unknown = value.keys() - LIMIT_ENV.keys() - if unknown: - raise ValueError(f"Unknown execution_limits fields: {sorted(unknown)}") - for name, raw in value.items(): - if type(raw) is not int: - raise ValueError(f"{name} must be a positive integer") - return {name: _positive_int(raw, name) for name, raw in value.items()} - - -def resolve_execution_limits(task_limits=_UNSET, *, environ=None, command_default=300): - env = os.environ if environ is None else environ - values = dict(max_agent_turns=30, command_timeout_s=command_default, verify_timeout_s=300) - values.update({name: _positive_int(env[key], key) for name, key in LIMIT_ENV.items() if key in env}) - if task_limits is not _UNSET: - values.update(_limit_fields(task_limits)) - return ExecutionLimits(**values) - - -def limits_for_task(task_item, *, command_default=300): - overrides = task_item.get("execution_limits", {}) if isinstance(task_item, dict) else {} - return resolve_execution_limits(overrides, command_default=command_default) - - -def evaluate_agent_status(agent_text): - declarations = [] - lines = agent_text.rstrip().splitlines() - fence = None - for index, line in enumerate(lines): - stripped = line.strip() - marker = re.match(r"^(`{3,}|~{3,})", stripped) - if marker: - token = marker.group(1) - if fence is None: - fence = token - elif token[0] == fence[0] and len(token) >= len(fence) and stripped == token: - fence = None - continue - if fence is not None or line.startswith((" ", "\t")): - continue - match = re.fullmatch(r"\[STATUS: (PASS|ISSUES|BLOCKED)\]", stripped) - if match: - declarations.append((index, match.group(1))) - elif re.fullmatch(r"\[STATUS\b.*\]", stripped, re.IGNORECASE): - declarations.append((index, "ISSUES")) - if len(declarations) == 1 and declarations[0][0] == len(lines) - 1: - return declarations[0][1], agent_text - return "ISSUES", agent_text - - -CREDENTIAL_PATTERNS = [ - re.compile(r"ghp_[A-Za-z0-9_]{36,}"), - re.compile(r"AIza[0-9A-Za-z-_]{35}"), - re.compile(r"github_pat_[0-9A-Za-z_]{20,}"), - re.compile(r"ya29\.[0-9A-Za-z-_]+"), - re.compile(r"Bearer [A-Za-z0-9_\-\.]+"), -] - - -def scrub_credentials(text): - for pattern in CREDENTIAL_PATTERNS: - text = pattern.sub("[REDACTED]", text) - return text - - -def write_diagnostic(repo_dir, name, text): - directory = Path(repo_dir) / ".agystack/diagnostics" - directory.mkdir(parents=True, exist_ok=True) - path = directory / f"{name}-{uuid.uuid4().hex}.log" - path.write_text(scrub_credentials(text)[-262144:], encoding="utf-8") - return path - - -def exhaustion_result(repo_dir, limit, consumed, last_tool, last_response): - summary = ( - f"Agent turn limit exhausted: limit={limit}, consumed={consumed}, " - f"last_tool={last_tool or 'none'}, last_response={last_response[-4096:]!r}" - ) - summary = scrub_credentials(summary) - write_diagnostic(repo_dir, "agent-exhaustion", summary) - return "ISSUES", summary - - -def run_bounded_shell(command, repo_dir, timeout_s, *, label="command"): - buffers = [bytearray(), bytearray()] - shell_args = ["bash", "-o", "pipefail", "-c", command] if os.name == "posix" else command - try: - process = subprocess.Popen( - shell_args, - shell=os.name != "posix", - cwd=repo_dir, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - start_new_session=os.name == "posix", - ) - except OSError as exc: - error = scrub_credentials(str(exc)) - log_path = write_diagnostic(repo_dir, label, f"Command could not start: {error}") - return subprocess.CompletedProcess(command, 127, "", error), f"Exit code 127: {error}\nLog: {log_path}" - - def drain(stream, buffer): - with stream: - while chunk := os.read(stream.fileno(), 8192): - buffer.extend(chunk) - del buffer[:-131072] - - readers = [ - threading.Thread(target=drain, args=(stream, buffer), daemon=True) - for stream, buffer in zip((process.stdout, process.stderr), buffers) - ] - for reader in readers: - reader.start() - timed_out = False - deadline = time.monotonic() + timeout_s - try: - process.wait(timeout=timeout_s) - for reader in readers: - reader.join(timeout=max(0, deadline - time.monotonic())) - if any(reader.is_alive() for reader in readers): - raise subprocess.TimeoutExpired(command, timeout_s) - except subprocess.TimeoutExpired: - timed_out = True - if os.name == "posix": - try: - os.killpg(process.pid, signal.SIGKILL) - except ProcessLookupError: - pass - else: - process.kill() - process.wait() - for reader in readers: - reader.join(timeout=1) - stdout, stderr = [scrub_credentials(bytes(buffer).decode("utf-8", errors="replace")) for buffer in buffers] - if timed_out: - stderr += f"\nCommand timed out after {timeout_s} seconds." - returncode = 124 if timed_out else process.returncode - output = f"Exit code {returncode}:\n{stdout}\n{stderr}" - log_path = write_diagnostic(repo_dir, label, output) - excerpt = f"Exit code {returncode}:\n{stdout[-8192:]}\n{stderr[-8192:]}\nLog: {log_path}" - return subprocess.CompletedProcess(command, returncode, stdout, stderr), excerpt diff --git a/skills/swarm/scripts/worker/partner_engine.py b/skills/swarm/scripts/worker/partner_engine.py deleted file mode 100644 index 35fa420..0000000 --- a/skills/swarm/scripts/worker/partner_engine.py +++ /dev/null @@ -1,1022 +0,0 @@ -#!/usr/bin/env python3 -""" -Partner model engine for Vertex AI Model Garden endpoints (Claude and Fable). -Handles model alias resolution, workspace tool execution with pre-tool safety -interception, AnthropicVertex client integration, and autonomous turn loops. -""" - -import os -import sys -import time -from pathlib import Path -from typing import Any, Dict, List, Optional, Tuple - -from .execution import ExecutionLimits, evaluate_agent_status as _evaluate_agent_status, exhaustion_result, limits_for_task, run_bounded_shell - -try: - from pre_tool_safety import evaluate_safety -except ImportError: - try: - hooks_dir = Path(__file__).resolve().parent.parent.parent.parent / "poteto-mode" / "scripts" / "hooks" - if hooks_dir.is_dir() and str(hooks_dir) not in sys.path: - sys.path.insert(0, str(hooks_dir)) - from pre_tool_safety import evaluate_safety - except Exception: - evaluate_safety = None - -DEFAULT_PARTNER_SYSTEM_PROMPT = """You are a specialized poteto coding delegate for agystack executing inside an isolated cloud worker container. -You implement surgical code edits, run test suites, verify outputs, and keep code and diffs clean and unslopped. - -Guidelines: -1. Implement the requested task directly and surgically in the workspace. -2. Maintain high engineering rigor: run test suites and verification commands before completing. -3. Keep diffs minimal and clean. Avoid narrating comments or speculative code. -4. End your final response with exactly one standalone unquoted line, outside code fences: [STATUS: PASS], [STATUS: ISSUES], or [STATUS: BLOCKED]. -""" - - -def emit_milestone(task_index: int, phase: str, detail: str = "") -> None: - cw = sys.modules.get("cloud_worker") - if cw and hasattr(cw, "emit_milestone") and cw.emit_milestone is not emit_milestone: - return cw.emit_milestone(task_index, phase, detail) - msg = f"[MILESTONE] [TASK {task_index}] [PHASE: {phase}]" - if detail: - msg += f" {detail}" - print(msg, flush=True) - - -def emit_thought(task_index_or_thought: Any, thought: Optional[str] = None, *args: Any, **kwargs: Any) -> None: - cw = sys.modules.get("cloud_worker") - if cw and hasattr(cw, "emit_thought") and cw.emit_thought is not emit_thought: - return cw.emit_thought(task_index_or_thought, thought, *args, **kwargs) - if thought is None and isinstance(task_index_or_thought, str): - task_idx = 0 - th = task_index_or_thought - elif isinstance(task_index_or_thought, int): - task_idx = task_index_or_thought - th = thought or "" - else: - task_idx = 0 - th = str(task_index_or_thought) - print(f"[THOUGHT] [TASK {task_idx}] {th}", flush=True) - - -def emit_tool_invocation(task_index: int, tool_name: str, tool_input: Any = None, *args: Any, **kwargs: Any) -> None: - cw = sys.modules.get("cloud_worker") - if cw and hasattr(cw, "emit_tool_invocation") and cw.emit_tool_invocation is not emit_tool_invocation: - return cw.emit_tool_invocation(task_index, tool_name, tool_input, *args, **kwargs) - if isinstance(tool_input, dict): - args_summary = ", ".join(f"{k}={v!r}" for k, v in tool_input.items()) - else: - args_summary = str(tool_input) - print(f"[TOOL_INVOCATION] [TASK {task_index}] [{tool_name}] {args_summary}", flush=True) - emit_milestone(task_index, "TOOL_START", f"{tool_name}: {args_summary[:60]}") - - -def emit_tool_result(task_index: int, tool_name: str, result: Any = "", *args: Any, **kwargs: Any) -> None: - cw = sys.modules.get("cloud_worker") - if cw and hasattr(cw, "emit_tool_result") and cw.emit_tool_result is not emit_tool_result: - return cw.emit_tool_result(task_index, tool_name, result, *args, **kwargs) - res_str = str(result) - summary = res_str[:200] if len(res_str) > 200 else res_str - print(f"[TOOL_RESULT] [TASK {task_index}] [{tool_name}] {summary}", flush=True) - emit_milestone(task_index, "TOOL_END", f"{tool_name}") - - -PARTNER_MODEL_ALIASES = { - # Claude 3.7 Sonnet - "claude-3-7-sonnet": "claude-3-7-sonnet@20250219", - "claude-3.7-sonnet": "claude-3-7-sonnet@20250219", - "claude-3-7-sonnet@20250219": "claude-3-7-sonnet@20250219", - "sonnet-3.7": "claude-3-7-sonnet@20250219", - "sonnet-3-7": "claude-3-7-sonnet@20250219", - "publishers/anthropic/models/claude-3-7-sonnet": "claude-3-7-sonnet@20250219", - "publishers/anthropic/models/claude-3.7-sonnet": "claude-3-7-sonnet@20250219", - "publishers/anthropic/models/claude-3-7-sonnet@20250219": "claude-3-7-sonnet@20250219", - - # Claude 3.5 Sonnet - "claude-3-5-sonnet": "claude-3-5-sonnet-v2@20241022", - "claude-3.5-sonnet": "claude-3-5-sonnet-v2@20241022", - "claude-3-5-sonnet-v2@20241022": "claude-3-5-sonnet-v2@20241022", - "claude-3.5-sonnet-v2@20241022": "claude-3-5-sonnet-v2@20241022", - "claude-3-5-sonnet-v2": "claude-3-5-sonnet-v2@20241022", - "claude-3.5-sonnet-v2": "claude-3-5-sonnet-v2@20241022", - "sonnet-5.5": "claude-3-5-sonnet-v2@20241022", - "sonnet-5-5": "claude-3-5-sonnet-v2@20241022", - "claude-5-5-sonnet": "claude-3-5-sonnet-v2@20241022", - "claude-5.5-sonnet": "claude-3-5-sonnet-v2@20241022", - "publishers/anthropic/models/claude-3-5-sonnet": "claude-3-5-sonnet-v2@20241022", - "publishers/anthropic/models/claude-3.5-sonnet": "claude-3-5-sonnet-v2@20241022", - "publishers/anthropic/models/claude-3-5-sonnet-v2@20241022": "claude-3-5-sonnet-v2@20241022", - "publishers/anthropic/models/claude-5-5-sonnet": "claude-3-5-sonnet-v2@20241022", - "publishers/anthropic/models/claude-5.5-sonnet": "claude-3-5-sonnet-v2@20241022", - - # Claude 3.5 Haiku - "claude-3-5-haiku": "claude-3-5-haiku@20241022", - "claude-3.5-haiku": "claude-3-5-haiku@20241022", - "claude-3-5-haiku@20241022": "claude-3-5-haiku@20241022", - "claude-3.5-haiku@20241022": "claude-3-5-haiku@20241022", - "haiku-3.5": "claude-3-5-haiku@20241022", - "haiku-3-5": "claude-3-5-haiku@20241022", - "publishers/anthropic/models/claude-3-5-haiku": "claude-3-5-haiku@20241022", - "publishers/anthropic/models/claude-3.5-haiku": "claude-3-5-haiku@20241022", - "publishers/anthropic/models/claude-3-5-haiku@20241022": "claude-3-5-haiku@20241022", - - # Claude 3 Opus - "claude-3-opus": "claude-3-opus@20240229", - "claude-3-opus@20240229": "claude-3-opus@20240229", - "opus-3": "claude-3-opus@20240229", - "opus-5.5": "claude-3-opus@20240229", - "opus-5-5": "claude-3-opus@20240229", - "claude-5-5-opus": "claude-3-opus@20240229", - "claude-5.5-opus": "claude-3-opus@20240229", - "publishers/anthropic/models/claude-3-opus": "claude-3-opus@20240229", - "publishers/anthropic/models/claude-3-opus@20240229": "claude-3-opus@20240229", - "publishers/anthropic/models/claude-5-5-opus": "claude-3-opus@20240229", - "publishers/anthropic/models/claude-5.5-opus": "claude-3-opus@20240229", - - # Fable - "fable": "fable-5-1", - "fable-5-1": "fable-5-1", - "fable-5.1": "fable-5-1", - "publishers/fable/models/fable-5-1": "fable-5-1", - "publishers/fable/models/fable-5.1": "fable-5-1", - - # DeepSeek Model Garden - "deepseek": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "deepseek-flash": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "deepseek-4.1": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "deepseek-v4.1": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "deepseek-4.1-flash": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "deepseek-v4.1-flash-maas": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "deepseek-v4.1-flash-maas@001": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas": "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", -} - -PARTNER_MODELS = { - "claude-3-7-sonnet@20250219", - "claude-3-5-sonnet-v2@20241022", - "claude-3-5-haiku@20241022", - "claude-3-opus@20240229", - "fable-5-1", - "fable", -} - - -def is_deepseek_model(model: str) -> bool: - if not model: - return False - return "deepseek" in model.lower().strip() - - -def is_partner_model(model: str) -> bool: - if not model: - return False - m = model.lower().strip() - if is_deepseek_model(m): - return False - if m in PARTNER_MODELS or m in PARTNER_MODEL_ALIASES: - return True - if ( - m.startswith("publishers/anthropic/") - or m.startswith("publishers/fable/") - ): - return True - if ( - m.startswith("claude-") - or m.startswith("sonnet-") - or m.startswith("opus-") - or m.startswith("haiku-") - or m.startswith("fable-") - or m == "fable" - ): - return True - return False - - -def is_fable_model(model: str) -> bool: - if not model: - return False - m = model.lower().strip() - return "fable" in m - - -def measure_partner_client_startup( - project: Optional[str] = None, - region: Optional[str] = None, -) -> float: - t0 = time.perf_counter() - import anthropic - - resolved_project = ( - project - or os.environ.get("VERTEXAI_PROJECT") - or os.environ.get("GCP_PROJECT") - or os.environ.get("PROJECT_ID") - or None - ) - resolved_region = ( - region - or os.environ.get("VERTEXAI_LOCATION") - or os.environ.get("GCP_REGION") - or os.environ.get("REGION") - or "us-central1" - ) - _ = anthropic.AnthropicVertex(project_id=resolved_project, region=resolved_region) - return time.perf_counter() - t0 - - -WORKSPACE_TOOLS = [ - { - "name": "read_file", - "description": "Read file contents from the workspace repository.", - "input_schema": { - "type": "object", - "properties": { - "path": {"type": "string", "description": "Relative path to the file"}, - }, - "required": ["path"], - }, - }, - { - "name": "write_file", - "description": "Write or overwrite a file in the workspace repository.", - "input_schema": { - "type": "object", - "properties": { - "path": {"type": "string", "description": "Relative path to the file"}, - "content": {"type": "string", "description": "File contents to write"}, - }, - "required": ["path", "content"], - }, - }, - { - "name": "edit_file", - "description": "Replace exact target string with replacement string in a file.", - "input_schema": { - "type": "object", - "properties": { - "path": {"type": "string", "description": "Relative path to the file"}, - "target": {"type": "string", "description": "Exact text to find and replace"}, - "replacement": {"type": "string", "description": "Replacement text"}, - }, - "required": ["path", "target", "replacement"], - }, - }, - { - "name": "run_command", - "description": "Execute a shell command within the repository root.", - "input_schema": { - "type": "object", - "properties": { - "command": {"type": "string", "description": "Command string to execute"}, - }, - "required": ["command"], - }, - }, -] - - -def _safe_resolve_repo_path(repo_dir: Path, rel_path: str) -> Optional[Path]: - try: - resolved_repo = repo_dir.resolve() - clean_rel = rel_path.lstrip("/\\") - candidate = (resolved_repo / clean_rel).resolve() - if candidate == resolved_repo or resolved_repo in candidate.parents: - return candidate - return None - except Exception: - return None - - -def execute_workspace_tool(tool_name: str, tool_input: Dict[str, Any], repo_dir: Path, *, limits: Optional[ExecutionLimits] = None) -> str: - try: - if tool_name == "read_file": - path_str = str(tool_input.get("path", "")).strip() - if not path_str: - return "Error: missing \x27path\x27 parameter for read_file." - target_path = _safe_resolve_repo_path(repo_dir, path_str) - if target_path is None: - return f"Error: path \x27{path_str}\x27 is outside repository directory." - if not target_path.exists(): - return f"Error: file \x27{path_str}\x27 does not exist." - if not target_path.is_file(): - return f"Error: \x27{path_str}\x27 is not a regular file." - return target_path.read_text(encoding="utf-8", errors="replace") - - elif tool_name == "write_file": - path_str = str(tool_input.get("path", "")).strip() - if not path_str: - return "Error: missing \x27path\x27 parameter for write_file." - content = tool_input.get("content", "") - if not isinstance(content, str): - content = str(content) - target_path = _safe_resolve_repo_path(repo_dir, path_str) - if target_path is None: - return f"Error: path \x27{path_str}\x27 is outside repository directory." - target_path.parent.mkdir(parents=True, exist_ok=True) - target_path.write_text(content, encoding="utf-8") - return f"Successfully wrote {len(content)} characters to {path_str}." - - elif tool_name == "edit_file": - path_str = str(tool_input.get("path", "")).strip() - if not path_str: - return "Error: missing \x27path\x27 parameter for edit_file." - target = tool_input.get("target") - replacement = tool_input.get("replacement") - if target is None or replacement is None: - return "Error: edit_file requires both \x27target\x27 and \x27replacement\x27 parameters." - target_str = str(target) - replacement_str = str(replacement) - target_path = _safe_resolve_repo_path(repo_dir, path_str) - if target_path is None: - return f"Error: path \x27{path_str}\x27 is outside repository directory." - if not target_path.exists() or not target_path.is_file(): - return f"Error: file \x27{path_str}\x27 does not exist." - content = target_path.read_text(encoding="utf-8", errors="replace") - if target_str not in content: - return f"Error: target string not found in \x27{path_str}\x27." - new_content = content.replace(target_str, replacement_str, 1) - target_path.write_text(new_content, encoding="utf-8") - return f"Successfully edited \x27{path_str}\x27." - - elif tool_name == "run_command": - cmd = tool_input.get("command") or tool_input.get("cmd", "") - if not cmd: - return "Error: missing \x27command\x27 parameter for run_command." - cmd_str = str(cmd) - - # Security Interception: evaluate command safety before execution - if evaluate_safety is not None: - safety_res = evaluate_safety(cmd_str, is_headless=True) - if isinstance(safety_res, dict) and safety_res.get("decision") in ("deny", "reject"): - reason = safety_res.get("reason", "Destructive command rejected.") - return f"Error: Command blocked by safety policy ({safety_res.get('decision')}): {reason}" - - limits = limits or limits_for_task(None) - _, output = run_bounded_shell(cmd_str, repo_dir, limits.command_timeout_s) - return output - - else: - return f"Error: unknown tool \x27{tool_name}\x27." - except Exception as exc: - return f"Error executing tool \x27{tool_name}\x27: {exc}" - - -def _extract_thought(block: Any) -> Optional[str]: - if isinstance(block, dict): - if block.get("type") == "thinking" and block.get("thinking"): - return str(block["thinking"]) - if block.get("thought"): - return str(block["thought"]) - return None - b_type = getattr(block, "type", None) - if b_type == "thinking": - thinking = getattr(block, "thinking", None) - if isinstance(thinking, str) and thinking: - return thinking - thinking = getattr(block, "thinking", None) - if isinstance(thinking, str) and thinking: - return thinking - return None - - -def _extract_tool_use(block: Any) -> Optional[Tuple[str, str, Dict[str, Any]]]: - if isinstance(block, dict): - if block.get("type") == "tool_use": - tool_id = str(block.get("id", "")) - tool_name = str(block.get("name", "")) - tool_input = block.get("input") - if not isinstance(tool_input, dict): - tool_input = {} - return tool_id, tool_name, tool_input - return None - b_type = getattr(block, "type", None) - if b_type == "tool_use": - tool_id = getattr(block, "id", "") - if not isinstance(tool_id, str): - tool_id = str(tool_id) - tool_name = getattr(block, "name", "") - if not isinstance(tool_name, str): - tool_name = str(tool_name) - tool_input = getattr(block, "input", {}) - if not isinstance(tool_input, dict): - try: - tool_input = dict(tool_input) - except Exception: - tool_input = {} - return tool_id, tool_name, tool_input - return None - - -def _extract_text(block: Any) -> str: - if isinstance(block, str): - return block - if isinstance(block, dict): - return str(block.get("text", "")) - t = getattr(block, "text", None) - if isinstance(t, str): - return t - return "" - - -def _get_anthropic(): - if "anthropic" in sys.modules: - mod = sys.modules["anthropic"] - if mod is not None: - return mod - return None - try: - import anthropic - return anthropic - except (ImportError, AttributeError): - return None - - -def _get_aiplatform(): - if "google.cloud.aiplatform" in sys.modules: - mod = sys.modules["google.cloud.aiplatform"] - if mod is not None: - return mod - return None - try: - from google.cloud import aiplatform - return aiplatform - except (ImportError, AttributeError): - pass - try: - import google.cloud.aiplatform as aiplatform - return aiplatform - except (ImportError, AttributeError): - return None - - -def _get_genai(): - if "google.genai" in sys.modules: - mod = sys.modules["google.genai"] - if mod is not None: - return mod - return None - try: - from google import genai - return genai - except (ImportError, AttributeError): - pass - try: - import google.genai as genai - return genai - except (ImportError, AttributeError): - return None - - -def execute_claude_model_agent( - model: str, - task_brief: str, - repo_dir: Path, - task_item: Any = None, - task_index: int = 0, - project: Optional[str] = None, - location: Optional[str] = None, - messenger: Optional[Any] = None, - *, - limits: Optional[ExecutionLimits] = None, -) -> Tuple[str, str]: - limits = limits or limits_for_task(task_item) - anthropic = _get_anthropic() - if anthropic is None: - return "BLOCKED", "Missing dependency: anthropic[vertex] Python package is not installed." - - resolved_project = ( - project - or os.environ.get("VERTEXAI_PROJECT") - or os.environ.get("GCP_PROJECT") - or os.environ.get("PROJECT_ID") - or None - ) - resolved_region = ( - location - or os.environ.get("VERTEXAI_LOCATION") - or os.environ.get("GCP_REGION") - or os.environ.get("REGION") - or "us-central1" - ) - - try: - client = anthropic.AnthropicVertex( - project_id=resolved_project, - region=resolved_region, - ) - system_prompt = ( - os.environ.get("AGYSTACK_WORKER_SYSTEM_PROMPT") - or DEFAULT_PARTNER_SYSTEM_PROMPT - ) - messages: List[Dict[str, Any]] = [ - {"role": "user", "content": task_brief} - ] - max_turns = limits.max_agent_turns - consumed = 0 - last_tool = "" - last_text = "" - - for turn in range(max_turns): - last_text = "" - consumed += 1 - response = client.messages.create( - model=model, - max_tokens=4096, - system=system_prompt, - messages=messages, - tools=WORKSPACE_TOOLS, - ) - - content_blocks = [] - if hasattr(response, "content") and response.content: - content_blocks = response.content - elif isinstance(response, list): - content_blocks = response - - thinking_text = "" - tool_uses = [] - text_parts = [] - - for block in content_blocks: - th = _extract_thought(block) - if th: - thinking_text += th + "\n" - - tu = _extract_tool_use(block) - if tu: - tool_uses.append(tu) - - txt = _extract_text(block) - if txt: - text_parts.append(txt) - - if thinking_text.strip(): - emit_thought(task_index, thinking_text.strip()) - - if text_parts: - last_text = "\n".join(text_parts) - - if not tool_uses: - if not last_text: - if isinstance(response, str): - last_text = response - elif hasattr(response, "text") and isinstance(response.text, str): - last_text = response.text - return _evaluate_agent_status(last_text) - - messages.append({ - "role": "assistant", - "content": response.content if hasattr(response, "content") else content_blocks, - }) - - tool_results = [] - for tool_id, tool_name, tool_input in tool_uses: - emit_tool_invocation(task_index, tool_name, tool_input) - last_tool = tool_name - result_str = execute_workspace_tool(tool_name, tool_input, repo_dir, limits=limits) - emit_tool_result(task_index, tool_name, result_str) - tool_results.append({ - "type": "tool_result", - "tool_use_id": tool_id, - "content": result_str, - }) - - messages.append({ - "role": "user", - "content": tool_results, - }) - - return exhaustion_result(repo_dir, max_turns, consumed, last_tool, last_text) - except Exception as exc: - return "ISSUES", f"Partner model execution exception: {exc}" - - -def execute_fable_model_agent( - model: str, - task_brief: str, - repo_dir: Path, - task_item: Any = None, - task_index: int = 0, - project: Optional[str] = None, - location: Optional[str] = None, - messenger: Optional[Any] = None, - *, - limits: Optional[ExecutionLimits] = None, -) -> Tuple[str, str]: - limits = limits or limits_for_task(task_item) - - aiplatform = _get_aiplatform() - if aiplatform is None: - return "BLOCKED", "Missing dependency: google-cloud-aiplatform Python package is not installed." - - resolved_project = ( - project - or os.environ.get("VERTEXAI_PROJECT") - or os.environ.get("GCP_PROJECT") - or os.environ.get("PROJECT_ID") - or None - ) - resolved_region = ( - location - or os.environ.get("VERTEXAI_LOCATION") - or os.environ.get("GCP_REGION") - or os.environ.get("REGION") - or "us-central1" - ) - - try: - if hasattr(aiplatform, "init"): - aiplatform.init(project=resolved_project, location=resolved_region) - - endpoint = None - if hasattr(aiplatform, "Endpoint"): - try: - endpoint = aiplatform.Endpoint(endpoint_name=model) - except TypeError: - try: - endpoint = aiplatform.Endpoint(model) - except Exception: - endpoint = None - except Exception: - endpoint = None - - system_prompt = ( - os.environ.get("AGYSTACK_WORKER_SYSTEM_PROMPT") - or DEFAULT_PARTNER_SYSTEM_PROMPT - ) - messages: List[Dict[str, Any]] = [ - {"role": "user", "content": task_brief} - ] - max_turns = limits.max_agent_turns - consumed = 0 - last_tool = "" - last_text = "" - - for turn in range(max_turns): - last_text = "" - response = None - consumed += 1 - if endpoint is not None and hasattr(endpoint, "predict"): - response = endpoint.predict( - instances=[{ - "prompt": task_brief if turn == 0 else "", - "messages": messages, - "system": system_prompt, - }], - parameters={"tools": WORKSPACE_TOOLS}, - ) - elif hasattr(aiplatform, "predict"): - response = aiplatform.predict( - endpoint=model, - instances=[{"messages": messages}], - ) - else: - return "ISSUES", "Vertex Model Garden predict API client not available on aiplatform." - - content_blocks = [] - if hasattr(response, "content") and response.content: - content_blocks = response.content - elif hasattr(response, "predictions") and response.predictions: - for pred in response.predictions: - if isinstance(pred, dict) and "content" in pred: - c = pred["content"] - if isinstance(c, list): - content_blocks.extend(c) - else: - content_blocks.append(c) - else: - content_blocks.append(pred) - elif isinstance(response, list): - content_blocks = response - - thinking_text = "" - tool_uses = [] - text_parts = [] - - for block in content_blocks: - th = _extract_thought(block) - if th: - thinking_text += th + "\n" - - tu = _extract_tool_use(block) - if tu: - tool_uses.append(tu) - - txt = _extract_text(block) - if txt: - text_parts.append(txt) - - if thinking_text.strip(): - emit_thought(task_index, thinking_text.strip()) - - if text_parts: - last_text = "\n".join(text_parts) - - if not tool_uses: - if not last_text: - if isinstance(response, str): - last_text = response - elif hasattr(response, "text") and isinstance(response.text, str): - last_text = response.text - elif hasattr(response, "predictions") and response.predictions: - p0 = response.predictions[0] - if isinstance(p0, str): - last_text = p0 - elif isinstance(p0, dict) and "text" in p0: - last_text = str(p0["text"]) - return _evaluate_agent_status(last_text) - - messages.append({ - "role": "assistant", - "content": content_blocks, - }) - - tool_results = [] - for tool_id, tool_name, tool_input in tool_uses: - emit_tool_invocation(task_index, tool_name, tool_input) - last_tool = tool_name - result_str = execute_workspace_tool(tool_name, tool_input, repo_dir, limits=limits) - emit_tool_result(task_index, tool_name, result_str) - tool_results.append({ - "type": "tool_result", - "tool_use_id": tool_id, - "content": result_str, - }) - - messages.append({ - "role": "user", - "content": tool_results, - }) - - return exhaustion_result(repo_dir, max_turns, consumed, last_tool, last_text) - except Exception as exc: - return "ISSUES", f"Vertex Model Garden Fable execution exception: {exc}" - - -def execute_deepseek_model_agent( - model: str, - task_brief: str, - repo_dir: Path, - task_item: Any = None, - task_index: int = 0, - project: Optional[str] = None, - location: Optional[str] = None, - messenger: Optional[Any] = None, - *, - limits: Optional[ExecutionLimits] = None, -) -> Tuple[str, str]: - limits = limits or limits_for_task(task_item) - genai = _get_genai() - if genai is None: - return "BLOCKED", "Missing dependency: google-genai Python package is not installed." - - resolved_project = ( - project - or os.environ.get("VERTEXAI_PROJECT") - or os.environ.get("GCP_PROJECT") - or os.environ.get("PROJECT_ID") - or None - ) - resolved_location = os.environ.get("VERTEXAI_LOCATION") or "global" - - if not model.startswith("publishers/"): - model = PARTNER_MODEL_ALIASES.get(model.lower()) or "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas" - - try: - import re - - client_kwargs = { - "vertexai": True, - "project": resolved_project, - "location": resolved_location, - } - if hasattr(genai.types, "HttpOptions"): - client_kwargs["http_options"] = genai.types.HttpOptions(timeout=120000) - - client = genai.Client(**client_kwargs) - - function_declarations = [ - genai.types.FunctionDeclaration( - name=t["name"], - description=t["description"], - parameters=t["input_schema"], - ) - for t in WORKSPACE_TOOLS - ] - tool = genai.types.Tool(function_declarations=function_declarations) - - system_prompt = ( - os.environ.get("AGYSTACK_WORKER_SYSTEM_PROMPT") - or DEFAULT_PARTNER_SYSTEM_PROMPT - ) - config = genai.types.GenerateContentConfig( - system_instruction=system_prompt, - tools=[tool], - temperature=0.0, - ) - - contents: List[Any] = [ - genai.types.Content( - role="user", - parts=[genai.types.Part.from_text(text=task_brief)], - ) - ] - max_turns = limits.max_agent_turns - consumed = 0 - last_tool = "" - last_text = "" - - for turn in range(max_turns): - if consumed >= max_turns: - return exhaustion_result(repo_dir, max_turns, consumed, last_tool, last_text) - last_text = "" - response = None - for attempt in range(5): - if consumed >= max_turns: - return exhaustion_result(repo_dir, max_turns, consumed, last_tool, last_text) - try: - consumed += 1 - response = client.models.generate_content( - model=model, - contents=contents, - config=config, - ) - break - except Exception as call_exc: - err_str = str(call_exc).lower() - if ( - "503" in err_str - or "unavailable" in err_str - or "429" in err_str - or "resource_exhausted" in err_str - or "deadline" in err_str - or "connection" in err_str - ) and attempt < 4 and consumed < max_turns: - backoff = (2 ** attempt) * 2 - emit_milestone(task_index, "RETRY", f"Transient {call_exc}; retrying in {backoff}s (attempt {attempt + 1}/5)...") - time.sleep(backoff) - elif consumed >= max_turns: - return exhaustion_result(repo_dir, max_turns, consumed, last_tool, str(call_exc)) - else: - raise - - candidate_parts = [] - if hasattr(response, "candidates") and response.candidates: - c0 = response.candidates[0] - if hasattr(c0, "content") and c0.content: - candidate_parts = getattr(c0.content, "parts", []) or [] - - # Handle thoughts: check part.thought or ... in text - for part in candidate_parts: - th = getattr(part, "thought", None) - if th: - if isinstance(th, str) and th.strip(): - emit_thought(task_index, th.strip()) - elif isinstance(th, bool) and getattr(part, "text", None): - emit_thought(task_index, str(part.text).strip()) - - ptxt = getattr(part, "text", None) - if ptxt and isinstance(ptxt, str) and not th: - for m in re.finditer(r"(.*?)", ptxt, re.DOTALL): - val = m.group(1).strip() - if val: - emit_thought(task_index, val) - - # Check function calls - func_calls = [] - if hasattr(response, "function_calls") and response.function_calls: - func_calls = response.function_calls - else: - for part in candidate_parts: - fc = getattr(part, "function_call", None) - if fc: - func_calls.append(fc) - - try: - response_text = getattr(response, "text", "") - last_text = response_text if isinstance(response_text, str) else "" - except Exception: - last_text = "" - - if not func_calls: - resp_text = None - try: - resp_text = getattr(response, "text", None) - except Exception: - pass - - if resp_text and isinstance(resp_text, str) and not candidate_parts: - for m in re.finditer(r"(.*?)", resp_text, re.DOTALL): - val = m.group(1).strip() - if val: - emit_thought(task_index, val) - - if resp_text and isinstance(resp_text, str) and resp_text.strip(): - last_text = resp_text - elif candidate_parts: - text_pieces = [ - getattr(p, "text", "") for p in candidate_parts if getattr(p, "text", None) - ] - last_text = "\n".join(text_pieces).strip() - - if not last_text and consumed >= max_turns: - return exhaustion_result(repo_dir, max_turns, consumed, last_tool, last_text) - if not last_text: - contents.append(genai.types.Content( - role="model", - parts=[genai.types.Part.from_text(text="")] - )) - contents.append(genai.types.Content( - role="user", - parts=[genai.types.Part.from_text(text="Give your final summary. End with exactly one standalone unquoted status line outside code fences, [STATUS: PASS], [STATUS: ISSUES], or [STATUS: BLOCKED].")] - )) - continue - - cleaned_text = re.sub(r".*?", "", last_text, flags=re.DOTALL).strip() - return _evaluate_agent_status(cleaned_text) - - # Filter out empty text parts so DeepSeek does not echo empty text on next turn - clean_parts = [ - p for p in candidate_parts - if not (getattr(p, "text", None) == "" and not getattr(p, "function_call", None)) - ] - contents.append(genai.types.Content(role="model", parts=clean_parts)) - - # Execute workspace tools and append user response parts - response_parts = [] - for fc in func_calls: - tool_name = getattr(fc, "name", "") - tool_input = getattr(fc, "args", {}) - if not isinstance(tool_input, dict): - try: - tool_input = dict(tool_input) - except Exception: - tool_input = {} - emit_tool_invocation(task_index, tool_name, tool_input) - last_tool = tool_name - result_str = execute_workspace_tool(tool_name, tool_input, repo_dir, limits=limits) - emit_tool_result(task_index, tool_name, result_str) - response_parts.append( - genai.types.Part.from_function_response( - name=tool_name, - response={"result": result_str}, - ) - ) - - contents.append(genai.types.Content(role="user", parts=response_parts)) - - return exhaustion_result(repo_dir, max_turns, consumed, last_tool, last_text) - except Exception as exc: - return "ISSUES", f"DeepSeek model execution exception: {exc}" - - -def execute_partner_model_agent( - model: str, - task_brief: str, - repo_dir: Path, - task_item: Any = None, - task_index: int = 0, - project: Optional[str] = None, - location: Optional[str] = None, - messenger: Optional[Any] = None, - *, - limits: Optional[ExecutionLimits] = None, -) -> Tuple[str, str]: - limits = limits or limits_for_task(task_item) - if is_deepseek_model(model): - return execute_deepseek_model_agent( - model=model, - task_brief=task_brief, - repo_dir=repo_dir, - task_item=task_item, - task_index=task_index, - project=project, - location=location, - messenger=messenger, - limits=limits, - ) - if is_fable_model(model): - return execute_fable_model_agent( - model=model, - task_brief=task_brief, - repo_dir=repo_dir, - task_item=task_item, - task_index=task_index, - project=project, - location=location, - messenger=messenger, - limits=limits, - ) - return execute_claude_model_agent( - model=model, - task_brief=task_brief, - repo_dir=repo_dir, - task_item=task_item, - task_index=task_index, - project=project, - location=location, - messenger=messenger, - limits=limits, - ) diff --git a/tests/test_architecture_remediation.py b/tests/test_architecture_remediation.py deleted file mode 100755 index 9a8eee9..0000000 --- a/tests/test_architecture_remediation.py +++ /dev/null @@ -1,707 +0,0 @@ -#!/usr/bin/env python3 -import json -import os -import subprocess -import sys -import tempfile -import unittest -from pathlib import Path -from unittest.mock import MagicMock, patch - -REPO_ROOT = Path(__file__).resolve().parent.parent -SWARM_SCRIPTS = REPO_ROOT / "skills" / "swarm" / "scripts" -sys.path.insert(0, str(SWARM_SCRIPTS)) - -import cloud_dispatch -import cloud_worker -import result_harvester -import storage_messenger -import storage_uploader - - -class TestArchitectureRemediation(unittest.TestCase): - def setUp(self): - self.temp_dir = tempfile.TemporaryDirectory() - self.tmp_path = Path(self.temp_dir.name) - - def tearDown(self): - self.temp_dir.cleanup() - - def test_cli_argument_resolution_parallelism_and_gcs_prefix(self): - dispatch_script = SWARM_SCRIPTS / "cloud_dispatch.py" - manifest_file = self.tmp_path / "manifest.json" - manifest_file.write_text("[]", encoding="utf-8") - - # 1. Test CLI --parallelism 100 overrides runtime config default - cfg_file = self.tmp_path / "agystack-runtime.json" - cfg_file.write_text( - json.dumps({"parallelism": 25, "gcs_bucket": "test-bkt"}), - encoding="utf-8", - ) - - cmd = [ - sys.executable, - str(dispatch_script), - "--dry-run", - "--manifest", str(manifest_file), - "--repo", "https://github.com/test/repo.git", - "--project", "test-project", - "--session", "sess-12345", - "--parallelism", "100", - ] - res = subprocess.run( - cmd, - capture_output=True, - text=True, - check=True, - cwd=str(self.tmp_path), - env=dict(os.environ, GH_TOKEN="fake_tok", GEMINI_API_KEY="fake_key"), - ) - payload = json.loads(res.stdout) - self.assertEqual(payload["parallelism"], 100) - # Default prefix derivation when --gcs-prefix is not passed - self.assertEqual(payload["env_vars"].get("GCS_PREFIX"), "swarms/sess-12345") - - # 2. Test fallback to runtime config when --parallelism is omitted - cmd_fallback = [ - sys.executable, - str(dispatch_script), - "--dry-run", - "--manifest", str(manifest_file), - "--repo", "https://github.com/test/repo.git", - "--project", "test-project", - "--session", "sess-fallback", - ] - res_fb = subprocess.run( - cmd_fallback, - capture_output=True, - text=True, - check=True, - cwd=str(self.tmp_path), - env=dict(os.environ, GH_TOKEN="fake_tok", GEMINI_API_KEY="fake_key"), - ) - payload_fb = json.loads(res_fb.stdout) - self.assertEqual(payload_fb["parallelism"], 25) - self.assertEqual(payload_fb["env_vars"].get("GCS_PREFIX"), "swarms/sess-fallback") - - def test_strict_status_regex_parsing(self): - # 1. Exact valid tokens - status, _ = cloud_worker.evaluate_agent_status("Finished work.\n[STATUS: PASS]") - self.assertEqual(status, "PASS") - - status, _ = cloud_worker.evaluate_agent_status("[STATUS: ISSUES]\nFound some edge cases") - self.assertEqual(status, "ISSUES") - - status, _ = cloud_worker.evaluate_agent_status("Out of quota\n[STATUS: BLOCKED]") - self.assertEqual(status, "BLOCKED") - - status, _ = cloud_worker.evaluate_agent_status("[status: pass]") - self.assertEqual(status, "ISSUES") - - status, _ = cloud_worker.evaluate_agent_status("[STATUS: DEV_IMPROVED]\nCandidate improved score") - self.assertEqual(status, "ISSUES") - - # 2. False positives without strict token must fall back to ISSUES - status, _ = cloud_worker.evaluate_agent_status("I hope this passes and does not fail password test.") - self.assertEqual(status, "ISSUES") - - status, _ = cloud_worker.evaluate_agent_status("STATUS: PASS (no brackets)") - self.assertEqual(status, "ISSUES") - - def test_build_gcloud_command_omits_parallelism_max_retries_and_secrets(self): - cmd = cloud_dispatch.build_gcloud_command( - job_name="test-worker-job", - tasks_count=10, - parallelism=50, - region="us-central1", - project="test-proj", - env_vars={"FOO": "BAR"}, - wait=True, - max_retries=3, - set_secrets="MY_SECRET=sec:1", - ) - self.assertEqual(cmd[0:5], ["gcloud", "run", "jobs", "execute", "test-worker-job"]) - self.assertIn("--tasks=10", cmd) - self.assertIn("--region=us-central1", cmd) - self.assertIn("--project=test-proj", cmd) - self.assertIn("--wait", cmd) - self.assertIn("--format=json", cmd) - - # Explicitly absent from execute command - self.assertFalse(any(arg.startswith("--parallelism") for arg in cmd)) - self.assertFalse(any(arg.startswith("--max-retries") for arg in cmd)) - self.assertFalse(any(arg.startswith("--set-secrets") for arg in cmd)) - - def test_harvest_candidate_patches(self): - # Setup mock local storage directory - mock_storage = self.tmp_path / "mock_gcs" - bucket = "test-bucket" - prefix = "swarms/session-42" - task0_dir = mock_storage / bucket / prefix / "task-0" - task1_dir = mock_storage / bucket / prefix / "task-1" - task0_dir.mkdir(parents=True, exist_ok=True) - task1_dir.mkdir(parents=True, exist_ok=True) - - (task0_dir / "score.json").write_text(json.dumps({"score": 98.2, "status": "PASS"}), encoding="utf-8") - (task0_dir / "status.json").write_text(json.dumps({"status": "PASS"}), encoding="utf-8") - (task0_dir / "patch.diff").write_text("--- a/foo\n+++ b/foo\n+pass", encoding="utf-8") - - (task1_dir / "score.json").write_text(json.dumps({"score": 45.0, "status": "ISSUES"}), encoding="utf-8") - (task1_dir / "status.json").write_text(json.dumps({"status": "ISSUES"}), encoding="utf-8") - (task1_dir / "patch.diff").write_text("--- a/bar\n+++ b/bar\n+fail", encoding="utf-8") - - dest_dir = self.tmp_path / "downloaded_patches" - - with patch.dict(os.environ, {"STORAGE_MESSENGER_LOCAL_DIR": str(mock_storage)}): - results = result_harvester.harvest_candidate_patches( - bucket_name=bucket, - prefix=prefix, - dest_dir=dest_dir, - ) - - self.assertEqual(len(results), 2) - r0 = results[0] - self.assertEqual(r0["task_index"], 0) - self.assertEqual(r0["score"], 98.2) - self.assertEqual(r0["status"], "PASS") - self.assertTrue(Path(r0["patch_file"]).is_file()) - self.assertTrue(Path(r0["score_file"]).is_file()) - self.assertEqual(Path(r0["patch_file"]).read_text(encoding="utf-8"), "--- a/foo\n+++ b/foo\n+pass") - - r1 = results[1] - self.assertEqual(r1["task_index"], 1) - self.assertEqual(r1["score"], 45.0) - self.assertEqual(r1["status"], "ISSUES") - - def test_status_json_upload_and_harvesting(self): - mock_storage = self.tmp_path / "mock_gcs" - bucket = "test-bucket" - prefix = "swarms/session-status" - task_dir = mock_storage / bucket / prefix / "task-0" - task_dir.mkdir(parents=True, exist_ok=True) - - status_payload = { - "task_index": 0, - "status": "PASS", - "summary": "Completed cache locality optimization", - "score": 99.4, - "candidate_files": ["src/pipeline/packet_filter.py"], - "session_id": "session-status", - } - (task_dir / "status.json").write_text(json.dumps(status_payload), encoding="utf-8") - (task_dir / "patch.diff").write_text("--- a/foo\n+++ b/foo\n+fast", encoding="utf-8") - - dest_dir = self.tmp_path / "downloaded_status" - with patch.dict(os.environ, {"STORAGE_MESSENGER_LOCAL_DIR": str(mock_storage)}): - results = result_harvester.harvest_candidate_patches( - bucket_name=bucket, - prefix=prefix, - dest_dir=dest_dir, - ) - - self.assertEqual(len(results), 1) - r0 = results[0] - self.assertEqual(r0["task_index"], 0) - self.assertEqual(r0["status"], "PASS") - self.assertEqual(r0["score"], 99.4) - self.assertEqual(r0["summary"], "Completed cache locality optimization") - self.assertEqual(r0["candidate_files"], ["src/pipeline/packet_filter.py"]) - self.assertTrue(Path(r0["status_file"]).is_file()) - self.assertTrue(Path(r0["patch_file"]).is_file()) - - def test_parse_worker_logs_extracts_task_index(self): - sample_log = ( - "Some preamble\n" - "================================================================================\n" - "[STATUS: PASS]\n" - "Evidence:\n" - "- Task Index: 7\n" - "- Branch: worker-7\n" - "- Commit SHA: deadbeef\n" - "Summary:\n" - "Task 7 completed successfully.\n" - "================================================================================\n" - "[STATUS: ISSUES]\n" - "Evidence:\n" - "- Task Index: 12\n" - "- Branch: worker-12\n" - "Summary:\n" - "Task 12 encountered test failure.\n" - "================================================================================\n" - ) - parsed = cloud_dispatch.parse_worker_logs(sample_log) - self.assertEqual(len(parsed), 2) - self.assertEqual(parsed[0]["status"], "PASS") - self.assertEqual(parsed[0]["task_index"], 7) - self.assertIn("Task 7 completed", parsed[0]["summary"]) - - self.assertEqual(parsed[1]["status"], "ISSUES") - self.assertEqual(parsed[1]["task_index"], 12) - self.assertIn("Task 12 encountered", parsed[1]["summary"]) - - @patch("urllib.request.urlopen") - @patch("subprocess.run") - def test_run_preflight_uses_credential_helper_and_clean_url(self, mock_run, mock_urlopen): - mock_run.return_value = MagicMock(returncode=0, stdout="HEAD\n") - mock_resp = MagicMock() - mock_resp.__enter__.return_value = mock_resp - mock_resp.read.return_value = b'{"candidates": []}' - mock_resp.headers = {} - mock_urlopen.return_value = mock_resp - - cloud_dispatch.run_preflight( - repo_url="https://x-access-token:leaked@github.com/myorg/myrepo.git", - gh_token="secret_token_12345", - use_vertex=False, - gemini_api_key="key", - project="test-proj", - region="us-central1", - model="gemini-2.5-flash", - dry_run=False, - gcs_bucket="test-bucket", - ) - - self.assertTrue(mock_run.called) - cmd = mock_run.call_args[0][0] - self.assertEqual(cmd[0], "git") - self.assertEqual(cmd[1], "-c") - self.assertIn("credential.helper=!f() { echo password=secret_token_12345; }; f", cmd[2]) - self.assertEqual(cmd[3], "ls-remote") - self.assertEqual(cmd[4], "https://github.com/myorg/myrepo.git") - self.assertEqual(cmd[5], "HEAD") - - def test_storage_messenger_raises_in_cloud_run_without_creds(self): - env_override = { - "K_SERVICE": "agystack-worker", - "CLOUD_RUN_TASK_INDEX": "0", - } - with patch.dict(os.environ, env_override, clear=False): - with patch("storage_uploader.get_oauth_token", return_value=None): - with patch.dict(sys.modules, {"google.cloud": None, "google.cloud.storage": None}): - with self.assertRaises(RuntimeError) as ctx: - storage_messenger.StorageMessenger( - bucket_name="test-bkt", - session_id="sess-test", - task_index=0, - ) - self.assertIn("GCS credentials unavailable in Cloud Run environment", str(ctx.exception)) - - def test_live_cloud_bidirectional_skips_when_live_bucket_unset(self): - cmd = [ - sys.executable, - "-m", "unittest", - "tests/test_live_cloud_bidirectional.py", - ] - clean_env = {k: v for k, v in os.environ.items() if k != "AGYSTACK_LIVE_BUCKET"} - res = subprocess.run( - cmd, - cwd=str(REPO_ROOT), - capture_output=True, - text=True, - env=clean_env, - ) - self.assertEqual(res.returncode, 0, f"Test failed with output:\n{res.stderr}\n{res.stdout}") - self.assertIn("skipped=3", res.stderr + res.stdout) - - def test_script_resolver_path_resolution_in_skill_md(self): - skill_md = REPO_ROOT / "skills" / "swarm" / "SKILL.md" - content = skill_md.read_text(encoding="utf-8") - resolver_pattern = 'find -L "$HOME/.gemini/config/plugins/agystack" ".agents/plugins/agystack" "skills/swarm/scripts" -name cloud_dispatch.py' - self.assertIn(resolver_pattern, content) - - def test_run_preflight_missing_gcs_bucket_fails_fast(self): - with self.assertRaises(RuntimeError) as ctx: - cloud_dispatch.run_preflight( - repo_url="https://github.com/test/repo.git", - gh_token="secret_token", - use_vertex=False, - gemini_api_key="key", - project="test-proj", - region="us-central1", - model="gemini-3.8-flash", - dry_run=False, - gcs_bucket=None, - ) - self.assertIn("Cloud Run swarms require a GCS bucket", str(ctx.exception)) - - def test_upload_run_artifacts_only_generates_patch_when_pass(self): - repo_test = self.tmp_path / "test_repo" - repo_test.mkdir(parents=True, exist_ok=True) - (repo_test / ".git").mkdir() - (repo_test / "app.py").write_text("print('hello')", encoding="utf-8") - - mock_storage = self.tmp_path / "mock_gcs_upload" - with patch.dict(os.environ, {"STORAGE_MESSENGER_LOCAL_DIR": str(mock_storage)}): - with patch("storage_uploader._generate_git_patch", return_value="diff --git a/app.py"): - # ISSUES status must not generate or upload patch.diff - res_issues = storage_uploader.upload_run_artifacts( - bucket_name="test-bkt", - prefix="swarms/test-run", - repo_dir=repo_test, - task_index=0, - status="ISSUES", - ) - self.assertNotIn("patch.diff", res_issues) - self.assertFalse((repo_test / "patch.diff").exists()) - - # PASS status must generate and upload patch.diff - res_pass = storage_uploader.upload_run_artifacts( - bucket_name="test-bkt", - prefix="swarms/test-run", - repo_dir=repo_test, - task_index=0, - status="PASS", - ) - self.assertIn("patch.diff", res_pass) - self.assertTrue((repo_test / "patch.diff").exists()) - - def test_scoped_git_patch_generation_honors_candidate_files(self): - repo_dir = self.tmp_path / "git_scope_repo" - repo_dir.mkdir(parents=True, exist_ok=True) - subprocess.run(["git", "init"], cwd=repo_dir, check=True, capture_output=True) - subprocess.run(["git", "config", "user.name", "Tester"], cwd=repo_dir, check=True) - subprocess.run(["git", "config", "user.email", "test@test.com"], cwd=repo_dir, check=True) - - target_file = repo_dir / "target.py" - target_file.write_text("v1", encoding="utf-8") - junk_file = repo_dir / "junk.log" - junk_file.write_text("junk", encoding="utf-8") - - subprocess.run(["git", "add", "target.py", "junk.log"], cwd=repo_dir, check=True) - subprocess.run(["git", "commit", "-m", "init"], cwd=repo_dir, check=True) - - target_file.write_text("v2", encoding="utf-8") - junk_file.write_text("junk modified", encoding="utf-8") - - patch_content = storage_uploader._generate_git_patch(repo_dir, candidate_files=["target.py"]) - self.assertIn("target.py", patch_content) - self.assertNotIn("junk.log", patch_content) - - def test_harvest_candidate_patches_score_delta_ranking(self): - mock_storage = self.tmp_path / "mock_delta_gcs" - bucket = "test-delta-bucket" - prefix = "swarms/delta-session" - - t0 = mock_storage / bucket / prefix / "task-0" - t1 = mock_storage / bucket / prefix / "task-1" - t2 = mock_storage / bucket / prefix / "task-2" - t3 = mock_storage / bucket / prefix / "task-3" - for t in (t0, t1, t2, t3): - t.mkdir(parents=True, exist_ok=True) - - (t0 / "score.json").write_text(json.dumps({"score": 90.0, "status": "PASS"}), encoding="utf-8") - (t0 / "status.json").write_text(json.dumps({"status": "PASS"}), encoding="utf-8") - (t1 / "score.json").write_text(json.dumps({"score": 95.0, "status": "PASS"}), encoding="utf-8") - (t1 / "status.json").write_text(json.dumps({"status": "PASS"}), encoding="utf-8") - (t2 / "score.json").write_text(json.dumps({"score": 99.0, "status": "ISSUES"}), encoding="utf-8") - (t2 / "status.json").write_text(json.dumps({"status": "ISSUES"}), encoding="utf-8") - (t3 / "status.json").write_text(json.dumps({"status": "PASS"}), encoding="utf-8") - - dest_dir = self.tmp_path / "harvest_delta_out" - with patch.dict(os.environ, {"STORAGE_MESSENGER_LOCAL_DIR": str(mock_storage)}): - ranked = result_harvester.harvest_candidate_patches( - bucket_name=bucket, - prefix=prefix, - dest_dir=dest_dir, - baseline_score=88.0, - sort_by_delta=True, - ) - - self.assertEqual(len(ranked), 4) - # Rank 1: Task 1 (PASS, delta +7.0) - self.assertEqual(ranked[0]["task_index"], 1) - self.assertEqual(ranked[0]["score_delta"], 7.0) - self.assertEqual(ranked[0]["status"], "PASS") - - # Rank 2: Task 0 (PASS, delta +2.0) - self.assertEqual(ranked[1]["task_index"], 0) - self.assertEqual(ranked[1]["score_delta"], 2.0) - self.assertEqual(ranked[1]["status"], "PASS") - - # Rank 3: Task 3 (PASS, score None) - self.assertEqual(ranked[2]["task_index"], 3) - self.assertEqual(ranked[2]["status"], "PASS") - - # Rank 4: Task 2 (ISSUES, delta +11.0, sorted after PASS) - self.assertEqual(ranked[3]["task_index"], 2) - self.assertEqual(ranked[3]["status"], "ISSUES") - - def test_harvest_session_cli_standalone(self): - dispatch_script = SWARM_SCRIPTS / "cloud_dispatch.py" - mock_storage = self.tmp_path / "mock_cli_gcs" - bucket = "test-cli-bkt" - session_id = "sess-cli-harvest" - - task_dir = mock_storage / bucket / f"swarms/{session_id}" / "task-0" - task_dir.mkdir(parents=True, exist_ok=True) - (task_dir / "score.json").write_text(json.dumps({"score": 92.5, "status": "PASS"}), encoding="utf-8") - (task_dir / "status.json").write_text(json.dumps({"status": "PASS"}), encoding="utf-8") - (task_dir / "patch.diff").write_text("--- a/f\n+++ b/f\n+ok", encoding="utf-8") - - cmd = [ - sys.executable, - str(dispatch_script), - "--harvest-session", session_id, - "--tasks", "1", - "--gcs-bucket", bucket, - "--baseline-score", "90.0", - ] - res = subprocess.run( - cmd, - capture_output=True, - text=True, - check=True, - cwd=str(self.tmp_path), - env=dict(os.environ, STORAGE_MESSENGER_LOCAL_DIR=str(mock_storage)), - ) - self.assertIn("CANDIDATE PATCHES (RANKED):", res.stdout) - self.assertIn("Winning Candidate #1", res.stdout) - self.assertIn("+2.5000", res.stdout) - - def test_worker_fail_closed_on_upload_failure(self): - worker_dir = self.tmp_path / "worker_fail_repo" - worker_dir.mkdir(parents=True, exist_ok=True) - (worker_dir / ".git").mkdir() - (worker_dir / "target.py").write_text("v2", encoding="utf-8") - status_file = worker_dir / "status.json" - status_file.write_text(json.dumps({"status": "PASS", "task_index": 0}), encoding="utf-8") - - mock_storage = self.tmp_path / "mock_gcs_fail" - - # When patch.diff fails to upload, upload_run_artifacts must override status to ISSUES - with patch.dict(os.environ, {"STORAGE_MESSENGER_LOCAL_DIR": str(mock_storage)}): - with patch("storage_uploader._generate_git_patch", return_value="diff --git a/target.py"): - with patch("storage_uploader.upload_to_gcs") as mock_upload: - # Let status.json upload succeed, but patch.diff upload fail - def fake_upload(bkt, dest, path): - if "patch.diff" in str(dest): - return False - return True - - mock_upload.side_effect = fake_upload - - uploaded = storage_uploader.upload_run_artifacts( - bucket_name="test-bkt", - prefix="swarms/test-atomic", - repo_dir=worker_dir, - task_index=0, - status="PASS", - candidate_files=["target.py"], - ) - - # patch.diff must not be in uploaded - self.assertNotIn("patch.diff", uploaded) - # status.json on disk must be updated to ISSUES - saved_status = json.loads(status_file.read_text(encoding="utf-8")) - self.assertEqual(saved_status.get("status"), "ISSUES") - self.assertIn("failed to upload", saved_status.get("evidence", "")) - - def test_generate_git_patch_omits_head_commit_when_commit_sha_is_none(self): - repo_dir = self.tmp_path / "patch_repo" - repo_dir.mkdir(parents=True, exist_ok=True) - (repo_dir / ".git").mkdir() - - executed_cmds = [] - - def fake_run(cmd, *args, **kwargs): - executed_cmds.append(cmd) - m = MagicMock() - m.returncode = 0 - m.stdout = "diff --git a/mod.py\n+change" - return m - - with patch("subprocess.run", side_effect=fake_run): - # When commit_sha is None, must NOT diff HEAD~1 HEAD - patch_content = storage_uploader._generate_git_patch( - repo_dir=repo_dir, - candidate_files=["mod.py"], - commit_sha=None, - ) - self.assertTrue(patch_content) - for cmd in executed_cmds: - cmd_str = " ".join(cmd) - self.assertNotIn("HEAD~1", cmd_str) - - # When commit_sha IS provided, must diff {sha}~1 {sha} - executed_cmds.clear() - with patch("subprocess.run", side_effect=fake_run): - patch_content = storage_uploader._generate_git_patch( - repo_dir=repo_dir, - candidate_files=["mod.py"], - commit_sha="a1b2c3d", - ) - self.assertTrue(patch_content) - found_sha_diff = any("a1b2c3d~1" in cmd and "a1b2c3d" in cmd for cmd in executed_cmds) - self.assertTrue(found_sha_diff) - - def test_result_harvester_sorts_non_numeric_and_nan_metrics(self): - mock_storage = self.tmp_path / "mock_nan_gcs" - bucket = "test-nan-bucket" - prefix = "swarms/nan-session" - - t0 = mock_storage / bucket / prefix / "task-0" - t1 = mock_storage / bucket / prefix / "task-1" - t2 = mock_storage / bucket / prefix / "task-2" - t3 = mock_storage / bucket / prefix / "task-3" - for t in (t0, t1, t2, t3): - t.mkdir(parents=True, exist_ok=True) - - # Task 0: string score "N/A" - (t0 / "score.json").write_text(json.dumps({"score": "N/A", "status": "PASS"}), encoding="utf-8") - (t0 / "status.json").write_text(json.dumps({"status": "PASS"}), encoding="utf-8") - # Task 1: valid float score 95.0 - (t1 / "score.json").write_text(json.dumps({"score": 95.0, "status": "PASS"}), encoding="utf-8") - (t1 / "status.json").write_text(json.dumps({"status": "PASS"}), encoding="utf-8") - # Task 2: None score - (t2 / "status.json").write_text(json.dumps({"status": "PASS"}), encoding="utf-8") - # Task 3: valid float score 99.0 - (t3 / "score.json").write_text(json.dumps({"score": 99.0, "status": "PASS"}), encoding="utf-8") - (t3 / "status.json").write_text(json.dumps({"status": "PASS"}), encoding="utf-8") - - dest_dir = self.tmp_path / "harvest_nan_out" - with patch.dict(os.environ, {"STORAGE_MESSENGER_LOCAL_DIR": str(mock_storage)}): - # Must not raise TypeError: must be real number, not str - results = result_harvester.harvest_candidate_patches( - bucket_name=bucket, - prefix=prefix, - dest_dir=dest_dir, - sort_by_delta=True, - ) - - self.assertEqual(len(results), 4) - self.assertEqual(results[0]["task_index"], 3) - self.assertEqual(results[0]["score"], 99.0) - self.assertEqual(results[1]["task_index"], 1) - self.assertEqual(results[1]["score"], 95.0) - - def test_monitor_execution_detects_completed_false(self): - failed_describe_output = json.dumps({ - "metadata": {"name": "test-exec-failed"}, - "status": { - "conditions": [ - { - "type": "Completed", - "status": "False", - "reason": "TasksFailed", - "message": "1 of 2 tasks failed in execution", - } - ], - "succeededCount": 1, - "failedCount": 1, - }, - }) - - def fake_run(cmd, *args, **kwargs): - m = MagicMock() - m.returncode = 0 - if "describe" in cmd: - m.stdout = failed_describe_output - elif "logging" in cmd: - m.stdout = "" - return m - - with patch("subprocess.run", side_effect=fake_run): - res = cloud_dispatch.monitor_execution( - execution_name="test-exec-failed", - project="test-proj", - region="us-central1", - task_count=2, - poll_interval=0.01, - ) - self.assertFalse(res.succeeded) - self.assertIn("failed", res.error.lower()) - self.assertIsNotNone(res.data) - - def test_candidate_table_notice_when_no_passing_patches(self): - import io - patches = [ - {"task_index": 0, "status": "ISSUES", "score": 80.0, "patch_file": "path/0.diff"}, - {"task_index": 1, "status": "ISSUES", "score": 75.0, "patch_file": "path/1.diff"}, - ] - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - cloud_dispatch.print_candidate_patches_table(patches) - out = mock_out.getvalue() - self.assertIn("Notice: No passing candidate patches produced.", out) - self.assertNotIn("1*", out) - self.assertNotIn("Winning Candidate", out) - - def test_recover_session_id_from_execution(self): - describe_output = json.dumps({ - "metadata": {"name": "test-exec-123"}, - "spec": { - "template": { - "spec": { - "template": { - "spec": { - "containers": [ - { - "env": [ - {"name": "REPO_URL", "value": "https://github.com/foo/bar.git"}, - {"name": "SWARM_SESSION_ID", "value": "recovered-session-999"}, - ] - } - ] - } - } - } - } - } - }) - - with patch("subprocess.run") as mock_run: - mock_run.return_value = MagicMock(returncode=0, stdout=describe_output) - session = cloud_dispatch.recover_session_id_from_execution("test-exec-123", region="us-central1") - self.assertEqual(session, "recovered-session-999") - - def test_cloud_worker_fail_closed_in_cloud_mode_without_gcs_bucket(self): - worker_repo = self.tmp_path / "worker_cloud_repo" - worker_repo.mkdir(parents=True, exist_ok=True) - subprocess.run(["git", "init"], cwd=worker_repo, check=True, capture_output=True) - subprocess.run(["git", "config", "user.name", "Tester"], cwd=worker_repo, check=True) - subprocess.run(["git", "config", "user.email", "test@test.com"], cwd=worker_repo, check=True) - (worker_repo / "app.py").write_text("v1", encoding="utf-8") - subprocess.run(["git", "add", "app.py"], cwd=worker_repo, check=True) - subprocess.run(["git", "commit", "-m", "init"], cwd=worker_repo, check=True) - - env = { - "CLOUD_RUN_TASK_INDEX": "0", - "SWARM_SESSION_ID": "sess-fail-closed", - "REPO_URL": "https://github.com/test/repo.git", - "GEMINI_API_KEY": "fake_key", - "TASK_BRIEF": "Optimize app.py", - } - - def fake_clone(repo_url, gh_token, branch_name, repo_dir, base_branch=None): - # Mirror the worker_repo - import shutil - for item in worker_repo.iterdir(): - if item.is_dir(): - shutil.copytree(item, repo_dir / item.name, dirs_exist_ok=True) - else: - shutil.copy2(item, repo_dir / item.name) - - def fake_execute(*args, **kwargs): - # Modify app.py - repo_dir = kwargs.get("repo_dir") - (repo_dir / "app.py").write_text("v2", encoding="utf-8") - return ("PASS", "Work completed successfully") - - orig_cwd = os.getcwd() - try: - with patch.dict(os.environ, env, clear=True): - with patch("cloud_worker.clone_and_checkout_task", side_effect=fake_clone): - with patch("cloud_worker.execute_task", side_effect=fake_execute): - import io - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - with self.assertRaises(SystemExit) as exit_result: - cloud_worker.main() - self.assertEqual(exit_result.exception.code, 1) - out = mock_out.getvalue() - self.assertIn("[STATUS: ISSUES]", out) - self.assertIn("Fail-closed: No GCS bucket configured", out) - finally: - os.chdir(orig_cwd) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_cloud_preflight_and_worker.py b/tests/test_cloud_preflight_and_worker.py deleted file mode 100644 index 2e8fc70..0000000 --- a/tests/test_cloud_preflight_and_worker.py +++ /dev/null @@ -1,1835 +0,0 @@ -import io -import json -import os -import subprocess -import sys -import tempfile -import unittest -import urllib -import urllib.error -from pathlib import Path -from unittest.mock import AsyncMock, MagicMock, patch - -sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "skills" / "swarm" / "scripts")) -import cloud_worker -from cloud_dispatch import ( - build_gcloud_command, - format_monitored_line, - monitor_execution, - parse_milestone_log, - parse_worker_logs, - resolve_swarm_model, - run_preflight, - stage_manifest, -) -from cloud_worker import ( - StagnancyTracker, - ToolInvocationRecord, - clean_repo_url, - clone_and_checkout_task, - create_agent_hooks, - download_manifest, - emit_milestone, - execute_task, - is_candidate_file, - parse_task_manifest, - resolve_worker_branch, - resolve_worker_model, -) - - -class TestCloudWorkerGuardrails(unittest.TestCase): - def test_candidate_file_filter_languages(self): - # Legitimate candidate source files across Python, TS/JS, Go, and Rust - self.assertTrue(is_candidate_file("src/main.py")) - self.assertTrue(is_candidate_file("backend/app/service.py")) - self.assertTrue(is_candidate_file("src/index.ts")) - self.assertTrue(is_candidate_file("ui/components/App.tsx")) - self.assertTrue(is_candidate_file("cmd/server/main.go")) - self.assertTrue(is_candidate_file("pkg/api/handler.go")) - self.assertTrue(is_candidate_file("src/ordering/mod.rs")) - self.assertTrue(is_candidate_file("candidate-worker/src/lib.rs")) - self.assertTrue(is_candidate_file("src/nested_dissection.rs")) - - def test_candidate_file_filter_default_excludes(self): - # Default ignored directories - ignored_dir_files = [ - ".git/config", - ".agents/skills/tool.py", - ".agystack/runtime.json", - "node_modules/react/index.js", - "target/debug/app", - "vendor/cache/pkg.gem", - ".cargo/config.toml", - "dist/index.js", - "build/lib.so", - ".venv/bin/activate", - "__pycache__/app.cpython-311.pyc", - ] - for f in ignored_dir_files: - self.assertFalse(is_candidate_file(f), f"Expected {f} to be excluded by default dir rules.") - - # Default exact excluded files - exact_files = [".git", ".agystack", ".agents"] - for f in exact_files: - self.assertFalse(is_candidate_file(f), f"Expected exact file {f} to be excluded.") - - def test_candidate_file_filter_custom_includes_and_excludes(self): - # Custom candidate list - explicit_candidates = ["src/model/", "scripts/eval.py"] - self.assertTrue(is_candidate_file("src/model/transformer.py", explicit_candidates=explicit_candidates)) - self.assertTrue(is_candidate_file("scripts/eval.py", explicit_candidates=explicit_candidates)) - self.assertFalse(is_candidate_file("src/other/worker.py", explicit_candidates=explicit_candidates)) - self.assertFalse(is_candidate_file("main.py", explicit_candidates=explicit_candidates)) - - # Custom excludes list - explicit_excludes = ["src/generated/", "proto/"] - self.assertFalse(is_candidate_file("src/generated/types.ts", explicit_excludes=explicit_excludes)) - self.assertFalse(is_candidate_file("proto/service.pb.go", explicit_excludes=explicit_excludes)) - self.assertTrue(is_candidate_file("src/valid.ts", explicit_excludes=explicit_excludes)) - - def test_parse_worker_logs(self): - log_sample = """ -================================================================================ -[STATUS: PASS] -Evidence: -- Task Index: 0 -- Branch: worker-0 -- Commit SHA: abc1234 -Summary: -Optimized Subtree Round 5 gating successfully. -================================================================================ -""" - parsed = parse_worker_logs(log_sample) - self.assertEqual(len(parsed), 1) - self.assertEqual(parsed[0]["status"], "PASS") - self.assertIn("Optimized Subtree Round 5", parsed[0]["summary"]) - - def test_emit_milestone_formatting(self): - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - emit_milestone(0, "BOOTING") - self.assertEqual(mock_out.getvalue(), "[MILESTONE] [TASK 0] [PHASE: BOOTING]\n") - - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - emit_milestone(3, "RUNNING_AGENT", "Antigravity SDK agent turn 1") - self.assertEqual( - mock_out.getvalue(), - "[MILESTONE] [TASK 3] [PHASE: RUNNING_AGENT] Antigravity SDK agent turn 1\n", - ) - - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - emit_milestone(1, "COMPLETE", "PASS") - self.assertEqual(mock_out.getvalue(), "[MILESTONE] [TASK 1] [PHASE: COMPLETE] PASS\n") - - def test_parse_milestone_log(self): - res = parse_milestone_log("[MILESTONE] [TASK 0] [PHASE: BOOTING]") - self.assertIsNotNone(res) - self.assertEqual(res["task_index"], "0") - self.assertEqual(res["phase"], "BOOTING") - self.assertEqual(res["detail"], "") - - res = parse_milestone_log("[MILESTONE] [TASK 2] [PHASE: COMPLETE] PASS") - self.assertIsNotNone(res) - self.assertEqual(res["task_index"], "2") - self.assertEqual(res["phase"], "COMPLETE") - self.assertEqual(res["detail"], "PASS") - - res = parse_milestone_log( - "2026-09-04T22:30:00.123Z [MILESTONE] [TASK 5] [PHASE: RUNNING_AGENT] evaluating slice 0..10" - ) - self.assertIsNotNone(res) - self.assertEqual(res["task_index"], "5") - self.assertEqual(res["phase"], "RUNNING_AGENT") - self.assertEqual(res["detail"], "evaluating slice 0..10") - - self.assertIsNone(parse_milestone_log("Building candidate worker...")) - self.assertIsNone(parse_milestone_log("[STATUS: PASS]")) - - def test_build_gcloud_command_sync_and_async(self): - cmd_async = build_gcloud_command( - job_name="test-swarm-job", - tasks_count=4, - parallelism=10, - region="us-central1", - project="test-project", - env_vars={"KEY1": "VAL1"}, - wait=False, - max_retries=0, - ) - self.assertIn("--async", cmd_async) - self.assertNotIn("--wait", cmd_async) - self.assertIn("--tasks=4", cmd_async) - self.assertNotIn("--parallelism", " ".join(cmd_async)) - self.assertNotIn("--max-retries", " ".join(cmd_async)) - - cmd_sync = build_gcloud_command( - job_name="test-swarm-job", - tasks_count=4, - parallelism=10, - region="us-central1", - project="test-project", - env_vars={"KEY1": "VAL1"}, - wait=True, - max_retries=2, - ) - self.assertIn("--wait", cmd_sync) - self.assertNotIn("--async", cmd_sync) - self.assertNotIn("--parallelism", " ".join(cmd_sync)) - self.assertNotIn("--max-retries", " ".join(cmd_sync)) - - @patch("subprocess.run") - def test_monitor_execution_under_threshold(self, mock_subproc): - describe_output = json.dumps({ - "metadata": {"name": "test-exec-123"}, - "status": { - "conditions": [{"type": "Completed", "status": "True"}], - "succeededCount": 2, - }, - }) - logging_output = "[MILESTONE] [TASK 0] [PHASE: BOOTING]\n[MILESTONE] [TASK 0] [PHASE: COMPLETE] PASS\n" - - def fake_run(cmd, *args, **kwargs): - m = MagicMock() - m.returncode = 0 - if "describe" in cmd: - m.stdout = describe_output - elif "logging" in cmd: - m.stdout = logging_output - else: - m.stdout = "" - return m - - mock_subproc.side_effect = fake_run - - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - desc = monitor_execution( - execution_name="test-exec-123", - project="test-proj", - region="us-central1", - task_count=2, - poll_interval=0.01, - ) - out = mock_out.getvalue() - self.assertIn("[MILESTONE] [TASK 0] [PHASE: BOOTING]", out) - self.assertIn("[MILESTONE] [TASK 0] [PHASE: COMPLETE] PASS", out) - self.assertIsNotNone(desc) - - @patch("subprocess.run") - def test_monitor_execution_over_threshold(self, mock_subproc): - describe_output = json.dumps({ - "metadata": {"name": "test-exec-456"}, - "status": { - "conditions": [{"type": "Completed", "status": "True"}], - "succeededCount": 5, - "runningCount": 0, - "failedCount": 0, - }, - }) - - mock_res = MagicMock() - mock_res.returncode = 0 - mock_res.stdout = describe_output - mock_subproc.return_value = mock_res - - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - desc = monitor_execution( - execution_name="test-exec-456", - project="test-proj", - region="us-central1", - task_count=5, - poll_interval=0.01, - ) - out = mock_out.getvalue() - self.assertIn("[Cloud Swarm] Progress: 5/5 succeeded, 0 running, 0 failed.", out) - self.assertIsNotNone(desc) - - def test_format_monitored_line_standard(self): - line = "[MILESTONE] [TASK 0] [PHASE: BOOTING]" - self.assertEqual(format_monitored_line(line), line) - line2 = "[STATUS: RUNNING] Normal status update" - self.assertEqual(format_monitored_line(line2), line2) - - def test_format_monitored_line_alarm_color_tty(self): - line = "[ALARM] Stagnancy detected in task 3" - formatted = format_monitored_line(line, use_color=True) - self.assertEqual( - formatted, - "\033[91;1m[ALARM] >>> Stagnancy detected in task 3 <<<\033[0m", - ) - self.assertNotIn("[ALARM] >>> [ALARM]", formatted) - - def test_format_monitored_line_alarm_no_color(self): - line = "[ALARM] Stagnancy detected in task 3" - formatted = format_monitored_line(line, use_color=False) - self.assertEqual(formatted, "[ALARM] >>> Stagnancy detected in task 3 <<<") - self.assertNotIn("\033[", formatted) - self.assertEqual(format_monitored_line("[ALARM]", use_color=False), "[ALARM]") - - def test_format_monitored_line_alarm_idempotency(self): - already_wrapped = "[ALARM] >>> already alerted <<<" - self.assertEqual( - format_monitored_line(already_wrapped, use_color=False), - already_wrapped, - ) - self.assertEqual( - format_monitored_line(already_wrapped, use_color=True), - f"\033[91;1m{already_wrapped}\033[0m", - ) - - def test_format_monitored_line_potential_loop(self): - line = "[MILESTONE] [TASK 2] [PHASE: POTENTIAL_LOOP] repeated command detected" - self.assertEqual( - format_monitored_line(line, use_color=False), - f"[ALARM] >>> {line} <<<", - ) - self.assertEqual( - format_monitored_line(line, use_color=True), - f"\033[91;1m[ALARM] >>> {line} <<<\033[0m", - ) - - def test_format_monitored_line_no_false_positive_on_args(self): - line = "[MILESTONE] 1 TOOL_START grep_search {'query': 'POTENTIAL_LOOP'}" - self.assertEqual(format_monitored_line(line, use_color=True), line) - line2 = "[MILESTONE] 2 TOOL_START view_file {'path': '/some/[ALARM]/file.py'}" - self.assertEqual(format_monitored_line(line2, use_color=True), line2) - line3 = "[MILESTONE] 3 TOOL_START run_command {'command': 'echo WAITING_FOR_ORCHESTRATOR'}" - self.assertEqual(format_monitored_line(line3, use_color=True), line3) - self.assertEqual(format_monitored_line(line3, use_color=False), line3) - - def test_format_monitored_line_waiting_for_orchestrator(self): - line = "[TASK 1] WAITING_FOR_ORCHESTRATOR steer input needed" - self.assertEqual( - format_monitored_line(line, use_color=False), - "[WAITING_FOR_ORCHESTRATOR] >>> [TASK 1] WAITING_FOR_ORCHESTRATOR steer input needed <<<", - ) - self.assertEqual( - format_monitored_line(line, use_color=True), - "\033[93;1m[WAITING_FOR_ORCHESTRATOR] >>> [TASK 1] WAITING_FOR_ORCHESTRATOR steer input needed <<<\033[0m", - ) - bare_waiting = "WAITING_FOR_ORCHESTRATOR input needed" - self.assertEqual( - format_monitored_line(bare_waiting, use_color=False), - "[WAITING_FOR_ORCHESTRATOR] >>> WAITING_FOR_ORCHESTRATOR input needed <<<", - ) - already_wrapped = "[WAITING_FOR_ORCHESTRATOR] >>> steer needed <<<" - self.assertEqual(format_monitored_line(already_wrapped, use_color=False), already_wrapped) - self.assertEqual( - format_monitored_line(already_wrapped, use_color=True), - f"\033[93;1m{already_wrapped}\033[0m", - ) - - @patch("subprocess.run") - def test_monitor_execution_alarm_streaming(self, mock_subproc): - describe_output = json.dumps({ - "metadata": {"name": "test-exec-alarm"}, - "status": { - "conditions": [{"type": "Completed", "status": "True"}], - "succeededCount": 1, - }, - }) - logging_output = ( - "[MILESTONE] [TASK 0] [PHASE: BOOTING]\n" - "[ALARM] Task 0 stuck in loop\n" - "[TASK 0] WAITING_FOR_ORCHESTRATOR needs approval\n" - "[MILESTONE] 0 TOOL_START grep_search {'query': 'POTENTIAL_LOOP'}\n" - ) - - def fake_run(cmd, *args, **kwargs): - m = MagicMock() - m.returncode = 0 - if "describe" in cmd: - m.stdout = describe_output - elif "logging" in cmd: - m.stdout = logging_output - else: - m.stdout = "" - return m - - mock_subproc.side_effect = fake_run - - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - desc = monitor_execution( - execution_name="test-exec-alarm", - project="test-proj", - region="us-central1", - task_count=1, - poll_interval=0.01, - ) - out = mock_out.getvalue() - self.assertIn("[MILESTONE] [TASK 0] [PHASE: BOOTING]", out) - self.assertIn("[ALARM] >>> Task 0 stuck in loop <<<", out) - self.assertNotIn("[ALARM] >>> [ALARM]", out) - self.assertIn( - "[WAITING_FOR_ORCHESTRATOR] >>> [TASK 0] WAITING_FOR_ORCHESTRATOR needs approval <<<", - out, - ) - self.assertIn( - "[MILESTONE] 0 TOOL_START grep_search {'query': 'POTENTIAL_LOOP'}", - out, - ) - self.assertNotIn(">>> [MILESTONE] 0 TOOL_START", out) - self.assertIsNotNone(desc) - - -class TestTaskExecutionAndValidation(unittest.TestCase): - def setUp(self): - self.temp_dir = tempfile.TemporaryDirectory() - self.repo_dir = Path(self.temp_dir.name) - - def tearDown(self): - self.temp_dir.cleanup() - - def test_command_runner_success(self): - task_item = {"type": "command", "command": "echo 'command test output'"} - status, output = execute_task( - task_item=task_item, - task_brief="", - repo_dir=self.repo_dir, - model_override="", - api_key="", - ) - self.assertEqual(status, "PASS") - self.assertIn("command test output", output) - - def test_command_runner_failure(self): - task_item = {"type": "command", "command": "echo 'failing command' >&2; exit 1"} - status, output = execute_task( - task_item=task_item, - task_brief="", - repo_dir=self.repo_dir, - model_override="", - api_key="", - ) - self.assertEqual(status, "ISSUES") - self.assertIn("failing command", output) - - def test_agent_mode_passes_poteto_system_prompt_to_config(self): - mock_ag = MagicMock() - mock_config = MagicMock() - mock_ag.LocalAgentConfig = mock_config - mock_ag.CapabilitiesConfig = MagicMock() - mock_ag.policy.allow_all = MagicMock() - - mock_agent_instance = MagicMock() - mock_resp = MagicMock() - mock_resp.text = AsyncMock(return_value="completed successfully\n[STATUS: PASS]") - mock_agent_instance.chat = AsyncMock(return_value=mock_resp) - - mock_agent_cm = MagicMock() - mock_agent_cm.__aenter__ = AsyncMock(return_value=mock_agent_instance) - mock_agent_cm.__aexit__ = AsyncMock(return_value=None) - mock_ag.Agent = MagicMock(return_value=mock_agent_cm) - - modules_patch = { - "google": MagicMock(), - "google.antigravity": mock_ag, - } - with patch.dict(sys.modules, modules_patch): - status, output = execute_task( - task_item={"type": "agent"}, - task_brief="Implement PR-5", - repo_dir=self.repo_dir, - model_override="gemini-3.8-flash", - api_key="test-key", - ) - self.assertEqual(status, "PASS") - mock_config.assert_called_once() - call_kwargs = mock_config.call_args[1] - self.assertIn("system_prompt", call_kwargs) - self.assertIn("poteto", call_kwargs["system_prompt"].lower()) - self.assertIn("surgical", call_kwargs["system_prompt"].lower()) - self.assertIn("unslopped", call_kwargs["system_prompt"].lower()) - - def test_agent_mode_env_var_overrides_poteto_system_prompt(self): - mock_ag = MagicMock() - mock_config = MagicMock() - mock_ag.LocalAgentConfig = mock_config - mock_ag.CapabilitiesConfig = MagicMock() - mock_ag.policy.allow_all = MagicMock() - - mock_agent_instance = MagicMock() - mock_resp = MagicMock() - mock_resp.text = AsyncMock(return_value="done\n[STATUS: PASS]") - mock_agent_instance.chat = AsyncMock(return_value=mock_resp) - - mock_agent_cm = MagicMock() - mock_agent_cm.__aenter__ = AsyncMock(return_value=mock_agent_instance) - mock_agent_cm.__aexit__ = AsyncMock(return_value=None) - mock_ag.Agent = MagicMock(return_value=mock_agent_cm) - - modules_patch = { - "google": MagicMock(), - "google.antigravity": mock_ag, - } - custom_prompt = "Custom system prompt for worker override" - with patch.dict(sys.modules, modules_patch), patch.dict(os.environ, {"AGYSTACK_WORKER_SYSTEM_PROMPT": custom_prompt}): - status, output = execute_task( - task_item={"type": "agent"}, - task_brief="Custom prompt task", - repo_dir=self.repo_dir, - model_override="gemini-3.8-flash", - api_key="test-key", - ) - self.assertEqual(status, "PASS") - call_kwargs = mock_config.call_args[1] - self.assertEqual(call_kwargs.get("system_prompt"), custom_prompt) - - def test_agent_mode_typeerror_fallback_pops_optional_keys(self): - mock_ag = MagicMock() - mock_ag.CapabilitiesConfig = MagicMock() - mock_ag.policy.allow_all = MagicMock() - - def fake_local_agent_config(**kwargs): - if "system_prompt" in kwargs or "custom_tools" in kwargs: - raise TypeError("unsupported parameter") - return MagicMock() - - mock_ag.LocalAgentConfig = MagicMock(side_effect=fake_local_agent_config) - - mock_agent_instance = MagicMock() - mock_resp = MagicMock() - mock_resp.text = AsyncMock(return_value="fallback success\n[STATUS: PASS]") - mock_agent_instance.chat = AsyncMock(return_value=mock_resp) - - mock_agent_cm = MagicMock() - mock_agent_cm.__aenter__ = AsyncMock(return_value=mock_agent_instance) - mock_agent_cm.__aexit__ = AsyncMock(return_value=None) - mock_ag.Agent = MagicMock(return_value=mock_agent_cm) - - modules_patch = { - "google": MagicMock(), - "google.antigravity": mock_ag, - } - with patch.dict(sys.modules, modules_patch), patch("cloud_worker.emit_milestone") as mock_milestone: - status, output = execute_task( - task_item={"type": "agent"}, - task_brief="Implement PR-5 with fallback", - repo_dir=self.repo_dir, - model_override="gemini-3.8-flash", - api_key="test-key", - ) - self.assertEqual(status, "PASS") - self.assertEqual(mock_ag.LocalAgentConfig.call_count, 2) - fallback_kwargs = mock_ag.LocalAgentConfig.call_args[1] - self.assertNotIn("system_prompt", fallback_kwargs) - self.assertNotIn("custom_tools", fallback_kwargs) - milestone_phases = [call.args[1] for call in mock_milestone.call_args_list] - self.assertIn("AGENT_FALLBACK", milestone_phases) - - -class TestPreflightGlobalAndRegionalURL(unittest.TestCase): - @patch("urllib.request.urlopen") - @patch("subprocess.run") - def test_preflight_vertex_global_url_and_headers(self, mock_subproc, mock_urlopen): - def fake_run(cmd, *args, **kwargs): - m = MagicMock() - m.returncode = 0 - if "print-access-token" in cmd: - m.stdout = "token-xyz\n" - else: - m.stdout = "HEAD\n" - return m - mock_subproc.side_effect = fake_run - - mock_resp = MagicMock() - mock_resp.__enter__.return_value = mock_resp - mock_urlopen.return_value = mock_resp - - run_preflight( - repo_url="https://github.com/test/repo.git", - gh_token="gh-token", - use_vertex=True, - gemini_api_key="", - project="my-gcp-project", - region="us-central1", - model="gemini-3.8-flash", - dry_run=False, - gcs_bucket="test-bucket", - ) - - mock_urlopen.assert_called_once() - req = mock_urlopen.call_args[0][0] - self.assertEqual( - req.full_url, - "https://aiplatform.googleapis.com/v1/projects/my-gcp-project/locations/global/publishers/google/models/gemini-3.8-flash:generateContent", - ) - self.assertEqual(req.get_header("X-goog-user-project"), "my-gcp-project") - self.assertEqual(req.get_header("Authorization"), "Bearer token-xyz") - req_body = json.loads(req.data.decode("utf-8")) - self.assertEqual(req_body.get("generationConfig", {}).get("maxOutputTokens"), 1) - - @patch("urllib.request.urlopen") - @patch("subprocess.run") - def test_preflight_vertex_regional_url_and_headers(self, mock_subproc, mock_urlopen): - def fake_run(cmd, *args, **kwargs): - m = MagicMock() - m.returncode = 0 - if "print-access-token" in cmd: - m.stdout = "token-xyz\n" - else: - m.stdout = "HEAD\n" - return m - mock_subproc.side_effect = fake_run - - mock_resp = MagicMock() - mock_resp.__enter__.return_value = mock_resp - mock_urlopen.return_value = mock_resp - - run_preflight( - repo_url="https://github.com/test/repo.git", - gh_token="gh-token", - use_vertex=True, - gemini_api_key="", - project="my-gcp-project", - region="europe-west4", - model="gemini-1.5-flash", - dry_run=False, - gcs_bucket="test-bucket", - ) - - mock_urlopen.assert_called_once() - req = mock_urlopen.call_args[0][0] - self.assertEqual( - req.full_url, - "https://europe-west4-aiplatform.googleapis.com/v1/projects/my-gcp-project/locations/europe-west4/publishers/google/models/gemini-1.5-flash:generateContent", - ) - self.assertEqual(req.get_header("X-goog-user-project"), "my-gcp-project") - - @patch("urllib.request.urlopen") - @patch("subprocess.run") - def test_preflight_vertex_partner_model_url_and_guidance(self, mock_subproc, mock_urlopen): - def fake_run(cmd, *args, **kwargs): - m = MagicMock() - m.returncode = 0 - if "print-access-token" in cmd: - m.stdout = "token-xyz\n" - else: - m.stdout = "HEAD\n" - return m - mock_subproc.side_effect = fake_run - - # 1. Success case: verifies rawPredict endpoint and resolution to claude-3-opus@20240229 in us-east5 - mock_resp = MagicMock() - mock_resp.__enter__.return_value = mock_resp - mock_urlopen.return_value = mock_resp - - run_preflight( - repo_url="https://github.com/test/repo.git", - gh_token="gh-token", - use_vertex=True, - gemini_api_key="", - project="my-gcp-project", - region="global", - model="opus-5.5", - dry_run=False, - gcs_bucket="test-bucket", - ) - - mock_urlopen.assert_called_once() - req = mock_urlopen.call_args[0][0] - self.assertEqual( - req.full_url, - "https://us-east5-aiplatform.googleapis.com/v1/projects/my-gcp-project/locations/us-east5/publishers/anthropic/models/claude-3-opus@20240229:rawPredict", - ) - self.assertEqual(req.get_header("X-goog-user-project"), "my-gcp-project") - self.assertEqual(req.get_header("Authorization"), "Bearer token-xyz") - req_body = json.loads(req.data.decode("utf-8")) - self.assertEqual(req_body.get("anthropic_version"), "vertex-2023-10-16") - self.assertEqual(req_body.get("messages"), [{"role": "user", "content": "ping"}]) - self.assertEqual(req_body.get("max_tokens"), 1) - - # 2. HTTP 404 error case: raises RuntimeError with Model Garden instructions - mock_urlopen.reset_mock() - http_404 = urllib.error.HTTPError( - url=req.full_url, - code=404, - msg="Not Found", - hdrs={}, - fp=io.BytesIO(b'{"error": {"code": 404, "message": "Publisher model not found"}}'), - ) - mock_urlopen.side_effect = http_404 - - with self.assertRaises(RuntimeError) as ctx: - run_preflight( - repo_url="https://github.com/test/repo.git", - gh_token="gh-token", - use_vertex=True, - gemini_api_key="", - project="my-gcp-project", - region="global", - model="opus-5.5", - dry_run=False, - gcs_bucket="test-bucket", - ) - err_msg = str(ctx.exception) - self.assertIn("opus-5.5", err_msg) - self.assertIn("claude-3-opus@20240229", err_msg) - self.assertIn("us-east5", err_msg) - self.assertIn("404 Not Found", err_msg) - self.assertIn("Model Garden", err_msg) - self.assertIn("Enable", err_msg) - - @patch("urllib.request.urlopen") - @patch("subprocess.run") - def test_preflight_vertex_deepseek_model_url(self, mock_subproc, mock_urlopen): - def fake_run(cmd, *args, **kwargs): - m = MagicMock() - m.returncode = 0 - if "print-access-token" in cmd: - m.stdout = "token-xyz\n" - else: - m.stdout = "HEAD\n" - return m - mock_subproc.side_effect = fake_run - - mock_resp = MagicMock() - mock_resp.__enter__.return_value = mock_resp - mock_urlopen.return_value = mock_resp - - run_preflight( - repo_url="https://github.com/test/repo.git", - gh_token="gh-token", - use_vertex=True, - gemini_api_key="", - project="my-gcp-project", - region="global", - model="deepseek-v4.1-flash", - dry_run=False, - gcs_bucket="test-bucket", - ) - - mock_urlopen.assert_called_once() - req = mock_urlopen.call_args[0][0] - self.assertEqual( - req.full_url, - "https://aiplatform.googleapis.com/v1/projects/my-gcp-project/locations/global/publishers/deepseek-ai/models/deepseek-v4.1-flash-maas:generateContent", - ) - self.assertEqual(req.get_header("X-goog-user-project"), "my-gcp-project") - self.assertEqual(req.get_header("Authorization"), "Bearer token-xyz") - req_body = json.loads(req.data.decode("utf-8")) - self.assertEqual(req_body.get("generationConfig", {}).get("maxOutputTokens"), 1) - - @patch("urllib.request.urlopen") - @patch("subprocess.run") - def test_preflight_deepseek_auto_vertex_and_canonical_alias(self, mock_subproc, mock_urlopen): - def fake_run(cmd, *args, **kwargs): - m = MagicMock() - m.returncode = 0 - if "print-access-token" in cmd: - m.stdout = "token-xyz\n" - else: - m.stdout = "HEAD\n" - return m - mock_subproc.side_effect = fake_run - - mock_resp = MagicMock() - mock_resp.__enter__.return_value = mock_resp - mock_urlopen.return_value = mock_resp - - run_preflight( - repo_url="https://github.com/test/repo.git", - gh_token="gh-token", - use_vertex=False, - gemini_api_key="", - project="my-gcp-project", - region="global", - model="deepseek", - dry_run=False, - gcs_bucket="test-bucket", - ) - - mock_urlopen.assert_called_once() - req = mock_urlopen.call_args[0][0] - self.assertEqual( - req.full_url, - "https://aiplatform.googleapis.com/v1/projects/my-gcp-project/locations/global/publishers/deepseek-ai/models/deepseek-v4.1-flash-maas:generateContent", - ) - self.assertEqual(req.get_header("Authorization"), "Bearer token-xyz") - req_body = json.loads(req.data.decode("utf-8")) - self.assertEqual(req_body.get("generationConfig", {}).get("maxOutputTokens"), 1) - - @patch("urllib.request.urlopen") - @patch("subprocess.run") - def test_preflight_vertex_gemini_generation_config_max_output_tokens(self, mock_subproc, mock_urlopen): - def fake_run(cmd, *args, **kwargs): - m = MagicMock() - m.returncode = 0 - if "print-access-token" in cmd: - m.stdout = "token-xyz\n" - else: - m.stdout = "HEAD\n" - return m - mock_subproc.side_effect = fake_run - - mock_resp = MagicMock() - mock_resp.__enter__.return_value = mock_resp - mock_urlopen.return_value = mock_resp - - run_preflight( - repo_url="https://github.com/test/repo.git", - gh_token="gh-token", - use_vertex=True, - gemini_api_key="", - project="my-gcp-project", - region="us-central1", - model="gemini-4-argon", - dry_run=False, - gcs_bucket="test-bucket", - ) - - mock_urlopen.assert_called_once() - req = mock_urlopen.call_args[0][0] - req_body = json.loads(req.data.decode("utf-8")) - self.assertEqual(req_body.get("generationConfig", {}).get("maxOutputTokens"), 1) - - def test_tier3_dedicated_models_interception(self): - for model in ("glm-5-3-flash", "llama-3.3-70b", "GLM-5-3-FLASH", "Llama-3.3-70b", "glm-5.3", "llama-3.3", "glm-5.3-flash", "llama-3.3-70b-instruct"): - with self.subTest(model=model): - with self.assertRaises(RuntimeError) as ctx: - run_preflight( - repo_url="https://github.com/org/repo.git", - gh_token="test-token", - use_vertex=True, - gemini_api_key="", - project="test-proj", - region="us-central1", - model=model, - dry_run=False, - ) - self.assertIn("Tier 3 open-weights model requiring a dedicated GPU cluster endpoint", str(ctx.exception)) - self.assertIn("gemini-4-argon, gemini-3.8-flash, deepseek-v4.1-flash", str(ctx.exception)) - - def test_cloud_dispatch_list_models_flag(self): - import cloud_dispatch - with patch("sys.argv", ["cloud_dispatch.py", "--list-models"]), patch("sys.stdout", new_callable=io.StringIO) as mock_out: - cloud_dispatch.main() - out = mock_out.getvalue() - self.assertIn("Vertex AI Model Garden Tiers for Cloud Swarms:", out) - self.assertIn("Tier 1: Native MaaS", out) - self.assertIn("Tier 2: Gated Partner MaaS", out) - self.assertIn("Tier 3: Dedicated GPU Cluster Endpoints", out) - self.assertIn("glm-5-3-flash", out) - self.assertIn("llama-3.3-70b", out) - self.assertIn("gemini-4-argon", out) - self.assertIn("deepseek-v4.1-flash", out) - - @patch("urllib.request.urlopen") - @patch("subprocess.run") - def test_preflight_free_tier_indicator_rejection(self, mock_subproc, mock_urlopen): - mock_subproc.return_value = MagicMock(returncode=0, stdout="HEAD\n") - - mock_resp = MagicMock() - mock_resp.__enter__.return_value = mock_resp - mock_resp.read.return_value = b'{"error": "rate limit <= 5 rpm"}' - mock_resp.headers = {"x-rate-limit": "5rpm"} - mock_urlopen.return_value = mock_resp - - with self.assertRaises(RuntimeError) as ctx: - run_preflight( - repo_url="https://github.com/test/repo.git", - gh_token="gh-token", - use_vertex=False, - gemini_api_key="AIzaTestKey", - project="", - region="us-central1", - model="gemini-3.8-flash", - dry_run=False, - gcs_bucket="test-bucket", - ) - self.assertIn("Free-tier Gemini API key detected", str(ctx.exception)) - - def test_resolve_swarm_model_cli_override(self): - # Direct CLI override takes highest precedence - self.assertEqual(resolve_swarm_model(cli_model="gemini-2.5-flash"), "gemini-2.5-flash") - self.assertEqual(resolve_swarm_model(cli_model="gemini-3.7-flash"), "gemini-3.7-flash") - - def test_resolve_swarm_model_tier_mappings(self): - # Tiers map to concrete Cloud Run / Vertex AI models - self.assertEqual(resolve_swarm_model(cli_model="pro"), "gemini-3.1-pro") - self.assertEqual(resolve_swarm_model(cli_model="flash"), "gemini-3.8-flash") - self.assertEqual(resolve_swarm_model(cli_model="flash_lite"), "gemini-3.1-flash-lite") - self.assertEqual(resolve_swarm_model(cli_model="flash-lite"), "gemini-3.1-flash-lite") - self.assertEqual(resolve_swarm_model(cli_model="inherit"), "gemini-3.8-flash") - self.assertEqual(resolve_swarm_model(cli_model="auto"), "gemini-3.8-flash") - self.assertEqual(resolve_swarm_model(cli_model="inherit-parent"), "gemini-3.8-flash") - self.assertEqual(resolve_swarm_model(cli_model="inherit_parent"), "gemini-3.8-flash") - self.assertEqual(resolve_swarm_model(cli_model="argon"), "gemini-4-argon") - self.assertEqual(resolve_swarm_model(cli_model="gemini-argon"), "gemini-4-argon") - self.assertEqual(resolve_swarm_model(cli_model="gemini"), "gemini-3.8-flash") - self.assertEqual(resolve_swarm_model(cli_model="deepseek"), "deepseek-v4.1-flash") - self.assertEqual(resolve_swarm_model(cli_model="deepseek-flash"), "deepseek-v4.1-flash") - self.assertEqual(cloud_worker.resolve_worker_model("argon"), "gemini-4-argon") - self.assertEqual(cloud_worker.resolve_worker_model("deepseek"), "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas") - self.assertEqual(cloud_worker.resolve_worker_model("deepseek-flash"), "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas") - - def test_resolve_swarm_model_parent_model_inheritance(self): - # Explicit parent_model argument - self.assertEqual( - resolve_swarm_model(cli_model="inherit", parent_model="gemini-3.7-flash"), - "gemini-3.7-flash", - ) - self.assertEqual( - resolve_swarm_model(cli_model="auto", parent_model="gemini-3.1-pro"), - "gemini-3.1-pro", - ) - # Inherited from ANTIGRAVITY_MODEL env var - with patch.dict(os.environ, {"ANTIGRAVITY_MODEL": "claude-3-7-sonnet"}): - self.assertEqual(resolve_swarm_model(cli_model="inherit"), "claude-3-7-sonnet") - # Inherited from GEMINI_MODEL env var - with patch.dict(os.environ, {"GEMINI_MODEL": "gemini-2.5-flash"}): - self.assertEqual(resolve_swarm_model(cli_model="inherit"), "gemini-2.5-flash") - - def test_resolve_swarm_model_runtime_config_and_agystack_models(self): - # Explicit model in runtime config - self.assertEqual(resolve_swarm_model(runtime_model="gemini-2.5-pro"), "gemini-2.5-pro") - - # When runtime config is 'inherit', it resolves to role or default - with tempfile.NamedTemporaryFile("w", encoding="utf-8", delete=False) as f: - f.write("# Model config\nswarm workers: pro\n") - f_path = Path(f.name) - try: - resolved = resolve_swarm_model(runtime_model="inherit", agystack_models_path=f_path) - self.assertEqual(resolved, "gemini-3.1-pro") - finally: - f_path.unlink(missing_ok=True) - - def test_worker_resolve_model_per_task_and_alias(self): - # 1. Per-task override in task_item takes highest precedence - task_with_model = {"type": "agent", "model": "gemini-3.1-pro"} - self.assertEqual( - resolve_worker_model(raw_model="gemini-2.5-flash", task_item=task_with_model), - "gemini-3.1-pro", - ) - - # 2. Per-task alias resolution - task_with_alias = {"type": "agent", "model": "flash_lite"} - self.assertEqual( - resolve_worker_model(raw_model="", task_item=task_with_alias), - "gemini-3.1-flash-lite", - ) - - # 3. Raw model alias resolution - self.assertEqual(resolve_worker_model(raw_model="pro"), "gemini-3.1-pro") - self.assertEqual(resolve_worker_model(raw_model="flash"), "gemini-3.8-flash") - self.assertEqual(resolve_worker_model(raw_model="auto"), "gemini-3.8-flash") - self.assertEqual(resolve_worker_model(raw_model="inherit-parent"), "gemini-3.8-flash") - - # 4. Custom model slug passthrough - self.assertEqual(resolve_worker_model(raw_model="gemini-2.5-flash"), "gemini-2.5-flash") - - # 5. Default model from env var - with patch.dict(os.environ, {"DEFAULT_SWARM_MODEL": "gemini-2.5-flash"}): - self.assertEqual(resolve_worker_model(raw_model="auto"), "gemini-2.5-flash") - self.assertEqual(resolve_worker_model(raw_model=""), "gemini-2.5-flash") - - -class TestSecureSwarmAndManifestStaging(unittest.TestCase): - def setUp(self): - self.temp_dir_obj = tempfile.TemporaryDirectory() - self.temp_dir = Path(self.temp_dir_obj.name) - - def tearDown(self): - self.temp_dir_obj.cleanup() - - def test_manifest_staging_avoids_large_task_manifest_env(self): - # 1. Test stage_manifest uploads to gs:///swarms//manifest.json - large_tasks = [{"task_id": i, "brief": f"Task number {i} with substantial description " * 20} for i in range(50)] - manifest_serialized = json.dumps(large_tasks) - self.assertGreater(len(manifest_serialized), 32 * 1024) - - with patch.dict(os.environ, {"STORAGE_MESSENGER_LOCAL_DIR": str(self.temp_dir)}): - staged_uri = stage_manifest( - manifest_data=large_tasks, - bucket_name="my-manifest-bucket", - session_id="session-test-42", - ) - self.assertEqual(staged_uri, "gs://my-manifest-bucket/swarms/session-test-42/manifest.json") - staged_file = self.temp_dir / "my-manifest-bucket" / "swarms" / "session-test-42" / "manifest.json" - self.assertTrue(staged_file.is_file()) - loaded = json.loads(staged_file.read_text(encoding="utf-8")) - self.assertEqual(len(loaded), 50) - self.assertEqual(loaded[0]["task_id"], 0) - - # 2. Test CLI dispatcher sets MANIFEST_URI and omits TASK_MANIFEST when bucket is provided - manifest_path = self.temp_dir / "manifest.json" - manifest_path.write_text(manifest_serialized, encoding="utf-8") - - dispatch_script = Path(__file__).resolve().parent.parent / "skills" / "swarm" / "scripts" / "cloud_dispatch.py" - cmd = [ - sys.executable, - str(dispatch_script), - "--dry-run", - "--manifest", str(manifest_path), - "--gcs-bucket", "my-manifest-bucket", - "--session-id", "session-test-42", - "--repo", "https://github.com/test/repo.git", - "--vertex", - "--project", "test-project", - ] - res = subprocess.run(cmd, capture_output=True, text=True, check=True, env=dict(os.environ, GH_TOKEN="test_tok")) - payload = json.loads(res.stdout) - env_vars = payload["env_vars"] - - self.assertIn("MANIFEST_URI", env_vars) - self.assertEqual(env_vars["MANIFEST_URI"], "gs://my-manifest-bucket/swarms/session-test-42/manifest.json") - self.assertNotIn("TASK_MANIFEST", env_vars) - - # 3. Test that when no GCS bucket is provided, it falls back to TASK_MANIFEST - cmd_no_bkt = [ - sys.executable, - str(dispatch_script), - "--dry-run", - "--manifest", str(manifest_path), - "--gcs-bucket", "", - "--repo", "https://github.com/test/repo.git", - "--vertex", - "--project", "test-project", - ] - res_no_bkt = subprocess.run(cmd_no_bkt, capture_output=True, text=True, check=True, env=dict(os.environ, GH_TOKEN="test_tok")) - payload_no_bkt = json.loads(res_no_bkt.stdout) - env_vars_no_bkt = payload_no_bkt["env_vars"] - - self.assertIn("TASK_MANIFEST", env_vars_no_bkt) - self.assertNotIn("MANIFEST_URI", env_vars_no_bkt) - - def test_worker_loads_tasks_from_manifest_uri(self): - tasks = [ - {"brief": "Implement secure storage staging", "candidate_files": ["dispatch.py"]}, - {"command": "pytest -q tests/test_secure.py"}, - ] - bkt = "test-worker-bucket" - sess = "swarm-worker-1" - target_file = self.temp_dir / bkt / "swarms" / sess / "manifest.json" - target_file.parent.mkdir(parents=True, exist_ok=True) - target_file.write_text(json.dumps(tasks), encoding="utf-8") - - manifest_uri = f"gs://{bkt}/swarms/{sess}/manifest.json" - - with patch.dict(os.environ, { - "STORAGE_MESSENGER_LOCAL_DIR": str(self.temp_dir), - "MANIFEST_URI": manifest_uri, - }, clear=False): - os.environ.pop("TASK_MANIFEST", None) - os.environ.pop("TASK_BRIEF", None) - - # Worker loads task index 0 - item0, brief0 = parse_task_manifest(task_index=0) - self.assertEqual(brief0, "Implement secure storage staging") - self.assertEqual(item0["candidate_files"], ["dispatch.py"]) - - # Worker loads task index 1 - item1, brief1 = parse_task_manifest(task_index=1) - self.assertEqual(brief1, "pytest -q tests/test_secure.py") - - # Out of bounds index - with self.assertRaises(IndexError): - parse_task_manifest(task_index=2) - - # Test download_manifest directly - with patch.dict(os.environ, {"STORAGE_MESSENGER_LOCAL_DIR": str(self.temp_dir)}): - content = download_manifest(manifest_uri) - self.assertEqual(json.loads(content), tasks) - - def test_git_clone_scrubs_tokens_from_remote_origin_url(self): - # 1. Test clean_repo_url helper directly - token_url = "https://x-access-token:ghp_999SECRETTOKEN999@github.com/my-org/my-repo.git" - cleaned = clean_repo_url(token_url) - self.assertEqual(cleaned, "https://github.com/my-org/my-repo.git") - self.assertNotIn("ghp_999SECRETTOKEN999", cleaned) - self.assertNotIn("x-access-token", cleaned) - - # 2. Test clone_and_checkout_task on an actual git repo - source_repo_dir = self.temp_dir / "source-repo" - source_repo_dir.mkdir(parents=True, exist_ok=True) - subprocess.run(["git", "init"], cwd=source_repo_dir, check=True, capture_output=True) - subprocess.run(["git", "config", "user.name", "Test User"], cwd=source_repo_dir, check=True) - subprocess.run(["git", "config", "user.email", "user@test.org"], cwd=source_repo_dir, check=True) - (source_repo_dir / "README.md").write_text("# Test Repo", encoding="utf-8") - subprocess.run(["git", "add", "README.md"], cwd=source_repo_dir, check=True) - subprocess.run(["git", "commit", "-m", "initial commit"], cwd=source_repo_dir, check=True) - - worker_dest = self.temp_dir / "cloned-worker-repo" - fake_token = "ghp_VERYSECRETTOKEN123456789" - with patch("cloud_worker.subprocess.run", wraps=subprocess.run) as mock_subproc: - clone_and_checkout_task( - repo_url=str(source_repo_dir), - gh_token=fake_token, - branch_name="worker-7", - repo_dir=worker_dest, - ) - clone_calls = [call[0][0] for call in mock_subproc.call_args_list if "clone" in call[0][0]] - self.assertTrue(len(clone_calls) > 0) - for cmd in clone_calls: - for arg in cmd: - self.assertNotIn(fake_token, arg) - - # Inspect .git/config in cloned repo - git_config_path = worker_dest / ".git" / "config" - self.assertTrue(git_config_path.is_file()) - config_text = git_config_path.read_text(encoding="utf-8") - self.assertNotIn(fake_token, config_text) - self.assertNotIn("x-access-token", config_text) - - # Verify remote.origin.url matches clean URL - res = subprocess.run( - ["git", "config", "--get", "remote.origin.url"], - cwd=worker_dest, - capture_output=True, - text=True, - check=True, - ) - self.assertEqual(res.stdout.strip(), str(source_repo_dir)) - - # Verify checkout branch - branch_res = subprocess.run( - ["git", "rev-parse", "--abbrev-ref", "HEAD"], - cwd=worker_dest, - capture_output=True, - text=True, - check=True, - ) - self.assertEqual(branch_res.stdout.strip(), "worker-7") - - def test_zero_push_architecture_omits_git_push(self): - self.assertFalse(hasattr(cloud_worker, "push_candidate_branch")) - - def test_build_gcloud_command_supports_set_secrets_and_vertex_mode(self): - # 1. Supports --set-secrets with dict mapping - cmd = build_gcloud_command( - job_name="test-worker-job", - tasks_count=5, - parallelism=5, - region="us-central1", - project="test-proj", - env_vars={"REPO_URL": "https://github.com/test/repo.git"}, - secrets_mapping={ - "GEMINI_API_KEY": "gemini-key:latest", - "SLACK_WEBHOOK": "slack-secret:1", - }, - ) - self.assertFalse(any(arg.startswith("--set-secrets=") for arg in cmd)) - self.assertFalse(any(arg.startswith("--parallelism=") for arg in cmd)) - self.assertFalse(any(arg.startswith("--max-retries=") for arg in cmd)) - - # 2. Supports set_secrets argument without passing to execute - cmd_str = build_gcloud_command( - job_name="test-worker-job", - tasks_count=1, - parallelism=1, - region="us-central1", - project="test-proj", - env_vars={}, - set_secrets="GEMINI_API_KEY=my-secret:latest", - ) - self.assertNotIn("--set-secrets", " ".join(cmd_str)) - - # 3. Omits GEMINI_API_KEY in Vertex AI mode via auth_mode="vertex" - cmd_vertex = build_gcloud_command( - job_name="test-worker-job", - tasks_count=1, - parallelism=1, - region="us-central1", - project="test-proj", - env_vars={ - "GEMINI_API_KEY": "AIzaSySuperSecretKey", - "REPO_URL": "https://github.com/test/repo.git", - }, - auth_mode="vertex", - ) - cmd_vertex_str = " ".join(cmd_vertex) - self.assertNotIn("AIzaSySuperSecretKey", cmd_vertex_str) - self.assertNotIn("GEMINI_API_KEY", cmd_vertex_str) - - # 4. Omits GEMINI_API_KEY when USE_VERTEX_AI is in env_vars - cmd_vertex_env = build_gcloud_command( - job_name="test-worker-job", - tasks_count=1, - parallelism=1, - region="us-central1", - project="test-proj", - env_vars={ - "GEMINI_API_KEY": "AIzaSySuperSecretKey", - "USE_VERTEX_AI": "1", - }, - ) - self.assertNotIn("AIzaSySuperSecretKey", " ".join(cmd_vertex_env)) - - # 5. Preserves GEMINI_API_KEY in non-Vertex mode - cmd_studio = build_gcloud_command( - job_name="test-worker-job", - tasks_count=1, - parallelism=1, - region="us-central1", - project="test-proj", - env_vars={ - "GEMINI_API_KEY": "AIzaSySuperSecretKey", - "REPO_URL": "https://github.com/test/repo.git", - }, - auth_mode="api_key", - ) - self.assertIn("GEMINI_API_KEY=AIzaSySuperSecretKey", " ".join(cmd_studio)) - - def test_build_gcloud_command_secrets_mapping_strips_env_vars(self): - # Test that when secrets_mapping={"GH_TOKEN": "gh-token:latest", "GEMINI_API_KEY": "gemini-key:latest"} is passed, - # GH_TOKEN and GEMINI_API_KEY are in --set-secrets and completely absent from --update-env-vars. - cmd = build_gcloud_command( - job_name="test-worker-job", - tasks_count=2, - parallelism=2, - region="us-central1", - project="test-proj", - env_vars={ - "REPO_URL": "https://github.com/test/repo.git", - "GH_TOKEN": "ghp_secret_token_123", - "GEMINI_API_KEY": "AIzaSySecretGeminiKey456", - "APP_ENV": "production", - }, - secrets_mapping={ - "GH_TOKEN": "gh-token:latest", - "GEMINI_API_KEY": "gemini-key:latest", - }, - ) - self.assertFalse(any(arg.startswith("--set-secrets=") for arg in cmd)) - - update_env_arg = next((arg for arg in cmd if arg.startswith("--update-env-vars=")), "") - self.assertIn("APP_ENV=production", update_env_arg) - self.assertIn("REPO_URL=https://github.com/test/repo.git", update_env_arg) - self.assertNotIn("GH_TOKEN", update_env_arg) - self.assertNotIn("ghp_secret_token_123", update_env_arg) - self.assertNotIn("GEMINI_API_KEY", update_env_arg) - self.assertNotIn("AIzaSySecretGeminiKey456", update_env_arg) - - def test_build_gcloud_command_set_secrets_string_strips_env_vars(self): - # Test that when set_secrets="GH_TOKEN=gh-token:latest" is passed, - # GH_TOKEN is in --set-secrets and absent from --update-env-vars. - cmd = build_gcloud_command( - job_name="test-worker-job", - tasks_count=1, - parallelism=1, - region="us-central1", - project="test-proj", - env_vars={ - "REPO_URL": "https://github.com/test/repo.git", - "GH_TOKEN": "ghp_secret_token_123", - "OTHER_VAR": "val", - }, - set_secrets="GH_TOKEN=gh-token:latest", - ) - self.assertFalse(any(arg.startswith("--set-secrets=") for arg in cmd)) - - update_env_arg = next((arg for arg in cmd if arg.startswith("--update-env-vars=")), "") - self.assertIn("OTHER_VAR=val", update_env_arg) - self.assertNotIn("GH_TOKEN", update_env_arg) - self.assertNotIn("ghp_secret_token_123", update_env_arg) - - def test_build_gcloud_command_vertex_mode_completely_absent_from_update_env_vars(self): - # Test that in Vertex AI mode, GEMINI_API_KEY is completely absent from --update-env-vars. - cmd = build_gcloud_command( - job_name="test-worker-job", - tasks_count=1, - parallelism=1, - region="us-central1", - project="test-proj", - env_vars={ - "REPO_URL": "https://github.com/test/repo.git", - "GEMINI_API_KEY": "AIzaSySuperSecretKey", - "EXTRA_VAR": "extra", - }, - auth_mode="vertex", - ) - update_env_arg = next((arg for arg in cmd if arg.startswith("--update-env-vars=")), "") - self.assertIn("EXTRA_VAR=extra", update_env_arg) - self.assertNotIn("GEMINI_API_KEY", update_env_arg) - self.assertNotIn("AIzaSySuperSecretKey", update_env_arg) - - # Also verify when USE_VERTEX_AI=1 in env_vars - cmd_env = build_gcloud_command( - job_name="test-worker-job", - tasks_count=1, - parallelism=1, - region="us-central1", - project="test-proj", - env_vars={ - "GEMINI_API_KEY": "AIzaSySuperSecretKey", - "USE_VERTEX_AI": "1", - }, - ) - update_env_env = next((arg for arg in cmd_env if arg.startswith("--update-env-vars=")), "") - self.assertNotIn("GEMINI_API_KEY", update_env_env) - self.assertNotIn("AIzaSySuperSecretKey", update_env_env) - - def test_cli_dispatch_omits_secrets_from_env_vars_when_using_set_secrets_or_runtime_config(self): - dispatch_script = Path(__file__).resolve().parent.parent / "skills" / "swarm" / "scripts" / "cloud_dispatch.py" - manifest_path = self.temp_dir / "manifest_empty.json" - manifest_path.write_text("[]", encoding="utf-8") - - # 1. CLI flag --set-secrets removes GH_TOKEN and GEMINI_API_KEY from env_vars and update-env-vars - cmd = [ - sys.executable, - str(dispatch_script), - "--dry-run", - "--manifest", str(manifest_path), - "--repo", "https://github.com/test/repo.git", - "--set-secrets", "GH_TOKEN=gh-token:latest,GEMINI_API_KEY=gemini-key:latest", - "--project", "test-project", - ] - res = subprocess.run( - cmd, - capture_output=True, - text=True, - check=True, - env=dict(os.environ, GH_TOKEN="secret_gh_tok", GEMINI_API_KEY="secret_gem_key"), - ) - payload = json.loads(res.stdout) - env_vars = payload["env_vars"] - self.assertNotIn("GH_TOKEN", env_vars) - self.assertNotIn("GEMINI_API_KEY", env_vars) - gcloud_cmd = payload["gcloud_command"] - self.assertNotIn("--set-secrets=", gcloud_cmd) - self.assertNotIn("--parallelism=", gcloud_cmd) - self.assertNotIn("--max-retries=", gcloud_cmd) - self.assertNotIn("secret_gh_tok", gcloud_cmd) - self.assertNotIn("secret_gem_key", gcloud_cmd) - for part in gcloud_cmd.split(): - if part.startswith("--update-env-vars="): - self.assertNotIn("GH_TOKEN", part) - self.assertNotIn("GEMINI_API_KEY", part) - - # 2. runtime_cfg default secrets in agystack-runtime.json - cfg_file = self.temp_dir / "agystack-runtime.json" - cfg_file.write_text(json.dumps({ - "secrets": { - "GH_TOKEN": "gh-token:latest", - "GEMINI_API_KEY": "gemini-key:latest", - } - }), encoding="utf-8") - cmd_cfg = [ - sys.executable, - str(dispatch_script), - "--dry-run", - "--manifest", str(manifest_path), - "--repo", "https://github.com/test/repo.git", - "--project", "test-project", - ] - res_cfg = subprocess.run( - cmd_cfg, - capture_output=True, - text=True, - check=True, - cwd=str(self.temp_dir), - env=dict(os.environ, GH_TOKEN="secret_gh_tok", GEMINI_API_KEY="secret_gem_key"), - ) - payload_cfg = json.loads(res_cfg.stdout) - self.assertNotIn("GH_TOKEN", payload_cfg["env_vars"]) - self.assertNotIn("GEMINI_API_KEY", payload_cfg["env_vars"]) - gcloud_cmd_cfg = payload_cfg["gcloud_command"] - self.assertNotIn("--set-secrets=", gcloud_cmd_cfg) - self.assertNotIn("--parallelism=", gcloud_cmd_cfg) - self.assertNotIn("--max-retries=", gcloud_cmd_cfg) - - @patch("cloud_worker.run_command") - def test_clone_and_checkout_task_passes_base_branch(self, mock_run): - mock_run.return_value = MagicMock(returncode=0, stdout="", stderr="") - clone_and_checkout_task( - repo_url="https://github.com/test-org/test-repo.git", - gh_token="test-token", - branch_name="worker-1", - repo_dir=Path("/tmp/fake-dir"), - base_branch="feature/custom-base", - ) - clone_calls = [call[0][0] for call in mock_run.call_args_list if len(call[0][0]) > 1 and "clone" in call[0][0]] - self.assertTrue(len(clone_calls) > 0) - clone_cmd = clone_calls[0] - self.assertIn("--branch", clone_cmd) - branch_idx = clone_cmd.index("--branch") - self.assertEqual(clone_cmd[branch_idx + 1], "feature/custom-base") - - @patch("urllib.request.urlopen") - @patch("subprocess.run") - def test_run_preflight_with_base_branch_probe_and_missing_rejection(self, mock_subproc, mock_urlopen): - mock_res = MagicMock() - mock_res.returncode = 0 - mock_res.stdout = "" - mock_subproc.return_value = mock_res - - mock_resp = MagicMock() - mock_resp.__enter__.return_value = mock_resp - mock_resp.read.return_value = b'{"candidates": []}' - mock_resp.headers = {} - mock_urlopen.return_value = mock_resp - - with self.assertRaises(RuntimeError) as ctx: - run_preflight( - repo_url="https://github.com/test/repo.git", - gh_token="gh-token", - use_vertex=False, - gemini_api_key="AIzaTestKey", - project="test-proj", - region="us-central1", - model="gemini-3.8-flash", - dry_run=True, - base_branch="non-existent-branch", - ) - self.assertIn("Base branch 'non-existent-branch' not found on remote origin", str(ctx.exception)) - - call_args = mock_subproc.call_args[0][0] - self.assertEqual(call_args[0:2], ["git", "-c"]) - self.assertIn("ls-remote", call_args) - self.assertIn("--heads", call_args) - self.assertEqual(call_args[-1], "non-existent-branch") - - mock_res.stdout = "abc1234567890abcdef\trefs/heads/valid-branch\n" - run_preflight( - repo_url="https://github.com/test/repo.git", - gh_token="gh-token", - use_vertex=False, - gemini_api_key="AIzaTestKey", - project="test-proj", - region="us-central1", - model="gemini-3.8-flash", - dry_run=True, - base_branch="valid-branch", - ) - - def test_manifest_and_session_branch_resolution(self): - with patch.dict(os.environ, {"SWARM_SESSION_ID": "session-xyz-123"}): - branch = resolve_worker_branch(task_item={}, task_index=3) - self.assertEqual(branch, "agystack/session-xyz-123/worker-3") - - with patch.dict(os.environ, {"SWARM_SESSION_ID": "session-xyz-123"}): - branch_override = resolve_worker_branch(task_item={"branch": "custom-override-branch"}, task_index=3) - self.assertEqual(branch_override, "custom-override-branch") - - with patch.dict(os.environ, {}, clear=True): - branch_fallback = resolve_worker_branch(task_item={}, task_index=2) - self.assertEqual(branch_fallback, "worker-2") - - -class TestDispatcherPartialFailureGating(unittest.TestCase): - def test_partial_failure_output_gating_warning_and_suppression(self): - from cloud_dispatch import print_candidate_patches_table - harvested = [ - {"task_index": 0, "status": "PASS", "score": 95.0, "score_delta": 5.0, "patch_file": ".slices/s1/w0.diff"}, - {"task_index": 1, "status": "ISSUES", "score": 40.0, "score_delta": -5.0, "patch_file": None}, - ] - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - print_candidate_patches_table(harvested, exec_succeeded=False, failed_count=1, allow_partial=False) - out = mock_out.getvalue() - self.assertIn("[WARNING: SWARM EXECUTION EXPERIENCED PARTIAL FAILURES: 1 TASKS FAILED]", out) - self.assertIn("Quarantined Candidate #1", out) - self.assertNotIn("* Winning Candidate #1", out) - - def test_partial_failure_output_gating_bypassed_with_flag(self): - from cloud_dispatch import print_candidate_patches_table - harvested = [ - {"task_index": 0, "status": "PASS", "score": 95.0, "score_delta": 5.0, "patch_file": ".slices/s1/w0.diff"}, - ] - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - print_candidate_patches_table(harvested, exec_succeeded=False, failed_count=1, allow_partial=True) - out = mock_out.getvalue() - self.assertIn("* Winning Candidate #1", out) - - -class TestStagnancyTrackerAndHooks(unittest.TestCase): - def test_stagnancy_tracker_identical_calls_trigger_alarm(self): - tracker = StagnancyTracker() - rec1 = ToolInvocationRecord.create("view_file", {"path": "main.py"}) - rec2 = ToolInvocationRecord.create("view_file", {"path": "main.py"}) - rec3 = ToolInvocationRecord.create("view_file", {"path": "main.py"}) - - stagnant1, count1, warn1 = tracker.record_start(rec1) - self.assertFalse(stagnant1) - self.assertEqual(count1, 1) - self.assertEqual(warn1, "") - - stagnant2, count2, warn2 = tracker.record_start(rec2) - self.assertFalse(stagnant2) - self.assertEqual(count2, 2) - self.assertEqual(warn2, "") - - stagnant3, count3, warn3 = tracker.record_start(rec3) - self.assertTrue(stagnant3) - self.assertEqual(count3, 3) - self.assertIn("Warning", warn3) - self.assertIn("view_file", warn3) - self.assertIn("3 consecutive times", warn3) - - def test_stagnancy_tracker_reset_on_arg_or_tool_change(self): - tracker = StagnancyTracker() - rec1 = ToolInvocationRecord.create("view_file", {"path": "main.py"}) - rec2 = ToolInvocationRecord.create("view_file", {"path": "main.py"}) - tracker.record_start(rec1) - tracker.record_start(rec2) - - rec_diff_args = ToolInvocationRecord.create("view_file", {"path": "other.py"}) - stagnant, count, _ = tracker.record_start(rec_diff_args) - self.assertFalse(stagnant) - self.assertEqual(count, 1) - - rec_diff_tool = ToolInvocationRecord.create("run_command", {"command": "pytest"}) - stagnant_tool, count_tool, _ = tracker.record_start(rec_diff_tool) - self.assertFalse(stagnant_tool) - self.assertEqual(count_tool, 1) - - def test_stagnancy_tracker_record_start_never_cancels_or_raises(self): - tracker = StagnancyTracker() - stagnant, count, warn = tracker.record_start(None) - self.assertFalse(stagnant) - self.assertEqual(count, 1) - - rec = ToolInvocationRecord.create("view_file", {"path": "main.py"}) - for i in range(1, 15): - stagnant, count, _ = tracker.record_start(rec) - self.assertEqual(count, i) - if i >= 3: - self.assertTrue(stagnant) - - def test_create_agent_hooks_abort_on_steer_instruction(self): - class FakeHookResult: - def __init__(self, allow=True, error_message="", custom_context=""): - self.allow = allow - self.error_message = error_message - self.custom_context = custom_context - - class FakeHooks: - def pre_tool_call_decide(self, fn): - return fn - - def post_tool_call(self, fn): - return fn - - fake_hooks = FakeHooks() - fake_types = MagicMock() - fake_types.HookResult = FakeHookResult - - mock_messenger = MagicMock() - mock_messenger.check_steer_instructions.return_value = ["ABORT immediately requested by orchestrator"] - - tracker = StagnancyTracker() - hooks_list = create_agent_hooks( - messenger=mock_messenger, - task_index=2, - tracker=tracker, - hooks_module=fake_hooks, - types_module=fake_types, - ) - self.assertEqual(len(hooks_list), 2) - pre_hook, _ = hooks_list - - tool_call = MagicMock() - tool_call.name = "run_command" - tool_call.args = {"command": "rm -rf /tmp/test"} - - import asyncio - - with patch("cloud_worker.emit_milestone") as mock_milestone: - res = asyncio.run(pre_hook(tool_call)) - self.assertFalse(res.allow) - self.assertIn("Execution aborted by orchestrator", res.error_message) - mock_milestone.assert_any_call(2, "ABORT_REQUESTED", "ABORT immediately requested by orchestrator") - - def test_create_agent_hooks_allows_tool_and_emits_milestones(self): - class FakeHookResult: - def __init__(self, allow=True, error_message="", custom_context=""): - self.allow = allow - self.error_message = error_message - self.custom_context = custom_context - - class FakeHooks: - def pre_tool_call_decide(self, fn): - return fn - - def post_tool_call(self, fn): - return fn - - fake_hooks = FakeHooks() - fake_types = MagicMock() - fake_types.HookResult = FakeHookResult - - tracker = StagnancyTracker() - hooks_list = create_agent_hooks( - messenger=None, - task_index=1, - tracker=tracker, - hooks_module=fake_hooks, - types_module=fake_types, - ) - pre_hook, post_hook = hooks_list - - tool_call = MagicMock() - tool_call.name = "grep_search" - tool_call.args = {"query": "TODO"} - - import asyncio - - with patch("cloud_worker.emit_milestone") as mock_milestone: - res = asyncio.run(pre_hook(tool_call)) - self.assertTrue(res.allow) - mock_milestone.assert_any_call(1, "TOOL_START", "grep_search: query='TODO'") - - data = MagicMock() - data.name = "grep_search" - data.args = {"query": "TODO"} - data.output = "match found" - asyncio.run(post_hook(data)) - tool_end_calls = [c for c in mock_milestone.call_args_list if c[0][1] == "TOOL_END"] - self.assertTrue(len(tool_end_calls) > 0) - self.assertIn("grep_search in", tool_end_calls[0][0][2]) - - def test_create_agent_hooks_emits_tool_error_milestone(self): - class FakeHooks: - def pre_tool_call_decide(self, fn): - return fn - - def post_tool_call(self, fn): - return fn - - def on_tool_error(self, fn): - return fn - - fake_hooks = FakeHooks() - fake_types = MagicMock() - - tracker = StagnancyTracker() - hooks_list = create_agent_hooks( - messenger=None, - task_index=5, - tracker=tracker, - hooks_module=fake_hooks, - types_module=fake_types, - ) - self.assertEqual(len(hooks_list), 3) - on_error_hook = hooks_list[2] - - import asyncio - - with patch("cloud_worker.emit_milestone") as mock_milestone: - err = FileNotFoundError("No such file: foo.md") - asyncio.run(on_error_hook(err)) - mock_milestone.assert_any_call(5, "TOOL_ERROR", "No such file: foo.md") - - def test_post_tool_call_raw_string_resolves_in_flight(self): - class FakeHookResult: - def __init__(self, allow=True, error_message="", custom_context=""): - self.allow = allow - self.error_message = error_message - self.custom_context = custom_context - - class FakeHooks: - def pre_tool_call_decide(self, fn): - return fn - - def post_tool_call(self, fn): - return fn - - fake_hooks = FakeHooks() - fake_types = MagicMock() - fake_types.HookResult = FakeHookResult - - tracker = StagnancyTracker() - hooks_list = create_agent_hooks( - messenger=None, - task_index=3, - tracker=tracker, - hooks_module=fake_hooks, - types_module=fake_types, - ) - pre_hook, post_hook = hooks_list - - tool_call = MagicMock() - tool_call.name = "read_file" - tool_call.args = {"path": "config.json"} - - import asyncio - - with patch("cloud_worker.emit_milestone") as mock_milestone: - res = asyncio.run(pre_hook(tool_call)) - self.assertTrue(res.allow) - mock_milestone.assert_any_call(3, "TOOL_START", "read_file: path='config.json'") - - raw_output = '{"status": "ok"}' - asyncio.run(post_hook(raw_output)) - - tool_end_calls = [c for c in mock_milestone.call_args_list if c[0][1] == "TOOL_END"] - self.assertEqual(len(tool_end_calls), 1) - self.assertIn("read_file in", tool_end_calls[0][0][2]) - - self.assertEqual(len(tracker.window), 1) - rec = tracker.window[0] - self.assertEqual(rec.tool_name, "read_file") - self.assertTrue(rec.success) - self.assertGreaterEqual(rec.duration_s, 0.0) - self.assertNotEqual(rec.output_hash, "") - - def test_post_tool_call_structured_object(self): - class FakeHookResult: - def __init__(self, allow=True, error_message="", custom_context=""): - self.allow = allow - self.error_message = error_message - self.custom_context = custom_context - - class FakeHooks: - def pre_tool_call_decide(self, fn): - return fn - - def post_tool_call(self, fn): - return fn - - fake_hooks = FakeHooks() - fake_types = MagicMock() - fake_types.HookResult = FakeHookResult - - tracker = StagnancyTracker() - hooks_list = create_agent_hooks( - messenger=None, - task_index=4, - tracker=tracker, - hooks_module=fake_hooks, - types_module=fake_types, - ) - pre_hook, post_hook = hooks_list - - tool_call = MagicMock() - tool_call.name = "list_directory" - tool_call.args = {"dir": "src"} - - import asyncio - - with patch("cloud_worker.emit_milestone") as mock_milestone: - asyncio.run(pre_hook(tool_call)) - - data = MagicMock() - data.name = "list_directory" - data.output = ["a.py", "b.py"] - data.error = None - - asyncio.run(post_hook(data)) - - tool_end_calls = [c for c in mock_milestone.call_args_list if c[0][1] == "TOOL_END"] - self.assertEqual(len(tool_end_calls), 1) - self.assertIn("list_directory in", tool_end_calls[0][0][2]) - - self.assertEqual(len(tracker.window), 1) - rec = tracker.window[0] - self.assertEqual(rec.tool_name, "list_directory") - self.assertTrue(rec.success) - self.assertGreaterEqual(rec.duration_s, 0.0) - - def test_on_tool_error_pops_in_flight_and_records_failure(self): - class FakeHookResult: - def __init__(self, allow=True, error_message="", custom_context=""): - self.allow = allow - self.error_message = error_message - self.custom_context = custom_context - - class FakeHooks: - def pre_tool_call_decide(self, fn): - return fn - - def post_tool_call(self, fn): - return fn - - def on_tool_error(self, fn): - return fn - - fake_hooks = FakeHooks() - fake_types = MagicMock() - fake_types.HookResult = FakeHookResult - - tracker = StagnancyTracker() - hooks_list = create_agent_hooks( - messenger=None, - task_index=2, - tracker=tracker, - hooks_module=fake_hooks, - types_module=fake_types, - ) - self.assertEqual(len(hooks_list), 3) - pre_hook, _, on_error_hook = hooks_list - - tool_call = MagicMock() - tool_call.name = "failing_tool" - tool_call.args = {"x": 1} - - import asyncio - - with patch("cloud_worker.emit_milestone") as mock_milestone: - asyncio.run(pre_hook(tool_call)) - err = RuntimeError("Process terminated with code 1") - res = asyncio.run(on_error_hook(err)) - self.assertIsNone(res) - - mock_milestone.assert_any_call( - 2, "TOOL_ERROR", "failing_tool: Process terminated with code 1" - ) - - self.assertEqual(len(tracker.window), 1) - rec = tracker.window[0] - self.assertEqual(rec.tool_name, "failing_tool") - self.assertFalse(rec.success) - self.assertGreaterEqual(rec.duration_s, 0.0) - - def test_pre_tool_call_steer_custom_context_passed_to_hook_result(self): - class FakeHookResult: - def __init__(self, allow=True, error_message="", custom_context=""): - self.allow = allow - self.error_message = error_message - self.custom_context = custom_context - - class FakeHooks: - def pre_tool_call_decide(self, fn): - return fn - - def post_tool_call(self, fn): - return fn - - fake_hooks = FakeHooks() - fake_types = MagicMock() - fake_types.HookResult = FakeHookResult - - mock_messenger = MagicMock() - mock_messenger.check_steer_instructions.return_value = ["Focus on fixing parsing logic in parser.py"] - - tracker = StagnancyTracker() - hooks_list = create_agent_hooks( - messenger=mock_messenger, - task_index=0, - tracker=tracker, - hooks_module=fake_hooks, - types_module=fake_types, - ) - pre_hook, _ = hooks_list - - tool_call = MagicMock() - tool_call.name = "run_command" - tool_call.args = {"command": "cargo test"} - - import asyncio - - with patch("cloud_worker.emit_milestone") as mock_milestone: - res = asyncio.run(pre_hook(tool_call)) - self.assertTrue(res.allow) - self.assertEqual(res.custom_context, "Focus on fixing parsing logic in parser.py") - mock_milestone.assert_any_call( - 0, "STEER_APPLIED", "Focus on fixing parsing logic in parser.py" - ) - - def test_command_task_timeout_handling(self): - with tempfile.TemporaryDirectory() as tmp_dir: - repo_dir = Path(tmp_dir) - with patch.dict(os.environ, {"COMMAND_TIMEOUT": "1"}): - status, output = execute_task( - task_item={"type": "command", "command": "echo started; sleep 2"}, - task_brief="Run long command", - repo_dir=repo_dir, - model_override="flash", - api_key="test-key", - ) - self.assertEqual(status, "ISSUES") - self.assertIn("timed out after 1 seconds", output) - self.assertIn("started", output) - - -if __name__ == "__main__": - unittest.main() - diff --git a/tests/test_cloud_worker_vertex_partner.py b/tests/test_cloud_worker_vertex_partner.py deleted file mode 100644 index 8a93910..0000000 --- a/tests/test_cloud_worker_vertex_partner.py +++ /dev/null @@ -1,903 +0,0 @@ -import io -import json -import os -import subprocess -import sys -import tempfile -import time -import unittest -from pathlib import Path -from unittest.mock import AsyncMock, MagicMock, patch - -REPO_ROOT = Path(__file__).resolve().parent.parent -sys.path.insert(0, str(REPO_ROOT / "skills" / "swarm" / "scripts")) -sys.path.insert(0, str(REPO_ROOT / "skills" / "setup-agystack" / "scripts")) - -import cloud_worker -import setup_runtime -from cloud_worker import ( - emit_thought, - emit_tool_invocation, - emit_tool_result, - execute_deepseek_model_agent, - execute_partner_model_agent, - execute_task, - execute_workspace_tool, - is_deepseek_model, - is_partner_model, - measure_partner_client_startup, - resolve_worker_model, -) -from setup_runtime import check_model_garden - - -class TestVertexPartnerModelResolution(unittest.TestCase): - def test_alias_resolution_sonnet(self): - aliases = [ - "claude-3-5-sonnet-v2@20241022", - "claude-3-5-sonnet-v2@20241022", - "sonnet-5.5", - "sonnet-5-5", - "publishers/anthropic/models/claude-3-5-sonnet-v2@20241022", - ] - for alias in aliases: - resolved = resolve_worker_model(alias) - self.assertEqual(resolved, "claude-3-5-sonnet-v2@20241022") - self.assertTrue(is_partner_model(resolved)) - - def test_alias_resolution_opus(self): - aliases = [ - "claude-3-opus@20240229", - "claude-3-opus@20240229", - "opus-5.5", - "opus-5-5", - "publishers/anthropic/models/claude-3-opus@20240229", - ] - for alias in aliases: - resolved = resolve_worker_model(alias) - self.assertEqual(resolved, "claude-3-opus@20240229") - self.assertTrue(is_partner_model(resolved)) - - def test_alias_resolution_fable(self): - aliases = [ - "fable-5-1", - "fable-5.1", - "publishers/fable/models/fable-5-1", - "publishers/fable/models/fable-5.1", - ] - for alias in aliases: - resolved = resolve_worker_model(alias) - self.assertEqual(resolved, "fable-5-1") - self.assertTrue(is_partner_model(resolved)) - - def test_alias_resolution_deepseek(self): - aliases = [ - "deepseek", - "deepseek-flash", - "deepseek-4.1", - "deepseek-v4.1", - "deepseek-4.1-flash", - "deepseek-v4.1-flash-maas", - "deepseek-v4.1-flash-maas@001", - "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas", - ] - canonical = "publishers/deepseek-ai/models/deepseek-v4.1-flash-maas" - for alias in aliases: - resolved = resolve_worker_model(alias) - self.assertEqual(resolved, canonical) - self.assertTrue(is_deepseek_model(resolved)) - self.assertFalse(is_partner_model(resolved)) - - def test_gemini_models_are_not_partner_models(self): - gemini_models = [ - "gemini-3.8-flash", - "gemini-3.1-pro", - "gemini-3.1-flash-lite", - "gemini-4-argon", - "argon", - "flash", - "pro", - ] - for model in gemini_models: - resolved = resolve_worker_model(model) - self.assertFalse(is_partner_model(resolved)) - - def test_task_item_model_override(self): - task_item = {"model": "sonnet-5.5"} - resolved = resolve_worker_model(task_item=task_item) - self.assertEqual(resolved, "claude-3-5-sonnet-v2@20241022") - self.assertTrue(is_partner_model(resolved)) - - -class TestVertexPartnerExecution(unittest.TestCase): - def setUp(self): - self.temp_dir = tempfile.TemporaryDirectory() - self.repo_dir = Path(self.temp_dir.name) - subprocess.run(["git", "init"], cwd=self.repo_dir, check=True, capture_output=True) - - def tearDown(self): - self.temp_dir.cleanup() - - def test_missing_sdk_fallback_blocked(self): - with patch.dict(sys.modules, {"anthropic": None}): - status, summary = execute_task( - task_item={"model": "claude-3-5-sonnet-v2@20241022"}, - task_brief="Implement task", - repo_dir=self.repo_dir, - model_override="claude-3-5-sonnet-v2@20241022", - api_key="", - ) - self.assertEqual(status, "BLOCKED") - self.assertEqual( - summary, - "Missing dependency: anthropic[vertex] Python package is not installed.", - ) - - def test_adc_project_and_region_pass_through(self): - mock_anthropic = MagicMock() - mock_client = MagicMock() - mock_response = MagicMock() - mock_block = MagicMock() - mock_block.text = "Work verified.\n[STATUS: PASS]" - mock_response.content = [mock_block] - mock_client.messages.create.return_value = mock_response - mock_anthropic.AnthropicVertex.return_value = mock_client - - with patch.dict(sys.modules, {"anthropic": mock_anthropic}): - status, summary = execute_task( - task_item={"model": "claude-3-5-sonnet-v2@20241022"}, - task_brief="Implement task", - repo_dir=self.repo_dir, - model_override="claude-3-5-sonnet-v2@20241022", - api_key="", - project="custom-prod-project", - location="europe-west1", - ) - self.assertEqual(status, "PASS") - mock_anthropic.AnthropicVertex.assert_called_once_with( - project_id="custom-prod-project", - region="europe-west1", - ) - - def test_adc_env_var_precedence_and_us_central1_fallback(self): - mock_anthropic = MagicMock() - mock_client = MagicMock() - mock_response = MagicMock() - mock_block = MagicMock() - mock_block.text = "Success.\n[STATUS: PASS]" - mock_response.content = [mock_block] - mock_client.messages.create.return_value = mock_response - mock_anthropic.AnthropicVertex.return_value = mock_client - - env = { - "GCP_PROJECT": "env-gcp-project", - "REGION": "", - "VERTEXAI_LOCATION": "", - "GCP_REGION": "", - } - with patch.dict(sys.modules, {"anthropic": mock_anthropic}), patch.dict(os.environ, env): - status, _ = execute_task( - task_item={"model": "claude-3-opus@20240229"}, - task_brief="Implement task", - repo_dir=self.repo_dir, - model_override="claude-3-opus@20240229", - api_key="", - ) - self.assertEqual(status, "PASS") - mock_anthropic.AnthropicVertex.assert_called_once_with( - project_id="env-gcp-project", - region="us-central1", - ) - - def test_missing_aiplatform_fallback_blocked_for_fable(self): - with patch.dict(sys.modules, {"google.cloud.aiplatform": None}): - status, summary = execute_task( - task_item={"model": "fable-5-1"}, - task_brief="Implement fable task", - repo_dir=self.repo_dir, - model_override="fable-5-1", - api_key="", - ) - self.assertEqual(status, "BLOCKED") - self.assertEqual( - summary, - "Missing dependency: google-cloud-aiplatform Python package is not installed.", - ) - - def test_missing_genai_fallback_blocked_for_deepseek(self): - with patch.dict(sys.modules, {"google.genai": None}): - status, summary = execute_task( - task_item={"model": "deepseek"}, - task_brief="Implement deepseek task", - repo_dir=self.repo_dir, - model_override="deepseek", - api_key="", - ) - self.assertEqual(status, "BLOCKED") - self.assertEqual( - summary, - "Missing dependency: google-genai Python package is not installed.", - ) - - def test_milestone_emission_partner_model(self): - mock_anthropic = MagicMock() - mock_client = MagicMock() - mock_response = MagicMock() - mock_block = MagicMock() - mock_block.text = "Done.\n[STATUS: PASS]" - mock_response.content = [mock_block] - mock_client.messages.create.return_value = mock_response - mock_anthropic.AnthropicVertex.return_value = mock_client - - with patch.dict(sys.modules, {"anthropic": mock_anthropic}), patch( - "cloud_worker.emit_milestone" - ) as mock_milestone: - status, _ = execute_task( - task_item={"model": "claude-3-5-sonnet-v2@20241022"}, - task_brief="Execute brief", - repo_dir=self.repo_dir, - model_override="claude-3-5-sonnet-v2@20241022", - api_key="", - task_index=2, - ) - self.assertEqual(status, "PASS") - mock_milestone.assert_called_with( - 2, "RUNNING_AGENT", "Vertex Model Garden agent (claude-3-5-sonnet-v2@20241022)" - ) - - def test_milestone_emission_fable_model(self): - mock_aiplatform = MagicMock() - mock_endpoint = MagicMock() - mock_resp = MagicMock() - mock_resp.predictions = ["Done.\n[STATUS: PASS]"] - mock_endpoint.predict.return_value = mock_resp - mock_aiplatform.Endpoint.return_value = mock_endpoint - - with patch.dict(sys.modules, {"google.cloud.aiplatform": mock_aiplatform}), patch( - "cloud_worker.emit_milestone" - ) as mock_milestone: - status, _ = execute_task( - task_item={"model": "fable-5-1"}, - task_brief="Execute brief", - repo_dir=self.repo_dir, - model_override="fable-5-1", - api_key="", - task_index=2, - ) - self.assertEqual(status, "PASS") - mock_milestone.assert_called_with( - 2, "RUNNING_AGENT", "Vertex Model Garden agent (fable-5-1)" - ) - - def test_milestone_emission_deepseek_model(self): - mock_genai = MagicMock() - mock_client = MagicMock() - mock_resp = MagicMock() - mock_resp.text = "DeepSeek done.\n[STATUS: PASS]" - mock_resp.function_calls = [] - mock_resp.candidates = [ - MagicMock( - content=MagicMock( - parts=[ - MagicMock( - text="DeepSeek done.\n[STATUS: PASS]", - thought=None, - function_call=None, - ) - ] - ) - ) - ] - mock_client.models.generate_content.return_value = mock_resp - mock_genai.Client.return_value = mock_client - - with patch.dict(sys.modules, {"google.genai": mock_genai}), patch( - "cloud_worker.emit_milestone" - ) as mock_milestone: - status, _ = execute_task( - task_item={"model": "deepseek"}, - task_brief="Execute brief", - repo_dir=self.repo_dir, - model_override="deepseek", - api_key="", - task_index=2, - ) - self.assertEqual(status, "PASS") - mock_milestone.assert_called_with( - 2, - "RUNNING_AGENT", - "Vertex Model Garden agent (publishers/deepseek-ai/models/deepseek-v4.1-flash-maas)", - ) - - def test_autonomous_tool_calling_loop_writes_files_and_passes(self): - mock_anthropic = MagicMock() - mock_client = MagicMock() - - block_think = MagicMock() - block_think.type = "thinking" - block_think.thinking = "I need to write solution.py" - - block_tool1 = MagicMock() - block_tool1.type = "tool_use" - block_tool1.id = "call_write_1" - block_tool1.name = "write_file" - block_tool1.input = {"path": "solution.py", "content": "def solve(): return 42\n"} - - resp0 = MagicMock() - resp0.content = [block_think, block_tool1] - - block_tool2 = MagicMock() - block_tool2.type = "tool_use" - block_tool2.id = "call_cmd_2" - block_tool2.name = "run_command" - block_tool2.input = {"command": "python3 -c 'import solution; assert solution.solve() == 42'"} - - resp1 = MagicMock() - resp1.content = [block_tool2] - - block_final = MagicMock() - block_final.text = "Solution implemented and tests pass.\n[STATUS: PASS]" - - resp2 = MagicMock() - resp2.content = [block_final] - - mock_client.messages.create.side_effect = [resp0, resp1, resp2] - mock_anthropic.AnthropicVertex.return_value = mock_client - - with patch.dict(sys.modules, {"anthropic": mock_anthropic}), patch( - "cloud_worker.emit_thought" - ) as mock_thought, patch("cloud_worker.emit_tool_invocation") as mock_inv, patch( - "cloud_worker.emit_tool_result" - ) as mock_res: - status, summary = execute_task( - task_item={"model": "claude-3-5-sonnet-v2@20241022"}, - task_brief="Implement solve in solution.py", - repo_dir=self.repo_dir, - model_override="claude-3-5-sonnet-v2@20241022", - api_key="", - task_index=1, - ) - self.assertEqual(status, "PASS") - self.assertIn("Solution implemented and tests pass.", summary) - - solution_file = self.repo_dir / "solution.py" - self.assertTrue(solution_file.is_file()) - self.assertEqual(solution_file.read_text(encoding="utf-8"), "def solve(): return 42\n") - - git_res = subprocess.run( - ["git", "status", "--porcelain"], - cwd=self.repo_dir, - capture_output=True, - text=True, - check=True, - ) - self.assertIn("solution.py", git_res.stdout) - - mock_thought.assert_called_once_with(1, "I need to write solution.py") - self.assertEqual(mock_inv.call_count, 2) - mock_inv.assert_any_call(1, "write_file", {"path": "solution.py", "content": "def solve(): return 42\n"}) - mock_inv.assert_any_call(1, "run_command", {"command": "python3 -c 'import solution; assert solution.solve() == 42'"}) - self.assertEqual(mock_res.call_count, 2) - - def test_autonomous_tool_calling_loop_deepseek(self): - mock_genai = MagicMock() - mock_client = MagicMock() - - def fake_content(role=None, parts=None): - c = MagicMock() - c.role = role - c.parts = parts - return c - mock_genai.types.Content.side_effect = fake_content - - # Turn 0: DeepSeek emits a thought and calls write_file - fc1 = MagicMock() - fc1.name = "write_file" - fc1.args = {"path": "deepseek_solution.py", "content": "def deepseek_fn(): return 100\n"} - - part_think = MagicMock() - part_think.thought = "Thinking about deepseek solution" - part_think.text = "Thinking about deepseek solution" - part_think.function_call = None - - part_call1 = MagicMock() - part_call1.thought = None - part_call1.text = None - part_call1.function_call = fc1 - - resp0 = MagicMock() - resp0.function_calls = [fc1] - cand0 = MagicMock() - cand0.content = MagicMock(parts=[part_think, part_call1]) - resp0.candidates = [cand0] - - # Turn 1: DeepSeek finishes with PASS - part_final = MagicMock() - part_final.thought = None - part_final.text = "DeepSeek solution implemented.\n[STATUS: PASS]" - part_final.function_call = None - - resp1 = MagicMock() - resp1.function_calls = [] - cand1 = MagicMock() - cand1.content = MagicMock(parts=[part_final]) - resp1.candidates = [cand1] - resp1.text = "DeepSeek solution implemented.\n[STATUS: PASS]" - - mock_client.models.generate_content.side_effect = [resp0, resp1] - mock_genai.Client.return_value = mock_client - - with patch.dict(sys.modules, {"google.genai": mock_genai}), patch( - "cloud_worker.emit_thought" - ) as mock_thought, patch("cloud_worker.emit_tool_invocation") as mock_inv, patch( - "cloud_worker.emit_tool_result" - ) as mock_res: - status, summary = execute_task( - task_item={"model": "deepseek-v4.1-flash"}, - task_brief="Implement deepseek solution", - repo_dir=self.repo_dir, - model_override="deepseek-v4.1-flash", - api_key="", - task_index=2, - ) - self.assertEqual(status, "PASS") - self.assertIn("DeepSeek solution implemented.", summary) - - solution_file = self.repo_dir / "deepseek_solution.py" - self.assertTrue(solution_file.is_file()) - self.assertEqual( - solution_file.read_text(encoding="utf-8"), "def deepseek_fn(): return 100\n" - ) - - mock_thought.assert_called_with(2, "Thinking about deepseek solution") - mock_inv.assert_called_once_with( - 2, - "write_file", - {"path": "deepseek_solution.py", "content": "def deepseek_fn(): return 100\n"}, - ) - self.assertEqual(mock_res.call_count, 1) - - # Verify that the turn sent to generate_content used role="model" (not "assistant") - second_call_contents = mock_client.models.generate_content.call_args_list[1][1]["contents"] - self.assertEqual(second_call_contents[1].role, "model") - - def test_autonomous_tool_calling_loop_edit_and_read_file(self): - readme = self.repo_dir / "README.md" - readme.write_text("Hello World\n", encoding="utf-8") - - mock_anthropic = MagicMock() - mock_client = MagicMock() - - block_read = MagicMock() - block_read.type = "tool_use" - block_read.id = "call_read" - block_read.name = "read_file" - block_read.input = {"path": "README.md"} - resp0 = MagicMock() - resp0.content = [block_read] - - block_edit = MagicMock() - block_edit.type = "tool_use" - block_edit.id = "call_edit" - block_edit.name = "edit_file" - block_edit.input = {"path": "README.md", "target": "World", "replacement": "Agystack"} - resp1 = MagicMock() - resp1.content = [block_edit] - - block_final = MagicMock() - block_final.text = "Readme edited.\n[STATUS: PASS]" - resp2 = MagicMock() - resp2.content = [block_final] - - mock_client.messages.create.side_effect = [resp0, resp1, resp2] - mock_anthropic.AnthropicVertex.return_value = mock_client - - with patch.dict(sys.modules, {"anthropic": mock_anthropic}): - status, _ = execute_task( - task_item={"model": "claude-3-opus@20240229"}, - task_brief="Update README", - repo_dir=self.repo_dir, - model_override="claude-3-opus@20240229", - api_key="", - task_index=0, - ) - self.assertEqual(status, "PASS") - self.assertEqual(readme.read_text(encoding="utf-8"), "Hello Agystack\n") - - def test_workspace_tool_path_traversal_prevention(self): - res_read = execute_workspace_tool("read_file", {"path": "../../etc/passwd"}, self.repo_dir) - self.assertIn("outside repository directory", res_read) - - res_write = execute_workspace_tool("write_file", {"path": "../evil.py", "content": "bad"}, self.repo_dir) - self.assertIn("outside repository directory", res_write) - - res_edit = execute_workspace_tool("edit_file", {"path": "../evil.py", "target": "a", "replacement": "b"}, self.repo_dir) - self.assertIn("outside repository directory", res_edit) - - -class TestMixedManifestRouting(unittest.TestCase): - def setUp(self): - self.temp_dir = tempfile.TemporaryDirectory() - self.repo_dir = Path(self.temp_dir.name) - subprocess.run(["git", "init"], cwd=self.repo_dir, check=True, capture_output=True) - - def tearDown(self): - self.temp_dir.cleanup() - - def test_mixed_manifest_picks_correct_client(self): - mock_ag = MagicMock() - mock_config = MagicMock() - mock_ag.LocalAgentConfig = mock_config - mock_ag.CapabilitiesConfig = MagicMock() - mock_ag.policy.allow_all = MagicMock() - mock_agent_instance = MagicMock() - mock_ag_resp = MagicMock() - mock_ag_resp.text = AsyncMock(return_value="Gemini agent done\n[STATUS: PASS]") - mock_agent_instance.chat = AsyncMock(return_value=mock_ag_resp) - mock_agent_cm = MagicMock() - mock_agent_cm.__aenter__ = AsyncMock(return_value=mock_agent_instance) - mock_agent_cm.__aexit__ = AsyncMock(return_value=None) - mock_ag.Agent = MagicMock(return_value=mock_agent_cm) - - mock_anthropic = MagicMock() - mock_claude_client = MagicMock() - mock_claude_resp = MagicMock() - mock_claude_block = MagicMock() - mock_claude_block.text = "Claude agent done\n[STATUS: PASS]" - mock_claude_resp.content = [mock_claude_block] - mock_claude_client.messages.create.return_value = mock_claude_resp - mock_anthropic.AnthropicVertex.return_value = mock_claude_client - - mock_aiplatform = MagicMock() - mock_fable_endpoint = MagicMock() - mock_fable_resp = MagicMock() - mock_fable_resp.predictions = ["Fable agent done\n[STATUS: PASS]"] - mock_fable_endpoint.predict.return_value = mock_fable_resp - mock_aiplatform.Endpoint.return_value = mock_fable_endpoint - - modules_patch = { - "google": MagicMock(), - "google.antigravity": mock_ag, - "anthropic": mock_anthropic, - "google.cloud.aiplatform": mock_aiplatform, - } - - manifest_tasks = [ - {"model": "gemini-3.8-flash", "brief": "Gemini subtask"}, - {"model": "claude-3-5-sonnet-v2@20241022", "brief": "Claude subtask"}, - {"model": "fable-5-1", "brief": "Fable subtask"}, - ] - - with patch.dict(sys.modules, modules_patch), patch("cloud_worker.emit_milestone") as mock_milestone: - # Task 0: Gemini - st0, out0 = execute_task( - task_item=manifest_tasks[0], - task_brief=manifest_tasks[0]["brief"], - repo_dir=self.repo_dir, - model_override="flash", - api_key="test-key", - task_index=0, - ) - self.assertEqual(st0, "PASS") - mock_ag.Agent.assert_called_once() - mock_anthropic.AnthropicVertex.assert_not_called() - mock_aiplatform.Endpoint.assert_not_called() - mock_milestone.assert_any_call(0, "RUNNING_AGENT", "Antigravity SDK agent (gemini-3.8-flash)") - - # Task 1: Claude 5.5 Sonnet - st1, out1 = execute_task( - task_item=manifest_tasks[1], - task_brief=manifest_tasks[1]["brief"], - repo_dir=self.repo_dir, - model_override="", - api_key="", - task_index=1, - ) - self.assertEqual(st1, "PASS") - mock_anthropic.AnthropicVertex.assert_called_once() - mock_aiplatform.Endpoint.assert_not_called() - mock_milestone.assert_any_call(1, "RUNNING_AGENT", "Vertex Model Garden agent (claude-3-5-sonnet-v2@20241022)") - - # Task 2: Fable 5.1 - st2, out2 = execute_task( - task_item=manifest_tasks[2], - task_brief=manifest_tasks[2]["brief"], - repo_dir=self.repo_dir, - model_override="", - api_key="", - task_index=2, - ) - self.assertEqual(st2, "PASS") - self.assertEqual(mock_anthropic.AnthropicVertex.call_count, 1) - mock_aiplatform.init.assert_called_once() - mock_aiplatform.Endpoint.assert_called_once_with(endpoint_name="fable-5-1") - mock_fable_endpoint.predict.assert_called_once() - mock_milestone.assert_any_call(2, "RUNNING_AGENT", "Vertex Model Garden agent (fable-5-1)") - - -class TestModelGardenPreflightProbe(unittest.TestCase): - def test_missing_project_fails(self): - result = check_model_garden(project_id="", import_fn=lambda name: MagicMock()) - self.assertFalse(result["ok"]) - self.assertIn("No active GCP project", result["error"]) - - def test_missing_anthropic_succeeds_with_note(self): - def fake_import(name): - if name == "anthropic": - raise ImportError("No module named 'anthropic'") - return MagicMock() - - mock_run_cmd = MagicMock(return_value=MagicMock(returncode=0, stdout="Listed 0 items.", stderr="")) - result = check_model_garden(project_id="test-project", run_cmd_fn=mock_run_cmd, import_fn=fake_import) - self.assertTrue(result["ok"]) - self.assertFalse(result["anthropic_installed"]) - self.assertEqual( - result["partner_models_note"], - "Optional package 'anthropic[vertex]' not installed for Claude partner models.", - ) - self.assertTrue(result["model_garden_verified"]) - - def test_worker_task_manifest_deepseek_enables_vertex_and_global_location(self): - mock_genai = MagicMock() - mock_client = MagicMock() - mock_resp = MagicMock() - mock_resp.text = "DeepSeek task done\n[STATUS: PASS]" - mock_resp.function_calls = [] - mock_resp.candidates = [] - mock_client.models.generate_content.return_value = mock_resp - mock_genai.Client.return_value = mock_client - - with tempfile.TemporaryDirectory() as tmp_dir, patch.dict(sys.modules, {"google.genai": mock_genai}): - repo_dir = Path(tmp_dir) - task_item = {"brief": "optimize", "model": "deepseek-v4.1-flash"} - status, summary = execute_task( - task_item=task_item, - task_brief="optimize", - repo_dir=repo_dir, - model_override="", - api_key="", - use_vertex=True, - location="us-central1", - task_index=0, - ) - self.assertEqual(status, "PASS") - mock_genai.Client.assert_called_once() - call_kwargs = mock_genai.Client.call_args[1] - self.assertTrue(call_kwargs.get("vertexai")) - self.assertEqual(call_kwargs.get("location"), "global") - - def test_successful_probe(self): - mock_mod = MagicMock() - mock_mod.AnthropicVertex = MagicMock() - mock_run_cmd = MagicMock(return_value=MagicMock(returncode=0, stdout="Listed 0 items.", stderr="")) - - result = check_model_garden( - project_id="test-project", - region="us-central1", - run_cmd_fn=mock_run_cmd, - import_fn=lambda name: mock_mod, - ) - self.assertTrue(result["ok"]) - self.assertTrue(result["anthropic_installed"]) - self.assertTrue(result["model_garden_verified"]) - self.assertEqual(result["project_id"], "test-project") - self.assertEqual(result["region"], "us-central1") - self.assertIn("gemini-4-argon", result["serverless_models"]) - self.assertIn("deepseek-v4.1-flash-maas", result["serverless_models"]) - self.assertIn("claude-3-5-sonnet-v2@20241022", result["partner_models"]) - self.assertIn("claude-3-opus@20240229", result["partner_models"]) - self.assertIn("fable-5-1", result["partner_models"]) - mock_mod.AnthropicVertex.assert_called_once_with( - project_id="test-project", - region="us-central1", - ) - mock_run_cmd.assert_called_once_with( - ["gcloud", "ai", "models", "list", "--project=test-project", "--region=us-central1", "--limit=1"], - check=False, - ) - - def test_client_init_error_fails(self): - mock_mod = MagicMock() - mock_mod.AnthropicVertex.side_effect = RuntimeError("ADC credentials expired") - - result = check_model_garden( - project_id="test-project", - import_fn=lambda name: mock_mod, - ) - self.assertFalse(result["ok"]) - self.assertTrue(result["anthropic_installed"]) - self.assertIn("ADC credentials expired", result["error"]) - - def test_probe_iam_failure(self): - mock_mod = MagicMock() - mock_run_cmd = MagicMock(return_value=MagicMock( - returncode=1, - stdout="", - stderr="ERROR: (gcloud.ai.models.list) User does not have permission aiplatform.models.list on resource", - )) - result = check_model_garden( - project_id="test-project", - run_cmd_fn=mock_run_cmd, - import_fn=lambda name: mock_mod, - ) - self.assertFalse(result["ok"]) - self.assertIn("Model Garden API check failed", result["error"]) - self.assertIn("permission", result["error"]) - - def test_probe_network_or_credential_exception(self): - mock_mod = MagicMock() - mock_run_cmd = MagicMock(side_effect=OSError("Network unreachable")) - result = check_model_garden( - project_id="test-project", - run_cmd_fn=mock_run_cmd, - import_fn=lambda name: mock_mod, - ) - self.assertFalse(result["ok"]) - self.assertIn("Model Garden API check exception", result["error"]) - self.assertIn("Network unreachable", result["error"]) - - def test_cli_check_model_garden(self): - cmd = [ - sys.executable, - str(REPO_ROOT / "skills" / "setup-agystack" / "scripts" / "setup_runtime.py"), - "--check-model-garden", - "--project=cli-test-project", - ] - res = subprocess.run(cmd, capture_output=True, text=True, check=False) - self.assertIn("cli-test-project", res.stdout) - data = json.loads(res.stdout.strip()) - self.assertEqual(data["project_id"], "cli-test-project") - - -class TestZeroPushAndPatchHarvesting(unittest.TestCase): - def setUp(self): - self.temp_dir = tempfile.TemporaryDirectory() - self.storage_dir = tempfile.TemporaryDirectory() - self.repo_dir = Path(self.temp_dir.name) - subprocess.run(["git", "init"], cwd=self.repo_dir, check=True, capture_output=True) - subprocess.run( - ["git", "config", "user.name", "Worker Bot"], - cwd=self.repo_dir, - check=True, - capture_output=True, - ) - subprocess.run( - ["git", "config", "user.email", "worker@example.com"], - cwd=self.repo_dir, - check=True, - capture_output=True, - ) - - init_file = self.repo_dir / "service.py" - init_file.write_text("def run():\n return 1\n", encoding="utf-8") - subprocess.run(["git", "add", "service.py"], cwd=self.repo_dir, check=True, capture_output=True) - subprocess.run(["git", "commit", "-m", "init"], cwd=self.repo_dir, check=True, capture_output=True) - - def tearDown(self): - self.temp_dir.cleanup() - self.storage_dir.cleanup() - - def test_zero_push_and_patch_diff_harvesting(self): - import storage_uploader - - service_file = self.repo_dir / "service.py" - service_file.write_text("def run():\n return 2\n", encoding="utf-8") - - bucket_name = "test-results-bucket" - session_id = "test-session-zero-push" - env = { - "STORAGE_MESSENGER_LOCAL_DIR": self.storage_dir.name, - "GCS_BUCKET": bucket_name, - "SWARM_SESSION_ID": session_id, - } - - with patch.dict(os.environ, env): - subprocess.run(["git", "add", "service.py"], cwd=self.repo_dir, check=True) - subprocess.run(["git", "commit", "-m", "worker commit"], cwd=self.repo_dir, check=True) - commit_res = subprocess.run( - ["git", "rev-parse", "HEAD"], - cwd=self.repo_dir, - capture_output=True, - text=True, - check=True, - ) - commit_sha = commit_res.stdout.strip() - - uris = storage_uploader.upload_run_artifacts( - bucket_name=bucket_name, - prefix=f"swarms/{session_id}", - repo_dir=self.repo_dir, - task_index=0, - status="PASS", - candidate_files=["service.py"], - commit_sha=commit_sha, - ) - - self.assertIn("patch.diff", uris) - diff_file = ( - Path(self.storage_dir.name) - / bucket_name - / "swarms" - / session_id - / "task-0" - / "patch.diff" - ) - self.assertTrue(diff_file.is_file()) - content = diff_file.read_text(encoding="utf-8") - self.assertIn("+ return 2", content) - - git_log = subprocess.run( - ["git", "remote"], cwd=self.repo_dir, capture_output=True, text=True - ) - self.assertEqual(git_log.stdout.strip(), "") - - -class TestStartupLatencyProbe(unittest.TestCase): - def test_partner_client_startup_overhead(self): - mock_anthropic = MagicMock() - mock_anthropic.AnthropicVertex = MagicMock() - - with patch.dict(sys.modules, {"anthropic": mock_anthropic}): - duration_s = measure_partner_client_startup( - project="perf-project", - region="us-central1", - ) - self.assertLessEqual(duration_s, 2.0) - - -class TestWorkspaceTools(unittest.TestCase): - def setUp(self): - self.temp_dir = tempfile.TemporaryDirectory() - self.repo_dir = Path(self.temp_dir.name) - subprocess.run(["git", "init"], cwd=self.repo_dir, check=True, capture_output=True) - - def tearDown(self): - self.temp_dir.cleanup() - - def test_workspace_tool_run_command_destructive_blocked_by_safety(self): - destructive_commands = [ - "rm -rf /", - "git push origin main -f", - "git push --force origin main", - "drop database testdb", - ] - for cmd in destructive_commands: - with self.subTest(cmd=cmd): - res = execute_workspace_tool("run_command", {"command": cmd}, self.repo_dir) - self.assertIn("Error: Command blocked by safety policy", res) - self.assertIn("deny", res.lower()) - - def test_workspace_tool_run_command_safe_allowed(self): - res = execute_workspace_tool("run_command", {"command": "echo safe_test_output"}, self.repo_dir) - self.assertIn("safe_test_output", res) - - -class TestCloudWorkerManifestAuth(unittest.TestCase): - def test_main_deepseek_manifest_enables_vertex_under_adc(self): - env = { - "REPO_URL": "https://github.com/example/repo.git", - "MODEL_OVERRIDE": "", - "TASK_MANIFEST": json.dumps([{"model": "deepseek", "brief": "solve"}]), - "GEMINI_API_KEY": "", - "USE_VERTEX_AI": "", - "CLOUD_RUN_TASK_INDEX": "0", - } - orig_cwd = os.getcwd() - try: - with patch.dict(os.environ, env, clear=False), \ - patch("cloud_worker.clone_and_checkout_task"), \ - patch("cloud_worker.execute_task", return_value=("PASS", "done")) as mock_exec, \ - patch("cloud_worker.run_command") as mock_run_cmd, \ - patch("cloud_worker.parse_score_metrics", return_value=(None, None, None)), \ - patch("os.chdir"): - mock_run_cmd.return_value = MagicMock(returncode=0, stdout="") - with patch("sys.exit"): - cloud_worker.main() - mock_exec.assert_called_once() - self.assertTrue(mock_exec.call_args[1].get("use_vertex")) - finally: - os.chdir(orig_cwd) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_container_spec.py b/tests/test_container_spec.py deleted file mode 100644 index 0c672ac..0000000 --- a/tests/test_container_spec.py +++ /dev/null @@ -1,130 +0,0 @@ -import re -import unittest -from pathlib import Path - - -class TestContainerSpec(unittest.TestCase): - @classmethod - def setUpClass(cls): - cls.project_root = Path(__file__).resolve().parent.parent - cls.scripts_dir = cls.project_root / "skills" / "swarm" / "scripts" - cls.dockerfile_path = cls.scripts_dir / "Dockerfile" - - if not cls.dockerfile_path.is_file(): - raise FileNotFoundError(f"Dockerfile not found at {cls.dockerfile_path}") - cls.dockerfile_content = cls.dockerfile_path.read_text(encoding="utf-8") - - def test_base_image(self): - self.assertRegex( - self.dockerfile_content, - r"FROM\s+python:3\.11-slim", - "Base image must be python:3.11-slim", - ) - - def test_environment_variables(self): - required_env_vars = [ - r"RUSTUP_HOME=/usr/local/rustup", - r"CARGO_HOME=/usr/local/cargo", - r"PATH=/usr/local/cargo/bin:\$PATH", - r"PYTHONUNBUFFERED=1", - r"DEBIAN_FRONTEND=noninteractive", - r"GEMINI_HOME=/home/worker/\.gemini", - r"AGYSTACK_PLUGIN_DIR=/home/worker/\.gemini/config/plugins/agystack", - ] - for env_var in required_env_vars: - self.assertTrue( - re.search(env_var, self.dockerfile_content), - f"Missing required environment variable definition: {env_var}", - ) - - def test_gemini_home_and_plugin_directory(self): - self.assertIn("GEMINI_HOME=/home/worker/.gemini", self.dockerfile_content) - self.assertIn( - "AGYSTACK_PLUGIN_DIR=/home/worker/.gemini/config/plugins/agystack", - self.dockerfile_content, - ) - self.assertRegex( - self.dockerfile_content, - r"mkdir\s+-p\s+.*\/home\/worker\/\.gemini\/config\/plugins\/agystack", - ) - self.assertRegex( - self.dockerfile_content, - r"chown\s+-R\s+worker:worker\s+.*\/home\/worker", - ) - - def test_system_packages(self): - required_packages = [ - "git", - "git-lfs", - "curl", - "ca-certificates", - "gnupg", - "build-essential", - "pkg-config", - "libssl-dev", - "bubblewrap", - "util-linux", - "nodejs", - ] - for pkg in required_packages: - pattern = rf"\b{re.escape(pkg)}\b" - self.assertTrue( - re.search(pattern, self.dockerfile_content), - f"Missing required system package in Dockerfile: {pkg}", - ) - self.assertIn("setup_20.x", self.dockerfile_content) - - def test_rust_toolchain(self): - self.assertIn("https://sh.rustup.rs", self.dockerfile_content) - self.assertIn("--default-toolchain stable", self.dockerfile_content) - self.assertIn("--profile minimal", self.dockerfile_content) - self.assertRegex( - self.dockerfile_content, - r"chmod\s+-R\s+a\+w\s+/usr/local/cargo", - "Cargo directory must be writable by all users", - ) - - def test_worker_user(self): - self.assertRegex( - self.dockerfile_content, - r"useradd\s+-m\s+-u\s+1000\s+-s\s+/bin/bash\s+worker", - "Non-root worker user with UID 1000 must be created", - ) - self.assertRegex( - self.dockerfile_content, - r"\bUSER\s+worker\b", - "Dockerfile should switch to worker user", - ) - - def test_git_lfs(self): - self.assertIn("git lfs install --system", self.dockerfile_content) - - def test_antigravity_and_entrypoint(self): - self.assertIn("COPY requirements.txt /app/requirements.txt", self.dockerfile_content) - self.assertIn("pip install --no-cache-dir -r /app/requirements.txt", self.dockerfile_content) - self.assertIn('ENTRYPOINT ["python", "/app/cloud_worker.py"]', self.dockerfile_content) - - def test_plugin_skills_and_rules_copied(self): - self.assertRegex( - self.dockerfile_content, - r"COPY\s+skills\s+\/home\/worker\/\.gemini\/config\/plugins\/agystack\/skills", - ) - self.assertRegex( - self.dockerfile_content, - r"COPY\s+rules\s+\/home\/worker\/\.gemini\/config\/plugins\/agystack\/rules", - ) - self.assertRegex( - self.dockerfile_content, - r"COPY\s+agents\s+\/home\/worker\/\.gemini\/config\/plugins\/agystack\/agents", - ) - - def test_cargo_deny_not_in_dockerfile(self): - self.assertNotIn( - "cargo-deny", - self.dockerfile_content, - "cargo-deny must not be referenced in Dockerfile", - ) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_conversational_steering_tool.py b/tests/test_conversational_steering_tool.py deleted file mode 100644 index aacc777..0000000 --- a/tests/test_conversational_steering_tool.py +++ /dev/null @@ -1,640 +0,0 @@ -#!/usr/bin/env python3 -""" -Unit tests for conversational mailbox steering tool. -Covers: -1. Text steering instruction delivery to worker mailbox in GCS. -2. Pre-tool hook intercepting steering instruction and emitting STEER_APPLIED. -3. ABORT command handling emitting ABORT_REQUESTED. -4. Broadcast steering instruction to all workers. -5. Target out of range error (exit code 1). -6. Dashboard reflecting steer pending status. -7. Idempotent re-delivery preventing duplicate execution via sequence numbers. -8. GCS network timeout retry logic. -9. Worker prompt injecting custom steer context. -10. Mailbox cleanup upon session completion. -11. Steering delivery latency probe <= 600ms (baseline 250ms). -""" - -import asyncio -import io -import json -import os -from pathlib import Path -import shutil -import sys -import tempfile -import time -import unittest -from unittest.mock import MagicMock, patch - -# Ensure scripts directory is on sys.path -SCRIPT_DIR = Path(__file__).resolve().parent.parent / "skills" / "swarm" / "scripts" -if str(SCRIPT_DIR) not in sys.path: - sys.path.insert(0, str(SCRIPT_DIR)) - -from storage_messenger import ( - MailboxEnvelope, - MessageStatus, - MessageType, - StorageMessenger, - retry_gcs_operation, -) -from steer_cloud_task import ( - is_abort_command, - steer_task, - validate_instruction, - validate_seq, - validate_task_target, -) -from cloud_dispatch import ( - SwarmDashboardWriter, - TaskDashboardState, - cleanup_session, - handle_mailbox_steer, -) -from cloud_worker import StagnancyTracker, create_agent_hooks - - -class FakeHookResult: - def __init__(self, allow=True, error_message=None, custom_context=None): - self.allow = allow - self.error_message = error_message - self.custom_context = custom_context - - -class FakeHooks: - def pre_tool_call_decide(self, fn): - return fn - - def post_tool_call(self, fn): - return fn - - -class TestConversationalSteeringTool(unittest.TestCase): - def setUp(self): - self.temp_dir = tempfile.mkdtemp(prefix="test_steer_") - self.storage_root = Path(self.temp_dir) - self.bucket_name = "test-steering-bucket" - self.session_id = f"test-sess-{int(time.time() * 1000)}" - - def tearDown(self): - shutil.rmtree(self.temp_dir, ignore_errors=True) - - def _create_messenger(self, task_index: int = 0, is_worker: bool = False): - return StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=task_index, - is_worker=is_worker, - local_dir=self.storage_root, - ) - - def test_01_text_steering_instruction_delivery_to_worker_mailbox(self): - """Verify delivery of text steering instruction to worker inbox envelope in GCS.""" - orch = self._create_messenger(is_worker=False) - worker = self._create_messenger(task_index=0, is_worker=True) - - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - envelope = handle_mailbox_steer( - task_index=0, - text="Refactor authentication parser", - session_id=self.session_id, - bucket_name=self.bucket_name, - messenger=orch, - ) - - stdout_val = mock_out.getvalue() - self.assertIn("[STEER] Instruction delivered to task-0 mailbox in GCS", stdout_val) - - self.assertIsNotNone(envelope) - self.assertEqual(envelope.task_index, 0) - self.assertEqual(envelope.seq, 1) - self.assertEqual(envelope.msg_type, MessageType.STEER) - self.assertEqual(envelope.payload.get("instruction"), "Refactor authentication parser") - - # Verify disk artifact exists in local GCS inbox - inbox_file = ( - self.storage_root - / self.bucket_name - / "swarms" - / self.session_id - / "tasks" - / "task-0" - / "inbox" - / "0001_steer.json" - ) - self.assertTrue(inbox_file.is_file()) - - # Worker picks up steering instruction - steers = worker.check_steer_instructions() - self.assertEqual(len(steers), 1) - self.assertEqual(steers[0].payload.get("instruction"), "Refactor authentication parser") - - def test_02_pre_tool_hook_intercepting_steering_instruction_and_emitting_steer_applied(self): - """Verify pre-tool hook intercepts steering instruction and emits STEER_APPLIED milestone.""" - orch = self._create_messenger(is_worker=False) - worker = self._create_messenger(task_index=1, is_worker=True) - - orch.send_steer(task_index=1, instruction="Prioritize latency regression fix") - - fake_hooks = FakeHooks() - fake_types = MagicMock() - fake_types.HookResult = FakeHookResult - - tracker = StagnancyTracker() - hooks = create_agent_hooks( - messenger=worker, - task_index=1, - tracker=tracker, - hooks_module=fake_hooks, - types_module=fake_types, - ) - pre_hook = hooks[0] - - tool_call = MagicMock() - tool_call.name = "run_command" - tool_call.args = {"CommandLine": "pytest"} - - with patch("cloud_worker.emit_milestone") as mock_milestone: - res = asyncio.run(pre_hook(tool_call)) - self.assertTrue(res.allow) - self.assertEqual(res.custom_context, "Prioritize latency regression fix") - mock_milestone.assert_any_call(1, "STEER_APPLIED", "Prioritize latency regression fix") - - def test_03_abort_command_handling_emitting_abort_requested(self): - """Verify ABORT command causes hook to reject execution and emit ABORT_REQUESTED.""" - orch = self._create_messenger(is_worker=False) - worker = self._create_messenger(task_index=2, is_worker=True) - - orch.send_steer(task_index=2, instruction="ABORT immediately due to resource saturation") - - fake_hooks = FakeHooks() - fake_types = MagicMock() - fake_types.HookResult = FakeHookResult - - tracker = StagnancyTracker() - hooks = create_agent_hooks( - messenger=worker, - task_index=2, - tracker=tracker, - hooks_module=fake_hooks, - types_module=fake_types, - ) - pre_hook = hooks[0] - - tool_call = MagicMock() - tool_call.name = "replace_file_content" - tool_call.args = {"TargetFile": "/tmp/test.py"} - - with patch("cloud_worker.emit_milestone") as mock_milestone: - res = asyncio.run(pre_hook(tool_call)) - self.assertFalse(res.allow) - self.assertIn("Execution aborted by orchestrator", res.error_message) - mock_milestone.assert_any_call( - 2, "ABORT_REQUESTED", "ABORT immediately due to resource saturation" - ) - - def test_04_broadcast_steering_instruction_to_all_workers(self): - """Verify broadcasting instruction to all workers with --task all.""" - orch = self._create_messenger(is_worker=False) - worker_0 = self._create_messenger(task_index=0, is_worker=True) - worker_1 = self._create_messenger(task_index=1, is_worker=True) - worker_2 = self._create_messenger(task_index=2, is_worker=True) - - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - envs = steer_task( - task="all", - instruction="Switch to strict memory bounds", - session_id=self.session_id, - bucket_name=self.bucket_name, - messenger=orch, - max_tasks=3, - ) - stdout_val = mock_out.getvalue() - self.assertIn("[STEER] Instruction delivered to task-0 mailbox in GCS", stdout_val) - self.assertIn("[STEER] Instruction delivered to task-1 mailbox in GCS", stdout_val) - self.assertIn("[STEER] Instruction delivered to task-2 mailbox in GCS", stdout_val) - - self.assertEqual(len(envs), 3) - - # Confirm each worker received the instruction - for worker in (worker_0, worker_1, worker_2): - steers = worker.check_steer_instructions() - self.assertEqual(len(steers), 1) - self.assertEqual(steers[0].payload.get("instruction"), "Switch to strict memory bounds") - - def test_05_target_out_of_range_error_exit_code_1(self): - """Verify target out of range errors raise ValueError or exit with code 1.""" - # Validation functions - with self.assertRaises(ValueError): - validate_task_target(-1) - - with self.assertRaises(ValueError): - validate_task_target(5, max_tasks=3) - - with self.assertRaises(ValueError): - validate_instruction("") - - with self.assertRaises(ValueError): - validate_seq(0) - - # Test CLI error handling in steer_cloud_task main - with patch("sys.argv", ["steer_cloud_task.py", "--task", "10", "--instruction", "foo", "--task-count", "2"]), \ - patch("sys.stderr", new_callable=io.StringIO) as mock_err: - from steer_cloud_task import main as steer_main - with self.assertRaises(SystemExit) as cm: - steer_main() - self.assertEqual(cm.exception.code, 1) - self.assertIn("out of range", mock_err.getvalue()) - - # Test CLI error handling in cloud_dispatch steer subcommand - orch = self._create_messenger(is_worker=False) - with patch("sys.stderr", new_callable=io.StringIO) as mock_err: - with self.assertRaises(SystemExit) as cm: - handle_mailbox_steer( - task_index=99, - text="Invalid task target", - session_id=self.session_id, - bucket_name=self.bucket_name, - messenger=orch, - max_tasks=2, - ) - self.assertEqual(cm.exception.code, 1) - self.assertIn("out of range", mock_err.getvalue()) - - def test_06_dashboard_reflecting_steer_pending_status(self): - """Verify SwarmDashboardWriter reflects steer pending status and clears it upon milestone.""" - app_data_dir = self.storage_root / "antigravity" - writer = SwarmDashboardWriter( - session_id=self.session_id, - conversation_id=self.session_id, - app_data_dir=app_data_dir, - task_count=2, - model="gemini-3.8-flash", - ) - writer.update_task_phase(0, "RUNNING_AGENT") - - # Initial render: no steer pending - initial_render = writer.render() - self.assertNotIn("STEER_PENDING", initial_render) - - # Dispatch steering instruction to task 0 - orch = self._create_messenger(is_worker=False) - handle_mailbox_steer( - task_index=0, - text="Abort search branch C", - session_id=self.session_id, - bucket_name=self.bucket_name, - messenger=orch, - dashboard_writer=writer, - ) - - state = writer.get_task_state(0) - self.assertIsNotNone(state) - self.assertTrue(state.is_steer_pending) - self.assertEqual(state.pending_steer, "Abort search branch C") - - # Render shows STEER_PENDING - steer_render = writer.render() - self.assertIn("STEER_PENDING: Abort search branch C", steer_render) - - # Worker applies steering instruction and emits STEER_APPLIED milestone - milestone_line = "[MILESTONE] [TASK 0] [PHASE: STEER_APPLIED] Abort search branch C" - processed = writer.process_log_line(milestone_line) - self.assertTrue(processed) - - # Pending steer is cleared and phase updated - self.assertFalse(state.is_steer_pending) - self.assertIsNone(state.pending_steer) - self.assertEqual(state.phase, "STEER_APPLIED") - - cleared_render = writer.render() - self.assertNotIn("STEER_PENDING", cleared_render) - self.assertIn("STEER_APPLIED", cleared_render) - - def test_07_idempotent_redelivery_preventing_duplicate_execution_via_sequence_numbers(self): - """Verify that sequence numbers and acknowledged status prevent duplicate execution.""" - orch = self._create_messenger(is_worker=False) - worker = self._create_messenger(task_index=0, is_worker=True) - - env1 = orch.send_steer(task_index=0, instruction="First directive") - self.assertEqual(env1.seq, 1) - - # First check consumes and acknowledges envelope seq 1 - steers = worker.check_steer_instructions() - self.assertEqual(len(steers), 1) - self.assertEqual(steers[0].seq, 1) - - # Immediate re-check returns empty list (in-memory deduplication) - steers_again = worker.check_steer_instructions() - self.assertEqual(len(steers_again), 0) - - # Re-instantiate worker (simulating crash and recovery) - recovered_worker = self._create_messenger(task_index=0, is_worker=True) - # Should not re-deliver already ACKNOWLEDGED envelope seq 1 - steers_recovered = recovered_worker.check_steer_instructions() - self.assertEqual(len(steers_recovered), 0) - - # Now send a second directive: receives seq 2 - env2 = orch.send_steer(task_index=0, instruction="Second directive") - self.assertEqual(env2.seq, 2) - - steers_new = recovered_worker.check_steer_instructions() - self.assertEqual(len(steers_new), 1) - self.assertEqual(steers_new[0].seq, 2) - self.assertEqual(steers_new[0].payload.get("instruction"), "Second directive") - - def test_08_gcs_network_timeout_retry_logic(self): - """Verify exponential backoff retry logic on network timeouts.""" - attempts = 0 - - def flaky_gcs_call(): - nonlocal attempts - attempts += 1 - if attempts < 3: - raise TimeoutError("Simulated GCS network socket timeout") - return "SUCCESS" - - result = retry_gcs_operation( - flaky_gcs_call, - max_retries=3, - initial_delay=0.01, - backoff_factor=1.2, - ) - self.assertEqual(result, "SUCCESS") - self.assertEqual(attempts, 3) - - # Test failure when retries exhausted - always_timeout_attempts = 0 - - def persistent_timeout(): - nonlocal always_timeout_attempts - always_timeout_attempts += 1 - raise TimeoutError("Persistent connection timeout") - - with self.assertRaises(TimeoutError): - retry_gcs_operation( - persistent_timeout, - max_retries=2, - initial_delay=0.01, - ) - self.assertEqual(always_timeout_attempts, 3) - - def test_09_worker_prompt_injecting_custom_steer_context(self): - """Verify that worker hook injects steering instruction as custom_context into model prompt.""" - orch = self._create_messenger(is_worker=False) - worker = self._create_messenger(task_index=3, is_worker=True) - - steer_text = "Ensure backward compatibility with API v1" - orch.send_steer(task_index=3, instruction=steer_text) - - fake_hooks = FakeHooks() - fake_types = MagicMock() - fake_types.HookResult = FakeHookResult - - tracker = StagnancyTracker() - hooks = create_agent_hooks( - messenger=worker, - task_index=3, - tracker=tracker, - hooks_module=fake_hooks, - types_module=fake_types, - ) - pre_hook = hooks[0] - - tool_call = MagicMock() - tool_call.name = "run_command" - tool_call.args = {"CommandLine": "cargo build"} - - res = asyncio.run(pre_hook(tool_call)) - self.assertTrue(res.allow) - self.assertEqual(res.custom_context, steer_text) - - def test_10_mailbox_cleanup_upon_session_completion(self): - """Verify that ephemeral mailbox envelopes are completely purged on session cleanup.""" - orch = self._create_messenger(is_worker=False) - worker_0 = self._create_messenger(task_index=0, is_worker=True) - worker_1 = self._create_messenger(task_index=1, is_worker=True) - - # Create outbox and inbox envelopes - worker_0.send_question("Worker 0 question") - worker_1.send_question("Worker 1 question") - orch.send_steer(task_index=0, instruction="Steer 0") - orch.send_steer(task_index=1, instruction="Steer 1") - - session_tasks_dir = ( - self.storage_root / self.bucket_name / "swarms" / self.session_id / "tasks" - ) - self.assertTrue(session_tasks_dir.exists()) - - # Clean up session - cleanup_res = cleanup_session( - session_id=self.session_id, - bucket_name=self.bucket_name, - messenger=orch, - ) - self.assertGreater(cleanup_res.get("mailboxes_cleaned", 0), 0) - - # Verify no questions or steer envelopes remain - self.assertEqual(len(orch.list_pending_questions()), 0) - self.assertEqual(len(worker_0.check_steer_instructions()), 0) - self.assertEqual(len(worker_1.check_steer_instructions()), 0) - - def test_11_steering_delivery_latency_probe_under_600ms(self): - """Probe steering delivery latency; must be <= 600ms (baseline ~250ms SLA).""" - orch = self._create_messenger(is_worker=False) - - latencies_ms = [] - iterations = 10 - for i in range(iterations): - t_start = time.perf_counter() - steer_task( - task=0, - instruction=f"Latency probe iteration {i}", - session_id=self.session_id, - messenger=orch, - ) - elapsed_ms = (time.perf_counter() - t_start) * 1000.0 - latencies_ms.append(elapsed_ms) - - avg_latency_ms = sum(latencies_ms) / len(latencies_ms) - max_latency_ms = max(latencies_ms) - - # Assert strict latency SLA under 600ms - self.assertLessEqual( - avg_latency_ms, - 600.0, - f"Average steering delivery latency ({avg_latency_ms:.2f}ms) exceeded 600ms SLA", - ) - self.assertLessEqual( - max_latency_ms, - 600.0, - f"Max steering delivery latency ({max_latency_ms:.2f}ms) exceeded 600ms spike limit", - ) - - def test_12_broadcast_steering_fails_closed_when_no_tasks_discovered(self): - """Verify that broadcast steering (--task all) raises RuntimeError when no tasks discovered.""" - empty_session = f"empty-sess-{int(time.time() * 1000)}" - orch = StorageMessenger( - bucket_name=self.bucket_name, - session_id=empty_session, - is_worker=False, - local_dir=self.storage_root, - ) - with self.assertRaises(RuntimeError) as cm: - steer_task( - task="all", - instruction="Cancel exploration", - session_id=empty_session, - messenger=orch, - max_tasks=None, - ) - self.assertIn("Broadcast steering failed: No tasks discovered", str(cm.exception)) - - def test_13_sequence_resolution_fails_closed_on_persistent_gcs_failure(self): - """Verify sequence resolution fails closed (RuntimeError) and does not default to 0 on persistent failure.""" - orch = self._create_messenger(is_worker=False) - - # Mock list_blobs to simulate persistent network timeouts - with patch.object(orch.bucket, "list_blobs", side_effect=TimeoutError("Persistent connection timeout")): - with self.assertRaises(RuntimeError) as cm: - orch.send_steer(task_index=0, instruction="Should fail safely", max_retries=1, retry_delay=0.01) - self.assertIn("GCS sequence resolution failed", str(cm.exception)) - - def test_14_storage_prefix_alignment_swarms_hierarchy(self): - """Verify StorageMessenger normalizes session prefixes to swarms/.""" - msg1 = StorageMessenger(bucket_name="bkt", session_id="test-123", is_worker=False, local_dir=self.storage_root) - self.assertEqual(msg1._session_prefix(), "swarms/test-123") - - msg2 = StorageMessenger(bucket_name="bkt", session_id="swarm-test-123", is_worker=False, local_dir=self.storage_root) - self.assertEqual(msg2._session_prefix(), "swarms/test-123") - - msg3 = StorageMessenger(bucket_name="bkt", session_id="swarms/test-123", is_worker=False, local_dir=self.storage_root) - self.assertEqual(msg3._session_prefix(), "swarms/test-123") - - def test_15_steering_context_preserved_alongside_stagnancy_warning(self): - """Verify that when a tool call is stagnant and steer is pending, both contexts are preserved.""" - orch = self._create_messenger(is_worker=False) - worker = self._create_messenger(task_index=4, is_worker=True) - - fake_hooks = FakeHooks() - fake_types = MagicMock() - fake_types.HookResult = FakeHookResult - - tracker = StagnancyTracker() - hooks = create_agent_hooks( - messenger=worker, - task_index=4, - tracker=tracker, - hooks_module=fake_hooks, - types_module=fake_types, - ) - pre_hook = hooks[0] - - tool_call = MagicMock() - tool_call.name = "list_dir" - tool_call.args = {"DirectoryPath": "/tmp"} - - # Simulate 2 prior calls to establish consecutive call pattern - asyncio.run(pre_hook(tool_call)) - asyncio.run(pre_hook(tool_call)) - - # Deliver steering directive immediately before the stagnant 3rd call - steer_text = "Pivot to breadth-first search" - orch.send_steer(task_index=4, instruction=steer_text) - - # Third identical call triggers stagnancy (count >= 3) AND consumes pending steer - res = asyncio.run(pre_hook(tool_call)) - self.assertTrue(res.allow) - self.assertIn(steer_text, res.custom_context) - self.assertIn("consecutive times with identical arguments", res.custom_context) - - def test_16_concurrent_send_steer_collision_retry(self): - """Simulate two simultaneous send_steer() calls colliding on sequence number, - verifying both succeed with distinct sequence numbers.""" - import concurrent.futures - import threading - from unittest.mock import patch - - orch = self._create_messenger(is_worker=False) - worker = self._create_messenger(task_index=0, is_worker=True) - - orig_list_blobs = orch.bucket.list_blobs - barrier = threading.Barrier(2) - barrier_passed = threading.Event() - - def sync_list_blobs(*args, **kwargs): - res = orig_list_blobs(*args, **kwargs) - if not barrier_passed.is_set(): - try: - barrier.wait(timeout=3.0) - barrier_passed.set() - except Exception: - pass - return res - - with patch.object(orch.bucket, "list_blobs", side_effect=sync_list_blobs): - with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor: - f1 = executor.submit(orch.send_steer, 0, "Concurrent directive A") - f2 = executor.submit(orch.send_steer, 0, "Concurrent directive B") - env1 = f1.result(timeout=5.0) - env2 = f2.result(timeout=5.0) - - self.assertIsNotNone(env1) - self.assertIsNotNone(env2) - self.assertNotEqual(env1.seq, env2.seq) - self.assertEqual({env1.seq, env2.seq}, {1, 2}) - - steers = worker.check_steer_instructions() - self.assertEqual(len(steers), 2) - steer_seqs = {s.seq for s in steers} - self.assertEqual(steer_seqs, {1, 2}) - instructions = {s.payload.get("instruction") for s in steers} - self.assertEqual(instructions, {"Concurrent directive A", "Concurrent directive B"}) - - def test_17_send_steer_retries_on_precondition_failed_collision(self): - """Verify send_steer retries when PreconditionFailed (HTTP 412) is raised during upload.""" - from storage_messenger import PreconditionFailed - from unittest.mock import patch - - orch = self._create_messenger(is_worker=False) - call_count = 0 - real_blob_factory = orch.bucket.blob - - def mock_blob(name: str): - blob = real_blob_factory(name) - orig_upload = blob.upload_from_string - - def mock_upload(*args, **kwargs): - nonlocal call_count - call_count += 1 - if call_count == 1: - real_blob_factory(name).upload_from_string("{}", content_type="application/json") - raise PreconditionFailed("Simulated HTTP 412 Precondition Failed") - return orig_upload(*args, **kwargs) - - blob.upload_from_string = mock_upload - return blob - - with patch.object(orch.bucket, "blob", side_effect=mock_blob): - env = orch.send_steer(task_index=0, instruction="Retry on 412 test") - - self.assertIsNotNone(env) - self.assertEqual(env.seq, 2) - self.assertEqual(call_count, 2) - - def test_18_mailbox_controller_modular_import(self): - """Verify mailbox CLI handlers are modularly importable from dispatch.mailbox_controller.""" - from dispatch.mailbox_controller import ( - handle_mailbox_list as mc_list, - handle_mailbox_reply as mc_reply, - handle_mailbox_steer as mc_steer, - ) - self.assertTrue(callable(mc_list)) - self.assertTrue(callable(mc_reply)) - self.assertTrue(callable(mc_steer)) - - -if __name__ == "__main__": - unittest.main() - diff --git a/tests/test_hooks.py b/tests/test_hooks.py index 22e9420..551e282 100644 --- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -32,7 +32,6 @@ def run_safety_hook( run_env = os.environ.copy() run_env.pop("NON_INTERACTIVE", None) run_env.pop("CI", None) - run_env.pop("CLOUD_RUN_TASK_INDEX", None) run_env.setdefault("GIT_BRANCH", "main") if env: run_env.update(env) @@ -299,7 +298,6 @@ def test_safety_hook_headless_rejects_destructive(self): {"NON_INTERACTIVE": "1"}, {"CI": "true"}, {"CI": "1"}, - {"CLOUD_RUN_TASK_INDEX": "0"}, ] destructive_commands = [ "rm -rf /", @@ -385,7 +383,6 @@ def run_delegation_hook( run_env = os.environ.copy() run_env.pop("NON_INTERACTIVE", None) run_env.pop("CI", None) - run_env.pop("CLOUD_RUN_TASK_INDEX", None) run_env.pop("SUBAGENT", None) run_env.pop("IS_SUBAGENT", None) run_env.pop("ANTIGRAVITY_SUBAGENT_ID", None) @@ -722,25 +719,6 @@ def test_user_override_env_bypass(self): self.assertEqual(result.returncode, 0) self.assertEqual(json.loads(result.stdout.strip()), {}) - def test_cloud_run_task_permits_writes(self): - large_code = "\n".join(f"var_{i} = {i}" for i in range(60)) - with tempfile.TemporaryDirectory(dir=REPO_ROOT) as tmp_dir: - target_py = Path(tmp_dir) / "cloud_task_file.py" - payload = { - "toolCall": { - "name": "write_to_file", - "args": { - "TargetFile": str(target_py), - "CodeContent": large_code, - }, - } - } - result = run_delegation_hook( - json.dumps(payload), env={"CLOUD_RUN_TASK_INDEX": "0"} - ) - self.assertEqual(result.returncode, 0) - self.assertEqual(json.loads(result.stdout.strip()), {}) - def test_coordinator_prompt_does_not_bypass(self): large_code = "\n".join(f"var_{i} = {i}" for i in range(60)) with tempfile.TemporaryDirectory(dir=REPO_ROOT) as tmp_dir: diff --git a/tests/test_live_cloud_bidirectional.py b/tests/test_live_cloud_bidirectional.py deleted file mode 100644 index 60a73d1..0000000 --- a/tests/test_live_cloud_bidirectional.py +++ /dev/null @@ -1,197 +0,0 @@ -#!/usr/bin/env python3 -""" -Rigorous live integration test for bidirectional messaging between orchestrator -and cloud swarm agents against real Google Cloud Storage (agystack-swarm-results-prod). -Tests: -1. Live GCS roundtrip: question upload, discovery, reply delivery, and acknowledgment. -2. Live GCS steering: asynchronous steer injection and worker retrieval. -3. Live CLI subcommands: cloud_dispatch.py mailbox list, reply, steer. -4. Worker timeout fallback: worker question times out and falls back to autonomous continuation. -5. Cleanup of test session artifacts in GCS. -""" - -import os -import subprocess -import sys -import time -import unittest -from pathlib import Path - -# Add scripts directory to path -SCRIPTS_DIR = Path(__file__).resolve().parent.parent / "skills" / "swarm" / "scripts" -sys.path.insert(0, str(SCRIPTS_DIR)) - -from storage_messenger import StorageMessenger, MessageStatus, MessageType -from cloud_dispatch import ( - handle_mailbox_list, - handle_mailbox_reply, - handle_mailbox_steer, -) - - -class TestLiveCloudBidirectional(unittest.TestCase): - @classmethod - def setUpClass(cls): - live_bucket = os.environ.get("AGYSTACK_LIVE_BUCKET") - if not live_bucket: - cls.live_gcs_available = False - return - - cls.bucket_name = live_bucket - cls.session_id = f"test-live-{int(time.time())}" - cls.task_index = 99 # Isolated high index for verification - - # Verify GCS connectivity - try: - test_msg = StorageMessenger( - bucket_name=cls.bucket_name, - session_id=cls.session_id, - task_index=cls.task_index, - is_worker=True, - ) - # Try a probe blob - probe_blob = test_msg.bucket.blob(f"swarm-{cls.session_id}/probe.txt") - probe_blob.upload_from_string("probe_ok") - cls.live_gcs_available = probe_blob.exists() - except Exception as exc: - print(f"Notice: Real GCS probe failed ({exc}). Tests will skip live network calls if unauthenticated.", file=sys.stderr) - cls.live_gcs_available = False - - @classmethod - def tearDownClass(cls): - if not getattr(cls, "live_gcs_available", False): - return - # Clean up test session blobs from GCS - try: - messenger = StorageMessenger( - bucket_name=cls.bucket_name, - session_id=cls.session_id, - is_worker=False, - ) - prefix = f"swarm-{cls.session_id}/" - blobs = messenger.bucket.list_blobs(prefix=prefix) - # Delete probe and test objects via gcloud storage rm - subprocess.run( - ["gcloud", "storage", "rm", "-r", f"gs://{cls.bucket_name}/{prefix}"], - capture_output=True, - check=False, - ) - except Exception: - pass - - def setUp(self): - if not self.live_gcs_available: - self.skipTest("AGYSTACK_LIVE_BUCKET not set; skipping live cloud tests") - - def test_01_live_gcs_question_and_reply_roundtrip(self): - worker = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=self.task_index, - is_worker=True, - ) - orchestrator = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - is_worker=False, - ) - - # 1. Cloud worker asks a question - question_text = "Live test: Should we prioritize throughput or latency in packet pipeline?" - q_env = worker.send_question(question=question_text, context="Benchmark suite indicates trade-off.") - self.assertEqual(q_env.seq, 1) - self.assertEqual(q_env.status, MessageStatus.PENDING) - - # 2. Orchestrator discovers pending question across all workers - pending = orchestrator.list_pending_questions() - matching = [q for q in pending if q.task_index == self.task_index and q.seq == 1] - self.assertEqual(len(matching), 1, "Orchestrator must discover the worker question in GCS") - self.assertEqual(matching[0].payload["question"], question_text) - - # 3. Orchestrator posts reply to GCS - reply_text = "Prioritize throughput for batch ingestion workloads." - reply_env = orchestrator.send_reply( - task_index=self.task_index, - seq=1, - reply_text=reply_text, - ) - self.assertEqual(reply_env.seq, 1) - - # 4. Cloud worker receives reply from GCS - received = worker.wait_for_reply(seq=1, timeout_seconds=10.0, poll_interval=0.5) - self.assertEqual(received, reply_text) - - # 5. Question is no longer listed as pending - pending_after = orchestrator.list_pending_questions() - matching_after = [q for q in pending_after if q.task_index == self.task_index and q.seq == 1] - self.assertEqual(len(matching_after), 0, "Answered question must be removed from pending list") - - def test_02_live_gcs_steer_injection_and_retrieval(self): - worker = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=self.task_index, - is_worker=True, - ) - orchestrator = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - is_worker=False, - ) - - # Orchestrator sends out-of-band steering instruction - steer_inst = "Ensure Linux 5.15 and 6.1 kernel compatibility." - orchestrator.send_steer(task_index=self.task_index, instruction=steer_inst) - - # Worker checks and retrieves the steering instruction - steers = worker.check_steer_instructions() - self.assertGreaterEqual(len(steers), 1) - self.assertIn(steer_inst, [s.payload.get("instruction") for s in steers]) - - # Second check should return empty (already processed) - steers_second = worker.check_steer_instructions() - self.assertEqual(len(steers_second), 0) - - def test_03_cli_mailbox_commands_against_live_gcs(self): - worker = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=self.task_index, - is_worker=True, - ) - - # Worker posts question 2 - worker.send_question("CLI test question: Proceed with schema migration?") - - # Orchestrator uses CLI handler to list - pending = handle_mailbox_list(session_id=self.session_id, bucket_name=self.bucket_name) - cli_q = [q for q in pending if q.task_index == self.task_index and q.payload.get("question", "").startswith("CLI test")] - self.assertEqual(len(cli_q), 1) - seq = cli_q[0].seq - - # Orchestrator uses CLI handler to reply - handle_mailbox_reply( - task_index=self.task_index, - seq=seq, - text="Proceed with migration.", - session_id=self.session_id, - bucket_name=self.bucket_name, - ) - - # Worker receives reply - received = worker.wait_for_reply(seq=seq, timeout_seconds=10.0, poll_interval=0.5) - self.assertEqual(received, "Proceed with migration.") - - # Orchestrator uses CLI handler to steer - handle_mailbox_steer( - task_index=self.task_index, - text="Add rollback script.", - session_id=self.session_id, - bucket_name=self.bucket_name, - ) - steers = worker.check_steer_instructions() - self.assertIn("Add rollback script.", [s.payload.get("instruction") for s in steers]) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_reactive_coordination_rules.py b/tests/test_reactive_coordination_rules.py index b4e57ee..c734c28 100644 --- a/tests/test_reactive_coordination_rules.py +++ b/tests/test_reactive_coordination_rules.py @@ -20,26 +20,15 @@ def test_agents_md_has_reactive_wakeup_invariant(self): self.assertIn("Continuous Busy-Wait Prohibited", content) self.assertIn("manage_subagents(list)", content) - def test_agents_md_scopes_cloud_swarm_liveness(self): + def test_agents_md_scopes_primitive_boundary(self): agents_file = RULES_DIR / "AGENTS.md" content = agents_file.read_text(encoding="utf-8") self.assertIn("Primitive Boundary:", content) self.assertIn( - "Active heartbeat polling (every 60-120s) applies strictly to external CLI/Cloud Run subprocesses (`run_command`, `cloud_dispatch.py`), NEVER to local Antigravity subagents (`invoke_subagent`).", + "Active heartbeat polling (every 60-120s) applies strictly to external CLI subprocesses (`run_command`), NEVER to local Antigravity subagents (`invoke_subagent`).", content, ) - swarm_file = SKILLS_DIR / "swarm" / "SKILL.md" - swarm_content = swarm_file.read_text(encoding="utf-8") - self.assertIn( - "Active Liveness & Non-Blocking Monitoring (Cloud Run Swarms Only):", - swarm_content, - ) - self.assertIn( - "NEVER applies to native local Antigravity subagents (`invoke_subagent`)", - swarm_content, - ) - def test_reviewer_prompt_has_send_message_contract(self): prompt_file = SKILLS_DIR / "interrogate" / "references" / "reviewer-prompt.md" content = prompt_file.read_text(encoding="utf-8") @@ -56,19 +45,13 @@ def test_interrogate_skill_has_zero_tool_yield(self): ) self.assertIn("{PARENT_CONVERSATION_ID}", content) - def test_arena_and_swarm_skills_have_reactive_protocol(self): + def test_arena_skill_has_reactive_protocol(self): arena_content = (SKILLS_DIR / "arena" / "SKILL.md").read_text(encoding="utf-8") self.assertIn('TimerCondition: "never"', arena_content) self.assertIn("ZERO tool calls", arena_content) self.assertIn("send_message", arena_content) self.assertIn("{PARENT_CONVERSATION_ID}", arena_content) - swarm_content = (SKILLS_DIR / "swarm" / "SKILL.md").read_text(encoding="utf-8") - self.assertIn('TimerCondition: "never"', swarm_content) - self.assertIn("ZERO tool calls", swarm_content) - self.assertIn("send_message", swarm_content) - self.assertIn("{PARENT_CONVERSATION_ID}", swarm_content) - def test_agents_md_has_delegation_thresholds(self): agents_file = RULES_DIR / "AGENTS.md" content = agents_file.read_text(encoding="utf-8") diff --git a/tests/test_setup_runtime.py b/tests/test_setup_runtime.py index 636c7b4..4a5e465 100644 --- a/tests/test_setup_runtime.py +++ b/tests/test_setup_runtime.py @@ -1,3 +1,4 @@ +import contextlib import io import json import os @@ -7,10 +8,22 @@ from pathlib import Path from unittest.mock import MagicMock, patch -sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "skills" / "setup-agystack" / "scripts")) +REPO_ROOT = Path(__file__).resolve().parent.parent +sys.path.insert(0, str(REPO_ROOT / "skills" / "setup-agystack" / "scripts")) import setup_runtime +@contextlib.contextmanager +def isolated_home(): + with tempfile.TemporaryDirectory() as tmp_home: + clean_env = os.environ.copy() + clean_env["HOME"] = tmp_home + clean_env.pop("ANTIGRAVITY_APP_DATA_DIR", None) + clean_env.pop("ANTIGRAVITY_CONVERSATION_ID", None) + with patch.dict(os.environ, clean_env, clear=True): + yield Path(tmp_home).resolve() + + class TestSetupRuntimeDoctor(unittest.TestCase): @patch("setup_runtime.run_cmd") def test_check_dependencies_all_installed(self, mock_run_cmd): @@ -26,14 +39,14 @@ def fake_run(cmd, *args, **kwargs): ) elif tool == "gt": return MagicMock(returncode=0, stdout="Graphite CLI version 0.21.0\n", stderr="") - elif tool == "gcloud": - return MagicMock(returncode=0, stdout="Google Cloud SDK 583.0.0\n", stderr="") return MagicMock(returncode=1, stdout="", stderr="") mock_run_cmd.side_effect = fake_run deps = setup_runtime.check_dependencies() + self.assertEqual(set(deps.keys()), {"bun", "gh", "gt"}) + self.assertTrue(deps["bun"]["installed"]) self.assertTrue(deps["bun"]["ok"]) self.assertEqual(deps["bun"]["version"], "1.3.14") @@ -49,18 +62,14 @@ def fake_run(cmd, *args, **kwargs): self.assertEqual(deps["gt"]["version"], "0.21.0") self.assertIsNone(deps["gt"]["error"]) - self.assertTrue(deps["gcloud"]["installed"]) - self.assertTrue(deps["gcloud"]["ok"]) - self.assertEqual(deps["gcloud"]["version"], "583.0.0") - self.assertIsNone(deps["gcloud"]["error"]) - @patch("setup_runtime.run_cmd") def test_check_dependencies_missing_all(self, mock_run_cmd): mock_run_cmd.return_value = MagicMock(returncode=127, stdout="", stderr="command not found") deps = setup_runtime.check_dependencies() - for tool in ["bun", "gh", "gt", "gcloud"]: + self.assertEqual(set(deps.keys()), {"bun", "gh", "gt"}) + for tool in ["bun", "gh", "gt"]: self.assertFalse(deps[tool]["installed"], f"{tool} should not be installed") self.assertFalse(deps[tool]["ok"], f"{tool} ok should be False") self.assertIsNone(deps[tool]["version"]) @@ -127,17 +136,35 @@ def test_doctor_main_exit_success(self, mock_check_deps): "bun": {"installed": True, "version": "1.3.14", "ok": True, "error": None, "required": True}, "gh": {"installed": True, "version": "2.97.0", "ok": True, "error": None, "required": True}, "gt": {"installed": False, "version": None, "ok": False, "error": "not found", "required": False}, - "gcloud": {"installed": False, "version": None, "ok": False, "error": "not found", "required": False}, } - with patch("sys.argv", ["setup_runtime.py", "--doctor"]): - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - with self.assertRaises(SystemExit) as cm: - setup_runtime.main() - self.assertEqual(cm.exception.code, 0) - output = json.loads(mock_out.getvalue().strip()) - self.assertTrue(output["bun"]["ok"]) - self.assertTrue(output["gh"]["ok"]) + with isolated_home() as tmp_home: + with patch("sys.argv", ["setup_runtime.py", "--doctor"]): + with patch("sys.stdout", new_callable=io.StringIO) as mock_out: + with self.assertRaises(SystemExit) as cm: + setup_runtime.main() + self.assertEqual(cm.exception.code, 0) + output = json.loads(mock_out.getvalue().strip()) + self.assertEqual( + set(output.keys()), + { + "bun", + "gh", + "gt", + "platform", + "safety_hook", + "artifact_dir", + "model_config", + "skill_collisions", + "status", + }, + ) + self.assertEqual(output["status"], "OK") + self.assertTrue(output["bun"]["ok"]) + self.assertTrue(output["gh"]["ok"]) + self.assertTrue(output["skill_collisions"]["ok"]) + self.assertFalse(output["skill_collisions"]["collision"]) + self.assertTrue(Path(output["artifact_dir"]["path"]).is_relative_to(tmp_home)) @patch("setup_runtime.check_dependencies") def test_doctor_main_exit_failure_missing_gh(self, mock_check_deps): @@ -145,14 +172,16 @@ def test_doctor_main_exit_failure_missing_gh(self, mock_check_deps): "bun": {"installed": True, "version": "1.3.14", "ok": True, "error": None, "required": True}, "gh": {"installed": False, "version": None, "ok": False, "error": "gh not found", "required": True}, "gt": {"installed": True, "version": "0.21.0", "ok": True, "error": None, "required": False}, - "gcloud": {"installed": True, "version": "583.0.0", "ok": True, "error": None, "required": False}, } - with patch("sys.argv", ["setup_runtime.py", "--doctor"]): - with patch("sys.stdout", new_callable=io.StringIO): - with self.assertRaises(SystemExit) as cm: - setup_runtime.main() - self.assertEqual(cm.exception.code, 1) + with isolated_home(): + with patch("sys.argv", ["setup_runtime.py", "--doctor"]): + with patch("sys.stdout", new_callable=io.StringIO) as mock_out: + with self.assertRaises(SystemExit) as cm: + setup_runtime.main() + self.assertEqual(cm.exception.code, 1) + output = json.loads(mock_out.getvalue().strip()) + self.assertEqual(output["status"], "ERROR") @patch("setup_runtime.check_dependencies") def test_doctor_main_exit_failure_bun_sub_v1(self, mock_check_deps): @@ -161,11 +190,12 @@ def test_doctor_main_exit_failure_bun_sub_v1(self, mock_check_deps): "gh": {"installed": True, "version": "2.97.0", "ok": True, "error": None, "required": True}, } - with patch("sys.argv", ["setup_runtime.py", "--doctor"]): - with patch("sys.stdout", new_callable=io.StringIO): - with self.assertRaises(SystemExit) as cm: - setup_runtime.main() - self.assertEqual(cm.exception.code, 1) + with isolated_home(): + with patch("sys.argv", ["setup_runtime.py", "--doctor"]): + with patch("sys.stdout", new_callable=io.StringIO): + with self.assertRaises(SystemExit) as cm: + setup_runtime.main() + self.assertEqual(cm.exception.code, 1) @patch("setup_runtime.check_dependencies") def test_doctor_main_evaluates_all_required_metadata(self, mock_check_deps): @@ -173,291 +203,24 @@ def test_doctor_main_evaluates_all_required_metadata(self, mock_check_deps): "bun": {"installed": True, "version": "1.3.14", "ok": True, "error": None, "required": True}, "gh": {"installed": True, "version": "2.97.0", "ok": True, "error": None, "required": True}, "gt": {"installed": False, "version": None, "ok": False, "error": "not found", "required": False}, - "gcloud": {"installed": False, "version": None, "ok": False, "error": "not found", "required": False}, } - with patch("sys.argv", ["setup_runtime.py", "--doctor"]): - with patch("sys.stdout", new_callable=io.StringIO): - with self.assertRaises(SystemExit) as cm: - setup_runtime.main() - self.assertEqual(cm.exception.code, 0) - - mock_check_deps.return_value = { - "bun": {"installed": True, "version": "1.3.14", "ok": True, "error": None, "required": True}, - "gh": {"installed": False, "version": None, "ok": False, "error": "gh not found", "required": True}, - "gt": {"installed": True, "version": "0.21.0", "ok": True, "error": None, "required": False}, - "gcloud": {"installed": True, "version": "583.0.0", "ok": True, "error": None, "required": False}, - } - with patch("sys.argv", ["setup_runtime.py", "--doctor"]): - with patch("sys.stdout", new_callable=io.StringIO): - with self.assertRaises(SystemExit) as cm: - setup_runtime.main() - self.assertEqual(cm.exception.code, 1) - - -class TestSetupRuntimeProvisioning(unittest.TestCase): - @patch("setup_runtime.write_runtime_config") - @patch("setup_runtime.run_cmd") - def test_run_provisioning_autoresolves_scripts_dir(self, mock_run_cmd, mock_write_cfg): - mock_run_cmd.return_value = MagicMock(returncode=0, stdout="", stderr="") - - expected_scripts_dir = str(Path(setup_runtime.__file__).resolve().parents[2] / "swarm" / "scripts") - self.assertTrue( - (Path(expected_scripts_dir) / "Dockerfile").is_file(), - f"Expected Dockerfile to exist at {expected_scripts_dir}", - ) - - for invalid_dir in ["", "/nonexistent/invalid/dir", None]: - mock_run_cmd.reset_mock() - setup_runtime.run_provisioning( - project_id="test-proj-autoresolve", - scripts_dir=invalid_dir, - ) - - all_cmds = [call[0][0] for call in mock_run_cmd.call_args_list] - build_cmd = next(cmd for cmd in all_cmds if len(cmd) > 2 and cmd[0:3] == ["gcloud", "builds", "submit"]) - self.assertEqual( - build_cmd[4], - expected_scripts_dir, - f"scripts_dir did not resolve to expected directory for input '{invalid_dir}'", - ) - - @patch("setup_runtime.write_runtime_config") - @patch("setup_runtime.run_cmd") - def test_run_provisioning_preserves_valid_scripts_dir(self, mock_run_cmd, mock_write_cfg): - mock_run_cmd.return_value = MagicMock(returncode=0, stdout="", stderr="") - - valid_dir = str(Path(setup_runtime.__file__).resolve().parents[2] / "swarm" / "scripts") - setup_runtime.run_provisioning( - project_id="test-proj-valid", - scripts_dir=valid_dir, - ) - all_cmds = [call[0][0] for call in mock_run_cmd.call_args_list] - build_cmd = next(cmd for cmd in all_cmds if len(cmd) > 2 and cmd[0:3] == ["gcloud", "builds", "submit"]) - self.assertEqual(build_cmd[4], valid_dir) - - -class TestSetupRuntimeSecretManager(unittest.TestCase): - @patch("setup_runtime.run_cmd") - def test_enable_apis_includes_secretmanager(self, mock_run_cmd): - mock_run_cmd.return_value = MagicMock(returncode=0, stdout="", stderr="") - setup_runtime.enable_apis("test-proj") - all_cmds = [call[0][0] for call in mock_run_cmd.call_args_list] - enable_cmd = next(cmd for cmd in all_cmds if cmd[0:3] == ["gcloud", "services", "enable"]) - self.assertIn("secretmanager.googleapis.com", enable_cmd) - - @patch("setup_runtime.run_cmd") - def test_ensure_secret_manager_creates_and_binds(self, mock_run_cmd): - describe_res = MagicMock(returncode=1, stdout="", stderr="Secret not found") - create_res = MagicMock(returncode=0, stdout="", stderr="") - bind_res = MagicMock(returncode=0, stdout="", stderr="") - mock_run_cmd.side_effect = [describe_res, create_res, bind_res] - - secret_name = setup_runtime.ensure_secret_manager( - project_id="test-proj", - secret_name="agystack-gh-token", - service_account="test-sa@developer.gserviceaccount.com", - ) - self.assertEqual(secret_name, "agystack-gh-token") - self.assertEqual(mock_run_cmd.call_count, 3) - - @patch("setup_runtime.run_cmd") - def test_configure_iam_permissions_includes_secret_accessor(self, mock_run_cmd): - mock_run_cmd.return_value = MagicMock(returncode=0, stdout="", stderr="") - setup_runtime.configure_iam_permissions("test-proj", "sa@developer.gserviceaccount.com") - all_cmds = [call[0][0] for call in mock_run_cmd.call_args_list] - roles = [next(arg.split("=")[1] for arg in cmd if arg.startswith("--role=")) for cmd in all_cmds if len(cmd) > 3 and cmd[0:3] == ["gcloud", "projects", "add-iam-policy-binding"]] - self.assertIn("roles/secretmanager.secretAccessor", roles) - - -class TestSetupRuntimePythonDependencies(unittest.TestCase): - def test_check_python_dependencies_all_present(self): - mock_mod = MagicMock() - mock_mod.__version__ = "1.2.3" - - def fake_import(name): - return mock_mod - - deps = setup_runtime.check_python_dependencies(import_fn=fake_import) - for pkg in ["google-cloud-storage", "google-genai", "google-cloud-run"]: - self.assertIn("required", deps[pkg]) - self.assertIn(pkg, deps) - self.assertTrue(deps[pkg]["installed"]) - self.assertTrue(deps[pkg]["ok"]) - self.assertEqual(deps[pkg]["version"], "1.2.3") - self.assertIsNone(deps[pkg]["error"]) - - def test_check_python_dependencies_missing_import(self): - def fake_import(name): - raise ImportError(f"No module named {name}") - - deps = setup_runtime.check_python_dependencies(import_fn=fake_import) - for pkg in ["google-cloud-storage", "google-genai", "google-cloud-run", "anthropic[vertex]"]: - self.assertFalse(deps[pkg]["installed"]) - self.assertTrue(deps[pkg]["ok"]) - self.assertIsNone(deps[pkg]["version"]) - self.assertIn(f"pip install {pkg}", deps[pkg]["error"]) - - def test_check_python_dependencies_unexpected_exception(self): - def fake_import(name): - raise RuntimeError("Unexpected import failure") - - deps = setup_runtime.check_python_dependencies(import_fn=fake_import) - for pkg in ["google-cloud-storage", "google-genai", "google-cloud-run", "anthropic[vertex]"]: - self.assertFalse(deps[pkg]["installed"]) - self.assertTrue(deps[pkg]["ok"]) - self.assertIn("Unexpected import failure", deps[pkg]["error"]) - - @patch("setup_runtime.run_cmd") - def test_check_dependencies_includes_python(self, mock_run_cmd): - mock_run_cmd.return_value = MagicMock(returncode=0, stdout="1.0.0\n", stderr="") - mock_mod = MagicMock() - mock_mod.__version__ = "2.0.0" - - deps = setup_runtime.check_dependencies(import_fn=lambda name: mock_mod) - self.assertIn("google-cloud-storage", deps) - self.assertTrue(deps["google-cloud-storage"]["ok"]) - - @patch("setup_runtime.run_cmd") - def test_check_dependencies_can_exclude_python(self, mock_run_cmd): - mock_run_cmd.return_value = MagicMock(returncode=0, stdout="1.0.0\n", stderr="") - deps = setup_runtime.check_dependencies(include_python=False) - self.assertNotIn("google-cloud-storage", deps) - - -class TestBuildAndDeployWorkerStaging(unittest.TestCase): - def setUp(self): - self.temp_dir = tempfile.TemporaryDirectory() - self.repo_root = Path(self.temp_dir.name).resolve() - - self.skills_dir = self.repo_root / "skills" - self.swarm_scripts_dir = self.skills_dir / "swarm" / "scripts" - self.swarm_scripts_dir.mkdir(parents=True, exist_ok=True) - (self.swarm_scripts_dir / "Dockerfile").write_text("FROM python:3.11-slim\n", encoding="utf-8") - - self.other_skill_dir = self.skills_dir / "poteto-mode" - self.other_skill_dir.mkdir(parents=True, exist_ok=True) - (self.other_skill_dir / "SKILL.md").write_text("# Poteto Mode\n", encoding="utf-8") - - (self.skills_dir / ".git").mkdir(parents=True, exist_ok=True) - (self.skills_dir / ".git" / "config").write_text("[core]\n", encoding="utf-8") - (self.skills_dir / "__pycache__").mkdir(parents=True, exist_ok=True) - (self.skills_dir / "__pycache__" / "cached.pyc").write_text("bytecode", encoding="utf-8") - (self.skills_dir / ".pytest_cache").mkdir(parents=True, exist_ok=True) - (self.skills_dir / ".pytest_cache" / "v").write_text("cache", encoding="utf-8") - (self.skills_dir / ".ruff_cache").mkdir(parents=True, exist_ok=True) - (self.skills_dir / ".ruff_cache" / "r").write_text("cache", encoding="utf-8") - (self.skills_dir / "node_modules").mkdir(parents=True, exist_ok=True) - (self.skills_dir / "node_modules" / "pkg.json").write_text("{}", encoding="utf-8") - (self.skills_dir / ".venv").mkdir(parents=True, exist_ok=True) - (self.skills_dir / ".venv" / "pyvenv.cfg").write_text("home = /bin\n", encoding="utf-8") - (self.skills_dir / "venv").mkdir(parents=True, exist_ok=True) - (self.skills_dir / "venv" / "pyvenv.cfg").write_text("home = /bin\n", encoding="utf-8") - - self.rules_dir = self.repo_root / "rules" - self.rules_dir.mkdir(parents=True, exist_ok=True) - (self.rules_dir / "AGENTS.md").write_text("# Agent Rules\n", encoding="utf-8") - - self.agents_dir = self.repo_root / "agents" - self.agents_dir.mkdir(parents=True, exist_ok=True) - (self.agents_dir / "poteto-agent.md").write_text("# Poteto Agent\n", encoding="utf-8") - - def tearDown(self): - self.temp_dir.cleanup() - - @patch("setup_runtime.run_cmd") - def test_build_and_deploy_worker_staging_no_recursion(self, mock_run_cmd): - observed_staged = {} - - def fake_run(cmd, *args, **kwargs): - if len(cmd) > 2 and cmd[0:3] == ["gcloud", "builds", "submit"]: - staged_skills = self.swarm_scripts_dir / "skills" - staged_rules = self.swarm_scripts_dir / "rules" - staged_agents = self.swarm_scripts_dir / "agents" - - observed_staged["staged_skills_exists"] = staged_skills.is_dir() - observed_staged["staged_rules_exists"] = staged_rules.is_dir() - observed_staged["staged_agents_exists"] = staged_agents.is_dir() - observed_staged["other_skill_copied"] = (staged_skills / "poteto-mode" / "SKILL.md").is_file() - observed_staged["recursion_prevented"] = not (staged_skills / "swarm" / "scripts").exists() - observed_staged["git_ignored"] = not (staged_skills / ".git").exists() - observed_staged["pycache_ignored"] = not (staged_skills / "__pycache__").exists() - observed_staged["pytest_cache_ignored"] = not (staged_skills / ".pytest_cache").exists() - observed_staged["ruff_cache_ignored"] = not (staged_skills / ".ruff_cache").exists() - observed_staged["node_modules_ignored"] = not (staged_skills / "node_modules").exists() - observed_staged["dot_venv_ignored"] = not (staged_skills / ".venv").exists() - observed_staged["venv_ignored"] = not (staged_skills / "venv").exists() - observed_staged["rules_file_copied"] = (staged_rules / "AGENTS.md").is_file() - observed_staged["agents_file_copied"] = (staged_agents / "poteto-agent.md").is_file() - return MagicMock(returncode=0, stdout="{}", stderr="") - - mock_run_cmd.side_effect = fake_run - - setup_runtime.build_and_deploy_worker( - project_id="test-proj-staging", - region="us-central1", - image_tag="us-central1-docker.pkg.dev/test-proj-staging/agystack/worker:latest", - scripts_dir=str(self.swarm_scripts_dir), - job_name="test-job", - ) - - for key, val in observed_staged.items(): - self.assertTrue(val, f"Expected {key} to be True") - - self.assertFalse((self.swarm_scripts_dir / "skills").exists()) - self.assertFalse((self.swarm_scripts_dir / "rules").exists()) - self.assertFalse((self.swarm_scripts_dir / "agents").exists()) - - @patch("setup_runtime.run_cmd") - def test_build_and_deploy_worker_cleans_existing_dst_first(self, mock_run_cmd): - stale_dst = self.swarm_scripts_dir / "skills" - stale_dst.mkdir(parents=True, exist_ok=True) - stale_file = stale_dst / "stale_leftover.txt" - stale_file.write_text("stale data", encoding="utf-8") - - observed_stale_cleaned = {} - - def fake_run(cmd, *args, **kwargs): - if len(cmd) > 2 and cmd[0:3] == ["gcloud", "builds", "submit"]: - staged_skills = self.swarm_scripts_dir / "skills" - observed_stale_cleaned["stale_cleaned"] = not (staged_skills / "stale_leftover.txt").exists() - observed_stale_cleaned["new_skill_copied"] = (staged_skills / "poteto-mode" / "SKILL.md").is_file() - return MagicMock(returncode=0, stdout="{}", stderr="") - - mock_run_cmd.side_effect = fake_run - - setup_runtime.build_and_deploy_worker( - project_id="test-proj-cleanup", - region="us-central1", - image_tag="us-central1-docker.pkg.dev/test-proj-cleanup/agystack/worker:latest", - scripts_dir=str(self.swarm_scripts_dir), - job_name="test-job", - ) - - self.assertTrue(observed_stale_cleaned.get("stale_cleaned")) - self.assertTrue(observed_stale_cleaned.get("new_skill_copied")) - self.assertFalse((self.swarm_scripts_dir / "skills").exists()) - - @patch("setup_runtime.run_cmd") - def test_build_and_deploy_worker_cleans_staged_dirs_on_error(self, mock_run_cmd): - def fake_run(cmd, *args, **kwargs): - if len(cmd) > 2 and cmd[0:3] == ["gcloud", "builds", "submit"]: - raise RuntimeError("Cloud Build failed abruptly") - return MagicMock(returncode=0, stdout="{}", stderr="") - - mock_run_cmd.side_effect = fake_run - - with self.assertRaises(RuntimeError): - setup_runtime.build_and_deploy_worker( - project_id="test-proj-error", - region="us-central1", - image_tag="us-central1-docker.pkg.dev/test-proj-error/agystack/worker:latest", - scripts_dir=str(self.swarm_scripts_dir), - job_name="test-job", - ) + with isolated_home(): + with patch("sys.argv", ["setup_runtime.py", "--doctor"]): + with patch("sys.stdout", new_callable=io.StringIO): + with self.assertRaises(SystemExit) as cm: + setup_runtime.main() + self.assertEqual(cm.exception.code, 0) - self.assertFalse((self.swarm_scripts_dir / "skills").exists()) - self.assertFalse((self.swarm_scripts_dir / "rules").exists()) - self.assertFalse((self.swarm_scripts_dir / "agents").exists()) + mock_check_deps.return_value = { + "bun": {"installed": True, "version": "1.3.14", "ok": True, "error": None, "required": True}, + "gh": {"installed": False, "version": None, "ok": False, "error": "gh not found", "required": True}, + "gt": {"installed": True, "version": "0.21.0", "ok": True, "error": None, "required": False}, + } + with patch("sys.argv", ["setup_runtime.py", "--doctor"]): + with patch("sys.stdout", new_callable=io.StringIO): + with self.assertRaises(SystemExit) as cm: + setup_runtime.main() + self.assertEqual(cm.exception.code, 1) class TestSetupRuntimePlatformValidation(unittest.TestCase): @@ -480,7 +243,7 @@ def test_check_hook_contract_missing_file(self): def test_check_hook_contract_unexpected_decision(self): fake_proc = MagicMock(returncode=0, stdout=json.dumps({"decision": "allow"}), stderr="") res = setup_runtime.check_hook_contract( - hook_path=Path(__file__).resolve().parent.parent / "skills" / "poteto-mode" / "scripts" / "hooks" / "pre_tool_safety.py", + hook_path=REPO_ROOT / "skills" / "poteto-mode" / "scripts" / "hooks" / "pre_tool_safety.py", run_cmd_fn=lambda *args, **kwargs: fake_proc, ) self.assertTrue(res["installed"]) @@ -507,14 +270,13 @@ def test_check_artifact_dir_not_writable(self): self.assertIn("not writable", res["error"]) def test_parse_model_config_success(self): - res = setup_runtime.parse_model_config() + res = setup_runtime.parse_model_config(config_path=REPO_ROOT / "agystack-models.md") self.assertTrue(res["installed"]) self.assertTrue(res["ok"]) self.assertGreater(res["roles_count"], 0) self.assertIn("arena runners", res["roles"]) self.assertEqual(res["roles"]["arena runners"], ["inherit", "flash", "pro"]) - self.assertIn("swarm workers", res["roles"]) - self.assertEqual(res["roles"]["swarm workers"], ["flash"]) + self.assertNotIn("swarm workers", res["roles"]) self.assertIn("feature", res["roles"]) self.assertEqual(res["roles"]["feature"], ["inherit"]) @@ -535,298 +297,106 @@ def test_parse_model_config_empty_file(self): self.assertEqual(res["roles_count"], 0) self.assertIn("No model roles defined", res["error"]) + def test_parse_model_config_precedence_workspace_and_plugin_over_home(self): + with isolated_home() as tmp_home, tempfile.TemporaryDirectory() as tmp_ws: + home_cfg = tmp_home / ".gemini" / "config" / "plugins" / "agystack" / "agystack-models.md" + home_cfg.parent.mkdir(parents=True, exist_ok=True) + home_cfg.write_text("feature: flash_lite\n", encoding="utf-8") + + ws_dir = Path(tmp_ws).resolve() + prev_cwd = Path.cwd() + try: + os.chdir(ws_dir) + # Without a workspace config, owning plugin root wins over $HOME + plugin_res = setup_runtime.parse_model_config() + self.assertTrue(plugin_res["ok"]) + self.assertEqual(plugin_res["path"], str((REPO_ROOT / "agystack-models.md").resolve())) + self.assertNotIn("swarm workers", plugin_res["roles"]) + + # Workspace-local .agents/plugins/agystack/agystack-models.md wins over both + ws_cfg = ws_dir / ".agents" / "plugins" / "agystack" / "agystack-models.md" + ws_cfg.parent.mkdir(parents=True, exist_ok=True) + ws_cfg.write_text("feature: pro\n", encoding="utf-8") + + ws_res = setup_runtime.parse_model_config() + self.assertTrue(ws_res["ok"]) + self.assertEqual(ws_res["path"], str(ws_cfg.resolve())) + self.assertEqual(ws_res["roles"]["feature"], ["pro"]) + finally: + os.chdir(prev_cwd) + + def test_check_skill_collisions_absent(self): + with tempfile.TemporaryDirectory() as tmp_root: + (Path(tmp_root) / "skills" / "poteto-mode").mkdir(parents=True, exist_ok=True) + res = setup_runtime.check_skill_collisions(plugin_root=tmp_root) + self.assertTrue(res["ok"]) + self.assertFalse(res["collision"]) + self.assertIsNone(res["error"]) + self.assertTrue(res["required"]) + self.assertEqual(res["path"], str((Path(tmp_root).resolve() / "skills" / "swarm"))) + + repo_res = setup_runtime.check_skill_collisions() + self.assertTrue(repo_res["ok"]) + self.assertFalse(repo_res["collision"]) + + def test_check_skill_collisions_present(self): + with tempfile.TemporaryDirectory() as tmp_root: + swarm_dir = Path(tmp_root) / "skills" / "swarm" + swarm_dir.mkdir(parents=True, exist_ok=True) + res = setup_runtime.check_skill_collisions(plugin_root=tmp_root) + self.assertFalse(res["ok"]) + self.assertTrue(res["collision"]) + self.assertTrue(res["required"]) + self.assertEqual(res["path"], str(swarm_dir.resolve())) + self.assertIn("Legacy skills/swarm directory shadows Antigravity built-in swarm", res["error"]) + self.assertIn(str(swarm_dir.resolve()), res["error"]) + def test_check_platform_all_passing(self): - res = setup_runtime.check_platform() - self.assertTrue(res["ok"]) - self.assertTrue(res["hook_contract"]["ok"]) - self.assertEqual(res["hook_contract"]["decision"], "deny") - self.assertTrue(res["artifact_dir"]["ok"]) - self.assertTrue(res["artifact_dir"]["writable"]) - self.assertTrue(res["model_config"]["ok"]) + with isolated_home() as tmp_home: + res = setup_runtime.check_platform() + self.assertTrue(res["ok"]) + self.assertTrue(res["hook_contract"]["ok"]) + self.assertEqual(res["hook_contract"]["decision"], "deny") + self.assertTrue(res["artifact_dir"]["ok"]) + self.assertTrue(res["artifact_dir"]["writable"]) + self.assertTrue(Path(res["artifact_dir"]["path"]).is_relative_to(tmp_home)) + self.assertTrue(res["model_config"]["ok"]) + self.assertEqual(res["model_config"]["path"], str((REPO_ROOT / "agystack-models.md").resolve())) + self.assertTrue(res["skill_collisions"]["ok"]) + self.assertFalse(res["skill_collisions"]["collision"]) def test_doctor_platform_overall_status_ok_exit_0(self): - with patch("sys.argv", ["setup_runtime.py", "--doctor"]): - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - with self.assertRaises(SystemExit) as cm: - setup_runtime.main() - self.assertEqual(cm.exception.code, 0) - report = json.loads(mock_out.getvalue().strip()) - self.assertEqual(report["status"], "OK") - self.assertTrue(report["platform"]["ok"]) - self.assertEqual(report["safety_hook"]["decision"], "deny") - self.assertTrue(report["artifact_dir"]["writable"]) - self.assertIn("arena runners", report["model_config"]["roles"]) - - def test_doctor_platform_failure_exits_1(self): - with patch("setup_runtime.check_hook_contract", return_value={"ok": False, "required": True, "error": "Hook failure"}): + with isolated_home() as tmp_home: with patch("sys.argv", ["setup_runtime.py", "--doctor"]): with patch("sys.stdout", new_callable=io.StringIO) as mock_out: with self.assertRaises(SystemExit) as cm: setup_runtime.main() - self.assertEqual(cm.exception.code, 1) + self.assertEqual(cm.exception.code, 0) report = json.loads(mock_out.getvalue().strip()) - self.assertEqual(report["status"], "ERROR") - self.assertFalse(report["platform"]["ok"]) - - -class TestSetupRuntimeProvisioner(unittest.TestCase): - def setUp(self): - self.temp_dir_obj = tempfile.TemporaryDirectory() - self.temp_dir = Path(self.temp_dir_obj.name) - - def tearDown(self): - self.temp_dir_obj.cleanup() - - @patch("setup_runtime.run_cmd") - def test_enable_apis_includes_storage(self, mock_run_cmd): - mock_run_cmd.return_value = MagicMock(returncode=0, stdout="", stderr="") - setup_runtime.enable_apis("my-project-123") - mock_run_cmd.assert_called_once() - cmd = mock_run_cmd.call_args[0][0] - self.assertEqual(cmd[0:3], ["gcloud", "services", "enable"]) - self.assertIn("storage.googleapis.com", cmd) - self.assertIn("run.googleapis.com", cmd) - self.assertIn("artifactregistry.googleapis.com", cmd) - self.assertIn("cloudbuild.googleapis.com", cmd) - self.assertIn("aiplatform.googleapis.com", cmd) - self.assertIn("--project=my-project-123", cmd) - - @patch("setup_runtime.run_cmd") - def test_ensure_gcs_bucket_creates_if_not_exists(self, mock_run_cmd): - describe_res = MagicMock(returncode=1, stdout="", stderr="Bucket not found") - create_res = MagicMock(returncode=0, stdout="", stderr="") - mock_run_cmd.side_effect = [describe_res, create_res] - - bucket_name = setup_runtime.ensure_gcs_bucket("my-new-bucket", "my-project-123", "us-central1") - self.assertEqual(bucket_name, "my-new-bucket") - self.assertEqual(mock_run_cmd.call_count, 2) - describe_cmd = mock_run_cmd.call_args_list[0][0][0] - self.assertEqual(describe_cmd, ["gcloud", "storage", "buckets", "describe", "gs://my-new-bucket"]) - create_cmd = mock_run_cmd.call_args_list[1][0][0] - self.assertEqual( - create_cmd, - ["gcloud", "storage", "buckets", "create", "gs://my-new-bucket", "--project=my-project-123", "--location=us-central1"] - ) - - @patch("setup_runtime.run_cmd") - def test_ensure_gcs_bucket_skips_if_exists(self, mock_run_cmd): - describe_res = MagicMock(returncode=0, stdout="{}", stderr="") - mock_run_cmd.return_value = describe_res - - bucket_name = setup_runtime.ensure_gcs_bucket("gs://my-existing-bucket", "my-project-123", "us-central1") - self.assertEqual(bucket_name, "my-existing-bucket") - self.assertEqual(mock_run_cmd.call_count, 1) - describe_cmd = mock_run_cmd.call_args[0][0] - self.assertEqual(describe_cmd, ["gcloud", "storage", "buckets", "describe", "gs://my-existing-bucket"]) - - @patch("setup_runtime.run_cmd") - def test_configure_iam_permissions_default_compute_sa(self, mock_run_cmd): - project_desc_res = MagicMock(returncode=0, stdout="9876543210\n", stderr="") - bind_aiplatform_res = MagicMock(returncode=0, stdout="", stderr="") - bind_storage_res = MagicMock(returncode=0, stdout="", stderr="") - bind_secret_res = MagicMock(returncode=0, stdout="", stderr="") - mock_run_cmd.side_effect = [project_desc_res, bind_aiplatform_res, bind_storage_res, bind_secret_res] - - sa = setup_runtime.configure_iam_permissions("my-project-123") - self.assertEqual(sa, "9876543210-compute@developer.gserviceaccount.com") - self.assertEqual(mock_run_cmd.call_count, 4) - - desc_cmd = mock_run_cmd.call_args_list[0][0][0] - self.assertEqual(desc_cmd, ["gcloud", "projects", "describe", "my-project-123", "--format=value(projectNumber)"]) - - bind1 = mock_run_cmd.call_args_list[1][0][0] - self.assertEqual( - bind1, - [ - "gcloud", "projects", "add-iam-policy-binding", "my-project-123", - "--member=serviceAccount:9876543210-compute@developer.gserviceaccount.com", - "--role=roles/aiplatform.user" - ] - ) - - bind2 = mock_run_cmd.call_args_list[2][0][0] - self.assertEqual( - bind2, - [ - "gcloud", "projects", "add-iam-policy-binding", "my-project-123", - "--member=serviceAccount:9876543210-compute@developer.gserviceaccount.com", - "--role=roles/storage.objectAdmin" - ] - ) - - bind3 = mock_run_cmd.call_args_list[3][0][0] - self.assertEqual( - bind3, - [ - "gcloud", "projects", "add-iam-policy-binding", "my-project-123", - "--member=serviceAccount:9876543210-compute@developer.gserviceaccount.com", - "--role=roles/secretmanager.secretAccessor" - ] - ) - - @patch("setup_runtime.run_cmd") - def test_configure_iam_permissions_custom_sa(self, mock_run_cmd): - bind_aiplatform_res = MagicMock(returncode=0, stdout="", stderr="") - bind_storage_res = MagicMock(returncode=0, stdout="", stderr="") - bind_secret_res = MagicMock(returncode=0, stdout="", stderr="") - mock_run_cmd.side_effect = [bind_aiplatform_res, bind_storage_res, bind_secret_res] - - sa = setup_runtime.configure_iam_permissions("my-project-123", "custom-runner@my-project-123.iam.gserviceaccount.com") - self.assertEqual(sa, "custom-runner@my-project-123.iam.gserviceaccount.com") - self.assertEqual(mock_run_cmd.call_count, 3) - - bind1 = mock_run_cmd.call_args_list[0][0][0] - self.assertEqual( - bind1, - [ - "gcloud", "projects", "add-iam-policy-binding", "my-project-123", - "--member=serviceAccount:custom-runner@my-project-123.iam.gserviceaccount.com", - "--role=roles/aiplatform.user" - ] - ) - - bind2 = mock_run_cmd.call_args_list[1][0][0] - self.assertEqual( - bind2, - [ - "gcloud", "projects", "add-iam-policy-binding", "my-project-123", - "--member=serviceAccount:custom-runner@my-project-123.iam.gserviceaccount.com", - "--role=roles/storage.objectAdmin" - ] - ) - - bind3 = mock_run_cmd.call_args_list[2][0][0] - self.assertEqual( - bind3, - [ - "gcloud", "projects", "add-iam-policy-binding", "my-project-123", - "--member=serviceAccount:custom-runner@my-project-123.iam.gserviceaccount.com", - "--role=roles/secretmanager.secretAccessor" - ] - ) - - @patch("setup_runtime.run_cmd") - def test_build_and_deploy_worker_creates_job_with_memory_and_cpu(self, mock_run_cmd): - repo_desc_res = MagicMock(returncode=0, stdout="", stderr="") - build_res = MagicMock(returncode=0, stdout="", stderr="") - job_desc_res = MagicMock(returncode=1, stdout="", stderr="Job not found") - job_create_res = MagicMock(returncode=0, stdout="", stderr="") - mock_run_cmd.side_effect = [repo_desc_res, build_res, job_desc_res, job_create_res] - - setup_runtime.build_and_deploy_worker( - project_id="my-project-123", - region="us-central1", - image_tag="us-central1-docker.pkg.dev/my-project-123/agystack/worker:latest", - scripts_dir="skills/swarm/scripts", - service_account="custom-sa@example.com", - ) - - job_cmd = mock_run_cmd.call_args_list[-1][0][0] - self.assertEqual(job_cmd[0:4], ["gcloud", "run", "jobs", "create"]) - self.assertIn("--memory=2Gi", job_cmd) - self.assertIn("--cpu=2", job_cmd) - self.assertIn("--parallelism=16", job_cmd) - self.assertIn("--max-retries=0", job_cmd) - self.assertIn("--image=us-central1-docker.pkg.dev/my-project-123/agystack/worker:latest", job_cmd) - self.assertIn("--region=us-central1", job_cmd) - self.assertIn("--project=my-project-123", job_cmd) - self.assertIn("--service-account=custom-sa@example.com", job_cmd) + self.assertEqual(report["status"], "OK") + self.assertTrue(report["platform"]["ok"]) + self.assertEqual(report["safety_hook"]["decision"], "deny") + self.assertTrue(report["artifact_dir"]["writable"]) + self.assertTrue(Path(report["artifact_dir"]["path"]).is_relative_to(tmp_home)) + self.assertEqual(report["model_config"]["path"], str((REPO_ROOT / "agystack-models.md").resolve())) + self.assertIn("arena runners", report["model_config"]["roles"]) + self.assertNotIn("swarm workers", report["model_config"]["roles"]) + self.assertTrue(report["skill_collisions"]["ok"]) - @patch("setup_runtime.run_cmd") - def test_build_and_deploy_worker_updates_job_with_memory_and_cpu(self, mock_run_cmd): - repo_desc_res = MagicMock(returncode=0, stdout="", stderr="") - build_res = MagicMock(returncode=0, stdout="", stderr="") - job_desc_res = MagicMock(returncode=0, stdout="{}", stderr="") - job_update_res = MagicMock(returncode=0, stdout="", stderr="") - mock_run_cmd.side_effect = [repo_desc_res, build_res, job_desc_res, job_update_res] - - setup_runtime.build_and_deploy_worker( - project_id="my-project-123", - region="us-central1", - image_tag="us-central1-docker.pkg.dev/my-project-123/agystack/worker:latest", - scripts_dir="skills/swarm/scripts", - service_account="custom-sa@example.com", - ) - - job_cmd = mock_run_cmd.call_args_list[-1][0][0] - self.assertEqual(job_cmd[0:4], ["gcloud", "run", "jobs", "update"]) - self.assertIn("--memory=2Gi", job_cmd) - self.assertIn("--cpu=2", job_cmd) - self.assertIn("--parallelism=16", job_cmd) - self.assertIn("--max-retries=0", job_cmd) - self.assertIn("--service-account=custom-sa@example.com", job_cmd) - - def test_write_runtime_config_persists_gcs_bucket(self): - target_file = self.temp_dir / "agystack-runtime.json" - config = setup_runtime.write_runtime_config( - project_id="test-proj", - region="us-central1", - job_name="agystack-swarm-worker", - image_tag="us-central1-docker.pkg.dev/test-proj/agystack/worker:latest", - auth_mode="vertex", - gcs_bucket="test-proj-swarm-results", - target_paths=[target_file], - service_account="test-sa@developer.gserviceaccount.com", - ) - - self.assertEqual(config["gcs_bucket"], "test-proj-swarm-results") - self.assertEqual(config["auth_mode"], "vertex") - self.assertEqual(config["runtime"], "cloud-run") - self.assertEqual(config["service_account"], "test-sa@developer.gserviceaccount.com") - - loaded = json.loads(target_file.read_text(encoding="utf-8")) - self.assertEqual(loaded["gcs_bucket"], "test-proj-swarm-results") - self.assertEqual(loaded["job_name"], "agystack-swarm-worker") - self.assertEqual(loaded["parallelism"], 16) - self.assertEqual(loaded["service_account"], "test-sa@developer.gserviceaccount.com") - - @patch("setup_runtime.write_runtime_config") - @patch("setup_runtime.run_cmd") - def test_run_provisioning_full_flow(self, mock_run_cmd, mock_write_cfg): - mock_run_cmd.side_effect = [ - MagicMock(returncode=0, stdout="", stderr=""), # enable_apis - MagicMock(returncode=1, stdout="", stderr=""), # bucket describe - MagicMock(returncode=0, stdout="", stderr=""), # bucket create - MagicMock(returncode=0, stdout="", stderr=""), # role binding aiplatform - MagicMock(returncode=0, stdout="", stderr=""), # role binding storage - MagicMock(returncode=0, stdout="", stderr=""), # role binding secretmanager - MagicMock(returncode=0, stdout="", stderr=""), # repo describe - MagicMock(returncode=0, stdout="", stderr=""), # builds submit - MagicMock(returncode=1, stdout="", stderr=""), # job describe (1 => create) - MagicMock(returncode=0, stdout="", stderr=""), # job create - ] - - summary = setup_runtime.run_provisioning( - project_id="test-proj-full", - region="us-central1", - scripts_dir="skills/swarm/scripts", - bucket_name="custom-bucket", - service_account="custom-sa@developer.gserviceaccount.com", - ) - - all_cmds = [call[0][0] for call in mock_run_cmd.call_args_list] - - api_cmd = next(cmd for cmd in all_cmds if cmd[0:3] == ["gcloud", "services", "enable"]) - self.assertIn("storage.googleapis.com", api_cmd) - - bucket_create_cmd = next(cmd for cmd in all_cmds if len(cmd) > 3 and cmd[0:4] == ["gcloud", "storage", "buckets", "create"]) - self.assertIn("gs://custom-bucket", bucket_create_cmd) - self.assertIn("--project=test-proj-full", bucket_create_cmd) - - iam_cmds = [cmd for cmd in all_cmds if len(cmd) > 3 and cmd[0:3] == ["gcloud", "projects", "add-iam-policy-binding"]] - self.assertEqual(len(iam_cmds), 3) - roles_bound = {next(arg.split("=")[1] for arg in cmd if arg.startswith("--role=")) for cmd in iam_cmds} - self.assertEqual(roles_bound, {"roles/aiplatform.user", "roles/storage.objectAdmin", "roles/secretmanager.secretAccessor"}) - - job_create_cmd = next(cmd for cmd in all_cmds if len(cmd) > 3 and cmd[0:4] == ["gcloud", "run", "jobs", "create"]) - self.assertIn("--memory=2Gi", job_create_cmd) - self.assertIn("--cpu=2", job_create_cmd) - self.assertIn("--service-account=custom-sa@developer.gserviceaccount.com", job_create_cmd) - - mock_write_cfg.assert_called_once() - self.assertEqual(mock_write_cfg.call_args[1].get("gcs_bucket"), "custom-bucket") - self.assertEqual(mock_write_cfg.call_args[1].get("service_account"), "custom-sa@developer.gserviceaccount.com") - self.assertEqual(summary.get("service_account"), "custom-sa@developer.gserviceaccount.com") + def test_doctor_platform_failure_exits_1(self): + with isolated_home(): + with patch( + "setup_runtime.check_hook_contract", + return_value={"ok": False, "required": True, "error": "Hook failure"}, + ): + with patch("sys.argv", ["setup_runtime.py", "--doctor"]): + with patch("sys.stdout", new_callable=io.StringIO) as mock_out: + with self.assertRaises(SystemExit) as cm: + setup_runtime.main() + self.assertEqual(cm.exception.code, 1) + report = json.loads(mock_out.getvalue().strip()) + self.assertEqual(report["status"], "ERROR") + self.assertFalse(report["platform"]["ok"]) if __name__ == "__main__": diff --git a/tests/test_shadow_transcript_projection.py b/tests/test_shadow_transcript_projection.py deleted file mode 100644 index 1b5e35e..0000000 --- a/tests/test_shadow_transcript_projection.py +++ /dev/null @@ -1,607 +0,0 @@ -import concurrent.futures -import io -import json -import os -import shutil -import sys -import tempfile -import threading -import time -import unittest -from datetime import datetime, timezone -from pathlib import Path -from unittest.mock import patch - -sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "skills" / "swarm" / "scripts")) - -from cloud_dispatch import ( - ShadowTranscriptProjector, - cleanup_session, - format_conversation_url, - get_task_brain_dir, - get_task_conversation_id, - initialize_shadow_transcript, - is_telemetry_line, - parse_telemetry_line, - resolve_app_data_dir, -) -from transcript_projector import ( - ShadowTranscriptProjector as ShadowTranscriptProjectorDirect, - cleanup_session as cleanup_session_direct, - format_conversation_url as format_conversation_url_direct, - get_task_brain_dir as get_task_brain_dir_direct, - get_task_conversation_id as get_task_conversation_id_direct, - initialize_shadow_transcript as initialize_shadow_transcript_direct, - is_telemetry_line as is_telemetry_line_direct, - parse_telemetry_line as parse_telemetry_line_direct, - resolve_app_data_dir as resolve_app_data_dir_direct, -) -from cloud_worker import ( - TokenShield, - emit_agent_response, - emit_milestone, - emit_telemetry, - emit_thought, - emit_tool_invocation, - emit_tool_result, - emit_user_input, -) - - -class TestShadowTranscriptProjection(unittest.TestCase): - def setUp(self): - self.temp_dir = Path(tempfile.mkdtemp()).resolve() - self.app_data_dir = self.temp_dir / "antigravity" - self.session_id = f"test-sess-{int(time.time() * 1000)}" - - def tearDown(self): - shutil.rmtree(self.temp_dir, ignore_errors=True) - - def test_initialization_of_shadow_transcript_directory_and_file(self): - task_index = 0 - brief = "Implement feature XYZ" - primary_file, system_file = initialize_shadow_transcript( - session_id=self.session_id, - task_index=task_index, - task_brief=brief, - app_data_dir=self.app_data_dir, - ) - - expected_task_dir = self.app_data_dir / "brain" / f"cloud-{self.session_id}-task-{task_index}" - self.assertTrue(expected_task_dir.is_dir()) - self.assertTrue(primary_file.is_file()) - self.assertTrue(system_file.is_file()) - self.assertEqual(primary_file, expected_task_dir / "transcript.jsonl") - self.assertEqual(system_file, expected_task_dir / ".system_generated" / "logs" / "transcript.jsonl") - - primary_content = primary_file.read_text(encoding="utf-8").strip() - system_content = system_file.read_text(encoding="utf-8").strip() - self.assertEqual(primary_content, system_content) - - entry = json.loads(primary_content) - self.assertEqual(entry["step_index"], 0) - self.assertEqual(entry["source"], "USER") - self.assertEqual(entry["type"], "USER_INPUT") - self.assertEqual(entry["status"], "DONE") - self.assertEqual(entry["content"], brief) - self.assertTrue("created_at" in entry) - - def test_agent_thought_projection_into_planner_response(self): - projector = ShadowTranscriptProjector( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=1, - ) - projector.init_task(0, task_brief="Initial user prompt") - - thought_line = f'[TELEMETRY] [TASK 0] {{"timestamp": {time.time()}, "event": "thought", "thought": "Analyzing system constraints"}}' - projector.process_log_line(thought_line) - - primary, system = projector.get_transcript_files(0) - lines = [json.loads(line) for line in primary.read_text(encoding="utf-8").splitlines() if line.strip()] - - self.assertEqual(len(lines), 2) - planner_entry = lines[1] - self.assertEqual(planner_entry["step_index"], 1) - self.assertEqual(planner_entry["source"], "MODEL") - self.assertEqual(planner_entry["type"], "PLANNER_RESPONSE") - self.assertEqual(planner_entry["status"], "DONE") - self.assertEqual(planner_entry["thinking"], "Analyzing system constraints") - self.assertEqual(planner_entry["tool_calls"], []) - - second_thought_line = f'[TELEMETRY] [TASK 0] {{"timestamp": {time.time()}, "event": "thought", "thought": "Selecting architecture"}}' - projector.process_log_line(second_thought_line) - - updated_lines = [json.loads(line) for line in primary.read_text(encoding="utf-8").splitlines() if line.strip()] - self.assertEqual(len(updated_lines), 2) - self.assertIn("Analyzing system constraints", updated_lines[1]["thinking"]) - self.assertIn("Selecting architecture", updated_lines[1]["thinking"]) - - def test_tool_call_argument_and_execution_output_projection(self): - projector = ShadowTranscriptProjector( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=1, - ) - projector.init_task(0, task_brief="Tool execution test") - - call_line = ( - f'[TELEMETRY] [TASK 0] {{"timestamp": {time.time()}, "event": "tool_call", ' - f'"tool_name": "run_command", "args": {{"CommandLine": "pytest"}}, "call_id": "call_1"}}' - ) - projector.process_log_line(call_line) - - result_line = ( - f'[TELEMETRY] [TASK 0] {{"timestamp": {time.time()}, "event": "tool_result", ' - f'"tool_name": "run_command", "output": "3 passed in 0.2s", "success": true, ' - f'"call_id": "call_1", "duration_s": 0.2}}' - ) - projector.process_log_line(result_line) - - primary, _ = projector.get_transcript_files(0) - entries = [json.loads(line) for line in primary.read_text(encoding="utf-8").splitlines() if line.strip()] - - self.assertEqual(len(entries), 3) - - planner_entry = entries[1] - self.assertEqual(planner_entry["step_index"], 1) - self.assertEqual(planner_entry["type"], "PLANNER_RESPONSE") - self.assertEqual(len(planner_entry["tool_calls"]), 1) - self.assertEqual(planner_entry["tool_calls"][0]["name"], "run_command") - self.assertEqual(planner_entry["tool_calls"][0]["args"], {"CommandLine": "pytest"}) - self.assertEqual(planner_entry["tool_calls"][0]["id"], "call_1") - - tool_entry = entries[2] - self.assertEqual(tool_entry["step_index"], 2) - self.assertEqual(tool_entry["source"], "TOOL") - self.assertEqual(tool_entry["type"], "TOOL_RESPONSE") - self.assertEqual(tool_entry["tool_name"], "run_command") - self.assertEqual(tool_entry["output"], "3 passed in 0.2s") - self.assertEqual(tool_entry["content"], "3 passed in 0.2s") - self.assertTrue(tool_entry["success"]) - self.assertEqual(tool_entry["call_id"], "call_1") - - def test_clickable_conversation_url_generation(self): - url = format_conversation_url(self.session_id, 3) - self.assertEqual(url, f"conversation://cloud-{self.session_id}-task-3") - - projector = ShadowTranscriptProjector( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=4, - ) - self.assertEqual( - projector.get_conversation_url(3), - f"conversation://cloud-{self.session_id}-task-3", - ) - self.assertTrue(url.startswith("conversation://cloud-")) - - def test_token_shield_stdout_contains_milestones_only(self): - with patch("sys.stdout", new_callable=io.StringIO) as mock_stdout: - with TokenShield(task_index=1): - emit_milestone(1, "BOOTING", "Container initialized") - print("Raw model thought token stream leaking into stdout...") - emit_thought(1, "Direct model thought emission") - emit_milestone(1, "RUNNING_AGENT", "Turn 1") - emit_tool_invocation(1, "grep_search", {"query": "SECRET"}) - print("Detailed tool output payload exceeding terminal limits: {'raw': 'data'}") - emit_tool_result(1, "grep_search", "match found", success=True) - emit_milestone(1, "COMPLETED", "Task finished") - - stdout_content = mock_stdout.getvalue() - - stdout_lines = [line.strip() for line in stdout_content.splitlines() if line.strip()] - self.assertGreaterEqual(len(stdout_lines), 3) - - for line in stdout_lines: - self.assertTrue( - line.startswith("[MILESTONE]"), - f"Non-milestone leaked to terminal stdout: {line}", - ) - - self.assertNotIn("Raw model thought token stream leaking into stdout", stdout_content) - self.assertNotIn("Detailed tool output payload exceeding terminal limits", stdout_content) - self.assertNotIn("Direct model thought emission", stdout_content) - - def test_concurrent_transcript_writes_across_8_workers(self): - worker_count = 8 - projector = ShadowTranscriptProjector( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=worker_count, - ) - - def worker_task(task_index: int): - projector.init_task(task_index, task_brief=f"Concurrent task brief {task_index}") - for step in range(5): - t_log = time.time() - thought_line = ( - f'[TELEMETRY] [TASK {task_index}] {{"timestamp": {t_log}, "event": "thought", ' - f'"thought": "Worker {task_index} step {step} thinking"}}' - ) - projector.process_log_line(thought_line) - - call_line = ( - f'[TELEMETRY] [TASK {task_index}] {{"timestamp": {t_log}, "event": "tool_call", ' - f'"tool_name": "worker_tool", "args": {{"step": {step}}}, "call_id": "c_{task_index}_{step}"}}' - ) - projector.process_log_line(call_line) - - res_line = ( - f'[TELEMETRY] [TASK {task_index}] {{"timestamp": {t_log}, "event": "tool_result", ' - f'"tool_name": "worker_tool", "output": "res_{task_index}_{step}", "success": true, ' - f'"call_id": "c_{task_index}_{step}"}}' - ) - projector.process_log_line(res_line) - - with concurrent.futures.ThreadPoolExecutor(max_workers=worker_count) as executor: - futures = [executor.submit(worker_task, idx) for idx in range(worker_count)] - concurrent.futures.wait(futures) - - for task_index in range(worker_count): - primary, system = projector.get_transcript_files(task_index) - self.assertTrue(primary.is_file()) - self.assertTrue(system.is_file()) - - primary_lines = [json.loads(line) for line in primary.read_text(encoding="utf-8").splitlines() if line.strip()] - system_lines = [json.loads(line) for line in system.read_text(encoding="utf-8").splitlines() if line.strip()] - - self.assertEqual(len(primary_lines), len(system_lines)) - self.assertEqual(len(primary_lines), 11) - - step_indices = [entry["step_index"] for entry in primary_lines] - self.assertEqual(step_indices, list(range(11))) - - for entry in primary_lines: - if entry["type"] == "TOOL_RESPONSE": - self.assertIn(f"res_{task_index}_", entry["output"]) - - def test_corrupted_log_parsing_recovery(self): - projector = ShadowTranscriptProjector( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=1, - ) - projector.init_task(0, task_brief="Resilience test") - - corrupted_lines = [ - "[TELEMETRY] [TASK 0] {malformed json: true,", - "[TELEMETRY] [TASK 0] truncated string payload \"abc", - "[TELEMETRY] not json data at all", - "[TELEMETRY] [TASK invalid] {\"event\": \"thought\"}", - "[TELEMETRY] [TASK 0] [\"unexpected\", \"list\"]", - "", - " ", - "[MILESTONE] [TASK 0] [PHASE: UNRELATED] ignore this", - ">> unhandled container exception line <<", - ] - - for corrupted in corrupted_lines: - result = projector.process_log_line(corrupted) - self.assertIsNone(result) - - valid_line = ( - f'[TELEMETRY] [TASK 0] {{"timestamp": {time.time()}, "event": "thought", ' - f'"thought": "Recovered from corrupted stream"}}' - ) - res = projector.process_log_line(valid_line) - self.assertIsNotNone(res) - self.assertEqual(res["type"], "PLANNER_RESPONSE") - self.assertEqual(res["thinking"], "Recovered from corrupted stream") - - primary, _ = projector.get_transcript_files(0) - entries = [json.loads(line) for line in primary.read_text(encoding="utf-8").splitlines() if line.strip()] - self.assertEqual(len(entries), 2) - self.assertEqual(entries[1]["thinking"], "Recovered from corrupted stream") - - def test_native_antigravity_schema_compliance(self): - projector = ShadowTranscriptProjector( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=1, - ) - projector.init_task(0, task_brief="Verify schema compliance") - - t0 = time.time() - projector.process_log_line( - f'[TELEMETRY] [TASK 0] {{"timestamp": {t0}, "event": "thought", "thought": "Refactoring step"}}' - ) - projector.process_log_line( - f'[TELEMETRY] [TASK 0] {{"timestamp": {t0}, "event": "tool_call", "tool_name": "view_file", ' - f'"args": {{"path": "lib.py"}}, "call_id": "c_1"}}' - ) - projector.process_log_line( - f'[TELEMETRY] [TASK 0] {{"timestamp": {t0}, "event": "tool_result", "tool_name": "view_file", ' - f'"output": "def foo(): pass", "success": true, "call_id": "c_1"}}' - ) - - primary, _ = projector.get_transcript_files(0) - entries = [json.loads(line) for line in primary.read_text(encoding="utf-8").splitlines() if line.strip()] - self.assertEqual(len(entries), 3) - - u = entries[0] - self.assertEqual(u["step_index"], 0) - self.assertEqual(u["source"], "USER") - self.assertEqual(u["type"], "USER_INPUT") - self.assertEqual(u["status"], "DONE") - self.assertIsInstance(u["content"], str) - datetime.fromisoformat(u["created_at"].replace("Z", "+00:00")) - - p = entries[1] - self.assertEqual(p["step_index"], 1) - self.assertEqual(p["source"], "MODEL") - self.assertEqual(p["type"], "PLANNER_RESPONSE") - self.assertEqual(p["status"], "DONE") - self.assertIsInstance(p["thinking"], str) - self.assertIsInstance(p["tool_calls"], list) - self.assertEqual(p["tool_calls"][0]["name"], "view_file") - self.assertEqual(p["tool_calls"][0]["args"], {"path": "lib.py"}) - datetime.fromisoformat(p["created_at"].replace("Z", "+00:00")) - - t = entries[2] - self.assertEqual(t["step_index"], 2) - self.assertEqual(t["source"], "TOOL") - self.assertEqual(t["type"], "TOOL_RESPONSE") - self.assertEqual(t["status"], "DONE") - self.assertEqual(t["tool_name"], "view_file") - self.assertEqual(t["output"], "def foo(): pass") - self.assertTrue(t["success"]) - datetime.fromisoformat(t["created_at"].replace("Z", "+00:00")) - - def test_preservation_of_transcripts_during_and_after_session_cleanup(self): - projector = ShadowTranscriptProjector( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=3, - ) - for i in range(3): - projector.init_task(i, task_brief=f"Preservation task {i}") - projector.process_log_line( - f'[TELEMETRY] [TASK {i}] {{"timestamp": {time.time()}, "event": "thought", "thought": "Running {i}"}}' - ) - - brain_dir = self.app_data_dir / "brain" - task_dirs = list(brain_dir.glob(f"cloud-{self.session_id}-task-*")) - self.assertEqual(len(task_dirs), 3) - - temp_scratch = Path(self.temp_dir) / "temp_scratch" - temp_scratch.mkdir(parents=True, exist_ok=True) - (temp_scratch / "temp_artifact.txt").write_text("transient", encoding="utf-8") - - cleanup_res = cleanup_session( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - preserve_transcripts=True, - temp_dir=temp_scratch, - ) - - self.assertTrue(cleanup_res["transcripts_preserved"]) - self.assertEqual(len(cleanup_res["preserved_directories"]), 3) - self.assertFalse(temp_scratch.exists()) - - for task_dir in task_dirs: - self.assertTrue(task_dir.is_dir()) - primary = task_dir / "transcript.jsonl" - system = task_dir / ".system_generated" / "logs" / "transcript.jsonl" - self.assertTrue(primary.is_file()) - self.assertTrue(system.is_file()) - lines = [line for line in primary.read_text(encoding="utf-8").splitlines() if line.strip()] - self.assertGreaterEqual(len(lines), 2) - - def test_telemetry_projection_latency_probe(self): - projector = ShadowTranscriptProjector( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=1, - ) - projector.init_task(0, task_brief="Latency probe task") - - baseline_delay_s = 2.0 - event_time = time.time() - baseline_delay_s - telemetry_line = ( - f'[TELEMETRY] [TASK 0] {{"timestamp": {event_time}, "event": "thought", ' - f'"thought": "Latency verification thought"}}' - ) - - measured_latency = projector.measure_projection_latency(telemetry_line) - self.assertIsNotNone(measured_latency) - self.assertLessEqual(measured_latency, 3.5) - self.assertGreaterEqual(measured_latency, 1.8) - - last_latency = projector.get_last_latency() - self.assertEqual(measured_latency, last_latency) - - iso_time = datetime.now(timezone.utc).isoformat() - iso_line = ( - f'[TELEMETRY] [TASK 0] {{"timestamp": "{iso_time}", "event": "thought", ' - f'"thought": "ISO timestamp latency test"}}' - ) - iso_latency = projector.measure_projection_latency(iso_line) - self.assertIsNotNone(iso_latency) - self.assertLessEqual(iso_latency, 3.5) - - def test_backwards_compatible_module_exports(self): - self.assertIs(ShadowTranscriptProjector, ShadowTranscriptProjectorDirect) - self.assertIs(initialize_shadow_transcript, initialize_shadow_transcript_direct) - self.assertIs(cleanup_session, cleanup_session_direct) - self.assertIs(format_conversation_url, format_conversation_url_direct) - self.assertIs(get_task_brain_dir, get_task_brain_dir_direct) - self.assertIs(get_task_conversation_id, get_task_conversation_id_direct) - self.assertIs(is_telemetry_line, is_telemetry_line_direct) - self.assertIs(parse_telemetry_line, parse_telemetry_line_direct) - self.assertIs(resolve_app_data_dir, resolve_app_data_dir_direct) - - def test_atomic_file_replacement_in_update_last_entry(self): - projector = ShadowTranscriptProjector( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=1, - ) - projector.init_task(0, task_brief="Atomic file replacement test") - primary, system = projector.get_transcript_files(0) - - t0 = time.time() - projector.process_log_line( - f'[TELEMETRY] [TASK 0] {{"timestamp": {t0}, "event": "thought", "thought": "Original thought"}}' - ) - - updated_entry = { - "step_index": 1, - "source": "MODEL", - "type": "PLANNER_RESPONSE", - "status": "DONE", - "created_at": datetime.now(timezone.utc).isoformat(), - "thinking": "Atomically replaced thought content", - "tool_calls": [], - "content": "Updated content", - } - - with patch("os.replace", wraps=os.replace) as mock_replace: - projector._update_last_entry(0, updated_entry) - self.assertEqual(mock_replace.call_count, 2) - - temp_files_primary = list(primary.parent.glob("tmp*")) - temp_files_system = list(system.parent.glob("tmp*")) - self.assertEqual(len(temp_files_primary), 0) - self.assertEqual(len(temp_files_system), 0) - - primary_lines = [json.loads(line) for line in primary.read_text(encoding="utf-8").splitlines() if line.strip()] - system_lines = [json.loads(line) for line in system.read_text(encoding="utf-8").splitlines() if line.strip()] - self.assertEqual(len(primary_lines), 2) - self.assertEqual(len(system_lines), 2) - self.assertEqual(primary_lines[1]["thinking"], "Atomically replaced thought content") - self.assertEqual(system_lines[1]["thinking"], "Atomically replaced thought content") - - def test_per_task_lock_concurrency(self): - projector = ShadowTranscriptProjector( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=2, - ) - lock_0 = projector._get_task_lock(0) - lock_1 = projector._get_task_lock(1) - - self.assertIsInstance(lock_0, type(threading.Lock())) - self.assertIsInstance(lock_1, type(threading.Lock())) - self.assertIsNot(lock_0, lock_1) - - acquired_0 = lock_0.acquire(blocking=False) - self.assertTrue(acquired_0) - - task_1_completed = threading.Event() - - def run_task_1(): - projector.init_task(1, task_brief="Task 1 independent progress") - task_1_completed.set() - - t = threading.Thread(target=run_task_1) - t.start() - t.join(timeout=2.0) - self.assertTrue(task_1_completed.is_set()) - - lock_0.release() - - def test_tokenshield_credential_regex_redaction(self): - mock_telemetry_out = io.StringIO() - with patch("sys.stdout", new_callable=io.StringIO) as mock_stdout: - shield = TokenShield(task_index=0, telemetry_stream=mock_telemetry_out) - fake_ghp = "ghp_" + "1234567890abcdefghijklmnopqrstuvwxyzAB" - fake_aiza = "AIza" + "SyD-1234567890abcdefABCDEF123456789" - fake_oauth = "ya29." + "a0AfH6SMCxyz123_456-789" - fake_bearer = "Bearer " + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.xyz" - fake_ghp_thought = "ghp_" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" - with shield: - shield.emit_milestone("START", "Container booted") - print(f"Leaking GitHub token {fake_ghp} in terminal") - print(f"Leaking Google AIza key {fake_aiza} in terminal") - print(f"Leaking OAuth token {fake_oauth} in terminal") - print(f"Leaking auth header {fake_bearer} in terminal") - shield.emit_thought(f"Internal thought with {fake_ghp_thought}") - - stdout_content = mock_stdout.getvalue() - telemetry_content = mock_telemetry_out.getvalue() - - self.assertIn("[MILESTONE]", stdout_content) - self.assertNotIn("ghp_", stdout_content) - self.assertNotIn("AIza", stdout_content) - self.assertNotIn("ya29", stdout_content) - self.assertNotIn("Bearer", stdout_content) - - for thought in shield.captured_thoughts: - self.assertNotIn("ghp_1234567890", thought) - self.assertNotIn("AIzaSyD", thought) - self.assertNotIn("ya29.a0Af", thought) - self.assertNotIn("Bearer eyJhbGciOi", thought) - self.assertIn("[REDACTED]", thought) - - self.assertNotIn("ghp_1234567890", telemetry_content) - self.assertNotIn("AIzaSyD", telemetry_content) - self.assertNotIn("ya29.a0Af", telemetry_content) - self.assertNotIn("Bearer eyJhbGciOi", telemetry_content) - self.assertIn("[REDACTED]", telemetry_content) - - def test_tokenshield_stdout_restoration_on_exception(self): - orig_stdout = sys.stdout - try: - with TokenShield(task_index=0): - self.assertIsInstance(sys.stdout, TokenShield) - raise RuntimeError("Forced exception inside TokenShield context") - except RuntimeError: - pass - self.assertIs(sys.stdout, orig_stdout) - - try: - with TokenShield(task_index=0) as shield: - with patch.object(shield, "_handle_non_milestone", side_effect=ValueError("Flush crash")): - print("Unflushed message before crash") - except ValueError: - pass - self.assertIs(sys.stdout, orig_stdout) - - def test_deduplication_of_identical_telemetry_events(self): - projector = ShadowTranscriptProjector( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=1, - ) - projector.init_task(0, task_brief="Deduplication test") - - fixed_ts = 1700000000.123 - thought_line = ( - f'[TELEMETRY] [TASK 0] {{"timestamp": {fixed_ts}, "event": "thought", ' - f'"thought": "Dedup test thinking statement"}}' - ) - - res1 = projector.process_log_line(thought_line) - self.assertIsNotNone(res1) - self.assertEqual(res1["type"], "PLANNER_RESPONSE") - - res2 = projector.process_log_line(thought_line) - self.assertIsNone(res2) - - expected_event_key = (0, "thought", "", fixed_ts) - self.assertIn(expected_event_key, projector._seen_events) - - primary, _ = projector.get_transcript_files(0) - lines = [json.loads(line) for line in primary.read_text(encoding="utf-8").splitlines() if line.strip()] - self.assertEqual(len(lines), 2) - self.assertEqual(lines[1]["thinking"].count("Dedup test thinking statement"), 1) - - call_line = ( - f'[TELEMETRY] [TASK 0] {{"timestamp": {fixed_ts + 1}, "event": "tool_call", ' - f'"tool_name": "test_tool", "call_id": "c_dedup_1", "args": {{"p": 1}}}}' - ) - c1 = projector.process_log_line(call_line) - self.assertIsNotNone(c1) - c2 = projector.process_log_line(call_line) - self.assertIsNone(c2) - - expected_call_key = (0, "tool_call", "c_dedup_1", fixed_ts + 1) - self.assertIn(expected_call_key, projector._seen_events) - - lines_after_call = [json.loads(line) for line in primary.read_text(encoding="utf-8").splitlines() if line.strip()] - self.assertEqual(len(lines_after_call[1]["tool_calls"]), 1) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_simulation_scenario.py b/tests/test_simulation_scenario.py deleted file mode 100644 index 3c8b59a..0000000 --- a/tests/test_simulation_scenario.py +++ /dev/null @@ -1,221 +0,0 @@ -#!/usr/bin/env python3 -import json -import os -from pathlib import Path -import subprocess -import sys -import tempfile -import unittest -from unittest.mock import MagicMock, patch - -SCRIPTS_DIR = Path(__file__).resolve().parent.parent / "skills" / "swarm" / "scripts" -if str(SCRIPTS_DIR) not in sys.path: - sys.path.insert(0, str(SCRIPTS_DIR)) - -from cloud_dispatch import run_preflight -from cloud_worker import is_candidate_file -from simulate_cloud_swarm import ( - build_simulation_manifest, - probe_vertex_ai, - run_simulation, - setup_simulation_repo, -) - - -class TestCloudDispatchGemini25Preflight(unittest.TestCase): - @patch("urllib.request.urlopen") - @patch("subprocess.run") - def test_gemini_25_flash_routes_to_vertex_global(self, mock_subproc, mock_urlopen): - def fake_run(cmd, *args, **kwargs): - m = MagicMock() - m.returncode = 0 - if "print-access-token" in cmd: - m.stdout = "token-test-25\n" - else: - m.stdout = "HEAD\n" - return m - - mock_subproc.side_effect = fake_run - mock_resp = MagicMock() - mock_resp.__enter__.return_value = mock_resp - mock_urlopen.return_value = mock_resp - - run_preflight( - repo_url="https://github.com/test/repo.git", - gh_token="test-token", - use_vertex=True, - gemini_api_key="", - project="test-proj-25", - region="us-central1", - model="gemini-2.5-flash", - dry_run=False, - gcs_bucket="test-bucket", - ) - - mock_urlopen.assert_called_once() - req = mock_urlopen.call_args[0][0] - self.assertEqual( - req.full_url, - "https://aiplatform.googleapis.com/v1/projects/test-proj-25/locations/global/publishers/google/models/gemini-2.5-flash:generateContent", - ) - self.assertEqual(req.get_header("X-goog-user-project"), "test-proj-25") - - @patch("urllib.request.urlopen") - @patch("subprocess.run") - def test_gemini_25_pro_routes_to_vertex_global(self, mock_subproc, mock_urlopen): - def fake_run(cmd, *args, **kwargs): - m = MagicMock() - m.returncode = 0 - if "print-access-token" in cmd: - m.stdout = "token-test-pro\n" - else: - m.stdout = "HEAD\n" - return m - - mock_subproc.side_effect = fake_run - mock_resp = MagicMock() - mock_resp.__enter__.return_value = mock_resp - mock_urlopen.return_value = mock_resp - - run_preflight( - repo_url="https://github.com/test/repo.git", - gh_token="test-token", - use_vertex=True, - gemini_api_key="", - project="test-proj-pro", - region="europe-west4", - model="gemini-2.5-pro", - dry_run=False, - gcs_bucket="test-bucket", - ) - - mock_urlopen.assert_called_once() - req = mock_urlopen.call_args[0][0] - self.assertEqual( - req.full_url, - "https://aiplatform.googleapis.com/v1/projects/test-proj-pro/locations/global/publishers/google/models/gemini-2.5-pro:generateContent", - ) - - def test_cli_argument_handler_vertex_location_resolution(self): - cmd = [ - sys.executable, - str(SCRIPTS_DIR / "cloud_dispatch.py"), - "--dry-run", - "--repo", "https://github.com/test/repo.git", - "--model", "gemini-2.5-flash", - "--vertex", - "--project", "test-project", - "--tasks", "1", - ] - res = subprocess.run(cmd, capture_output=True, text=True, check=True, env=dict(os.environ, GH_TOKEN="test_token")) - payload = json.loads(res.stdout) - self.assertEqual(payload["env_vars"].get("VERTEXAI_LOCATION"), "global") - - -class TestSimulationScenarioWorkflow(unittest.TestCase): - def setUp(self): - self.temp_dir_obj = tempfile.TemporaryDirectory() - self.base_dir = Path(self.temp_dir_obj.name) - - def tearDown(self): - self.temp_dir_obj.cleanup() - - def test_setup_simulation_repo(self): - origin_dir, work_dir = setup_simulation_repo(self.base_dir) - self.assertTrue(origin_dir.is_dir()) - self.assertTrue((work_dir / "src" / "pipeline" / "packet_filter.py").is_file()) - self.assertTrue((work_dir / "src" / "pipeline" / "transform.py").is_file()) - self.assertTrue((work_dir / "src" / "pipeline" / "router.py").is_file()) - self.assertTrue((work_dir / "tests" / "test_packet_filter.py").is_file()) - self.assertTrue((work_dir / "tests" / "test_transform.py").is_file()) - self.assertTrue((work_dir / "tests" / "test_router.py").is_file()) - - run_env = dict(os.environ, PYTHONPATH=str(work_dir)) - res = subprocess.run( - [sys.executable, "-m", "unittest", "discover", "tests"], - cwd=work_dir, - capture_output=True, - text=True, - env=run_env, - ) - self.assertEqual(res.returncode, 0) - self.assertIn("Ran 3 tests", res.stderr) - - def test_manifest_generation_and_guardrails(self): - manifest = build_simulation_manifest(tasks_count=3) - self.assertEqual(len(manifest), 3) - - self.assertEqual(manifest[0]["candidate_files"], ["src/pipeline/packet_filter.py"]) - self.assertEqual(manifest[1]["candidate_files"], ["src/pipeline/transform.py"]) - self.assertEqual(manifest[2]["candidate_files"], ["src/pipeline/router.py"]) - - for task in manifest: - cand = task["candidate_files"][0] - self.assertTrue(is_candidate_file(cand, explicit_candidates=task["candidate_files"], explicit_excludes=task["exclude_files"])) - self.assertFalse(is_candidate_file(".agystack/setup.sh", explicit_candidates=task["candidate_files"], explicit_excludes=task["exclude_files"])) - self.assertFalse(is_candidate_file(".git/HEAD", explicit_candidates=task["candidate_files"], explicit_excludes=task["exclude_files"])) - - @patch("urllib.request.urlopen") - @patch("subprocess.run") - def test_probe_vertex_ai_success(self, mock_subproc, mock_urlopen): - mock_subproc.return_value = MagicMock(returncode=0, stdout="test-access-token\n") - mock_resp = MagicMock() - mock_resp.__enter__.return_value = mock_resp - mock_urlopen.return_value = mock_resp - - probe_ok = probe_vertex_ai(project="test-proj", model="gemini-2.5-flash", location="global") - self.assertTrue(probe_ok) - req = mock_urlopen.call_args[0][0] - self.assertEqual( - req.full_url, - "https://aiplatform.googleapis.com/v1/projects/test-proj/locations/global/publishers/google/models/gemini-2.5-flash:generateContent", - ) - - def test_end_to_end_simulation_run(self): - result = run_simulation( - model="gemini-2.5-flash", - project="test-agystack-project", - gcs_bucket="test-swarm-results", - tasks=3, - skip_live_probe=True, - temp_base_dir=self.base_dir, - ) - self.assertEqual(result["status"], "PASS") - self.assertEqual(result["tasks"], 3) - self.assertEqual(len(result["harvested_scores"]), 3) - - out_slices = Path(".slices/harvested_scores.json") - self.assertTrue(out_slices.is_file()) - with open(out_slices, "r", encoding="utf-8") as f: - slices_data = json.load(f) - self.assertEqual(len(slices_data), 3) - - phases = [m["phase"] for m in result["milestones"]] - expected_phases = [ - "BOOTING", - "REPO_READY", - "RUNNING_AGENT", - "STEER_RECEIVED", - "WAITING_FOR_ORCHESTRATOR", - "ORCHESTRATOR_REPLY_RECEIVED", - "VALIDATING_CANDIDATE", - "COMPLETE", - ] - for ep in expected_phases: - self.assertIn(ep, phases, f"Missing expected milestone phase: {ep}") - - def test_cli_execution_clean_exit(self): - cmd = [ - sys.executable, - str(SCRIPTS_DIR / "simulate_cloud_swarm.py"), - "--skip-live-probe", - "--tasks", "3", - ] - proc = subprocess.run(cmd, capture_output=True, text=True) - self.assertEqual(proc.returncode, 0, f"CLI exited with {proc.returncode}:\n{proc.stderr}") - self.assertIn("SWARM SIMULATION REPORT", proc.stdout) - self.assertIn("[STATUS: PASS]", proc.stdout) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_skill_catalog.py b/tests/test_skill_catalog.py index f6b73d8..6fb6ce1 100644 --- a/tests/test_skill_catalog.py +++ b/tests/test_skill_catalog.py @@ -79,3 +79,17 @@ def test_all_skills_match_directory(): skill_name = name_match.group(1).strip().strip("'\"") assert skill_name == dir_name, f"{skill_file} name '{skill_name}' does not match dir '{dir_name}'" + +def test_no_swarm_skill_collision(): + skills_dir = REPO_ROOT / "skills" + assert not (skills_dir / "swarm").exists(), "skills/swarm must not exist (shadows Antigravity built-in swarm skill)" + for skill_file in sorted(skills_dir.glob("*/SKILL.md")): + content = skill_file.read_text(encoding="utf-8") + parts = content.split("---", 2) + assert len(parts) >= 3, f"{skill_file} invalid frontmatter structure" + name_match = re.search(r"^name:\s*(.+)$", parts[1], re.MULTILINE) + assert name_match, f"{skill_file} missing 'name:' in frontmatter" + skill_name = name_match.group(1).strip().strip("'\"") + assert skill_name != "swarm", f"{skill_file} declares 'name: swarm' and shadows Antigravity's built-in swarm skill" + + diff --git a/tests/test_storage_messenger.py b/tests/test_storage_messenger.py deleted file mode 100644 index 6f9e353..0000000 --- a/tests/test_storage_messenger.py +++ /dev/null @@ -1,378 +0,0 @@ -#!/usr/bin/env python3 -import asyncio -import io -import json -import os -from pathlib import Path -import sys -import tempfile -import time -import unittest -from unittest.mock import MagicMock, patch - -sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "skills" / "swarm" / "scripts")) - -from storage_messenger import ( - MailboxEnvelope, - MessageStatus, - MessageType, - StorageMessenger, -) -from cloud_worker import create_ask_orchestrator_tool -from cloud_dispatch import ( - handle_mailbox_list, - handle_mailbox_reply, - handle_mailbox_steer, -) - - -class TestStorageMessenger(unittest.TestCase): - def setUp(self): - self.temp_dir = tempfile.TemporaryDirectory() - self.storage_root = Path(self.temp_dir.name) - self.bucket_name = "test-swarm-bucket" - self.session_id = "test-session-001" - - def tearDown(self): - self.temp_dir.cleanup() - - def test_envelope_serialization_and_deserialization(self): - envelope = MailboxEnvelope( - session_id="session-xyz", - task_index=3, - seq=7, - msg_type=MessageType.QUESTION, - sender="worker-3", - recipient="orchestrator", - timestamp=1725500000.0, - payload={"question": "Should I refactor auth v1?", "context": "14 callers"}, - status=MessageStatus.PENDING, - reply_to_seq=None, - ) - - d = envelope.to_dict() - self.assertEqual(d["session_id"], "session-xyz") - self.assertEqual(d["task_index"], 3) - self.assertEqual(d["seq"], 7) - self.assertEqual(d["msg_type"], "question") - self.assertEqual(d["status"], "pending") - self.assertEqual(d["payload"]["question"], "Should I refactor auth v1?") - - json_str = envelope.to_json() - restored = MailboxEnvelope.from_json(json_str) - self.assertEqual(restored.session_id, envelope.session_id) - self.assertEqual(restored.task_index, envelope.task_index) - self.assertEqual(restored.seq, envelope.seq) - self.assertEqual(restored.msg_type, MessageType.QUESTION) - self.assertEqual(restored.status, MessageStatus.PENDING) - self.assertEqual(restored.payload, envelope.payload) - - def test_monotonic_sequence_numbers(self): - worker_messenger = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=1, - is_worker=True, - local_dir=self.storage_root, - ) - - q1 = worker_messenger.send_question("Question 1") - self.assertEqual(q1.seq, 1) - - q2 = worker_messenger.send_question("Question 2") - self.assertEqual(q2.seq, 2) - - q3 = worker_messenger.send_question("Question 3") - self.assertEqual(q3.seq, 3) - - expected_q1_path = ( - self.storage_root - / self.bucket_name - / "swarms" - / self.session_id - / "tasks" - / "task-1" - / "outbox" - / "0001_question.json" - ) - self.assertTrue(expected_q1_path.is_file()) - - def test_question_send_and_wait_reply_success(self): - worker_messenger = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=2, - is_worker=True, - local_dir=self.storage_root, - ) - orchestrator_messenger = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - is_worker=False, - local_dir=self.storage_root, - ) - - q_env = worker_messenger.send_question("Need approval to delete old API") - self.assertEqual(q_env.seq, 1) - - # Orchestrator sends reply - reply_env = orchestrator_messenger.send_reply( - task_index=2, - seq=q_env.seq, - reply_text="Approved. Proceed with deletion.", - ) - self.assertEqual(reply_env.reply_to_seq, 1) - - # Worker waits and gets reply - received_reply = worker_messenger.wait_for_reply(seq=1, timeout_seconds=2.0, poll_interval=0.01) - self.assertEqual(received_reply, "Approved. Proceed with deletion.") - - def test_wait_reply_timeout(self): - worker_messenger = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=4, - is_worker=True, - local_dir=self.storage_root, - ) - - worker_messenger.send_question("Unanswered question") - received_reply = worker_messenger.wait_for_reply(seq=1, timeout_seconds=0.05, poll_interval=0.01) - self.assertIsNone(received_reply) - - def test_create_ask_orchestrator_tool_success(self): - worker_messenger = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=0, - is_worker=True, - local_dir=self.storage_root, - ) - orchestrator_messenger = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - is_worker=False, - local_dir=self.storage_root, - ) - - tool = create_ask_orchestrator_tool(worker_messenger, task_index=0, timeout_seconds=2.0) - - # Simulate async reply - orchestrator_messenger.send_reply(task_index=0, seq=1, reply_text="Use schema v2.") - - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - ans = asyncio.run(tool("Which schema should I use?")) - self.assertEqual(ans, "Use schema v2.") - output = mock_out.getvalue() - self.assertIn("WAITING_FOR_ORCHESTRATOR", output) - self.assertIn("ORCHESTRATOR_REPLY_RECEIVED", output) - - def test_create_ask_orchestrator_tool_timeout(self): - worker_messenger = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=0, - is_worker=True, - local_dir=self.storage_root, - ) - - tool = create_ask_orchestrator_tool(worker_messenger, task_index=0, timeout_seconds=0.05) - - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - ans = asyncio.run(tool("Is anyone there?")) - self.assertIn("Orchestrator did not respond within timeout", ans) - output = mock_out.getvalue() - self.assertIn("ORCHESTRATOR_TIMEOUT", output) - - def test_steer_queuing_and_retrieval(self): - worker_messenger = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=3, - is_worker=True, - local_dir=self.storage_root, - ) - orchestrator_messenger = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - is_worker=False, - local_dir=self.storage_root, - ) - - # Send two steering instructions - orchestrator_messenger.send_steer(task_index=3, instruction="Fix unit tests first.") - orchestrator_messenger.send_steer(task_index=3, instruction="Do not modify Cargo.lock.") - - # Worker retrieves steer instructions - steer_msgs = worker_messenger.check_steer_instructions() - self.assertEqual(len(steer_msgs), 2) - self.assertEqual(steer_msgs[0].payload["instruction"], "Fix unit tests first.") - self.assertEqual(steer_msgs[1].payload["instruction"], "Do not modify Cargo.lock.") - - # Second check returns empty because already processed - steer_msgs_2 = worker_messenger.check_steer_instructions() - self.assertEqual(len(steer_msgs_2), 0) - - # Adding a third steer instruction returns only the third - orchestrator_messenger.send_steer(task_index=3, instruction="Run integration tests.") - steer_msgs_3 = worker_messenger.check_steer_instructions() - self.assertEqual(len(steer_msgs_3), 1) - self.assertEqual(steer_msgs_3[0].payload["instruction"], "Run integration tests.") - - def test_list_pending_questions(self): - w0 = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=0, - is_worker=True, - local_dir=self.storage_root, - ) - w1 = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=1, - is_worker=True, - local_dir=self.storage_root, - ) - orchestrator = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - is_worker=False, - local_dir=self.storage_root, - ) - - w0.send_question("Question from task 0") - w1.send_question("Question from task 1") - - pending = orchestrator.list_pending_questions() - self.assertEqual(len(pending), 2) - - # Answer task 0's question - orchestrator.send_reply(task_index=0, seq=1, reply_text="Answer to task 0") - - # Now only task 1 is pending - pending_after = orchestrator.list_pending_questions() - self.assertEqual(len(pending_after), 1) - self.assertEqual(pending_after[0].task_index, 1) - - def test_cli_handle_mailbox_list(self): - worker = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=2, - is_worker=True, - local_dir=self.storage_root, - ) - worker.send_question("Test question from task 2") - - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - pending = handle_mailbox_list( - session_id=self.session_id, - bucket_name=self.bucket_name, - messenger=StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - is_worker=False, - local_dir=self.storage_root, - ), - ) - self.assertEqual(len(pending), 1) - self.assertIn("Test question from task 2", mock_out.getvalue()) - - def test_cli_handle_mailbox_reply(self): - worker = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=5, - is_worker=True, - local_dir=self.storage_root, - ) - worker.send_question("Pending approval") - - orch_messenger = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - is_worker=False, - local_dir=self.storage_root, - ) - - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - env = handle_mailbox_reply( - task_index=5, - seq=1, - text="Approved for merge", - session_id=self.session_id, - bucket_name=self.bucket_name, - messenger=orch_messenger, - ) - self.assertEqual(env.payload["reply"], "Approved for merge") - self.assertIn("Reply sent to task 5", mock_out.getvalue()) - - reply = worker.wait_for_reply(seq=1, timeout_seconds=1.0, poll_interval=0.01) - self.assertEqual(reply, "Approved for merge") - - def test_cli_handle_mailbox_steer(self): - worker = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - task_index=1, - is_worker=True, - local_dir=self.storage_root, - ) - orch_messenger = StorageMessenger( - bucket_name=self.bucket_name, - session_id=self.session_id, - is_worker=False, - local_dir=self.storage_root, - ) - - with patch("sys.stdout", new_callable=io.StringIO) as mock_out: - env = handle_mailbox_steer( - task_index=1, - text="Focus on latency reduction", - session_id=self.session_id, - bucket_name=self.bucket_name, - messenger=orch_messenger, - ) - self.assertEqual(env.payload["instruction"], "Focus on latency reduction") - self.assertIn("Steer instruction sent to task 1", mock_out.getvalue()) - - steers = worker.check_steer_instructions() - self.assertEqual(len(steers), 1) - self.assertEqual(steers[0].payload["instruction"], "Focus on latency reduction") - - def test_mock_gcs_storage_client(self): - mock_client = MagicMock() - mock_bucket = MagicMock() - mock_blob = MagicMock() - - mock_client.bucket.return_value = mock_bucket - mock_bucket.blob.return_value = mock_blob - mock_blob.exists.return_value = True - mock_blob.download_as_text.return_value = json.dumps({ - "session_id": "mock-sess", - "task_index": 0, - "seq": 1, - "msg_type": "reply", - "sender": "orchestrator", - "recipient": "worker-0", - "timestamp": time.time(), - "payload": {"reply": "Mock reply"}, - "status": "pending", - }) - - messenger = StorageMessenger( - bucket_name="gcp-bucket", - session_id="mock-sess", - task_index=0, - is_worker=True, - storage_client=mock_client, - ) - - reply = messenger.wait_for_reply(seq=1, timeout_seconds=1.0, poll_interval=0.01) - self.assertEqual(reply, "Mock reply") - mock_client.bucket.assert_called_with("gcp-bucket") - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_storage_uploader.py b/tests/test_storage_uploader.py deleted file mode 100644 index 382c445..0000000 --- a/tests/test_storage_uploader.py +++ /dev/null @@ -1,443 +0,0 @@ -#!/usr/bin/env python3 -import json -import os -import subprocess -import tempfile -import unittest -from pathlib import Path -from unittest.mock import MagicMock, patch - -import sys - -sys.path.insert(0, str(Path(__file__).parent.parent / "skills" / "swarm" / "scripts")) - -import storage_uploader -import cloud_worker - - -class TestForkUrlResolution(unittest.TestCase): - def test_authenticated_url_ssh(self): - url = cloud_worker.build_authenticated_git_url("git@github.com:Layr-Labs/matrices-fast.git", "test_tok") - self.assertEqual(url, "https://x-access-token:test_tok@github.com/Layr-Labs/matrices-fast.git") - - def test_authenticated_url_https(self): - url = cloud_worker.build_authenticated_git_url("https://github.com/user/fork-repo.git", "test_tok") - self.assertEqual(url, "https://x-access-token:test_tok@github.com/user/fork-repo.git") - - def test_authenticated_url_shorthand(self): - url = cloud_worker.build_authenticated_git_url("my-org/my-repo", "test_tok") - self.assertEqual(url, "https://x-access-token:test_tok@github.com/my-org/my-repo.git") - - -class TestArtifactDiscovery(unittest.TestCase): - def setUp(self): - self.temp_dir = tempfile.TemporaryDirectory() - self.repo_dir = Path(self.temp_dir.name) - - def tearDown(self): - self.temp_dir.cleanup() - - @patch("storage_uploader.upload_to_gcs") - def test_upload_run_artifacts_all_files(self, mock_upload): - mock_upload.return_value = True - - score_file = self.repo_dir / "score.json" - score_file.write_text('{"score": 0.85, "geomean_fill_ratio": 0.92}', encoding="utf-8") - - tsv_file = self.repo_dir / "results.tsv" - tsv_file.write_text("id\tmetric\n1\t0.9\n", encoding="utf-8") - - diff_file = self.repo_dir / "patch.diff" - diff_file.write_text("--- a/foo\n+++ b/foo\n@@ -1 +1 @@\n-old\n+new\n", encoding="utf-8") - - results = storage_uploader.upload_run_artifacts( - bucket_name="test-bucket", - prefix="runs/experiment-1", - repo_dir=self.repo_dir, - task_index=3, - status="PASS", - ) - - self.assertIn("score.json", results) - self.assertIn("results.tsv", results) - self.assertIn("patch.diff", results) - self.assertEqual(results["score.json"], "gs://test-bucket/runs/experiment-1/task-3/score.json") - self.assertEqual(results["results.tsv"], "gs://test-bucket/runs/experiment-1/task-3/results.tsv") - self.assertEqual(results["patch.diff"], "gs://test-bucket/runs/experiment-1/task-3/patch.diff") - - @patch("storage_uploader.upload_to_gcs") - def test_upload_run_artifacts_empty_prefix(self, mock_upload): - mock_upload.return_value = True - - score_file = self.repo_dir / "score.json" - score_file.write_text('{"score": 0.85}', encoding="utf-8") - - results = storage_uploader.upload_run_artifacts( - bucket_name="test-bucket", - prefix="", - repo_dir=self.repo_dir, - task_index=0, - ) - - self.assertEqual(results["score.json"], "gs://test-bucket/task-0/score.json") - - @patch("storage_uploader.upload_to_gcs") - @patch("storage_uploader._generate_git_patch") - def test_upload_run_artifacts_generates_patch(self, mock_gen_patch, mock_upload): - mock_upload.return_value = True - mock_gen_patch.return_value = "diff --git a/test b/test\n+new line" - - score_file = self.repo_dir / "score.json" - score_file.write_text('{"score": 0.9}', encoding="utf-8") - - results = storage_uploader.upload_run_artifacts( - bucket_name="test-bucket", - prefix="test-prefix", - repo_dir=self.repo_dir, - task_index=1, - status="PASS", - ) - - self.assertIn("patch.diff", results) - self.assertTrue((self.repo_dir / "patch.diff").is_file()) - self.assertEqual( - (self.repo_dir / "patch.diff").read_text(encoding="utf-8"), "diff --git a/test b/test\n+new line" - ) - - -class TestGCSUploadFallback(unittest.TestCase): - def setUp(self): - self.prev_local = os.environ.pop("STORAGE_MESSENGER_LOCAL_DIR", None) - self.temp_dir = tempfile.TemporaryDirectory() - self.test_file = Path(self.temp_dir.name) / "sample.txt" - self.test_file.write_text("test artifact payload", encoding="utf-8") - - def tearDown(self): - self.temp_dir.cleanup() - if self.prev_local is not None: - os.environ["STORAGE_MESSENGER_LOCAL_DIR"] = self.prev_local - - def test_upload_to_gcs_nonexistent_file(self): - missing = Path(self.temp_dir.name) / "does_not_exist.txt" - self.assertFalse(storage_uploader.upload_to_gcs("bkt", "obj", missing)) - - @patch("urllib.request.urlopen") - @patch("storage_uploader.get_oauth_token") - def test_upload_to_gcs_rest_api_fallback(self, mock_token, mock_urlopen): - mock_token.return_value = "mock_bearer_token" - mock_resp = MagicMock() - mock_resp.status = 200 - mock_resp.__enter__.return_value = mock_resp - mock_urlopen.return_value = mock_resp - - with patch.dict(sys.modules, {"google.cloud": None, "google.cloud.storage": None}): - res = storage_uploader.upload_to_gcs("my-bucket", "artifacts/sample.txt", self.test_file) - self.assertTrue(res) - - req = mock_urlopen.call_args[0][0] - self.assertIn("https://storage.googleapis.com/upload/storage/v1/b/my-bucket/o", req.full_url) - self.assertEqual(req.headers.get("Authorization"), "Bearer mock_bearer_token") - - @patch("urllib.request.urlopen") - def test_get_oauth_token_from_metadata(self, mock_urlopen): - mock_resp = MagicMock() - mock_resp.status = 200 - mock_resp.read.return_value = json.dumps({"access_token": "metadata_token_123"}).encode("utf-8") - mock_resp.__enter__.return_value = mock_resp - mock_urlopen.return_value = mock_resp - - with patch.dict(os.environ, {}, clear=True): - token = storage_uploader.get_oauth_token() - self.assertEqual(token, "metadata_token_123") - - @patch("storage_uploader.get_oauth_token") - def test_upload_to_gcs_no_token_failure(self, mock_token): - mock_token.return_value = None - with patch.dict(sys.modules, {"google.cloud": None, "google.cloud.storage": None}): - res = storage_uploader.upload_to_gcs("my-bucket", "obj.txt", self.test_file) - self.assertFalse(res) - - -class TestScoreParsing(unittest.TestCase): - def setUp(self): - self.temp_dir = tempfile.TemporaryDirectory() - self.repo_dir = Path(self.temp_dir.name) - - def tearDown(self): - self.temp_dir.cleanup() - - def test_parse_score_metrics_flat(self): - score_file = self.repo_dir / "score.json" - score_file.write_text( - json.dumps({"score": 0.8123, "accuracy": 0.9412, "latency_ms": 12.5}), - encoding="utf-8", - ) - - score, accuracy, latency_ms = cloud_worker.parse_score_metrics(self.repo_dir) - self.assertAlmostEqual(score, 0.8123) - self.assertAlmostEqual(accuracy, 0.9412) - self.assertAlmostEqual(latency_ms, 12.5) - - def test_parse_score_metrics_nested(self): - score_file = self.repo_dir / "score.json" - data = { - "score": 0.844936, - "metrics": { - "accuracy": 0.944537, - "latency_ms": 15.2, - }, - } - score_file.write_text(json.dumps(data), encoding="utf-8") - - score, accuracy, latency_ms = cloud_worker.parse_score_metrics(self.repo_dir) - self.assertAlmostEqual(score, 0.844936) - self.assertAlmostEqual(accuracy, 0.944537) - self.assertAlmostEqual(latency_ms, 15.2) - - def test_parse_score_metrics_missing(self): - score, accuracy, latency_ms = cloud_worker.parse_score_metrics(self.repo_dir) - self.assertIsNone(score) - self.assertIsNone(accuracy) - self.assertIsNone(latency_ms) - - -class TestEvidenceCredentialSafeguards(unittest.TestCase): - def setUp(self): - self.temp_dir = tempfile.TemporaryDirectory() - self.repo_dir = Path(self.temp_dir.name) - subprocess.run(["git", "init"], cwd=self.repo_dir, capture_output=True, check=True) - subprocess.run(["git", "config", "user.name", "Tester"], cwd=self.repo_dir, capture_output=True, check=True) - subprocess.run( - ["git", "config", "user.email", "test@test.local"], cwd=self.repo_dir, capture_output=True, check=True - ) - (self.repo_dir / "app.py").write_text("print('hello')\n", encoding="utf-8") - subprocess.run(["git", "add", "app.py"], cwd=self.repo_dir, capture_output=True, check=True) - subprocess.run(["git", "commit", "-m", "init"], cwd=self.repo_dir, capture_output=True, check=True) - - def tearDown(self): - self.temp_dir.cleanup() - - @patch("storage_uploader.upload_to_gcs") - def test_evidence_with_credentials_rejected_and_degrades_pass(self, mock_upload): - uploaded_payloads = {} - - def spy_upload(bucket, obj, path): - uploaded_payloads[obj] = Path(path).read_bytes() - return True - - mock_upload.side_effect = spy_upload - - safe_file = self.repo_dir / "safe.txt" - safe_bytes = b"safe measurement: 42\n" - safe_file.write_bytes(safe_bytes) - - evidence_file = self.repo_dir / "proof.txt" - secret_token = "ghp_" + "a" * 36 - cred_bytes = f"run log with sensitive token: {secret_token}\n".encode("utf-8") - evidence_file.write_bytes(cred_bytes) - - results = storage_uploader.upload_run_artifacts( - bucket_name="test-bucket", - prefix="runs/exp1", - repo_dir=self.repo_dir, - task_index=0, - status="PASS", - evidence_files=["safe.txt", "proof.txt"], - ) - - self.assertEqual(safe_file.read_bytes(), safe_bytes) - self.assertEqual(evidence_file.read_bytes(), cred_bytes) - self.assertNotIn("evidence/proof.txt", results) - self.assertIn("evidence/safe.txt", results) - self.assertEqual( - uploaded_payloads.get("runs/exp1/task-0/evidence/safe.txt"), - safe_bytes, - ) - - secret_bytes = secret_token.encode("utf-8") - for obj, payload in uploaded_payloads.items(): - self.assertNotIn( - secret_bytes, - payload, - f"Synthetic secret leaked in outbound upload for {obj}", - ) - - status_file = self.repo_dir / "status.json" - self.assertTrue(status_file.is_file()) - status_data = json.loads(status_file.read_text(encoding="utf-8")) - self.assertEqual(status_data["status"], "ISSUES") - self.assertIn("credentials", status_data.get("evidence", "")) - - @patch("storage_uploader.upload_to_gcs") - def test_sensitive_filenames_rejected(self, mock_upload): - mock_upload.return_value = True - - sensitive_names = [ - ".env", - "server.pem", - "private.key", - "id_rsa", - "id_ed25519", - "credentials.json", - "token.json", - ] - for name in sensitive_names: - file_path = self.repo_dir / name - file_path.write_text("dummy sensitive data\n", encoding="utf-8") - self.assertTrue( - storage_uploader.is_sensitive_path(file_path, self.repo_dir), - f"{name} should be recognized as sensitive path", - ) - - # Also verify symlink is recognized as sensitive path - target_file = self.repo_dir / "target.txt" - target_file.write_text("target", encoding="utf-8") - symlink_file = self.repo_dir / "symlink_file.txt" - symlink_file.symlink_to(target_file) - self.assertTrue( - storage_uploader.is_sensitive_path(symlink_file, self.repo_dir), - "Symlink should be recognized as sensitive path", - ) - - # When passed as evidence_files, all sensitive files must be rejected and status degraded - results = storage_uploader.upload_run_artifacts( - bucket_name="test-bucket", - prefix="runs/exp1", - repo_dir=self.repo_dir, - task_index=0, - status="PASS", - evidence_files=sensitive_names + ["symlink_file.txt"], - ) - - for name in sensitive_names: - self.assertNotIn(f"evidence/{name}", results) - self.assertNotIn("evidence/symlink_file.txt", results) - - status_file = self.repo_dir / "status.json" - status_data = json.loads(status_file.read_text(encoding="utf-8")) - self.assertEqual(status_data["status"], "ISSUES") - - @patch("storage_uploader.upload_to_gcs", return_value=True) - def test_sensitive_directory_symlink_rejected_and_degrades_pass(self, mock_upload): - external = self.repo_dir.parent / "external_sensitive" - external.mkdir(exist_ok=True) - (external / "leak.log").write_text("secret") - - for location in ["evidence", "diagnostics"]: - with self.subTest(location=location): - status_file = self.repo_dir / "status.json" - if status_file.exists(): - status_file.unlink() - - evidence_files = [] - if location == "evidence": - ev_dir = self.repo_dir / "ev_tree" - ev_dir.mkdir(exist_ok=True) - (ev_dir / "safe.txt").write_text("admitted bytes") - (ev_dir / "sym_dir").symlink_to(external) - evidence_files = ["ev_tree"] - else: - diag_dir = self.repo_dir / ".agystack/diagnostics" - diag_dir.parent.mkdir(parents=True, exist_ok=True) - diag_dir.symlink_to(external) - - artifacts = storage_uploader.upload_run_artifacts( - "bucket", - "run", - self.repo_dir, - 0, - status="PASS", - evidence_files=evidence_files, - ) - self.assertNotIn("evidence/ev_tree/sym_dir/leak.log", artifacts) - self.assertNotIn("evidence/.agystack/diagnostics/leak.log", artifacts) - status_data = json.loads(status_file.read_text(encoding="utf-8")) - self.assertEqual(status_data["status"], "ISSUES") - self.assertTrue(status_data.get("delivery_errors")) - self.assertEqual((external / "leak.log").read_text(), "secret") - if location == "evidence": - self.assertEqual((self.repo_dir / "ev_tree/safe.txt").read_text(), "admitted bytes") - self.assertIn("evidence/ev_tree/safe.txt", artifacts) - (self.repo_dir / "ev_tree/sym_dir").unlink() - (self.repo_dir / "ev_tree/safe.txt").unlink() - (self.repo_dir / "ev_tree").rmdir() - else: - (self.repo_dir / ".agystack/diagnostics").unlink() - - @patch("storage_uploader.upload_to_gcs", return_value=True) - @patch("storage_uploader._generate_git_patch", return_value="replacement patch") - def test_patch_symlink_rejected_before_regeneration(self, mock_generate, mock_upload): - target = self.repo_dir / "untouched.txt" - target.write_bytes(b"original bytes") - for status, name in [("PASS", "patch.diff"), ("ISSUES", "partial.patch.diff")]: - with self.subTest(status=status): - sym_path = self.repo_dir / name - sym_path.symlink_to(target) - artifacts = storage_uploader.upload_run_artifacts( - "bucket", - "run", - self.repo_dir, - 0, - status, - ["app.py"], - ) - self.assertEqual(target.read_bytes(), b"original bytes") - self.assertNotIn(name, artifacts) - self.assertEqual(json.loads((self.repo_dir / "status.json").read_text())["status"], "ISSUES") - sym_path.unlink() - mock_generate.assert_not_called() - - @patch("storage_uploader.upload_to_gcs") - def test_failed_score_or_results_upload_degrades_pass_to_issues(self, mock_upload): - score_file = self.repo_dir / "score.json" - score_file.write_text(json.dumps({"score": 0.95}), encoding="utf-8") - - tsv_file = self.repo_dir / "results.tsv" - tsv_file.write_text("metric\tvalue\nscore\t0.95\n", encoding="utf-8") - - # 1. Test score.json upload failure - def fail_score_upload(bkt, dest, path): - if "score.json" in str(dest): - return False - return True - - mock_upload.side_effect = fail_score_upload - - results = storage_uploader.upload_run_artifacts( - bucket_name="test-bucket", - prefix="runs/exp1", - repo_dir=self.repo_dir, - task_index=0, - status="PASS", - ) - - self.assertNotIn("score.json", results) - status_file = self.repo_dir / "status.json" - status_data = json.loads(status_file.read_text(encoding="utf-8")) - self.assertEqual(status_data["status"], "ISSUES") - self.assertIn("score.json upload failed", status_data.get("evidence", "")) - - # 2. Test results.tsv upload failure - def fail_results_upload(bkt, dest, path): - if "results.tsv" in str(dest): - return False - return True - - mock_upload.side_effect = fail_results_upload - - results = storage_uploader.upload_run_artifacts( - bucket_name="test-bucket", - prefix="runs/exp1", - repo_dir=self.repo_dir, - task_index=0, - status="PASS", - ) - - self.assertNotIn("results.tsv", results) - status_data = json.loads(status_file.read_text(encoding="utf-8")) - self.assertEqual(status_data["status"], "ISSUES") - self.assertIn("results.tsv upload failed", status_data.get("evidence", "")) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_swarm_dashboard_generation.py b/tests/test_swarm_dashboard_generation.py deleted file mode 100644 index 945cc13..0000000 --- a/tests/test_swarm_dashboard_generation.py +++ /dev/null @@ -1,562 +0,0 @@ -#!/usr/bin/env python3 -import json -import os -import shutil -import sys -import tempfile -import time -import unittest -from pathlib import Path -from unittest.mock import MagicMock, patch - -sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "skills" / "swarm" / "scripts")) - -import swarm_dashboard -from cloud_dispatch import ( - SwarmDashboardWriter, - TaskDashboardState, - colorize, - format_cloud_logging_url, - format_cloud_run_execution_url, - format_cloud_run_url, - format_elapsed_time, - format_gcs_console_url, - format_gcs_url, - format_log_viewer_url, - format_monitored_line, - format_status_badge, - format_tool_snippet, -) - - -class TestSwarmDashboardGeneration(unittest.TestCase): - def setUp(self): - self.temp_dir = Path(tempfile.mkdtemp()).resolve() - self.app_data_dir = self.temp_dir / "antigravity" - self.session_id = f"test-sess-{int(time.time() * 1000)}" - self._orig_env = os.environ.copy() - os.environ.pop("CONVERSATION_ID", None) - os.environ.pop("ANTIGRAVITY_CONVERSATION_ID", None) - - def tearDown(self): - os.environ.clear() - os.environ.update(self._orig_env) - shutil.rmtree(self.temp_dir, ignore_errors=True) - - def test_initial_pending_table_rendering_all_tasks_queued(self): - task_count = 4 - writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=task_count, - model="gemini-3.8-flash", - ) - dashboard_file = writer.write() - - self.assertTrue(dashboard_file.is_file()) - self.assertEqual(dashboard_file, self.app_data_dir / "brain" / self.session_id / "swarm_dashboard.md") - - content = dashboard_file.read_text(encoding="utf-8") - - self.assertIn("| Task Index | Model | Active Phase / Tool | Elapsed Time | Status Badge | Conversation Deep Link |", content) - self.assertIn("**Total Tasks:** 4", content) - self.assertIn("**Queued:** 4", content) - self.assertIn("**Running:** 0", content) - - for i in range(task_count): - self.assertEqual(writer.get_task_status(i), "Queued") - self.assertEqual(writer.get_task_badge(i), "⏳ Queued") - expected_conv_url = f"conversation://cloud-{self.session_id}-task-{i}" - self.assertIn(f"| {i} | gemini-3.8-flash | - | 0s | ⏳ Queued | [{expected_conv_url}]({expected_conv_url}) |", content) - - def test_phase_transition_to_running_agent_changing_status_badge(self): - writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=2, - model="gemini-3.8-flash", - ) - writer.write() - - milestone_line = "[MILESTONE] [TASK 0] [PHASE: RUNNING_AGENT] Initializing subagent loop" - processed = writer.process_log_line(milestone_line) - self.assertTrue(processed) - - self.assertEqual(writer.get_task_status(0), "Running") - self.assertEqual(writer.get_task_badge(0), "🔄 Running") - self.assertEqual(writer.get_task_status(1), "Queued") - self.assertEqual(writer.get_task_badge(1), "⏳ Queued") - - content = writer.render() - self.assertIn("| 0 | gemini-3.8-flash | RUNNING_AGENT |", content) - self.assertIn("🔄 Running", content) - self.assertIn("| 1 | gemini-3.8-flash | - | 0s | ⏳ Queued |", content) - - def test_active_tool_name_and_arguments_snippet_updating_in_real_time(self): - writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=2, - model="gemini-3.8-flash", - ) - writer.update_task_phase(0, "RUNNING_AGENT") - - telemetry_line = ( - f'[TELEMETRY] [TASK 0] {{"timestamp": {time.time()}, "event": "tool_call", ' - f'"tool_name": "run_command", "args": {{"CommandLine": "cargo test --release", "timeout": 300}}}}' - ) - processed = writer.process_log_line(telemetry_line) - self.assertTrue(processed) - - content = writer.render() - self.assertIn("run_command(CommandLine='cargo test --release')", content) - self.assertIn("🔄 Running", content) - - # Test edge case with pipes and newlines to ensure markdown table structure is preserved - writer.update_task_tool( - 0, - tool_name="view_file", - args={"AbsolutePath": "/tmp/test|file\nname.py", "StartLine": 1}, - ) - content_sanitized = writer.render() - self.assertNotIn("\nname.py", content_sanitized.splitlines()[8]) # Check table row line does not break - self.assertIn("view_file", content_sanitized) - self.assertIn("\\|", content_sanitized) - - def test_elapsed_timer_column_incrementing_accurately(self): - writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=1, - model="gemini-3.8-flash", - ) - writer.update_task_phase(0, "RUNNING_AGENT") - state = writer.get_task_state(0) - self.assertIsNotNone(state) - t0 = 1000.0 - state.start_time = t0 - - content_15s = writer.render(now=t0 + 15.0) - self.assertIn("| 0 | gemini-3.8-flash | RUNNING_AGENT | 15s | 🔄 Running |", content_15s) - - content_75s = writer.render(now=t0 + 75.0) - self.assertIn("| 0 | gemini-3.8-flash | RUNNING_AGENT | 1m 15s | 🔄 Running |", content_75s) - - content_3665s = writer.render(now=t0 + 3665.0) - self.assertIn("| 0 | gemini-3.8-flash | RUNNING_AGENT | 1h 01m 05s | 🔄 Running |", content_3665s) - - def test_green_pass_badge_on_task_completion(self): - writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=1, - model="gemini-3.8-flash", - ) - writer.update_task_phase(0, "RUNNING_AGENT") - - status_line = "[TASK 0] [STATUS: PASS] All 42 tests verified successfully." - processed = writer.process_log_line(status_line) - self.assertTrue(processed) - - self.assertEqual(writer.get_task_status(0), "PASS") - self.assertEqual(writer.get_task_badge(0), "🟢 PASS") - - content = writer.render() - self.assertIn("🟢 PASS", content) - self.assertIn("**PASS:** 1", content) - - state = writer.get_task_state(0) - self.assertIsNotNone(state.end_time) - - def test_warning_issues_badge_on_test_failure(self): - writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=2, - model="gemini-3.8-flash", - ) - writer.update_task_phase(0, "RUNNING_AGENT") - writer.update_task_phase(1, "RUNNING_AGENT") - - issues_line = "[TASK 0] [STATUS: ISSUES] 2 assertions failed in test_suite.py" - processed_issues = writer.process_log_line(issues_line) - self.assertTrue(processed_issues) - self.assertEqual(writer.get_task_status(0), "ISSUES") - self.assertEqual(writer.get_task_badge(0), "⚠️ ISSUES") - - blocked_line = "[TASK 1] [STATUS: BLOCKED] Git authentication failure." - processed_blocked = writer.process_log_line(blocked_line) - self.assertTrue(processed_blocked) - self.assertEqual(writer.get_task_status(1), "BLOCKED") - self.assertEqual(writer.get_task_badge(1), "🔴 BLOCKED") - - content = writer.render() - self.assertIn("⚠️ ISSUES", content) - self.assertIn("🔴 BLOCKED", content) - self.assertIn("**ISSUES:** 1", content) - self.assertIn("**BLOCKED:** 1", content) - - def test_cloud_run_execution_console_link_formatting(self): - exec_name = "swarm-job-exec-456" - project_id = "test-gcp-project" - region = "us-central1" - - url = format_cloud_run_execution_url( - execution_name=exec_name, - project=project_id, - region=region, - ) - expected = f"https://console.cloud.google.com/run/jobs/executions/details/{region}/{exec_name}?project={project_id}" - self.assertEqual(url, expected) - - writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=1, - project=project_id, - region=region, - execution_name=exec_name, - ) - content = writer.render() - self.assertIn(f"[{exec_name}]({expected})", content) - - def test_prefiltered_cloud_logging_console_link_formatting(self): - exec_name = "swarm-job-exec-789" - project_id = "test-gcp-project" - - url = format_cloud_logging_url( - execution_name=exec_name, - project=project_id, - ) - self.assertTrue(url.startswith("https://console.cloud.google.com/logs/query;query=")) - self.assertIn(f"?project={project_id}", url) - self.assertIn("run.googleapis.com", url) - self.assertIn("swarm-job-exec-789", url) - - writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=1, - project=project_id, - execution_name=exec_name, - ) - content = writer.render() - self.assertIn(f"[Pre-filtered Logs]({url})", content) - - def test_gcs_artifact_folder_console_link_formatting(self): - bucket_name = "swarm-artifacts-bucket" - session_id = "session-20261021-alpha" - project_id = "test-gcp-project" - - url = format_gcs_console_url( - bucket=bucket_name, - prefix=f"swarms/{session_id}", - project=project_id, - ) - expected = f"https://console.cloud.google.com/storage/browser/{bucket_name}/swarms/{session_id}?project={project_id}" - self.assertEqual(url, expected) - - # Test resilient strip of gs:// prefix - url_with_gs = format_gcs_console_url( - bucket=f"gs://{bucket_name}", - prefix=f"gs://{bucket_name}/swarms/{session_id}", - project=project_id, - ) - self.assertEqual(url_with_gs, expected) - - writer = SwarmDashboardWriter( - session_id=session_id, - app_data_dir=self.app_data_dir, - task_count=1, - project=project_id, - gcs_bucket=bucket_name, - ) - content = writer.render() - self.assertIn(f"[gs://{bucket_name}/swarms/{session_id}]({expected})", content) - - def test_atomic_write_replacement_prevents_partial_reads(self): - writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=3, - model="gemini-3.8-flash", - ) - target_path = writer.dashboard_path - - replace_calls = [] - original_replace = os.replace - - def spy_replace(src, dst): - # Verify src is a temporary file in the target directory - self.assertTrue(Path(src).parent == Path(dst).parent) - self.assertTrue(Path(src).name.startswith(".swarm_dashboard_")) - self.assertTrue(Path(src).is_file()) - # Content in temp file must be complete valid markdown - temp_content = Path(src).read_text(encoding="utf-8") - self.assertIn("| Task Index | Model |", temp_content) - replace_calls.append((src, dst)) - return original_replace(src, dst) - - with patch("os.replace", side_effect=spy_replace): - result_file = writer.write() - - self.assertEqual(len(replace_calls), 1) - self.assertEqual(Path(result_file), target_path) - self.assertTrue(target_path.is_file()) - - # Second write: verify atomic replacement over existing file - writer.update_task_phase(0, "RUNNING_AGENT") - with patch("os.replace", side_effect=spy_replace): - writer.write() - - self.assertEqual(len(replace_calls), 2) - final_content = target_path.read_text(encoding="utf-8") - self.assertIn("RUNNING_AGENT", final_content) - - def test_dashboard_write_performance_benchmark(self): - task_count = 32 - writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=task_count, - model="gemini-3.8-flash", - project="test-proj", - region="us-central1", - execution_name="benchmark-exec", - gcs_bucket="benchmark-bucket", - ) - - for i in range(task_count): - if i % 4 == 0: - writer.update_task_phase(i, "RUNNING_AGENT") - writer.update_task_tool(i, "run_command", {"CommandLine": f"test_worker_{i}.sh"}) - elif i % 4 == 1: - writer.update_task_status(i, "PASS") - elif i % 4 == 2: - writer.update_task_status(i, "ISSUES") - else: - pass - - iterations = 20 - durations = [] - for _ in range(iterations): - t_start = time.perf_counter() - writer.write() - durations.append(time.perf_counter() - t_start) - - avg_duration_ms = (sum(durations) / len(durations)) * 1000.0 - max_duration_ms = max(durations) * 1000.0 - - # Overhead must be bounded <= 25 milliseconds across 32 tasks (baseline 5ms) - self.assertLessEqual( - avg_duration_ms, - 25.0, - f"Average dashboard write latency ({avg_duration_ms:.2f}ms) exceeded 25ms SLA.", - ) - self.assertLessEqual( - max_duration_ms, - 50.0, - f"Max dashboard write latency ({max_duration_ms:.2f}ms) exceeded 50ms spike limit.", - ) - - def test_reexported_symbols_match_between_modules(self): - import cloud_dispatch - - self.assertIs(cloud_dispatch.SwarmDashboardWriter, swarm_dashboard.SwarmDashboardWriter) - self.assertIs(cloud_dispatch.TaskDashboardState, swarm_dashboard.TaskDashboardState) - self.assertIs(cloud_dispatch.format_status_badge, swarm_dashboard.format_status_badge) - self.assertIs(cloud_dispatch.format_elapsed_time, swarm_dashboard.format_elapsed_time) - self.assertIs(cloud_dispatch.format_tool_snippet, swarm_dashboard.format_tool_snippet) - self.assertIs(cloud_dispatch.format_cloud_run_execution_url, swarm_dashboard.format_cloud_run_execution_url) - self.assertIs(cloud_dispatch.format_cloud_logging_url, swarm_dashboard.format_cloud_logging_url) - self.assertIs(cloud_dispatch.format_gcs_console_url, swarm_dashboard.format_gcs_console_url) - self.assertIs(cloud_dispatch.format_monitored_line, swarm_dashboard.format_monitored_line) - self.assertIs(cloud_dispatch.colorize, swarm_dashboard.colorize) - self.assertIs(cloud_dispatch.format_cloud_run_url, swarm_dashboard.format_cloud_run_url) - self.assertIs(cloud_dispatch.format_gcs_url, swarm_dashboard.format_gcs_url) - self.assertIs(cloud_dispatch.format_log_viewer_url, swarm_dashboard.format_log_viewer_url) - - def test_conversation_id_resolution_precedence(self): - # 1. Explicit argument takes top priority over environment variables and session_id - with patch.dict(os.environ, {"CONVERSATION_ID": "env-conv-123", "ANTIGRAVITY_CONVERSATION_ID": "antigravity-conv-456"}): - writer = SwarmDashboardWriter( - session_id=self.session_id, - conversation_id="explicit-conv-999", - app_data_dir=self.app_data_dir, - ) - self.assertEqual(writer.conversation_id, "explicit-conv-999") - self.assertEqual(writer.dashboard_path, self.app_data_dir / "brain" / "explicit-conv-999" / "swarm_dashboard.md") - - # 2. CONVERSATION_ID from environment takes precedence over session_id - with patch.dict(os.environ, {"CONVERSATION_ID": "env-conv-123"}): - os.environ.pop("ANTIGRAVITY_CONVERSATION_ID", None) - writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - ) - self.assertEqual(writer.conversation_id, "env-conv-123") - self.assertEqual(writer.dashboard_path, self.app_data_dir / "brain" / "env-conv-123" / "swarm_dashboard.md") - - # 3. ANTIGRAVITY_CONVERSATION_ID takes precedence when CONVERSATION_ID is unset - with patch.dict(os.environ, {"ANTIGRAVITY_CONVERSATION_ID": "antigravity-conv-456"}): - os.environ.pop("CONVERSATION_ID", None) - writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - ) - self.assertEqual(writer.conversation_id, "antigravity-conv-456") - self.assertEqual(writer.dashboard_path, self.app_data_dir / "brain" / "antigravity-conv-456" / "swarm_dashboard.md") - - # 4. Fallback to session_id when no environment variables or explicit argument are set - os.environ.pop("CONVERSATION_ID", None) - os.environ.pop("ANTIGRAVITY_CONVERSATION_ID", None) - writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - ) - self.assertEqual(writer.conversation_id, self.session_id) - self.assertEqual(writer.dashboard_path, self.app_data_dir / "brain" / self.session_id / "swarm_dashboard.md") - - # 5. Empty session_id falls back to "default" - writer_default = SwarmDashboardWriter( - session_id="", - app_data_dir=self.app_data_dir, - ) - self.assertEqual(writer_default.conversation_id, "default") - - def test_storage_url_formatting_uses_swarms_prefix(self): - bucket = "my-test-bucket" - sess = "sess-20261021" - - # Default prefix format in SwarmDashboardWriter uses swarms/ - writer = SwarmDashboardWriter( - session_id=sess, - app_data_dir=self.app_data_dir, - gcs_bucket=bucket, - ) - expected_url = f"https://console.cloud.google.com/storage/browser/{bucket}/swarms/{sess}" - self.assertEqual(writer.format_gcs_console_url(), expected_url) - - # Legacy prefix starting with swarm- is normalized to swarms/ - legacy_url = format_gcs_console_url(bucket=bucket, prefix=f"swarm-{sess}") - self.assertEqual(legacy_url, expected_url) - self.assertNotIn("swarm-", legacy_url) - - # Legacy prefix starting with swarm/ is normalized to swarms/ - slash_url = format_gcs_console_url(bucket=bucket, prefix=f"swarm/{sess}") - self.assertEqual(slash_url, expected_url) - - # Task subpath formatting - task_url = format_gcs_console_url(bucket=bucket, prefix=f"swarms/{sess}/tasks/task-3") - self.assertEqual(task_url, f"https://console.cloud.google.com/storage/browser/{bucket}/swarms/{sess}/tasks/task-3") - - # format_gcs_url alias behaves identically - alias_url = format_gcs_url(bucket=bucket, prefix=f"swarms/{sess}") - self.assertEqual(alias_url, expected_url) - - def test_log_monitoring_timestamp_cursor_pagination_past_1000_entries(self): - from cloud_dispatch import monitor_execution - - dashboard_writer = SwarmDashboardWriter( - session_id=self.session_id, - app_data_dir=self.app_data_dir, - task_count=1, - ) - - poll_count = 0 - logged_commands = [] - - # Generate 1,000 entries for batch 1 - batch_1_entries = [] - for i in range(1000): - ts = f"2026-10-21T18:00:00.{i:06d}Z" - batch_1_entries.append({ - "insertId": f"log-id-{i}", - "timestamp": ts, - "textPayload": f"[MILESTONE] [TASK 0] [PHASE: RUNNING_AGENT] Step {i}", - }) - - # Generate 200 entries for batch 2 - batch_2_entries = [] - for i in range(1000, 1200): - ts = f"2026-10-21T18:00:01.{i - 1000:06d}Z" - batch_2_entries.append({ - "insertId": f"log-id-{i}", - "timestamp": ts, - "textPayload": f"[MILESTONE] [TASK 0] [PHASE: RUNNING_AGENT] Step {i}", - }) - # Add a duplicate from batch 1 to verify deduplication - batch_2_entries.append(batch_1_entries[0]) - - def fake_subprocess_run(cmd, capture_output=True, text=True, check=False): - nonlocal poll_count - cmd_str = " ".join(cmd) - logged_commands.append(cmd) - - if "executions describe" in cmd_str: - poll_count += 1 - if poll_count == 1: - return MagicMock( - returncode=0, - stdout=json.dumps({ - "status": { - "runningCount": 1, - "succeededCount": 0, - "failedCount": 0, - "conditions": [{"type": "Completed", "status": "Unknown"}], - } - }), - ) - else: - return MagicMock( - returncode=0, - stdout=json.dumps({ - "status": { - "runningCount": 0, - "succeededCount": 1, - "failedCount": 0, - "conditions": [{"type": "Completed", "status": "True"}], - } - }), - ) - - if "logging read" in cmd_str: - if poll_count == 1: - return MagicMock(returncode=0, stdout=json.dumps(batch_1_entries)) - else: - return MagicMock(returncode=0, stdout=json.dumps(batch_2_entries)) - - return MagicMock(returncode=0, stdout="") - - with patch("subprocess.run", side_effect=fake_subprocess_run): - with patch("time.sleep", return_value=None): - result = monitor_execution( - execution_name="exec-cursor-test", - project="test-proj", - region="us-central1", - task_count=1, - poll_interval=0.01, - timeout=10.0, - session_id=self.session_id, - dashboard_writer=dashboard_writer, - ) - - self.assertTrue(result.succeeded) - - # Inspect the logging read commands across batches - log_read_cmds = [ - c for c in logged_commands - if len(c) > 2 and c[0] == "gcloud" and c[1] == "logging" and c[2] == "read" - ] - self.assertGreaterEqual(len(log_read_cmds), 2) - - # First read command has no cursor - self.assertNotIn("timestamp >", log_read_cmds[0][3]) - - # Second read command must have the timestamp cursor from the latest timestamp in batch 1 - expected_cursor = 'timestamp > "2026-10-21T18:00:00.000999Z"' - self.assertIn(expected_cursor, log_read_cmds[1][3]) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_swarm_generic.py b/tests/test_swarm_generic.py deleted file mode 100644 index 96edf3c..0000000 --- a/tests/test_swarm_generic.py +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env python3 -import math -import sys -import unittest -from pathlib import Path - -SWARM_SCRIPTS_DIR = Path(__file__).resolve().parent.parent / "skills" / "swarm" / "scripts" -if not SWARM_SCRIPTS_DIR.exists(): - SWARM_SCRIPTS_DIR = Path.home() / ".gemini" / "config" / "plugins" / "agystack" / "skills" / "swarm" / "scripts" - -sys.path.insert(0, str(SWARM_SCRIPTS_DIR)) - -from manifest_generator import ( - generate_parameter_sweep, - generate_range_slices, - generate_seed_lottery, -) -from result_harvester import extract_pareto_frontier - - -class TestSwarmGenericManifest(unittest.TestCase): - def test_range_slices_exact_coverage(self): - slices = generate_range_slices(total_items=100, num_slices=10, item_label="record") - self.assertEqual(len(slices), 10) - - offset = 0 - for i, s in enumerate(slices): - self.assertEqual(s["slice_id"], f"slice_{i}") - self.assertEqual(s["start_idx"], offset) - self.assertEqual(s["count"], 10) - self.assertEqual(s["end_idx"], offset + 10) - self.assertIn("records from index", s["brief"]) - offset = s["end_idx"] - self.assertEqual(offset, 100) - - def test_range_slices_remainder_distribution(self): - slices = generate_range_slices(total_items=25, num_slices=4) - self.assertEqual(len(slices), 4) - counts = [s["count"] for s in slices] - self.assertEqual(counts, [7, 6, 6, 6]) - self.assertEqual(sum(counts), 25) - - def test_seed_lottery_uniqueness_and_coprimality(self): - seeds_count = 200 - lottery = generate_seed_lottery(seeds_count=seeds_count, base_seed=123, coprime_stride=23) - self.assertEqual(len(lottery), seeds_count) - seeds = [t["seed"] for t in lottery] - self.assertEqual(len(set(seeds)), seeds_count) - - def test_seed_lottery_rejects_non_coprime(self): - with self.assertRaises(ValueError): - generate_seed_lottery(seeds_count=10, coprime_stride=10) - - def test_parameter_sweep_generation(self): - tasks = generate_parameter_sweep( - param_name="threshold", - values=[0.1, 0.2, 0.5], - base_brief="Run calibration", - ) - self.assertEqual(len(tasks), 3) - self.assertEqual(tasks[0]["param_value"], 0.1) - self.assertIn("threshold=0.1", tasks[0]["brief"]) - - -class TestParetoFrontier(unittest.TestCase): - def test_default_maximization(self): - trials = [ - {"id": "A", "score": 10.0, "fill_ratio": 5.0}, - {"id": "B", "score": 8.0, "fill_ratio": 9.0}, - {"id": "C", "score": 12.0, "fill_ratio": 4.0}, - {"id": "D", "score": 7.0, "fill_ratio": 3.0}, - {"id": "E", "score": 12.0, "fill_ratio": 8.0}, - ] - frontier = extract_pareto_frontier(trials, metric_key="score", secondary_key="fill_ratio") - frontier_ids = [t["id"] for t in frontier] - self.assertEqual(frontier_ids, ["E", "B"]) - - def test_minimization_mode(self): - trials = [ - {"id": "A", "score": 10.0, "fill_ratio": 5.0}, - {"id": "B", "score": 8.0, "fill_ratio": 6.0}, - {"id": "C", "score": 12.0, "fill_ratio": 8.0}, - {"id": "D", "score": 8.0, "fill_ratio": 4.0}, - {"id": "E", "score": 7.0, "fill_ratio": 4.5}, - ] - frontier = extract_pareto_frontier( - trials, - metric_key="score", - secondary_key="fill_ratio", - maximize=False, - ) - frontier_ids = [t["id"] for t in frontier] - self.assertEqual(frontier_ids, ["E", "D"]) - - def test_co_optimal_candidate_retention(self): - trials = [ - {"id": "A1", "score": 10.0, "fill_ratio": 5.0}, - {"id": "A2", "score": 10.0, "fill_ratio": 5.0}, - {"id": "B", "score": 8.0, "fill_ratio": 4.0}, - ] - frontier = extract_pareto_frontier(trials) - frontier_ids = [t["id"] for t in frontier] - self.assertEqual(frontier_ids, ["A1", "A2"]) - - frontier_min = extract_pareto_frontier(trials, maximize=False) - frontier_min_ids = [t["id"] for t in frontier_min] - self.assertEqual(frontier_min_ids, ["B"]) - - co_min_trials = [ - {"id": "M1", "score": 2.0, "fill_ratio": 1.0}, - {"id": "M2", "score": 2.0, "fill_ratio": 1.0}, - {"id": "M3", "score": 5.0, "fill_ratio": 3.0}, - ] - frontier_co_min = extract_pareto_frontier(co_min_trials, maximize=False) - frontier_co_min_ids = [t["id"] for t in frontier_co_min] - self.assertEqual(frontier_co_min_ids, ["M1", "M2"]) - - def test_empty_and_single_item_inputs(self): - self.assertEqual(extract_pareto_frontier([]), []) - - single = [{"id": "only", "score": 42.0, "fill_ratio": 0.9}] - self.assertEqual(extract_pareto_frontier(single), single) - - single_min = [{"id": "only", "score": 42.0, "fill_ratio": 0.9}] - self.assertEqual(extract_pareto_frontier(single_min, maximize=False), single_min) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/test_worker_execution_lifecycle.py b/tests/test_worker_execution_lifecycle.py deleted file mode 100644 index e2770de..0000000 --- a/tests/test_worker_execution_lifecycle.py +++ /dev/null @@ -1,569 +0,0 @@ -import json -import os -import shlex -import subprocess -import sys -import time -import types -from pathlib import Path -from types import SimpleNamespace -from unittest.mock import MagicMock, patch - -import pytest - -SCRIPTS = Path(__file__).resolve().parents[1] / "skills/swarm/scripts" -sys.path.insert(0, str(SCRIPTS)) -import cloud_dispatch -import cloud_worker -import result_harvester -import storage_uploader -from worker import partner_engine -from worker.execution import ExecutionLimits, resolve_execution_limits - - -def mock_storage(blobs=()): - storage = MagicMock() - storage.Client.return_value.bucket.return_value.list_blobs.side_effect = lambda prefix="": [ - Blob(k, v) for k, v in (blobs.items() if isinstance(blobs, dict) else blobs) if k.startswith(prefix) - ] - g, gc = types.ModuleType("google"), types.ModuleType("google.cloud") - g.cloud, gc.storage = gc, storage - return storage, {"google": g, "google.cloud": gc, "google.cloud.storage": storage} - - -class Blob: - def __init__(self, name, payload): - self.name = name - self.payload = payload - - def download_to_filename(self, filename): - path = Path(filename) - path.parent.mkdir(parents=True, exist_ok=True) - path.write_text(self.payload, encoding="utf-8") - - -@pytest.mark.parametrize( - "text, expected", - [ - ("Reporting `[STATUS: PASS]` now would be false. The correct status is [STATUS: BLOCKED]", "ISSUES"), - ("Deprecated `[STATUS: PASS]`\n[STATUS: BLOCKED]", "BLOCKED"), - ("Finished.\n[STATUS: PASS]", "PASS"), - ("[STATUS: PASS]\n[STATUS: BLOCKED]", "ISSUES"), - ("[STATUS: PASS]\n[STATUS: PASS]", "ISSUES"), - ("```text\n[STATUS: PASS]\n```", "ISSUES"), - ("~~~\n[STATUS: PASS]\n~~~\n[STATUS: BLOCKED]", "BLOCKED"), - ("> [STATUS: PASS]", "ISSUES"), - ('"[STATUS: PASS]"', "ISSUES"), - ("`[STATUS: PASS]`", "ISSUES"), - ("[STATUS: PASS] trailing prose", "ISSUES"), - ("[STATUS: DEV_IMPROVED]", "ISSUES"), - ("[STATUS: PASS]\nMore prose", "ISSUES"), - ("[STATUS: MAYBE]", "ISSUES"), - ("[status: issues]\n[STATUS: PASS]", "ISSUES"), - ("[STATUS PASS]\n[STATUS: PASS]", "ISSUES"), - (" [STATUS: PASS]", "ISSUES"), - ], -) -def test_strict_terminal_status(text, expected): - for evaluate in (cloud_worker.evaluate_agent_status, partner_engine._evaluate_agent_status): - assert evaluate(text)[0] == expected - - -@pytest.mark.parametrize("bad", [0, -1, True, 1.5, "1.5", "oops", None]) -def test_invalid_execution_limits(bad): - - with pytest.raises(ValueError): - resolve_execution_limits({"max_agent_turns": bad}, environ={}) - - -def test_limits_precedence_and_immutability(): - from dataclasses import FrozenInstanceError - - limits = resolve_execution_limits( - {"verify_timeout_s": 41}, - environ={"AGYSTACK_MAX_AGENT_TURNS": "32", "COMMAND_TIMEOUT": "600"}, - ) - assert (limits.max_agent_turns, limits.command_timeout_s, limits.verify_timeout_s) == (32, 600, 41) - with pytest.raises(FrozenInstanceError): - limits.max_agent_turns = 2 - with pytest.raises(ValueError): - resolve_execution_limits({"unexpected": 5}, environ={}) - with pytest.raises(ValueError): - resolve_execution_limits([], environ={}) - assert resolve_execution_limits(environ={}).command_timeout_s == 300 - assert resolve_execution_limits(environ={}, command_default=900).command_timeout_s == 900 - - -@pytest.mark.parametrize("provider", ["claude", "fable", "deepseek"]) -@pytest.mark.parametrize("finish", [True, False]) -def test_provider_turn_limits_and_final_response(tmp_path, provider, finish): - (tmp_path / "note.txt").write_text("still working") - tool = {"type": "tool_use", "id": "read", "name": "read_file", "input": {"path": "note.txt"}} - responses = [] - for turn in range(33): - final = finish and turn == 32 - text = "Finished.\n[STATUS: PASS]" if final else "[STATUS: PASS]" - if provider == "deepseek": - fc = SimpleNamespace(name="read_file", args={"path": "note.txt"}) - responses.append(SimpleNamespace(text=text, candidates=[], function_calls=[] if final else [fc])) - else: - responses.append(SimpleNamespace(content=[{"type": "text", "text": text}] + ([] if final else [tool]))) - sdk = MagicMock() - if provider == "claude": - request = sdk.AnthropicVertex.return_value.messages.create - entry = partner_engine.execute_claude_model_agent - getter = "_get_anthropic" - elif provider == "fable": - request = sdk.Endpoint.return_value.predict - entry = partner_engine.execute_fable_model_agent - getter = "_get_aiplatform" - else: - request = sdk.Client.return_value.models.generate_content - entry = partner_engine.execute_deepseek_model_agent - getter = "_get_genai" - request.side_effect = responses - with patch.object(partner_engine, getter, return_value=sdk): - status, summary = entry(provider, "work", tmp_path, task_item={"execution_limits": {"max_agent_turns": 33}}) - assert request.call_count == 33 - assert status == ("PASS" if finish else "ISSUES") - if not finish: - assert "limit=33" in summary - assert "consumed=33" in summary - assert "read_file" in summary - assert "last_response" in summary - - -@pytest.mark.parametrize("suffix", ["& wait", "| cat", "&"]) -def test_timeout_keeps_output_and_kills_descendants(tmp_path, suffix): - child = "import os,time; open('child.pid','w').write(str(os.getpid())); time.sleep(2); open('survived', 'w').write('bad')" - command = ( - f"echo partial-output; echo partial-error >&2; {shlex.quote(sys.executable)} -c {shlex.quote(child)} {suffix}" - ) - output = partner_engine.execute_workspace_tool( - "run_command", - {"command": command}, - tmp_path, - limits=ExecutionLimits(command_timeout_s=1), - ) - assert "timed out" in output.lower() - assert "partial-output" in output - assert "partial-error" in output - logs = list((tmp_path / ".agystack/diagnostics").glob("*.log")) - assert logs and "partial-output" in logs[0].read_text() - child_pid = int((tmp_path / "child.pid").read_text()) - time.sleep(1.5) - assert not (tmp_path / "survived").exists() - state = subprocess.run(["ps", "-o", "stat=", "-p", str(child_pid)], capture_output=True, text=True) - assert not state.stdout.strip() or state.stdout.strip().startswith("Z") - - -def test_command_pipeline_failure_is_not_hidden(tmp_path): - status, _ = cloud_worker.execute_task({"type": "command", "command": "false | tail -n 1"}, "", tmp_path, "", "") - assert status == "ISSUES" - - -@pytest.fixture -def worker_repo(tmp_path): - repo = tmp_path / "repo-task-0" - repo.mkdir() - for args in (["init"], ["config", "user.email", "test@example.com"], ["config", "user.name", "Test"]): - subprocess.run(["git", *args], cwd=repo, check=True, capture_output=True) - (repo / "service.py").write_text("value = 1\n") - subprocess.run(["git", "add", "."], cwd=repo, check=True, capture_output=True) - subprocess.run(["git", "commit", "-m", "base"], cwd=repo, check=True, capture_output=True) - return repo - - -@pytest.mark.parametrize( - "status, candidate, verify, fail_status", - [ - ("BLOCKED", True, "exit 1", False), - ("ISSUES", True, "exit 1", False), - ("PASS", False, "exit 1", False), - ("PASS", False, "exit 0", False), - ("PASS", True, "exit 0", False), - ("PASS", True, "exit 1", False), - ("PASS", False, "sleep 2", False), - ("PASS", True, "exit 0", True), - ], -) -def test_worker_finalization_preserves_evidence( - worker_repo, tmp_path, monkeypatch, status, candidate, verify, fail_status, capsys -): - storage = tmp_path / "storage" - task = { - "brief": "work", - "candidate_files": ["service.py"], - "evidence_files": ["results/proof.txt", "nested/domain/oracle/checks.json"], - "verify_command": f"echo verifier-ran > verification.txt; {verify}", - "execution_limits": {"verify_timeout_s": 1}, - } - monkeypatch.setenv("REPO_URL", "https://example.com/repo") - monkeypatch.setenv("TASK_MANIFEST", json.dumps([task])) - monkeypatch.setenv("USE_VERTEX_AI", "1") - monkeypatch.setenv("GCS_BUCKET", "test-bucket") - monkeypatch.setenv("GCS_PREFIX", "run") - monkeypatch.setenv("STORAGE_MESSENGER_LOCAL_DIR", str(storage)) - monkeypatch.chdir(tmp_path) - monkeypatch.setattr(cloud_worker.tempfile, "gettempdir", lambda: str(tmp_path)) - - raw_payload = json.dumps({"status": "verified", "checks": [1, 2, 3], "score": 0.98}, indent=2).encode("utf-8") - - def clone(**kwargs): - repo = kwargs["repo_dir"] - subprocess.run(["git", "init"], cwd=repo, check=True, capture_output=True) - for key, value in [("user.email", "test@example.com"), ("user.name", "Test")]: - subprocess.run(["git", "config", key, value], cwd=repo, check=True) - (repo / "service.py").write_text("value = 1\n") - subprocess.run(["git", "add", "."], cwd=repo, check=True) - subprocess.run(["git", "commit", "-m", "base"], cwd=repo, check=True, capture_output=True) - - def execute(**kwargs): - repo = kwargs["repo_dir"] - if candidate: - (repo / "service.py").write_text("value = 2\n") - (repo / "results").mkdir() - (repo / "results/proof.txt").write_text("partial proof") - deep = repo / "nested/domain/oracle/checks.json" - deep.parent.mkdir(parents=True, exist_ok=True) - deep.write_bytes(raw_payload) - return status, "work summary" - - monkeypatch.setattr(cloud_worker, "clone_and_checkout_task", clone) - monkeypatch.setattr(cloud_worker, "execute_task", execute) - monkeypatch.setattr(cloud_worker, "StorageMessenger", None) - - real_upload = storage_uploader.upload_to_gcs - - def upload_hook(bucket_name, object_name, local_file_path): - if fail_status and object_name.endswith("status.json"): - return False - return real_upload(bucket_name, object_name, local_file_path) - - monkeypatch.setattr(storage_uploader, "upload_to_gcs", upload_hook) - - exit_code = 0 - try: - cloud_worker.main() - except SystemExit as exc: - exit_code = exc.code - expected = ( - "ISSUES" - if fail_status - else ("PASS" if status == "PASS" and verify == "exit 0" else "ISSUES" if status == "PASS" else status) - ) - assert exit_code == (0 if expected == "PASS" else 1) - report = cloud_dispatch.parse_worker_logs(capsys.readouterr().out) - assert len(report) == 1 and report[0]["status"] == expected and report[0]["task_index"] == 0 - target = storage / "test-bucket/run/task-0" - assert (target / "evidence/results/proof.txt").read_text() == "partial proof" - assert (target / "evidence/nested/domain/oracle/checks.json").read_bytes() == raw_payload - if fail_status: - assert not (target / "status.json").exists() - return - - published = json.loads((target / "status.json").read_text()) - assert published["status"] == expected - if expected == "PASS" and candidate: - assert (target / "patch.diff").is_file() - else: - assert not (target / "patch.diff").exists() - if candidate: - assert "+value = 2" in (target / "partial.patch.diff").read_text() - if status == "PASS": - assert (worker_repo / "verification.txt").is_file() - assert list((target / "evidence/.agystack/diagnostics").glob("verification-*.log")) - harvested = result_harvester.harvest_candidate_patches("test-bucket", "run", tmp_path / "harvest") - assert len(harvested) == 1 - assert harvested[0]["status"] == published["status"] - assert (tmp_path / "harvest/task-0/evidence/results/proof.txt").is_file() - assert (tmp_path / "harvest/task-0/evidence/nested/domain/oracle/checks.json").read_bytes() == raw_payload - if expected == "PASS" and candidate: - assert harvested[0]["patch_file"] and Path(harvested[0]["patch_file"]).is_file() - else: - assert not harvested[0]["patch_file"] - - -@pytest.mark.parametrize( - "reports", - [ - [], - [{"task_index": 0, "status": "PASS"}], - [{"task_index": 0, "status": "PASS"}, {"task_index": 1, "status": "UNKNOWN"}], - [{"task_index": 0, "status": "PASS"}, {"task_index": 0, "status": "PASS"}], - ], -) -def test_dispatch_requires_complete_terminal_coverage(reports): - assert cloud_dispatch.failed_task_count(reports, 2) > 0 - - -def test_dispatch_complete_pass(): - assert ( - cloud_dispatch.failed_task_count([{"task_index": 0, "status": "PASS"}, {"task_index": 1, "status": "PASS"}], 2) - == 0 - ) - - -@pytest.mark.parametrize( - "limits, bad_env", - [ - (None, None), - ([], None), - ({"extra": 3}, None), - ({"max_agent_turns": "40"}, None), - ({"max_agent_turns": True}, None), - ({}, {"AGYSTACK_MAX_AGENT_TURNS": "oops"}), - ], -) -def test_dispatch_rejects_invalid_task_limits_before_launch(tmp_path, limits, bad_env): - command = [ - sys.executable, - str(SCRIPTS / "cloud_dispatch.py"), - "--dry-run", - "--repo", - "https://example.com/repo", - "--vertex", - "--project", - "test", - "--manifest", - json.dumps([{"brief": "work", "execution_limits": limits}]), - ] - env = dict(os.environ, GH_TOKEN="fake-test-token") - if bad_env: - env.update(bad_env) - result = subprocess.run(command, cwd=tmp_path, env=env, capture_output=True, text=True) - assert result.returncode != 0 - assert "execution_limits" in result.stderr or "positive integer" in result.stderr - - -def test_dispatch_env_forwarding(tmp_path): - env = dict(os.environ, AGYSTACK_MAX_AGENT_TURNS="41", COMMAND_TIMEOUT="600", GH_TOKEN="fake-test-token") - env.pop("VERIFY_TIMEOUT", None) - result = subprocess.run( - [ - sys.executable, - str(SCRIPTS / "cloud_dispatch.py"), - "--dry-run", - "--repo", - "https://example.com/repo", - "--vertex", - "--project", - "test", - "--manifest", - json.dumps([{"brief": "work", "execution_limits": {"max_agent_turns": 43}}]), - ], - cwd=tmp_path, - env=env, - capture_output=True, - text=True, - check=True, - ) - payload = json.loads(result.stdout) - assert payload["env_vars"]["AGYSTACK_MAX_AGENT_TURNS"] == "41" - assert payload["env_vars"]["COMMAND_TIMEOUT"] == "600" - assert "VERIFY_TIMEOUT" not in payload["env_vars"] - - -def test_deepseek_retries_consume_request_limit(tmp_path): - sdk = MagicMock() - request = sdk.Client.return_value.models.generate_content - request.side_effect = RuntimeError("503 unavailable") - with patch.object(partner_engine, "_get_genai", return_value=sdk), patch.object(partner_engine.time, "sleep"): - status, summary = partner_engine.execute_deepseek_model_agent( - "deepseek", - "work", - tmp_path, - task_item={"execution_limits": {"max_agent_turns": 2}}, - ) - assert request.call_count == 2 - assert status == "ISSUES" - assert "limit=2" in summary and "consumed=2" in summary - - -@pytest.mark.parametrize("provider", ["claude", "fable"]) -def test_empty_final_response_cannot_reuse_previous_pass(tmp_path, provider): - sdk = MagicMock() - tool = {"type": "tool_use", "id": "read", "name": "read_file", "input": {"path": "absent.txt"}} - responses = [ - SimpleNamespace(content=[{"type": "text", "text": "[STATUS: PASS]"}, tool]), - SimpleNamespace(content=[]), - ] - if provider == "claude": - sdk.AnthropicVertex.return_value.messages.create.side_effect = responses - entry, getter = partner_engine.execute_claude_model_agent, "_get_anthropic" - else: - sdk.Endpoint.return_value.predict.side_effect = responses - entry, getter = partner_engine.execute_fable_model_agent, "_get_aiplatform" - with patch.object(partner_engine, getter, return_value=sdk): - assert entry(provider, "work", tmp_path)[0] == "ISSUES" - - -def test_evidence_failure_downgrades_before_status_publication(worker_repo, tmp_path, monkeypatch): - (worker_repo / "service.py").write_text("value = 2\n") - (worker_repo / "proof.txt").write_text("proof") - storage = tmp_path / "storage" - monkeypatch.setenv("STORAGE_MESSENGER_LOCAL_DIR", str(storage)) - published = [] - - def upload(bucket, name, path): - published.append((name, path.read_text())) - if name.endswith("proof.txt"): - return False - dest = storage / bucket / name - dest.parent.mkdir(parents=True, exist_ok=True) - dest.write_text(path.read_text(), encoding="utf-8") - return True - - with patch.object(storage_uploader, "upload_to_gcs", side_effect=upload): - artifacts = storage_uploader.upload_run_artifacts( - "bucket", - "run", - worker_repo, - 0, - "PASS", - ["service.py"], - evidence_files=["proof.txt"], - ) - assert published[-1][0].endswith("/status.json") - assert json.loads(published[-1][1])["status"] == "ISSUES" - assert "patch.diff" not in artifacts - assert "partial.patch.diff" in artifacts - harvested = result_harvester.harvest_candidate_patches("bucket", "run", tmp_path / "harvest") - assert len(harvested) == 1 - assert harvested[0]["status"] == "ISSUES" - assert harvested[0]["patch_file"] is None - assert Path(harvested[0]["partial_patch_file"]).is_file() - - -def test_missing_status_file_never_promotes_score_or_patch(tmp_path, monkeypatch): - source = tmp_path / "storage/bucket/run/task-0" - source.mkdir(parents=True) - (source / "score.json").write_text(json.dumps({"score": 999, "status": "PASS"})) - (source / "patch.diff").write_text("candidate") - monkeypatch.setenv("STORAGE_MESSENGER_LOCAL_DIR", str(tmp_path / "storage")) - results = result_harvester.harvest_candidate_patches("bucket", "run", tmp_path / "harvest") - assert results[0]["status"] == "UNKNOWN" - assert results[0]["patch_file"] is None - - -def test_shell_output_is_bounded_and_credentials_scrubbed(tmp_path): - from worker.execution import run_bounded_shell - - secret = "AIza" + "a" * 35 - script = f"print('x' * 400000); print('{secret}'); print('last-line')" - result, output = run_bounded_shell(f"{shlex.quote(sys.executable)} -c {shlex.quote(script)}", tmp_path, 5) - assert result.returncode == 0 - assert len(output) < 17000 - log = next((tmp_path / ".agystack/diagnostics").glob("*.log")) - assert log.stat().st_size < 263000 - assert secret not in output and secret not in log.read_text() - assert "[REDACTED]" in output and "last-line" in output - - -@pytest.mark.parametrize("mode", ["complete", "missing", "unknown"]) -def test_attach_requires_all_worker_statuses(tmp_path, monkeypatch, mode, capsys): - storage = tmp_path / "storage" - for index in range(2 if mode != "missing" else 1): - directory = storage / f"bucket/swarms/run/task-{index}" - directory.mkdir(parents=True) - status = "UNKNOWN" if mode == "unknown" and index == 1 else "PASS" - (directory / "status.json").write_text(json.dumps({"task_index": index, "status": status})) - monkeypatch.chdir(tmp_path) - monkeypatch.setenv("STORAGE_MESSENGER_LOCAL_DIR", str(storage)) - monkeypatch.setattr( - sys, - "argv", - ["cloud_dispatch.py", "--wait-execution", "execution", "--session", "run", "--gcs-bucket", "bucket"], - ) - monkeypatch.setattr(cloud_dispatch, "wait_for_execution", lambda **kwargs: ({"spec": {"taskCount": 2}}, True, None)) - monkeypatch.setenv("ANTIGRAVITY_APP_DATA_DIR", str(tmp_path / "app-data")) - if mode == "complete": - cloud_dispatch.main() - else: - with pytest.raises(SystemExit) as exc: - cloud_dispatch.main() - assert exc.value.code == 1 - - -def test_sdk_harvest_downloads_nested_partial_evidence(tmp_path, monkeypatch): - payloads = { - "run/task-0/status.json": json.dumps({"status": "BLOCKED"}), - "run/task-0/partial.patch.diff": "partial diff", - "run/task-0/evidence/results/proof.txt": "proof", - "run/task-0/evidence/.agystack/diagnostics/timeout.log": "partial output", - } - - monkeypatch.delenv("STORAGE_MESSENGER_LOCAL_DIR", raising=False) - _, modules = mock_storage(payloads) - with patch.dict(sys.modules, modules): - results = result_harvester.harvest_candidate_patches("bucket", "run", tmp_path / "harvest") - assert results[0]["status"] == "BLOCKED" - assert results[0]["patch_file"] is None - assert Path(results[0]["partial_patch_file"]).read_text() == "partial diff" - assert (tmp_path / "harvest/task-0/evidence/results/proof.txt").read_text() == "proof" - assert (tmp_path / "harvest/task-0/evidence/.agystack/diagnostics/timeout.log").read_text() == "partial output" - - -@pytest.mark.parametrize("expected_count", [None, 2]) -def test_standalone_harvest_quarantines_incomplete_coverage(tmp_path, monkeypatch, expected_count): - source = tmp_path / "storage/bucket/run/task-0" - source.mkdir(parents=True) - (source / "status.json").write_text(json.dumps({"status": "PASS"})) - (source / "patch.diff").write_text("candidate") - monkeypatch.setenv("STORAGE_MESSENGER_LOCAL_DIR", str(tmp_path / "storage")) - command = [ - sys.executable, - str(SCRIPTS / "cloud_dispatch.py"), - "--harvest-session", - "run", - "--gcs-prefix", - "run", - "--gcs-bucket", - "bucket", - ] - if expected_count: - command += ["--tasks", str(expected_count)] - result = subprocess.run(command, cwd=tmp_path, capture_output=True, text=True) - assert result.returncode == 1 - assert "Quarantined Candidate" in result.stdout - assert "Winning Candidate" not in result.stdout - - -def test_harvest_candidate_patches_strict_prefix_matching(tmp_path, monkeypatch): - local_storage = tmp_path / "local_storage" - monkeypatch.setenv("STORAGE_MESSENGER_LOCAL_DIR", str(local_storage)) - for sub, idx, score, p_text in [ - ("canary/task-0", 0, 0.80, "patch canary"), - ("canary-other/task-1", 1, 0.99, "patch sibling"), - ]: - td = local_storage / "bucket/swarms" / sub - td.mkdir(parents=True) - (td / "status.json").write_text(json.dumps({"task_index": idx, "status": "PASS", "score": score})) - (td / "patch.diff").write_text(p_text) - - local_harvest = result_harvester.harvest_candidate_patches("bucket", "swarms/canary", tmp_path / "local_harvest") - assert len(local_harvest) == 1 - assert (local_harvest[0]["task_index"], local_harvest[0]["score"]) == (0, 0.80) - assert Path(local_harvest[0]["patch_file"]).read_text() == "patch canary" - assert cloud_dispatch.failed_task_count(local_harvest, 2) == 1 - - payloads = { - "run/task-0/status.json": json.dumps({"status": "PASS"}), - "run/task-0/score.json": json.dumps({"score": 0.95}), - "run/task-0/patch.diff": "valid patch", - "run-other/task-1/status.json": json.dumps({"status": "PASS"}), - "run-other/task-1/score.json": json.dumps({"score": 0.99}), - "run-other/task-1/patch.diff": "invalid patch", - "run/mytask-2/status.json": json.dumps({"status": "PASS"}), - "run/task-3-suffix/status.json": json.dumps({"status": "PASS"}), - } - - monkeypatch.delenv("STORAGE_MESSENGER_LOCAL_DIR", raising=False) - _, modules = mock_storage(payloads) - with patch.dict(sys.modules, modules): - results = result_harvester.harvest_candidate_patches("bucket", "run", tmp_path / "harvest") - - assert len(results) == 1 - assert results[0]["task_index"] == 0 - assert results[0]["status"] == "PASS" - assert results[0]["score"] == 0.95 diff --git a/uv.lock b/uv.lock index 28bee9c..9d8b1c0 100644 --- a/uv.lock +++ b/uv.lock @@ -1,35 +1,18 @@ version = 1 -revision = 3 +revision = 5 requires-python = ">=3.11" resolution-markers = [ "python_full_version >= '3.14'", "python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform == 'emscripten'", - "(python_full_version < '3.14' and sys_platform != 'emscripten') or (python_full_version < '3.12' and sys_platform == 'emscripten')", -] - -[[package]] -name = "absl-py" -version = "2.5.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/1f/1d/58e2b5a6e4d703ccb2a029943d665974cb3d5a4fb2b3e3675dd03a9df10e/absl_py-2.5.1.tar.gz", hash = "sha256:286e71c82c1a38e75bbcf185f9b37d0305ad7786535107cb49bf4df9ff2e1f95", size = 118387, upload-time = "2026-10-09T08:38:58.037Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b3/7d/01e62f59e4166af1be6238d9f2b7f3453630c51b8044b412d05b5606532a/absl_py-2.5.1-py3-none-any.whl", hash = "sha256:721200f2f0e9960f2ca9dc3a2a706b201f5f75d812c158f059cbbe29eeafbdb8", size = 137673, upload-time = "2026-10-09T08:38:56.629Z" }, + "python_full_version < '3.12' or (python_full_version >= '3.12' and python_full_version < '3.14' and sys_platform != 'emscripten')", ] [[package]] name = "agystack" version = "0.16.0" source = { editable = "." } -dependencies = [ - { name = "google-cloud-run" }, - { name = "google-cloud-storage" }, - { name = "google-genai" }, -] [package.optional-dependencies] -agent = [ - { name = "google-antigravity" }, -] test = [ { name = "pytest" }, { name = "pytest-mock" }, @@ -39,310 +22,12 @@ test = [ [package.metadata] requires-dist = [ - { name = "google-antigravity", marker = "extra == 'agent'", specifier = ">=0.1.0,<0.2.0" }, - { name = "google-cloud-run", specifier = ">=0.10.0,<1.0.0" }, - { name = "google-cloud-storage", specifier = ">=2.14.0,<3.0.0" }, - { name = "google-genai", specifier = ">=0.1.0,<3.0.0" }, { name = "pytest", marker = "extra == 'test'", specifier = ">=8.0.0" }, { name = "pytest-mock", marker = "extra == 'test'", specifier = ">=3.12.0" }, { name = "pytest-timeout", marker = "extra == 'test'", specifier = ">=2.2.0" }, { name = "ruff", marker = "extra == 'test'", specifier = ">=0.4.0" }, ] -provides-extras = ["agent", "test"] - -[[package]] -name = "annotated-types" -version = "0.8.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/5f/56/a8120250d128bed162cd73c76d45f6ef9991f3e068f62a8ee060afa3104a/annotated_types-0.8.0.tar.gz", hash = "sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7", size = 15893, upload-time = "2026-07-23T20:16:13.995Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/99/91/8acff4f5e50511b911bbccb72b8628a49c68ce14148cd9f6431094859a90/annotated_types-0.8.0-py3-none-any.whl", hash = "sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0", size = 13427, upload-time = "2026-07-23T20:16:12.938Z" }, -] - -[[package]] -name = "anyio" -version = "4.15.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "idna" }, - { name = "typing-extensions", marker = "python_full_version < '3.15'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/a9/d2/f4d173e22df740bc37b1db102b386ba719b66e95b0f0d751f556b387e6d2/anyio-4.15.1.tar.gz", hash = "sha256:9f28306018cbd6d329e64a36d58256edff76dd996fe423bc957326e578b82a94", size = 276966, upload-time = "2026-09-05T10:42:39.44Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/12/b8/4bd346e22b28902df4d651910f5242c28d84e4a5c2435ca5c3f797ed7e2e/anyio-4.15.1-py3-none-any.whl", hash = "sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101", size = 132079, upload-time = "2026-09-05T10:42:37.923Z" }, -] - -[[package]] -name = "attrs" -version = "26.1.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/9a/8e/82a0fe20a541c03148528be8cac2408564a6c9a0cc7e9171802bc1d26985/attrs-26.1.0.tar.gz", hash = "sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32", size = 952055, upload-time = "2026-03-19T14:22:25.026Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/64/b4/17d4b0b2a2dc85a6df63d1157e028ed19f90d4cd97c36717afef2bc2f395/attrs-26.1.0-py3-none-any.whl", hash = "sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309", size = 67548, upload-time = "2026-03-19T14:22:23.645Z" }, -] - -[[package]] -name = "certifi" -version = "2026.10.19" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a6/bd/1436c50cc46699de0230fbaacc1d1de7bfec413176099949e9d5112e88f2/certifi-2026.10.19.tar.gz", hash = "sha256:035c1e85572b141bf1c3a3eff0e33a8eb74917522f2559075ff8d2fea780a1ae", size = 137598, upload-time = "2026-10-20T02:24:16.604Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c4/51/29046e48f693c54e5b7412216d447a1d8362c9653148d98c02cdf65fa733/certifi-2026.10.19-py3-none-any.whl", hash = "sha256:42d35340cc5b9ba78e818ddbff0c5b1c2b779de448a340fd1b989f5fa8670e1b", size = 136464, upload-time = "2026-10-20T02:24:15.072Z" }, -] - -[[package]] -name = "cffi" -version = "2.1.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "pycparser", marker = "implementation_name != 'PyPy'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/9e/ef/008a1939e372c06329a3fce4279c02f328488f3526744906eeec3da7ad5f/cffi-2.1.1.tar.gz", hash = "sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be", size = 530807, upload-time = "2026-08-03T21:21:18.939Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/70/d2/16d99a0c4948febc0ebd133a13b2f688ff7f8cb04da971e1128872ce0c03/cffi-2.1.1-cp311-cp311-macosx_10_15_x86_64.whl", hash = "sha256:c8d2c9fd1f2d16f780d15127abb050d13d1a76c03a4bd87d7e4980e45e511e12", size = 183838, upload-time = "2026-08-03T21:19:29.637Z" }, - { url = "https://files.pythonhosted.org/packages/cd/95/31b535a9f0220ae9f357de4a08d57ce89cb417653c2fd9f075f50822a388/cffi-2.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:398aff33cee2767e3e781d2554c54bd0dff386bb437581e0d8011fde1a942ec1", size = 184168, upload-time = "2026-08-03T21:19:30.764Z" }, - { url = "https://files.pythonhosted.org/packages/ad/5a/4707a0dc1f203f5dde5a907b0d4e3c25d71120241048bd5bc6f1bb9d4e71/cffi-2.1.1-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:154852545011f779917b11c78db2358d095da62a9a172b78ad0a583ee5adc0d0", size = 211805, upload-time = "2026-08-03T21:19:31.867Z" }, - { url = "https://files.pythonhosted.org/packages/ad/66/c19feabb28485b6e0bbaaafa90837a1ef5d302e90f2178bd33f17a49879b/cffi-2.1.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3311ed60d36f83378794e1009ac6258bafbf81f7888b4caa7b35a521e3f95813", size = 218716, upload-time = "2026-08-03T21:19:32.896Z" }, - { url = "https://files.pythonhosted.org/packages/a7/92/500760486c8baab49a7a8a58ba7fc3355ec3974b454b8a09e528efde9e1d/cffi-2.1.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:6e192623c49c94421616a5778fba35cf0d5a8d000650c1967ef4448ee5cdd990", size = 205569, upload-time = "2026-08-03T21:19:34.142Z" }, - { url = "https://files.pythonhosted.org/packages/a5/a7/a67c733254d6e7373f7822f8082d8d6beade791e0cf12a7611f376fa61c7/cffi-2.1.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a6e721d4b0e45d5b65e87534470e67b18dcd092c83f68fba09f152b9cbc061af", size = 204907, upload-time = "2026-08-03T21:19:35.174Z" }, - { url = "https://files.pythonhosted.org/packages/f7/a4/4399daaf8f7dfee9d7c3327fdb0426ee041cc63edc358b93911ceb2bfc7a/cffi-2.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632", size = 217807, upload-time = "2026-08-03T21:19:36.286Z" }, - { url = "https://files.pythonhosted.org/packages/28/f7/dabe6da2466ecbd82dc62e7342dc6b1065dad990c06f00f0ede9ebf2a0ed/cffi-2.1.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7225e4514edb64eb6740324353e0da0711954fd8d7da4576755b1c6e09b697cd", size = 221252, upload-time = "2026-08-03T21:19:37.416Z" }, - { url = "https://files.pythonhosted.org/packages/ce/87/616202d8e51342c07d2534c510111c4cc37201775ce8f60802c9335d1edd/cffi-2.1.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:df913725b79db7bcf03448f36b7bf8815363417d5b58deecf9305e3e30f0f21a", size = 214214, upload-time = "2026-08-03T21:19:38.507Z" }, - { url = "https://files.pythonhosted.org/packages/b4/c6/ab025d75d2c26c19b087c0124e75ee31cb65032f4fe345d356d8c507ab97/cffi-2.1.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f5cfbc5fe74540d335175b656c725d74d90e3730c626d92575eea35029d9afaa", size = 219408, upload-time = "2026-08-03T21:19:39.809Z" }, - { url = "https://files.pythonhosted.org/packages/db/e2/7e8109f65445bdc673a7b54f02c677de462db75674220fd1335efc8eb598/cffi-2.1.1-cp311-cp311-win32.whl", hash = "sha256:f8ec5e643a9a937f64e1999eb9f75d072263751912dc5cd06d3c85f8f44be7c3", size = 174470, upload-time = "2026-08-03T21:19:41.246Z" }, - { url = "https://files.pythonhosted.org/packages/73/c0/77ba02423c2f7d7091143c45cd49e0e6575c4c1967394bb542bd923a9b74/cffi-2.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:42f6930c31dc7f50732c9ae793c2786c7b6b044195967bbdde40bb9be81c4cc0", size = 185096, upload-time = "2026-08-03T21:19:42.615Z" }, - { url = "https://files.pythonhosted.org/packages/7c/47/9f1f85f9672ceda4984dc6c4f8824e8558992a2972c3d3c81fb8eb28d4ba/cffi-2.1.1-cp311-cp311-win_arm64.whl", hash = "sha256:c7659f22557c5a0bc4855cd635f55edec690cc008a40768527762cb9fb263455", size = 179941, upload-time = "2026-08-03T21:19:43.747Z" }, - { url = "https://files.pythonhosted.org/packages/10/69/43965eccfdead3b9220015fd1320e117be8c6ed01a62ffab76eeb752f5d5/cffi-2.1.1-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0", size = 184821, upload-time = "2026-08-03T21:19:44.887Z" }, - { url = "https://files.pythonhosted.org/packages/54/7d/16e5a096677b5e313ca80cd5e5170efa3ea44624a82bb111925522da64b1/cffi-2.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf", size = 184719, upload-time = "2026-08-03T21:19:46.129Z" }, - { url = "https://files.pythonhosted.org/packages/56/e6/8941622732edec876dd17d0453dce07317ae96db34f2ec1436c9d3785986/cffi-2.1.1-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a", size = 214799, upload-time = "2026-08-03T21:19:47.218Z" }, - { url = "https://files.pythonhosted.org/packages/44/de/f98430906df1545ffde0d543dd124a7a439bc2cd32b36b9c53f805df7333/cffi-2.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890", size = 222389, upload-time = "2026-08-03T21:19:48.331Z" }, - { url = "https://files.pythonhosted.org/packages/6a/5b/717f1526b9957b34456313c31645c5b82b8fb5c3fe9e4752999be7128bfc/cffi-2.1.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50", size = 210249, upload-time = "2026-08-03T21:19:49.543Z" }, - { url = "https://files.pythonhosted.org/packages/64/b3/f8aa4f3e34986c7e4ec45072d1b1b9dd295b6b18007b45518d79726dd725/cffi-2.1.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e", size = 208775, upload-time = "2026-08-03T21:19:50.918Z" }, - { url = "https://files.pythonhosted.org/packages/b1/db/dceb9dd5b231e1da801793f8acc9f3c52a7e1afe40bb1aae37e02b0faad5/cffi-2.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf", size = 221822, upload-time = "2026-08-03T21:19:52.054Z" }, - { url = "https://files.pythonhosted.org/packages/a0/d2/6cd24ae3be000a634109c247d1475d62e5616d0dc78c82770942ec384248/cffi-2.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517", size = 225232, upload-time = "2026-08-03T21:19:53.109Z" }, - { url = "https://files.pythonhosted.org/packages/cb/52/3fa190537004dd7f0ab860a6dc7c0175b8667f68d1e618a46f5498d30250/cffi-2.1.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735", size = 223597, upload-time = "2026-08-03T21:19:54.515Z" }, - { url = "https://files.pythonhosted.org/packages/80/fb/0bb75b7039588c074b37ae99f40d9bfddf990ecb2fbc346ebccd2e56b9be/cffi-2.1.1-cp312-cp312-win32.whl", hash = "sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e", size = 175292, upload-time = "2026-08-03T21:19:55.566Z" }, - { url = "https://files.pythonhosted.org/packages/d9/79/615cc094e2fb508cade7de88d3b4f6c4ec2bab695c97bce9153dc65aadf5/cffi-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a", size = 185919, upload-time = "2026-08-03T21:19:56.89Z" }, - { url = "https://files.pythonhosted.org/packages/70/c6/d0ea84713fe46b243a436a18fcd47d639732747e21635c8a27191b06dc30/cffi-2.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80", size = 180093, upload-time = "2026-08-03T21:19:58.155Z" }, - { url = "https://files.pythonhosted.org/packages/9d/f4/035513d4117049066b4779dc3b7c0c0fdad175fa13731c9f4003f1cd1478/cffi-2.1.1-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e", size = 194248, upload-time = "2026-08-03T21:19:59.399Z" }, - { url = "https://files.pythonhosted.org/packages/76/af/2aeb4dbb5fc41a04161ae9ff1518de7cec08e164f44a8ce6a4cf7fd2cd1d/cffi-2.1.1-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c", size = 196908, upload-time = "2026-08-03T21:20:00.746Z" }, - { url = "https://files.pythonhosted.org/packages/a7/46/2e5fdde8555706dd98139a910ca11be02809f3f605ce956f655d0214e100/cffi-2.1.1-cp313-cp313-macosx_10_15_x86_64.whl", hash = "sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6", size = 184805, upload-time = "2026-08-03T21:20:02.02Z" }, - { url = "https://files.pythonhosted.org/packages/55/41/4c7042f317b9217502988f0873af87e16ad606dc20f84e546e3e6ce9764c/cffi-2.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971", size = 184764, upload-time = "2026-08-03T21:20:03.141Z" }, - { url = "https://files.pythonhosted.org/packages/43/1f/1c3d90d91811c8f86ced9ed637956c54bfe5b79ca98fe976d7f8c8979f6b/cffi-2.1.1-cp313-cp313-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:6a8dddef476fab96d066d578fc88526767b836ab5ab21754e1d5bf3879c31c7c", size = 214722, upload-time = "2026-08-03T21:20:04.377Z" }, - { url = "https://files.pythonhosted.org/packages/37/6f/3b5ce4c3b2192d250f04908f2bfd91ef34552ec8f7716a5d4abdb8d67bb2/cffi-2.1.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f16c709686a78c727bbbf059f92b0bf41c6fc60deec706d2dc19f529175a6125", size = 222369, upload-time = "2026-08-03T21:20:05.544Z" }, - { url = "https://files.pythonhosted.org/packages/02/10/4b3c75dde3d9663c9e02ba05c2668b954f671d4bbe346413ca8c696b295a/cffi-2.1.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:fcd22650c908d7b7da162bbfaab594a1227a15d1643a98c68b122ac642fa2264", size = 210175, upload-time = "2026-08-03T21:20:06.75Z" }, - { url = "https://files.pythonhosted.org/packages/df/62/14f74b9543e605d17701dc797b815958b8bb70b7624ce1b832ddad48ed6c/cffi-2.1.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:aa9511c62d14da7aacc9b4bf51f3f697a621e83b2d6919008243c3aad168eea3", size = 208670, upload-time = "2026-08-03T21:20:08.04Z" }, - { url = "https://files.pythonhosted.org/packages/95/95/86342356ff5953b3fb06f7ef7c5bee212d45e770abc7218d451b9148313c/cffi-2.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a931079504ecc49efed7744c476a5c343a92fabf66dec2db95edb1b2fdc770e2", size = 221824, upload-time = "2026-08-03T21:20:09.274Z" }, - { url = "https://files.pythonhosted.org/packages/eb/ff/7b3429ff53aafe931ed8a5fc69f481bbef7ba6de87ddcbb63d08f483f613/cffi-2.1.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a2d7755bef5a12ed488f4ef1f1b69ee9191d7396083b755a5d2295f6edb4768b", size = 225148, upload-time = "2026-08-03T21:20:10.7Z" }, - { url = "https://files.pythonhosted.org/packages/34/34/a95870b9221e09cf4f2ce3178b1a210abdfe63a1bd357da940418d7b8d15/cffi-2.1.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e0bcb7e0f677f543555d2adff3bf19c05f66cdb4796e5ff602442ab2fe3c4ef7", size = 223564, upload-time = "2026-08-03T21:20:12.165Z" }, - { url = "https://files.pythonhosted.org/packages/70/ea/839b50531021a647fb5e929f72cf97bc1ff702b5472166164b5b6e76b851/cffi-2.1.1-cp313-cp313-win32.whl", hash = "sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac", size = 175263, upload-time = "2026-08-03T21:20:13.559Z" }, - { url = "https://files.pythonhosted.org/packages/60/a6/8b149b2c3f2e11aaa1618ef64500b45f50f22c57a977a4dff1aff1f91042/cffi-2.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d", size = 185688, upload-time = "2026-08-03T21:20:14.69Z" }, - { url = "https://files.pythonhosted.org/packages/01/9a/11f687cb39d6a3504060d5242f04f48c735afb4d3d533958a20594890cb2/cffi-2.1.1-cp313-cp313-win_arm64.whl", hash = "sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973", size = 180078, upload-time = "2026-08-03T21:20:15.917Z" }, - { url = "https://files.pythonhosted.org/packages/d3/7b/d6bbf82b8b96e7391438898c42f5bd96dd02030fd5b64937d248220003e2/cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c", size = 194064, upload-time = "2026-08-03T21:20:17.148Z" }, - { url = "https://files.pythonhosted.org/packages/94/e6/bcc91b283be94735e268487a054004f0aa19947b6348fa367db53230abc8/cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb", size = 196720, upload-time = "2026-08-03T21:20:18.268Z" }, - { url = "https://files.pythonhosted.org/packages/d9/99/c4b0c17cacdc9c3b8f280026286a9826d6a208c0f047591a3c3ce99b91fd/cffi-2.1.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54", size = 184964, upload-time = "2026-08-03T21:20:19.708Z" }, - { url = "https://files.pythonhosted.org/packages/b3/a9/9db617d05d7367c1ad0ab00b3aa6e6f9281edd689b4ee9ea0e5a84e89c97/cffi-2.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72", size = 184962, upload-time = "2026-08-03T21:20:20.833Z" }, - { url = "https://files.pythonhosted.org/packages/67/b8/b42132ca113dc567d37684437b46ca1dafc885902b02a110a02d5b511857/cffi-2.1.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1", size = 222328, upload-time = "2026-08-03T21:20:22.118Z" }, - { url = "https://files.pythonhosted.org/packages/80/10/c5c0cbf0a657aecf59ef511409734230bf556f05a0d6c9eed7aa5c0a0166/cffi-2.1.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062", size = 209985, upload-time = "2026-08-03T21:20:23.401Z" }, - { url = "https://files.pythonhosted.org/packages/d5/6c/bfa0b87b03b9238148beca990292843c9396ba069b54496596594173de7b/cffi-2.1.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03", size = 208530, upload-time = "2026-08-03T21:20:24.628Z" }, - { url = "https://files.pythonhosted.org/packages/e9/02/4e7d553a7ac4b4238b38b3c1b80d486e9d4436f8d2acbf87a0997fe3f402/cffi-2.1.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96", size = 221525, upload-time = "2026-08-03T21:20:25.758Z" }, - { url = "https://files.pythonhosted.org/packages/82/1d/a4aaf9babd75acb4d5f223bff71533bee748dd770a382619a798960ee9ba/cffi-2.1.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527", size = 225053, upload-time = "2026-08-03T21:20:26.985Z" }, - { url = "https://files.pythonhosted.org/packages/81/10/5dc0e7bdd18e22107054288283380fc97a06ae3f1656a106908d666a3c88/cffi-2.1.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13", size = 223213, upload-time = "2026-08-03T21:20:28.277Z" }, - { url = "https://files.pythonhosted.org/packages/0b/e9/d0061c364cde06ee43168a0d076ac1da512cbc380d44767b844ba34fe2b6/cffi-2.1.1-cp314-cp314-win32.whl", hash = "sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c", size = 177682, upload-time = "2026-08-03T21:20:44.288Z" }, - { url = "https://files.pythonhosted.org/packages/a7/06/1c3e01e3ba14c39f6d10bfbac52753b7e22259e38088e5cfe1d704918690/cffi-2.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48", size = 187949, upload-time = "2026-08-03T21:20:45.623Z" }, - { url = "https://files.pythonhosted.org/packages/87/5b/da4e39efe18eeb89cf580ea9cfc66b6a7c3eadb808fc0cc1d3a295cb5a5d/cffi-2.1.1-cp314-cp314-win_arm64.whl", hash = "sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836", size = 182947, upload-time = "2026-08-03T21:20:46.955Z" }, - { url = "https://files.pythonhosted.org/packages/23/59/40338bf421c5accea1d45158170c87006ef1cd371b05c077e76476949728/cffi-2.1.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3", size = 188504, upload-time = "2026-08-03T21:20:29.495Z" }, - { url = "https://files.pythonhosted.org/packages/7d/47/5ecf1023850036e674c77ec4de86182d309ae344e39e7cba984b7df5d647/cffi-2.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2", size = 188259, upload-time = "2026-08-03T21:20:31.291Z" }, - { url = "https://files.pythonhosted.org/packages/2a/9c/92934c3bea9f785b23eba304538c0b4d37a2a96d2431eb3a1bc87a11aa19/cffi-2.1.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94", size = 223864, upload-time = "2026-08-03T21:20:32.571Z" }, - { url = "https://files.pythonhosted.org/packages/4d/45/ba4c93527bc38616a8bd36488acb69a2212d60486794f0c1f318949bbb76/cffi-2.1.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc", size = 211538, upload-time = "2026-08-03T21:20:33.808Z" }, - { url = "https://files.pythonhosted.org/packages/80/e9/b6ef565e452acb932fb0cb5443f44a78efbd1233e566f02b5a83855e9115/cffi-2.1.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29", size = 210688, upload-time = "2026-08-03T21:20:34.974Z" }, - { url = "https://files.pythonhosted.org/packages/9a/95/eff5f0cee78d2eabc7eebffec40d3fc1876b5f3c95582e018bb4b99601f2/cffi-2.1.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676", size = 223803, upload-time = "2026-08-03T21:20:36.564Z" }, - { url = "https://files.pythonhosted.org/packages/fa/01/579d39fb8bef00a335a23d83757b44feb24cd6345a2c451b64cb67b9c362/cffi-2.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e", size = 226763, upload-time = "2026-08-03T21:20:37.816Z" }, - { url = "https://files.pythonhosted.org/packages/8d/b0/0b44f47c60b01b57b6e2bbd92343f13a85a1d93bc46ccf6e47e244acd99c/cffi-2.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f", size = 225688, upload-time = "2026-08-03T21:20:38.959Z" }, - { url = "https://files.pythonhosted.org/packages/eb/d2/3b7176cb570a1d3e27faf67b72f591af508036e0d8b2be2ef9af9e8c84bb/cffi-2.1.1-cp314-cp314t-win32.whl", hash = "sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4", size = 182868, upload-time = "2026-08-03T21:20:40.388Z" }, - { url = "https://files.pythonhosted.org/packages/56/78/31f00c1bcd97c9bbf55f1bfdf5bc809a5de8887473e90bb9960dca825e80/cffi-2.1.1-cp314-cp314t-win_amd64.whl", hash = "sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e", size = 194104, upload-time = "2026-08-03T21:20:41.725Z" }, - { url = "https://files.pythonhosted.org/packages/7b/1b/58496f2ed0a35de575250c02a43ab3cc2c04d494a88fed31c1cabc0fd176/cffi-2.1.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5", size = 186402, upload-time = "2026-08-03T21:20:43.042Z" }, - { url = "https://files.pythonhosted.org/packages/c1/8f/9ebe220eab48a093d1a5a5e339ab0dc7316eef3bb04d63c42f0251b61f50/cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphoneos.whl", hash = "sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d", size = 194043, upload-time = "2026-08-03T21:20:48.179Z" }, - { url = "https://files.pythonhosted.org/packages/ff/69/844bad3ece306c4782c2ecb93597035b6690d48704b803914c199da1e8b3/cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b", size = 196737, upload-time = "2026-08-03T21:20:49.457Z" }, - { url = "https://files.pythonhosted.org/packages/1b/8a/af668013284634733f02d683458a0728739c7d6ddb5e14cb0c20832266fe/cffi-2.1.1-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4", size = 184933, upload-time = "2026-08-03T21:20:50.639Z" }, - { url = "https://files.pythonhosted.org/packages/0c/75/2f5207ff6d1a613133b23a5203cc0c2a628313b5eb3974d7956ae3c57950/cffi-2.1.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8", size = 185002, upload-time = "2026-08-03T21:20:52.173Z" }, - { url = "https://files.pythonhosted.org/packages/e2/31/9e1313b0a6e30e91b3b3d3fff51ae99c857c07738e3afcce1f7334e1b7ab/cffi-2.1.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6", size = 222271, upload-time = "2026-08-03T21:20:53.462Z" }, - { url = "https://files.pythonhosted.org/packages/50/e3/f6234a833e6e08c7007003074723c406559eecf9b48dfc97471e5a8eb7a0/cffi-2.1.1-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80", size = 209919, upload-time = "2026-08-03T21:20:54.783Z" }, - { url = "https://files.pythonhosted.org/packages/0d/fc/5f74e293fced6edb51af3a46c4ccf6c23c9943774ecb375ddbd522c76add/cffi-2.1.1-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779", size = 208529, upload-time = "2026-08-03T21:20:56.066Z" }, - { url = "https://files.pythonhosted.org/packages/44/16/29e6d01b388bef055ecd6ca8244b3f4d336bd09e92d5d892187b9601084e/cffi-2.1.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399", size = 221630, upload-time = "2026-08-03T21:20:57.336Z" }, - { url = "https://files.pythonhosted.org/packages/a4/18/fa7f1f6857d5eb88a4ca99ffcbfb7c387a287ccc154c64a73e86314745d7/cffi-2.1.1-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688", size = 225134, upload-time = "2026-08-03T21:20:58.675Z" }, - { url = "https://files.pythonhosted.org/packages/e0/9f/e8e3dfa04a1b4c241f8c91faacad872b4d4efd051d49764ad4e2fd4b9fea/cffi-2.1.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7", size = 223197, upload-time = "2026-08-03T21:20:59.968Z" }, - { url = "https://files.pythonhosted.org/packages/f8/7e/8debeb04f1ab9fe2a6963964cd6f1aaf7192627b83926586a6a4e089c9fa/cffi-2.1.1-cp315-cp315-win32.whl", hash = "sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac", size = 177683, upload-time = "2026-08-03T21:21:14.901Z" }, - { url = "https://files.pythonhosted.org/packages/e0/31/5158704cc474ab65c1647932e88be78dc0873f47130e253be38bcaf13d01/cffi-2.1.1-cp315-cp315-win_amd64.whl", hash = "sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960", size = 187897, upload-time = "2026-08-03T21:21:16.108Z" }, - { url = "https://files.pythonhosted.org/packages/cc/4b/b3a2da8570c704ffc0f9762cdc3ec0f02c8573798e0b5cf7f11c82bbb70f/cffi-2.1.1-cp315-cp315-win_arm64.whl", hash = "sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1", size = 182935, upload-time = "2026-08-03T21:21:17.271Z" }, - { url = "https://files.pythonhosted.org/packages/d0/ef/5443574510a1207e6f6bc38ba6e1f1de36cb48fef07b2728bb896a21f430/cffi-2.1.1-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc", size = 188464, upload-time = "2026-08-03T21:21:01.163Z" }, - { url = "https://files.pythonhosted.org/packages/7e/ae/a56fa8c4686ad50e148fcbc8d3ae0d03915ff5c30d795058988c24118cef/cffi-2.1.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab", size = 188262, upload-time = "2026-08-03T21:21:02.382Z" }, - { url = "https://files.pythonhosted.org/packages/53/b2/6187f46f2912276a3ae284076109cc5c8680482f11f766ccf26db4a86427/cffi-2.1.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e", size = 223779, upload-time = "2026-08-03T21:21:03.553Z" }, - { url = "https://files.pythonhosted.org/packages/8a/f6/c3ad28bd19f77047a03084424fbd4cbe997303267c14423737324be0385d/cffi-2.1.1-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358", size = 211520, upload-time = "2026-08-03T21:21:04.863Z" }, - { url = "https://files.pythonhosted.org/packages/a0/cd/ccac9013a5bd9fd764de118674ab9c805b5ca10c19270d90ee273f8b2240/cffi-2.1.1-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231", size = 210673, upload-time = "2026-08-03T21:21:06.223Z" }, - { url = "https://files.pythonhosted.org/packages/52/86/2976131c639aead931c5bee5aba67e4b09fbeb8018b6f282f70803f923a7/cffi-2.1.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6", size = 223835, upload-time = "2026-08-03T21:21:07.539Z" }, - { url = "https://files.pythonhosted.org/packages/ac/0c/33a7aeab2f9c76918c52e084beb39c570db3588133412929e8ec06fab90b/cffi-2.1.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94", size = 226705, upload-time = "2026-08-03T21:21:08.774Z" }, - { url = "https://files.pythonhosted.org/packages/e3/26/2cde30fdde421130bfc18f70395731a6e6b2053c6a1978a5258ff04e72fa/cffi-2.1.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5", size = 225539, upload-time = "2026-08-03T21:21:09.911Z" }, - { url = "https://files.pythonhosted.org/packages/6d/cd/a361394c94b2129d604bb846f624a8e88255a3ee33129c434a00d715e64f/cffi-2.1.1-cp315-cp315t-win32.whl", hash = "sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66", size = 182707, upload-time = "2026-08-03T21:21:11.226Z" }, - { url = "https://files.pythonhosted.org/packages/9b/b5/ba2b299993c26577d529b6ae29841f9e15b9fcf004d65f423f4fcf94ade9/cffi-2.1.1-cp315-cp315t-win_amd64.whl", hash = "sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3", size = 193772, upload-time = "2026-08-03T21:21:12.39Z" }, - { url = "https://files.pythonhosted.org/packages/aa/29/35e016098c814cd93de9cd320c66b5bfba14dc6ecedd3cb518fa7c408c69/cffi-2.1.1-cp315-cp315t-win_arm64.whl", hash = "sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692", size = 186360, upload-time = "2026-08-03T21:21:13.636Z" }, -] - -[[package]] -name = "charset-normalizer" -version = "3.5.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/33/1c/f41d4e74c28ab327ff3acd36053f7ea506c55872d7a90b0fa71aa3ab0c89/charset_normalizer-3.5.2.tar.gz", hash = "sha256:39de2a259fc954455c57274dc94c79d5842774e1247a016aff30bc0efed0f4ef", size = 172659, upload-time = "2026-09-30T04:39:23.398Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/22/67/6a0b94a7960d5e1b5eacd2fb529f3fccc47db4644f7f0a7cfdcfc3be578a/charset_normalizer-3.5.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3d21b8b13c7592db2ac5e544a6d83187b995257472b0c9e8351b6d507ae37ed6", size = 370642, upload-time = "2026-09-30T04:35:06.91Z" }, - { url = "https://files.pythonhosted.org/packages/fb/94/01009e13b94041599004edf32e56e382c24e570f60f79bab8efe45cfe1eb/charset_normalizer-3.5.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d760fe2a4d7c3b226cb9026d6a842868d52a7901bd98420e1baf14e80da85cf5", size = 259280, upload-time = "2026-09-30T04:35:08.448Z" }, - { url = "https://files.pythonhosted.org/packages/66/85/3b5358f60a13210f0b67d3755c168ef758701b021e655d88d4da28554467/charset_normalizer-3.5.2-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c9790464842f85f437dbbb54417eda1e0e6bfc52dd8d22d6fd1c994b73b2dc74", size = 245335, upload-time = "2026-09-30T04:35:10.104Z" }, - { url = "https://files.pythonhosted.org/packages/74/75/77c1c479b09ecd751d1e767b251ea5c14d4d50ff757bf404afab2692f600/charset_normalizer-3.5.2-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4685902cf26edf013ed7a3da0f426ebba7a00ebb9541386d835afbf002c11cab", size = 291707, upload-time = "2026-09-30T04:35:11.575Z" }, - { url = "https://files.pythonhosted.org/packages/0b/0d/363f78cacb70f58f15f4b083961bbd9d292f335d3f5c66fc4f1cfe69cb90/charset_normalizer-3.5.2-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4495c5002a7b28557e7e222e77e0b661183e432b7d6d2e788101e3f240e05b8c", size = 286747, upload-time = "2026-09-30T04:35:13.022Z" }, - { url = "https://files.pythonhosted.org/packages/e4/ed/cf505d3011ffceb12c2067a7a5d3cfe92b875d4d44bb0ff0d69375e2c184/charset_normalizer-3.5.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:211d5a3eb6af8f513b8d4ca19a8c1b7accab1b5f0d3175f9826b03c1a920dc1f", size = 269972, upload-time = "2026-09-30T04:35:14.606Z" }, - { url = "https://files.pythonhosted.org/packages/15/d8/f0a93a431d170e7ca681d4f6650fee3de934d18560e474e7267eb4b0f987/charset_normalizer-3.5.2-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ef4fcbf3327382cd4c9f540babd61248208af7b93eec4de397b4d5f58a09e288", size = 269339, upload-time = "2026-09-30T04:35:16.087Z" }, - { url = "https://files.pythonhosted.org/packages/86/bd/9b2bd1c5b7af02462c9752d33994834ff972a96b4c483eefde9e594488e2/charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:bd16aabe4a02a297c23417aa17ac6299dbd8c49f673bcd645b4929b11f5a4400", size = 261683, upload-time = "2026-09-30T04:35:17.488Z" }, - { url = "https://files.pythonhosted.org/packages/76/a5/cac540ab0fd61f3fec88ad3dbb64509e71424593d73cfdfff5ab3e4db279/charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:fb9e68df06293761f9fe66ade60a9bc6d0f5e42b8acf2939a9158af86ab0e5bd", size = 248143, upload-time = "2026-09-30T04:35:18.849Z" }, - { url = "https://files.pythonhosted.org/packages/71/7a/ff467301deef2089fad87f72df9e000a26a78fec7acbb18e1999371b8369/charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:59f63901b0031c3136cf64704dcb21de0bbae62ce2c9529bc39d27665463de37", size = 292358, upload-time = "2026-09-30T04:35:20.326Z" }, - { url = "https://files.pythonhosted.org/packages/ad/77/22d7e785d1e210afc2e2f58600dd1799d17a35665faf84383f002826c5f8/charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:304d5463e65a35d7bb0850550e0780395395f6fcf452f04db7d5ca7cecc425ac", size = 268766, upload-time = "2026-09-30T04:35:21.72Z" }, - { url = "https://files.pythonhosted.org/packages/ae/91/e8e946267f1c2d9e2bd651726e2fbd2addf02c4d36cea5069e32ca9d7bb5/charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:9cf9b1a857e25c4baceeb3624e92a56df3668f398c4acba74e174d81fb4d1d3a", size = 287432, upload-time = "2026-09-30T04:35:23.273Z" }, - { url = "https://files.pythonhosted.org/packages/4e/88/7561d8a88d555e7df6623abe7c0070b4baf47549b9408783a2ae0a1a6cf7/charset_normalizer-3.5.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:114e4d0c92d618409ed82a99e22b5c5e768fe995f2973f78265f4524f49d4640", size = 272470, upload-time = "2026-09-30T04:35:24.655Z" }, - { url = "https://files.pythonhosted.org/packages/35/7e/578c702301ec036f01455f30744a08d2b42f6ab35b9b2d4bf8cae0ef2a80/charset_normalizer-3.5.2-cp311-cp311-win32.whl", hash = "sha256:2625388c6c754520c37abaf3b41eb34d1cc4a373f457898f08606c8e362b891d", size = 186688, upload-time = "2026-09-30T04:35:26.225Z" }, - { url = "https://files.pythonhosted.org/packages/e8/fc/fdf8cf52ff21cd5bf158f20978991cf985325842f74283eb6df26c8a39d8/charset_normalizer-3.5.2-cp311-cp311-win_amd64.whl", hash = "sha256:87e50a3e7cb90af586b6c5faf23e302a970415ac73bd7bd90a515a04b427ef96", size = 214932, upload-time = "2026-09-30T04:35:27.796Z" }, - { url = "https://files.pythonhosted.org/packages/97/66/3e45a506d8110b632541faf9a9470185aa9878f1ed44020f31346c1c5e5b/charset_normalizer-3.5.2-cp311-cp311-win_arm64.whl", hash = "sha256:254eb48b9fa5ee9898a3c445825a1f340fe53712a098904b39b0bddba8ea3cb1", size = 202828, upload-time = "2026-09-30T04:35:29.259Z" }, - { url = "https://files.pythonhosted.org/packages/e7/c8/693809898870237d82785a03f3b2b58fe4c9f14669f84a7d4e623c92a59e/charset_normalizer-3.5.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:ed2a239c0ea213acc1908150a3037257083c7c083128f1a4cec2ec4b97dca491", size = 367780, upload-time = "2026-09-30T04:35:30.888Z" }, - { url = "https://files.pythonhosted.org/packages/c9/87/2fea8c13dc24b3ca9c6f803a5b2dfdeae73eb4f9e12c7885ed908ff0433c/charset_normalizer-3.5.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b91363207bd9dc966a691e959bb47f64b30f7ac4b072be9968b366982f7db77c", size = 246730, upload-time = "2026-09-30T04:35:32.286Z" }, - { url = "https://files.pythonhosted.org/packages/a8/9e/09efac30b937722f46d3110ba30b875b24b2e3a266ed746cc4e376a94d80/charset_normalizer-3.5.2-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:38a873987f3be698494da8b2e3085e29da02da7b633dce73e79c699a113d7bf0", size = 237707, upload-time = "2026-09-30T04:35:33.709Z" }, - { url = "https://files.pythonhosted.org/packages/9e/18/70d76670b13686237863a379928d60bd10e021f17d243ab3d7014c4a5f4e/charset_normalizer-3.5.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:355ad8011081dec5412240c087a9a0c9d4d5039f3ed11a3f13e18c2b29b56c51", size = 273050, upload-time = "2026-09-30T04:35:35.138Z" }, - { url = "https://files.pythonhosted.org/packages/54/e2/77a8b09d5adc013ed07b95b01b8b8fa5441c4e810e83ee7e4aae2fa4d91a/charset_normalizer-3.5.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ee21e28f0430bd6dc9086c6e525d5e818a44a5ad19720c8a0ef766792f3eb5e5", size = 270345, upload-time = "2026-09-30T04:35:36.502Z" }, - { url = "https://files.pythonhosted.org/packages/7f/c5/38806a25ab5e65fc178f39affeda20858efafede2fce1ffc2556cfc9fe73/charset_normalizer-3.5.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3d31298449090ab8d47b7b1b2a555ff73cac7ed438a08b7ac160980c7ebed649", size = 257601, upload-time = "2026-09-30T04:35:37.919Z" }, - { url = "https://files.pythonhosted.org/packages/ae/8d/213565184708fdb263ae55e2c04ee1ff748129dd65d48ed0e3502da9c85a/charset_normalizer-3.5.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5cde776b7cc66e4f6c99612cea4aa7269aa65863f7a15841b2c264f103822f4e", size = 252222, upload-time = "2026-09-30T04:35:39.544Z" }, - { url = "https://files.pythonhosted.org/packages/7e/24/76d2cefc25472531e4c5c7dfff68865eb1c39b78482f0fdc15b46f047830/charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:ae4f5fea5b8b8ccff88238cc8569303e5ee95efae67fa62922a311397a71f346", size = 248482, upload-time = "2026-09-30T04:35:41.088Z" }, - { url = "https://files.pythonhosted.org/packages/7d/dc/65a801b66ab4c197e22c433ab25e7ac24324ac6f45a2269aca42cce309bf/charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:f7d486c83842422badd511868fd8a9a20e9407ace71564b6af47ce7e60a336c1", size = 241206, upload-time = "2026-09-30T04:35:42.59Z" }, - { url = "https://files.pythonhosted.org/packages/a7/95/ca9b5eabde673002c6f1e7ada1b223916fe18f6d661da7aabd4d643718f1/charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:11a4d68a6ecda3292cb1e50239e111543ba5d709bb62a6b4ea1afcfa729d8875", size = 273190, upload-time = "2026-09-30T04:35:44.347Z" }, - { url = "https://files.pythonhosted.org/packages/2d/8b/803b4d2a3f6e1740f63f1e87b04d14b42f3d4fdfe6ed7d4db2d34102b14f/charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:d6734d2ef8a50fbf8445c139477da401f50d62a0606bf00e20ec6d87773fefb1", size = 253527, upload-time = "2026-09-30T04:35:45.915Z" }, - { url = "https://files.pythonhosted.org/packages/a9/55/93c0e5dbd085ae0471346026abbe7e0db9ea2d6fea74e51f0b5a46f233a7/charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:a815775b6c38d4e0ff7bcffbeba67feded90202bb6a226b8dd35f1c855217413", size = 271285, upload-time = "2026-09-30T04:35:47.49Z" }, - { url = "https://files.pythonhosted.org/packages/95/69/0dbd0e0b9b16cfa816cdfcb3e2e3854a1f680dc07fb1245ea125e7448060/charset_normalizer-3.5.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:23851fb4e1b85ed3f6c2a27b777cdfe2e19fb5b38429a8faf38c7542b7665869", size = 260010, upload-time = "2026-09-30T04:35:48.996Z" }, - { url = "https://files.pythonhosted.org/packages/58/9d/e7b88e7b1bf403590c3b573277b5e1e488c68c7a6fbacca310a2c324e90c/charset_normalizer-3.5.2-cp312-cp312-win32.whl", hash = "sha256:db19d07e2e0129e974a0e65d0064fc222a446cd5122c2fd4184d2af9fc734a9e", size = 184125, upload-time = "2026-09-30T04:35:50.777Z" }, - { url = "https://files.pythonhosted.org/packages/eb/e6/e6e083884cbcfd49c64865af05027fe7011be7b2d9179524f099a1b611f3/charset_normalizer-3.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:780fbe7cab297b81dad9fb8dc5eb003c0468ffb0d9e5f65068c53a34661a96bc", size = 207486, upload-time = "2026-09-30T04:35:52.194Z" }, - { url = "https://files.pythonhosted.org/packages/c4/e3/017aea0911ada7405a825c7d937eb3a13009664e2f5b38e8c4bbf2abf894/charset_normalizer-3.5.2-cp312-cp312-win_arm64.whl", hash = "sha256:e2af3aad578aa6bd1384bcf4750fc285e5a9de53f40b7d41e5a0bf748edeb2b3", size = 196734, upload-time = "2026-09-30T04:35:53.636Z" }, - { url = "https://files.pythonhosted.org/packages/c5/34/68292d68512768591aaff07c59bb53ee31341c87759433a859c4641a50c2/charset_normalizer-3.5.2-cp313-cp313-android_24_arm64_v8a.whl", hash = "sha256:ed905975ab14056a2e5eb1c376cb2e1ebc5396baf84163939c518556fccde9f5", size = 225946, upload-time = "2026-09-30T04:35:55.313Z" }, - { url = "https://files.pythonhosted.org/packages/e3/80/bee0b01b90ccd5322ae1d0abb33fab1bd95b7c2eadaf02aeccf22e04ee83/charset_normalizer-3.5.2-cp313-cp313-android_24_x86_64.whl", hash = "sha256:a66c3bc5ab1f0ff2164fc9965ddd611ff0802173f4b9d24554c563f6ab7e1d6e", size = 238619, upload-time = "2026-09-30T04:35:56.863Z" }, - { url = "https://files.pythonhosted.org/packages/78/6e/60ce52a85a7fd631ae8482ae6d74521014ca2f255892679484dc04d7ef56/charset_normalizer-3.5.2-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:d2374b62878abb00cd8309b32af6c0b715cd02dec0ca74ef12e5069bdc64144a", size = 206701, upload-time = "2026-09-30T04:35:58.639Z" }, - { url = "https://files.pythonhosted.org/packages/36/8c/71aafad23f971afc84c2b295bc0c560739ce1dac558aad9fec22e39f3639/charset_normalizer-3.5.2-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:d376bbd28b3a8999db1a103b3b388aee6f1ddeb3e51bc2172993efdcd86e064d", size = 210506, upload-time = "2026-09-30T04:36:00.147Z" }, - { url = "https://files.pythonhosted.org/packages/91/da/3c5a7798c046df7d2d68ad653cf5b6c5a8bfee225055a843c6f2f42aac1a/charset_normalizer-3.5.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:6045373d5a89a5ec71afde535db987ca28e76dfa276c2d4c818265b375d4b055", size = 366626, upload-time = "2026-09-30T04:36:01.77Z" }, - { url = "https://files.pythonhosted.org/packages/e1/16/710ac3de2ee354e2bd1a9c94efe45a2d27b5c6ad39b2d6a905be2c094b6c/charset_normalizer-3.5.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:849df64e889b2e17230d58410a03dba311a65b163508fd33679b2b737d4b7858", size = 244624, upload-time = "2026-09-30T04:36:03.389Z" }, - { url = "https://files.pythonhosted.org/packages/d6/39/45c7439f5b63d24f7d5b2a1d760f34af7628782d7144b4cc8ded45c2d4bc/charset_normalizer-3.5.2-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:15c44f7edfd477b06f517a5cc317fc1707edb9de2c865f43d4b6513907473234", size = 235731, upload-time = "2026-09-30T04:36:04.987Z" }, - { url = "https://files.pythonhosted.org/packages/4d/34/38f3154785ce92e9f56eb226f4d35bdfae6b008480dd055f58837a89c810/charset_normalizer-3.5.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a89012d6d5476ee112d20d998570ed58df2260a852afb1758809cd6900411d21", size = 270352, upload-time = "2026-09-30T04:36:06.412Z" }, - { url = "https://files.pythonhosted.org/packages/04/f3/859f74e7babc977705026b30593b3be04049632a522fb7000f83c033d747/charset_normalizer-3.5.2-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:0c951d5e6dd9c2ff60609476752bee49da4206adde960ebc247766937f72e718", size = 267393, upload-time = "2026-09-30T04:36:07.865Z" }, - { url = "https://files.pythonhosted.org/packages/4b/85/41d27f234b82e47c167a5f6c0f62501dc0c640585ff4aba79e08a390336a/charset_normalizer-3.5.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7218e8f32b0956cfcd048fd42d9d5779809745ca1d86113ca56f66e7ae1549c4", size = 254660, upload-time = "2026-09-30T04:36:09.248Z" }, - { url = "https://files.pythonhosted.org/packages/58/ca/5d1a997587febe5b26d8daffe363b5c1a091cece19828eec6502fd09c5ef/charset_normalizer-3.5.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a19a731138fc27d5682277d3b9df22855cea1239bce7fcec5f78f42ef2d1f3c3", size = 249996, upload-time = "2026-09-30T04:36:10.73Z" }, - { url = "https://files.pythonhosted.org/packages/b3/1f/d1e78246f7ed60c8c8d606b4ac27f66ce49cc3e95f24893ccbeba9f77302/charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:62603db9a7caa0802eaa28c1c46fecd7b3a263a774069c24c3c28c302448721c", size = 247028, upload-time = "2026-09-30T04:36:12.294Z" }, - { url = "https://files.pythonhosted.org/packages/8e/37/eba316edd4f0c4d3a5d945924c4eeeae59abac4056aa815d8a4268f863a2/charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:b6856554c4f44d79fc2307d5768854310a8f0096e501c75637542c82292b0429", size = 240562, upload-time = "2026-09-30T04:36:13.887Z" }, - { url = "https://files.pythonhosted.org/packages/c8/8e/aaa037d40ca9ef045977f1a661048b1aa33f223adfce3452fe9be9f79d14/charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:1bc0baf5ef96b6ede57d47f4b8fe4d9d84019c3bfcbeb20a41edc6a6ee341f1f", size = 271699, upload-time = "2026-09-30T04:36:15.41Z" }, - { url = "https://files.pythonhosted.org/packages/26/19/1c1c9f75974adf523b87f34b8a2adc5a435cd65916812bcbd0dfa45f9a29/charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:56bc200a365efb37383b7852e4cc5898d3b2da5987289b543956cf8cad71018a", size = 252030, upload-time = "2026-09-30T04:36:16.839Z" }, - { url = "https://files.pythonhosted.org/packages/bc/90/0660ef18e18df0a4d2a1a0edff7dfbba42d4e50ef2425557a5bb7051f77b/charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:2c9ad19a6cfcd5ea5c0d41161d22f9df1dcc277e9bef2751391334546a314c00", size = 268565, upload-time = "2026-09-30T04:36:18.468Z" }, - { url = "https://files.pythonhosted.org/packages/79/ba/57adc269824e8658f1a0f97a9e514c247445a9632b3419b97e0ba37f16dc/charset_normalizer-3.5.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e243bd13217235fc7290c621941c3f5cc8b66e4872495be821d7436ba2fb838d", size = 257627, upload-time = "2026-09-30T04:36:19.938Z" }, - { url = "https://files.pythonhosted.org/packages/9a/85/33abd4315c052d3d4f54c92b1ee49bfbc0dc7115a981e462a793b6d2ab87/charset_normalizer-3.5.2-cp313-cp313-pyemscripten_2025_0_wasm32.whl", hash = "sha256:a090bb2c68df85450502e3e20d665e3a5af9c65a84d6508ed477badd49166fd3", size = 143407, upload-time = "2026-09-30T04:36:21.376Z" }, - { url = "https://files.pythonhosted.org/packages/4f/de/6435e18d1aaa5d910b896d551411c96af1f42a0c56c29afc2016c61ccc2e/charset_normalizer-3.5.2-cp313-cp313-win32.whl", hash = "sha256:2b7b3bbfb4fe8ef40600792d762fbaa9057559f9d3fad209525b7a22b99e91fd", size = 183207, upload-time = "2026-09-30T04:36:22.776Z" }, - { url = "https://files.pythonhosted.org/packages/9c/76/b8ec57f4e9ee3253541abf95e4a462c0175fe8032dcd070f1f2421240942/charset_normalizer-3.5.2-cp313-cp313-win_amd64.whl", hash = "sha256:78456a747de8dc58360ffa581f30a002baf5aa28cb262536545e91f113ed7639", size = 206489, upload-time = "2026-09-30T04:36:24.306Z" }, - { url = "https://files.pythonhosted.org/packages/3e/60/c647c6ae47480221e875ea5d743ff94946f7416e3c69415ab772928e8d32/charset_normalizer-3.5.2-cp313-cp313-win_arm64.whl", hash = "sha256:11912e4bb14baae7c5d8791aa55ba0a3a03ec6729073307b0f57270abaa713d3", size = 195501, upload-time = "2026-09-30T04:36:25.846Z" }, - { url = "https://files.pythonhosted.org/packages/58/ca/7aa91362a2f77ac8e9e28a9b902a74f7d0e11a851ef0d27a74308da8cd90/charset_normalizer-3.5.2-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:1afb975bd5d68d5ce9f6b6d44fdf2f7e34b895a35e95708a7a91b20a3b51d187", size = 226010, upload-time = "2026-09-30T04:36:27.669Z" }, - { url = "https://files.pythonhosted.org/packages/a8/cf/ac8878d0322cf88a1aad4c7b147db32ca0bd806eb0060957b2e31486dbe6/charset_normalizer-3.5.2-cp314-cp314-android_24_x86_64.whl", hash = "sha256:bbbfc8e28816f19d7c0f1816664980c0a9875d01b27cdf8eedddb639d9e108ad", size = 239266, upload-time = "2026-09-30T04:36:29.434Z" }, - { url = "https://files.pythonhosted.org/packages/c9/6d/9a08d7e0b29b7208e2c6c01dc56c8e0520e7c7beadbbfb024b58fd69c8a5/charset_normalizer-3.5.2-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7967d08cf06dee78443b874f98c98036f624f3a4e73e11f9f64f5be4d25393cf", size = 206783, upload-time = "2026-09-30T04:36:30.872Z" }, - { url = "https://files.pythonhosted.org/packages/82/44/b0aa350280e6ff5a5492d17cf10460dd39d5ee848f872f7ba2df10607f60/charset_normalizer-3.5.2-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:4c2b5031f63e331e3839b40aed2dd6f191e9c07edbde303e7876846ea1946995", size = 210449, upload-time = "2026-09-30T04:36:32.625Z" }, - { url = "https://files.pythonhosted.org/packages/7c/8a/40db9aa9f5907bb0e6f8b6d64064bf8852fb33d4b813ff9414911df7647c/charset_normalizer-3.5.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:fcff63213e8e6e47770541a4607175404f47cbb3ebea7b6058cc82d524a0e424", size = 367815, upload-time = "2026-09-30T04:36:34.197Z" }, - { url = "https://files.pythonhosted.org/packages/7f/72/9c5e7707b57c8ddfa9ddf7b0b1d009d7fbab9e9e887d5b721060f37e307d/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8d86d6fc60743dc916eb79e2eb1ec4818e21e427731543af40a3021851174a13", size = 247095, upload-time = "2026-09-30T04:36:35.803Z" }, - { url = "https://files.pythonhosted.org/packages/83/09/71e453691e927de4ddf792770cfaab3f49d494e222f66ea5e404bbd5e39c/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:7a881931aa470808df94a8c380eed2bbbc76cd9dc622310f99665658c821eb6d", size = 233942, upload-time = "2026-09-30T04:36:37.407Z" }, - { url = "https://files.pythonhosted.org/packages/9f/86/85c84e4da8b27dd409577d9437926ff581c5f9d3c66038dc68c1a526de51/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8024d00c3faf3fc0c16e07a69f4405e8eac7cc0ab15f65fe6cf43827c4cf72b4", size = 273762, upload-time = "2026-09-30T04:36:38.904Z" }, - { url = "https://files.pythonhosted.org/packages/92/08/564955a4b5f2ccb410ab480bbe8c6a18063ff27f2d35458731c4a5335df9/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4d48f2d08b9de5864e2c8744d4461b862fb149a18274abc8b698c45975573438", size = 269514, upload-time = "2026-09-30T04:36:40.469Z" }, - { url = "https://files.pythonhosted.org/packages/18/24/bad3ac4271589df29cf5ce2f5ae490518a5739358052bd0d61209e6fea54/charset_normalizer-3.5.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:34276fd796040bf0993ab33a369aa572e6979c7aab225a88893667ad8eac8f7a", size = 255056, upload-time = "2026-09-30T04:36:42.02Z" }, - { url = "https://files.pythonhosted.org/packages/d6/3e/350d89ad49916b86554d6f5f2d03ec1152148f87e5ff735106c6a03b1a36/charset_normalizer-3.5.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0521c5665880b33d603717defa76c094048900010897909952397feb3039da56", size = 251311, upload-time = "2026-09-30T04:36:43.577Z" }, - { url = "https://files.pythonhosted.org/packages/56/5b/4970a2d154df502e133402906dd04e3ae7cada7b3011283c88d0479a2585/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:eff0ac9dbe711a4aee69bf04a83896aa9b85f19641264053a9f6d48573abb7dd", size = 250190, upload-time = "2026-09-30T04:36:45.185Z" }, - { url = "https://files.pythonhosted.org/packages/88/8c/f1a91bddc8fb47c2889e29ea7ea49a194eb0d9868675d786806519c00d76/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:1503bccbeb36d5527790c3930327704c39af22de3112f1b1666a9f3ce15ee204", size = 237098, upload-time = "2026-09-30T04:36:46.689Z" }, - { url = "https://files.pythonhosted.org/packages/24/0e/bb5dace3cc7e79068425386a6589c19b5a2ab5fefc2a46abea6919683332/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:52aa6992700996af31f375de0c6bacd402b0097fe40b53c426b9f51a90ebabc7", size = 274228, upload-time = "2026-09-30T04:36:48.31Z" }, - { url = "https://files.pythonhosted.org/packages/9d/79/b849ad523017ea9f5a45581bbebed91439e0cf42fd2860a6f64e358eb5a6/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:e09a3942ecbdee5cce73ea9d42da82b81b72ac1bf031ce069b93b5adf4eac8cd", size = 252401, upload-time = "2026-09-30T04:36:50.091Z" }, - { url = "https://files.pythonhosted.org/packages/89/8c/75469d690cf47200bce8f6cad7655724fc23148e147abfc5ce78b5f65863/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:c7c9ab723cde841fefb34efbad91e87f00a674b1fe1cd0784fde742bf2c154dc", size = 271846, upload-time = "2026-09-30T04:36:51.719Z" }, - { url = "https://files.pythonhosted.org/packages/26/cd/6d52d3c7437cdcf2e310ce9f28f282e733d4ef60ed19105d1819c356255f/charset_normalizer-3.5.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ddc7dacc8ece3a182e7f15cb862d1fd616b46d076cb1ae9dd232b2c38b655874", size = 258151, upload-time = "2026-09-30T04:36:53.234Z" }, - { url = "https://files.pythonhosted.org/packages/f7/4c/070b38bdb5f49a70199fce923ec0726a49536a63ab262abbfcaaf351110b/charset_normalizer-3.5.2-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:ee43c17b173d46a3212baa6ead3ae258eeabdae48c263a01ccf0218c366dd655", size = 143570, upload-time = "2026-09-30T04:36:54.816Z" }, - { url = "https://files.pythonhosted.org/packages/81/84/9ebfc8ed6c8c4fcd8e726ff6bf220cc8deb3966e31dce9be8dd8aa017e64/charset_normalizer-3.5.2-cp314-cp314-win32.whl", hash = "sha256:4f87960d57feabfb618e4e0af6e7371645fa26a277860739d6e5d6e0012c92f0", size = 186412, upload-time = "2026-09-30T04:36:56.643Z" }, - { url = "https://files.pythonhosted.org/packages/d1/78/5ed86f743d4bc350db307e7636419a0a5ee1d91806d30c7f667bd5c80dae/charset_normalizer-3.5.2-cp314-cp314-win_amd64.whl", hash = "sha256:e4e81e09c1578b8df602e3db08b0b3ea0a6947ad612f52bf8dc5ea8d47691f0c", size = 210965, upload-time = "2026-09-30T04:36:58.205Z" }, - { url = "https://files.pythonhosted.org/packages/53/94/a3a7698e9b1a395e1eb99ccd9a324be9347973bff4e72db2a06496d7cd27/charset_normalizer-3.5.2-cp314-cp314-win_arm64.whl", hash = "sha256:80d02b6f04e92601a081dd97b23d3128033098bff5d35d392ddcc0476ea11253", size = 200406, upload-time = "2026-09-30T04:36:59.764Z" }, - { url = "https://files.pythonhosted.org/packages/c1/48/c5dd00d5ef7791f02666de250a5bb6071e29b7e133cf4b835800b6d3bc27/charset_normalizer-3.5.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:dca9ab98072a5a54ebacebdc45f53e645336b320c667410b061be1ca588ae709", size = 396871, upload-time = "2026-09-30T04:37:01.543Z" }, - { url = "https://files.pythonhosted.org/packages/12/c8/8379554b42e8368161d898476686947a0fdbd3e8865170d7909dcabfdee8/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f0aa869112ef88429ae17820d99c3dd9504c9e9c671d3c246f3d7442cb051084", size = 249711, upload-time = "2026-09-30T04:37:03.111Z" }, - { url = "https://files.pythonhosted.org/packages/4a/eb/2ddb1035d17320caa9f41682935123a9a250277b261c3efc86b2d2a21343/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c0afc6800ba57ccc350374c5bd6150419915d95ce93cdbab2d783d75eaf30ecb", size = 231146, upload-time = "2026-09-30T04:37:04.721Z" }, - { url = "https://files.pythonhosted.org/packages/4a/24/2ecb4bde104322cd7859d6594fcfa74649f8d90b3221c9feecbef149875b/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7dcd882da75ef9adf94903b1e3b9419e8aa8fb4c7396822b834b9ef7fb96954f", size = 271552, upload-time = "2026-09-30T04:37:06.295Z" }, - { url = "https://files.pythonhosted.org/packages/3f/98/9d5f6ebc3aee9fef5d30b4aff11fb2ab7a1222b4064f8ef2c7c87cde217a/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2e06a3a98f916dd41d27f3105e02e7a40181c98c94b9158733d03a6f80506c09", size = 269810, upload-time = "2026-09-30T04:37:07.905Z" }, - { url = "https://files.pythonhosted.org/packages/09/e1/a3b06a10461b1b7628853c934c644e03bc28e42767116afb52f19a56519b/charset_normalizer-3.5.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6bd128f206a7752ae1f2ab6c61bf8a24ba28913a10df8b14c2637b973ff97a80", size = 259845, upload-time = "2026-09-30T04:37:09.554Z" }, - { url = "https://files.pythonhosted.org/packages/fd/d3/6f561f74a296cf27d61775a1dc665ad13f3bff6a798810ca05907f37a7c4/charset_normalizer-3.5.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c8f3d67aeaf55f017982b73683f0e7342ba2f6635a78f69ce89ebb26aa411e5c", size = 252825, upload-time = "2026-09-30T04:37:11.274Z" }, - { url = "https://files.pythonhosted.org/packages/26/9f/69e13ca3b18f43e0eafcd34c04a45b732ae22a43b54a5fc9e119103356eb/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:fe9753dfee015c570d73df76f899f18444d41388bffcde097deba51c4fadbb9f", size = 252659, upload-time = "2026-09-30T04:37:12.941Z" }, - { url = "https://files.pythonhosted.org/packages/73/a9/ace29806a0dae18939919c76ba526472d83214afa101105fabff2cf30625/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:92888bb3187c5ba50500b00b3b310c9f2c651709d28036077680cb5255450a03", size = 238819, upload-time = "2026-09-30T04:37:14.659Z" }, - { url = "https://files.pythonhosted.org/packages/f8/c1/6116d52a2e3311ec80f21f5fb5e17b27405f10b9608af8f6e69516841a1b/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:d008d90a7f2471519aef0c90dfbe73b3e6e4d5e66ac48e19154c17e89e98b604", size = 272973, upload-time = "2026-09-30T04:37:16.346Z" }, - { url = "https://files.pythonhosted.org/packages/19/aa/9955c7e93bba10a9c7e8f7a5031b7ced66f3a1883a55c00712b8d5850ff3/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:31f3930700408d211f13378ccbe1c40845d8da54bd0681fac3a9b5aae81c7aa8", size = 253692, upload-time = "2026-09-30T04:37:18.212Z" }, - { url = "https://files.pythonhosted.org/packages/bb/33/2a6ae7fdc1b10cb581cef91addd8cdfc5f40d50abb5702309369d5834579/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:2a925889534b3748302dae5dead07cc13480de1dac3aea80a941b729b471ef93", size = 268757, upload-time = "2026-09-30T04:37:19.877Z" }, - { url = "https://files.pythonhosted.org/packages/a2/22/80992720a0282cd39bba1db35868e6b9c22f41281160143a836544bc1d8a/charset_normalizer-3.5.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:f5ec61164adcec446f8969a3358ec3f9b26bbda3b9213e5586d219afa8df2915", size = 262220, upload-time = "2026-09-30T04:37:21.583Z" }, - { url = "https://files.pythonhosted.org/packages/92/9f/181fd07e1bffea1d95cd80c84ac537354f50699c22cfc4d3c02b6fc16208/charset_normalizer-3.5.2-cp314-cp314t-win32.whl", hash = "sha256:598a11a2c7ebaa5334bf698bf29568c9c390abac6a154d8170fedecd1cea38c5", size = 197797, upload-time = "2026-09-30T04:37:23.235Z" }, - { url = "https://files.pythonhosted.org/packages/49/1c/25d8415ec1c4f2f41f1680435e4c87cfb378ff2f677d950946f2a45d0632/charset_normalizer-3.5.2-cp314-cp314t-win_amd64.whl", hash = "sha256:7fdde2c9fd9e3eca40631e024664cf2584272cc8f96308cbe5fdfc930f51d8bc", size = 222765, upload-time = "2026-09-30T04:37:24.891Z" }, - { url = "https://files.pythonhosted.org/packages/3e/b4/46b48f013dadfc0d0d33b375438e31bdf5a989dc68389c6bf627054d4df9/charset_normalizer-3.5.2-cp314-cp314t-win_arm64.whl", hash = "sha256:d1befeed746d247c81127bb14de9dc3d30edb6e5976d34f83f86ed262b1d9105", size = 210985, upload-time = "2026-09-30T04:37:26.634Z" }, - { url = "https://files.pythonhosted.org/packages/ca/e9/34e597dee616d0b8ee4b34d29399e85c2204ade174157a48505d42baa4ff/charset_normalizer-3.5.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:87475fabc8d9996fd9c27debb395e642e8c838d78a00b6e932227a0e06b81e26", size = 367676, upload-time = "2026-09-30T04:37:28.329Z" }, - { url = "https://files.pythonhosted.org/packages/60/9f/a5d1c91c0263745e2cd344c5a4415d787c575501ab1d449f1148ac6b495d/charset_normalizer-3.5.2-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9409a8bf35cf78353942504b24a57de3d75b708997a1e4bd8db71ac8633ce364", size = 248414, upload-time = "2026-09-30T04:37:30.167Z" }, - { url = "https://files.pythonhosted.org/packages/26/79/e697f77464748a3ee3cf490c83d592459400d4898380d66c38366b03080c/charset_normalizer-3.5.2-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:498dc3188ca05a68231ac3fdbfc7f57eb67e1343c30e0fea17f8218c1599b253", size = 244775, upload-time = "2026-09-30T04:37:31.964Z" }, - { url = "https://files.pythonhosted.org/packages/ca/87/3d42a42e18ea066e2513936fd678a00696e77878b5ae04528976abdbcb83/charset_normalizer-3.5.2-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e242bb1c5e76e97dfa9e7f209a71e93a01d7f19ffdd5cfbb2e2d55b4f08f8ab0", size = 273877, upload-time = "2026-09-30T04:37:33.661Z" }, - { url = "https://files.pythonhosted.org/packages/c3/76/8a28136f3938ba9836f84280ce0c4d61ed1cf15a036b2034900c62634162/charset_normalizer-3.5.2-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:def79fa35ef0cef8d2accec024f4fdc7ead3012ff02f5215c783f39f03ef8cfc", size = 269455, upload-time = "2026-09-30T04:37:35.573Z" }, - { url = "https://files.pythonhosted.org/packages/a0/a1/4fbf5d0f0f1b2a080474c1cf9a2f12c4c6531bb0e8ba591055e846d2b4e9/charset_normalizer-3.5.2-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3df041de8887954562c9b261cba85ca0e9ded74048daf125f45edcfaa4832229", size = 257336, upload-time = "2026-09-30T04:37:37.397Z" }, - { url = "https://files.pythonhosted.org/packages/ba/a2/8b50aa320adb880ad579518e6f718f24944804b42a88b83d267d5d444125/charset_normalizer-3.5.2-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:04851f73ae72b8413dddadb16a49dfee95263553741fd42d546f7d66907e6be5", size = 257584, upload-time = "2026-09-30T04:37:39.522Z" }, - { url = "https://files.pythonhosted.org/packages/a5/57/50e3fed84e175f40349bd0da7a4fce94c87f0378f52d74f511d89e0bdc20/charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:183b88127acdb4fabe59d951ab424faf1af7b63cdbb5f776186c1ea2ffcaed98", size = 251854, upload-time = "2026-09-30T04:37:41.23Z" }, - { url = "https://files.pythonhosted.org/packages/d6/54/f7fbb3493c9f49091213b9c2d6dd65800696f1ce1a3f196a4205f50417b1/charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_armv7l.whl", hash = "sha256:16fa0eccf81304b79c5cd87f9271c3b85dd9dd99245e4422ae9c0dd45e0f99d3", size = 248767, upload-time = "2026-09-30T04:37:42.883Z" }, - { url = "https://files.pythonhosted.org/packages/d9/37/b3a6385acc5a1e45b39ae9c90bfb9cf838a09b9dd37ef2740ab4c6b4a2eb/charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:7441d755b7ab94f8d4eb3e43ec05482d760842fd263d003a99102d742cd835e2", size = 274479, upload-time = "2026-09-30T04:37:44.658Z" }, - { url = "https://files.pythonhosted.org/packages/89/44/809913e2cfd279e635a9294fdbbfb1b1dc62a8189d473d561f649fce98d8/charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:ca403d7e4798f525fdfc78e258820419cbbd0f0ecbab9de7840e3c017cf6b8cf", size = 258310, upload-time = "2026-09-30T04:37:46.529Z" }, - { url = "https://files.pythonhosted.org/packages/af/a2/f28400ab13359d91bd39179df8e149376b9bf36588e739a3a4f9de2b84b2/charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_s390x.whl", hash = "sha256:df29a0a7107f7011e77f4eebdddec4c7331e24d787a0b21a46d63bdf7445da95", size = 271100, upload-time = "2026-09-30T04:37:48.399Z" }, - { url = "https://files.pythonhosted.org/packages/e9/89/9bab37955edf0adb3b66f8a3a6617d9f2f487e0d56f295a6a286cb640aa6/charset_normalizer-3.5.2-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:f3c96f633825733f735c5a9cf21d21a257d8e1edf0b1cee0a064b9c424ca0f7d", size = 259936, upload-time = "2026-09-30T04:37:50.023Z" }, - { url = "https://files.pythonhosted.org/packages/23/b5/4459e08d45a679f903d50fea08bc52cfa728cca4d7bd02c757b5e5abda2e/charset_normalizer-3.5.2-cp315-cp315-win32.whl", hash = "sha256:281cb91036248400f4cc957495cccd44c275c2e0c5854f7e45ac5cf7dc193847", size = 186301, upload-time = "2026-09-30T04:37:51.722Z" }, - { url = "https://files.pythonhosted.org/packages/98/e8/55d5fd3935b4bce6da4fe0df61898e8c82653e317e677bd58aceb9c60f13/charset_normalizer-3.5.2-cp315-cp315-win_amd64.whl", hash = "sha256:89b53f3cda69831909888e0494f4fa0bcd3537e3e138dabeb620bd6ad946bae8", size = 210858, upload-time = "2026-09-30T04:37:53.427Z" }, - { url = "https://files.pythonhosted.org/packages/a9/5b/974423c2fd8e524c7a7f64318c1e02240ef954912fa2b4d70344107b9c68/charset_normalizer-3.5.2-cp315-cp315-win_arm64.whl", hash = "sha256:6be488a102b8cf28d0391d8c4ba7748938ae28b78ad901f8585520fca33ead1a", size = 200309, upload-time = "2026-09-30T04:37:55.015Z" }, - { url = "https://files.pythonhosted.org/packages/ee/f9/00ee0195db1013d8f7c416fd770fbeb560bb46eb2e36b054d05cb56f6cfa/charset_normalizer-3.5.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:915563965d418f986e7e145accc592eae9e1a1be3566ff98a05d7a9ec42a76e1", size = 395343, upload-time = "2026-09-30T04:37:56.743Z" }, - { url = "https://files.pythonhosted.org/packages/04/3a/c00b50e94c964cf934c7899cd47c97952fc11dad71cc5884b3c61795b09b/charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:65cd72beeeca9d3aaea1201e5923859f308f952f9c71de93f06063c79f0f7a3b", size = 250114, upload-time = "2026-09-30T04:37:58.607Z" }, - { url = "https://files.pythonhosted.org/packages/50/27/d102dc880bbcffd0479ab64dfc1fb96777a854355a55e2bda72a71efadcb/charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b7fd005a73d9e657273b7a10dc71a9e03c8fb9ee6999798d6918ce095b81ac7f", size = 239997, upload-time = "2026-09-30T04:38:00.511Z" }, - { url = "https://files.pythonhosted.org/packages/a5/4a/bf7ef45794dd293fab5f98a9309817977fbb845b9998f171b8cc5d8437a3/charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e54da4baf05720032d527874d40b65fa4d7e5c6c6a43d0c3adbeffcaf275a2b3", size = 272313, upload-time = "2026-09-30T04:38:02.509Z" }, - { url = "https://files.pythonhosted.org/packages/e8/ee/008a2837737991474c5754bb3191010007663860979701990982a502cbaf/charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:124fbf1a8ff966d87ae05bb8bd45a71f966055ed8bba320d0c7cf450bc5f4d0e", size = 269986, upload-time = "2026-09-30T04:38:04.435Z" }, - { url = "https://files.pythonhosted.org/packages/93/ad/bd74a283940dc910c5b14f8e4f80a248082bc9c0fcbe1f54530cb6d9cc5e/charset_normalizer-3.5.2-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:28b4f0d66fb834ff90f28209ac7bce77868c45d8c93e26f906709d9b7c2e1af9", size = 260202, upload-time = "2026-09-30T04:38:06.549Z" }, - { url = "https://files.pythonhosted.org/packages/8a/7b/ed341c66f69f688723501fac752be3d63c7159ca0d0d4174fc611e5710bb/charset_normalizer-3.5.2-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:58ca3755ee7ff7f59b57789ec9833c9de9ea275405cdd240eda1f193112e398a", size = 259083, upload-time = "2026-09-30T04:38:08.311Z" }, - { url = "https://files.pythonhosted.org/packages/cc/9d/e41588b777965e5031a43128a1e96173ebb35ac75fc53ec3b517e7c21cd4/charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:443eae2bf318abeaf6f15d785138f71fd6de770e99a92158b8b814265e079115", size = 253081, upload-time = "2026-09-30T04:38:10.402Z" }, - { url = "https://files.pythonhosted.org/packages/81/35/b761eb6d8c1eb218b9b42b9b4d5ac902afdc399fb6dac6f9a9aac7bda589/charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_armv7l.whl", hash = "sha256:58f361dcbab699cf8f42db3f47c8e7fd1036f138c23a5d08de9fde5f425a730c", size = 248712, upload-time = "2026-09-30T04:38:12.317Z" }, - { url = "https://files.pythonhosted.org/packages/4d/2c/147169a041b747759f37405c0a97157e8e92de967968373101ff14915cba/charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:1b4cbc7c3491ccb4aa17fcd8165649d01cf39f76de1696da8631b5f71b85401d", size = 274176, upload-time = "2026-09-30T04:38:14.138Z" }, - { url = "https://files.pythonhosted.org/packages/f0/2d/0ff8db0d373ba8538db686db11cd7e8912031490b9e4f383b41912e8d594/charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:ba0b1d2620edf869789c3879223f52bf2afc5d31b3cb47cc57b3a12c05e2aa9d", size = 259413, upload-time = "2026-09-30T04:38:15.841Z" }, - { url = "https://files.pythonhosted.org/packages/8a/8e/b4a085fb47c9d3a7e43576a4784fdd8fe23f907514a972de8086edaf7a48/charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:5e2b6b57e9733d39f0c9fd3185efa6b8e29652c4cd8fe94180272cf6ed9a78c4", size = 269434, upload-time = "2026-09-30T04:38:17.626Z" }, - { url = "https://files.pythonhosted.org/packages/83/1c/d8d8d7322a7c3eecdf3237a4a419cf41d2eaad8e006ce7dfdd9d4c8fa2eb/charset_normalizer-3.5.2-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:51cf45226a9b588d0d2b4880c62d686934b63ab0bd79ca23ab0e9762eb27441b", size = 262716, upload-time = "2026-09-30T04:38:19.214Z" }, - { url = "https://files.pythonhosted.org/packages/a0/16/0e4c6ba9b44e97a2da150e52d331e8f9c968b21b358fbffa6c856cebcd89/charset_normalizer-3.5.2-cp315-cp315t-win32.whl", hash = "sha256:5fb29fb8cd1a46c27a1bf9613ad5ec2599310d46b4025d9556404a6b6a292800", size = 197159, upload-time = "2026-09-30T04:38:21.037Z" }, - { url = "https://files.pythonhosted.org/packages/be/33/e90bc2b1374f7f36ef106f56620de5a783907e19ca857efe2277e31cac3e/charset_normalizer-3.5.2-cp315-cp315t-win_amd64.whl", hash = "sha256:a192e2c40070d92c3ccf777e3a5c4ff515573cd2bb7ed0c537fdadbbec5bbf21", size = 221322, upload-time = "2026-09-30T04:38:22.886Z" }, - { url = "https://files.pythonhosted.org/packages/66/89/dfa6dcb08c200b7830ab56439e8c1890f2971d51aafbb3937894a2e7fcfc/charset_normalizer-3.5.2-cp315-cp315t-win_arm64.whl", hash = "sha256:749e97e1b32313717a565abbe321bc2190bc8b35f1a67e4cdbc7c56c8d8ffe58", size = 209192, upload-time = "2026-09-30T04:38:24.648Z" }, - { url = "https://files.pythonhosted.org/packages/8c/ab/176fbfd5b64939c55d652366aa5b9ef1d767af207a3aa6ebeb0d226c484d/charset_normalizer-3.5.2-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:4275811936e2f06feff5e598fb42a1b7ae852da8e39605211892b56b81a34efd", size = 331815, upload-time = "2026-09-30T04:38:26.216Z" }, - { url = "https://files.pythonhosted.org/packages/7e/84/371eac6b30bdbcbf2d632a1a01809103459216fcaae61b8b8d922c1bfb8a/charset_normalizer-3.5.2-cp37-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1c50fe28bbc2ced33386f298650d91218076c05420e6cbd790b913adc41659e7", size = 253276, upload-time = "2026-09-30T04:38:28.032Z" }, - { url = "https://files.pythonhosted.org/packages/43/6f/c4fbae58febff71709c51bc7e18fdfa55341dc382704740f9f0cbf03817b/charset_normalizer-3.5.2-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d19fbd981a488e22cd04883659ca6b08f50b5974f9fd7c95655ef6a043e5893f", size = 241239, upload-time = "2026-09-30T04:38:29.732Z" }, - { url = "https://files.pythonhosted.org/packages/61/71/458c3f42164a07d0c5210798e9e704b39e540a6793b05aba67f3a35243a9/charset_normalizer-3.5.2-cp37-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0fed1d06615f022ee3b13caf5e8b180cfea32bb2c5aded8a9d44277afc040f93", size = 231121, upload-time = "2026-09-30T04:38:31.462Z" }, - { url = "https://files.pythonhosted.org/packages/09/54/ab9e89367076f6331bb6c65c4bf14a5361fa5191cb6561bf534f18504e1b/charset_normalizer-3.5.2-cp37-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:838dcc90063569a0448120554591a1d6c4a4ffe11babf048908793154ab86ade", size = 260350, upload-time = "2026-09-30T04:38:33.239Z" }, - { url = "https://files.pythonhosted.org/packages/7c/c1/061431ecc688d9d76602502cb57cc01e691e682c18f1beb45f9673b5bbd2/charset_normalizer-3.5.2-cp37-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2ce45c6627b22c47e390bc91a41c3d13032192e699fa0bea96e9671b373d69b0", size = 255430, upload-time = "2026-09-30T04:38:34.865Z" }, - { url = "https://files.pythonhosted.org/packages/8d/1f/20c8949f0676f7ab811abdeb7f4d7f1cbc6e61ff20bef08b44edeb092bc8/charset_normalizer-3.5.2-cp37-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0774bf9bf620249fee3e0b8b9fd3065de213be30f3aa94ce2494b3b638949e26", size = 250612, upload-time = "2026-09-30T04:38:36.649Z" }, - { url = "https://files.pythonhosted.org/packages/2b/9e/46f2fa4c431fc98c4ae76a8cb5bdca54e0341e3cfc3fcfd8e82740250818/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1db38f4c5496827c1a501846d64d14c3b80c7e6714e406cd7dc36a9899fa1011", size = 242083, upload-time = "2026-09-30T04:38:38.26Z" }, - { url = "https://files.pythonhosted.org/packages/bd/39/559be29a0c0f086e0bba6922babd38916cc5e0b58ced4de13ee01ea05508/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:304d8e4d493af723536393eee0c689eb7813f4a474c8b479dee63f1fdd98f621", size = 232738, upload-time = "2026-09-30T04:38:39.81Z" }, - { url = "https://files.pythonhosted.org/packages/ff/6c/387b0e4f756a282831c1d9fc6aeb6c51ca4507ca202767c8de15ce9b12e2/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:9b7f416ff0978e2f2249330527f0ad6fa02f4932e6199692d3b52da2048c19e4", size = 260703, upload-time = "2026-09-30T04:38:41.346Z" }, - { url = "https://files.pythonhosted.org/packages/96/92/1fdf015f09ef449f50d3ac4b67c90887c9c318b727daa95cc4f866e6521d/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:01077390b03f7988f11d700a2194e69b119741a86b1a638b1db88891e3eced8e", size = 247622, upload-time = "2026-09-30T04:38:42.937Z" }, - { url = "https://files.pythonhosted.org/packages/dc/3c/8e7b8a5671ad5d433669fb2a76f1a0164df2d9b1718b0206bc2a16d840cc/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_s390x.whl", hash = "sha256:7e841fb9010836c992c9f12fcbd43a831de93a5f726fc1ccd8ca1d0268c5014c", size = 257500, upload-time = "2026-09-30T04:38:44.604Z" }, - { url = "https://files.pythonhosted.org/packages/b4/f0/45b579df5cabc1d5d53ea1cc35e8437d3ca768c0acccc7041517cb6fbb32/charset_normalizer-3.5.2-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:9cae88599c7219005d879f98e5ed53341e9a122af585e1091200358a3003d2a0", size = 255100, upload-time = "2026-09-30T04:38:46.289Z" }, - { url = "https://files.pythonhosted.org/packages/31/68/fdec18a343f5fb3f310588dd478b09ac4799e0b187dbade3a8cd776f03ef/charset_normalizer-3.5.2-cp37-abi3-win32.whl", hash = "sha256:01b0c0d2262a9e28e8484a278c7e1b5d650e3ac8cf2683d2967e25899f208bdf", size = 174499, upload-time = "2026-09-30T04:38:47.999Z" }, - { url = "https://files.pythonhosted.org/packages/9d/8a/b618149cc5207943a0242068d7a27897f56a62947b5a039085f2a22029f8/charset_normalizer-3.5.2-cp37-abi3-win_amd64.whl", hash = "sha256:9f56f72050826f63dcee7a7f55b0a77168cb3bfc553fd405e7f8f9ece75a4036", size = 200092, upload-time = "2026-09-30T04:38:49.707Z" }, - { url = "https://files.pythonhosted.org/packages/03/cf/4c66866fa9e2b1c78e3c911516d1de497a677b7ac60f1eceda74ce777ca3/charset_normalizer-3.5.2-cp37-abi3-win_arm64.whl", hash = "sha256:40ab6bffa02ae10a0581e6c198be7d2d8ca5c2a0c64e4ed3465d766df457573e", size = 294363, upload-time = "2026-09-30T04:38:51.312Z" }, - { url = "https://files.pythonhosted.org/packages/fc/ad/d07d7862a62ffa6d79d68074d14823243dd235a77c45262acbf6adeb28bf/charset_normalizer-3.5.2-py3-none-any.whl", hash = "sha256:b6b751274acb69d77b3323d6b7dbaa3c7fdfc1eb829b7eb61d262f32e1af9685", size = 68872, upload-time = "2026-09-30T04:39:21.828Z" }, -] - -[[package]] -name = "click" -version = "8.5.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/c7/0e/7fa0ef50764b67090eca4114772a2abf8b6148198475e54c660b97caeee6/click-8.5.0.tar.gz", hash = "sha256:ba0d2089de75ea0310e2dde03160e6ca10009947fb95a182f9b54021bb272e34", size = 382235, upload-time = "2026-08-26T13:33:14.56Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/58/50/6c0d534c5f134586a8e1ba4e330569e32f057e33372ae556463212fb4cd3/click-8.5.0-py3-none-any.whl", hash = "sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360", size = 125251, upload-time = "2026-08-26T13:33:12.928Z" }, -] +provides-extras = ["test"] [[package]] name = "colorama" @@ -353,451 +38,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, ] -[[package]] -name = "cryptography" -version = "50.0.2" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/9d/af/182eb91b0df3fe75c4d9f26fe70684569566745f6ba7e5c9c73a862c5252/cryptography-50.0.2.tar.gz", hash = "sha256:7b46165bb56eb4704e2eaaf86f3c940d19154535d9b0ca7d6d590b04060e00d5", size = 880623, upload-time = "2026-09-30T15:30:04.884Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e5/56/d194340cc4a57535e82e1bee9e89667ac4b7c13b5d3f59686deae3094dd5/cryptography-50.0.2-cp311-abi3-macosx_11_0_arm64.whl", hash = "sha256:fa8f5efb344d6908a1ce62f4a24e2e5780f825d6f53f5f50ec5ffacac72936cb", size = 3914904, upload-time = "2026-09-30T14:43:44.339Z" }, - { url = "https://files.pythonhosted.org/packages/d9/69/c9bd862c3bf43d6399c433caf002df16e2dffd4be49bdf515cda38038711/cryptography-50.0.2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:79def8d059362e7831389ed3be0ecdf58a89386e1271e35dd9f5af84e81bffd0", size = 4731146, upload-time = "2026-09-30T14:43:47.113Z" }, - { url = "https://files.pythonhosted.org/packages/21/69/64cef1f702bf6657e0cc186ed1a2891d50d29fb41586b254e1c07adea261/cryptography-50.0.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:630ebfea3bf689d075f82316324ff7433dc447fe6bc1bfc76524b74b4a9567d2", size = 4719841, upload-time = "2026-09-30T14:43:49.01Z" }, - { url = "https://files.pythonhosted.org/packages/38/6b/61a3f8d8c5e1e49a6cddccafc4015cc1c0021360ab0acb4080e7a423644a/cryptography-50.0.2-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:f9f6143a8c75945eb960d9eb98905a441394abfa24afaae239d514ffb2586480", size = 4738340, upload-time = "2026-09-30T14:43:50.932Z" }, - { url = "https://files.pythonhosted.org/packages/7b/2e/7212ca32fd43dc91f2f41db20160b268098874b4c9a0e7be94d6835f5b2e/cryptography-50.0.2-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:a582ab2ae1d34f67112cadc86702774c9ea4374df6bca6afe672817203c99134", size = 5367029, upload-time = "2026-09-30T14:43:52.911Z" }, - { url = "https://files.pythonhosted.org/packages/1a/f1/b474e930c4d910328780e3940da76f5aa5cbc48ce1fc14e44d239d9ea9db/cryptography-50.0.2-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:4061c0079120205fb760c58acab6443e217307dcf05e3702cf970e0689972856", size = 4753050, upload-time = "2026-09-30T14:43:55.272Z" }, - { url = "https://files.pythonhosted.org/packages/7c/52/9af10e80ac16b0fcc2123f9cbd5e7afbd0fd5075bb7a607c592258a39cda/cryptography-50.0.2-cp311-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:ac9ed99d81760c62fe89d5f0815cdfa1ba9a35141cf30f1c2d044f04b4803d2e", size = 4376724, upload-time = "2026-09-30T14:43:57.24Z" }, - { url = "https://files.pythonhosted.org/packages/71/37/6202e488cc1eb625ea110c292c6bda92823176e023f427d8d5660ce8d632/cryptography-50.0.2-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:87e9ce85beb6b328ba370cc6e6aea483c92617b4c95b1d33a49297eb662bfb04", size = 4737859, upload-time = "2026-09-30T14:43:59.541Z" }, - { url = "https://files.pythonhosted.org/packages/8f/30/e86d7d518489b0ae2497091a35287abcb1a2ce4037837a34afbe9b1d6964/cryptography-50.0.2-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:f265528741e048bce55c3463ed721fb0aa45a5888d8add8cfeccb3035451bbdc", size = 5324103, upload-time = "2026-09-30T14:44:01.901Z" }, - { url = "https://files.pythonhosted.org/packages/d3/69/2c833a049475e0a3444e94c7d0aca0aa51d166374a449b09e92ac98138de/cryptography-50.0.2-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:9dab55f57c74c3cad24c323bacbbd04be4705ba6eb0d92e920b1fc4837ed5079", size = 4752576, upload-time = "2026-09-30T14:44:04.545Z" }, - { url = "https://files.pythonhosted.org/packages/6c/5d/906970b83bbfc1f5bbfb677a143c181f2801f23b6a7204a3b47c42c97e65/cryptography-50.0.2-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:25784ce8b9621c90c643efb9e1e2162ab3b0224cae446ad5e70e7fcb1ce18b51", size = 4870819, upload-time = "2026-09-30T14:44:06.884Z" }, - { url = "https://files.pythonhosted.org/packages/68/e3/f2298d3bb55e0c4a91841ec4d01b3f020ba8c5fbf15ccdcc6dcf03f97025/cryptography-50.0.2-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:85d0d9a31b9098e98534226d5686b47264b95e62ce459dc2e62fdfc809f9fe93", size = 5030152, upload-time = "2026-09-30T14:44:09.443Z" }, - { url = "https://files.pythonhosted.org/packages/9a/4f/adfc442765721292fff86d314ce385d3249d22db42295c0dd057727b60f3/cryptography-50.0.2-cp311-abi3-win_amd64.whl", hash = "sha256:7afa5a6602a9f29af1f3a2965f831bae7c9d5d597b7cbb716d41ab3b7d89879c", size = 3824692, upload-time = "2026-09-30T14:44:11.671Z" }, - { url = "https://files.pythonhosted.org/packages/ce/cb/52eb3770c0d0be2702a98c6e96065ddc0a2877cf0845aa9c23397c142cd4/cryptography-50.0.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f785f6161f202ab04d8ca194158968798e480ca058943907972da5f12e2881e8", size = 3892731, upload-time = "2026-09-30T14:44:13.485Z" }, - { url = "https://files.pythonhosted.org/packages/19/8e/aa1fc533d4546b127b45de8aa024eb5933d23eff9debfe25931e56861095/cryptography-50.0.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:0ecbc5652bdb6fc9eaf89a7d196e20941adfe812f43bc4ca05d9150496821047", size = 4710431, upload-time = "2026-09-30T14:44:15.427Z" }, - { url = "https://files.pythonhosted.org/packages/6a/64/72bc3f75176e7e406b748a3e3830432b8c51297b38368713df04dc04898a/cryptography-50.0.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ab50ee449bf968271e820086f10a33d101dd060370abc10bcd22279be2656539", size = 4694824, upload-time = "2026-09-30T14:44:17.69Z" }, - { url = "https://files.pythonhosted.org/packages/4e/c6/62c77550edfa5ca3f14bf44a1e6739b9fa09d6e998a11d97ed8213bccc98/cryptography-50.0.2-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:a9f7355e6fab51f6c369b86fb7571cffa05edee2c2121e0380a37fb9ac1cd5c1", size = 4716967, upload-time = "2026-09-30T14:44:19.661Z" }, - { url = "https://files.pythonhosted.org/packages/f4/37/cce70f150c432914460157a6ecc161752e053aa5ec0ef3b3f7dc6e31039a/cryptography-50.0.2-cp314-cp314t-manylinux_2_28_ppc64le.whl", hash = "sha256:94e5e9f108ee10471288214d3d233fbfbb492840a8457eb85178d643ddeb32c7", size = 5328676, upload-time = "2026-09-30T14:44:21.744Z" }, - { url = "https://files.pythonhosted.org/packages/aa/9a/6f2f0304d634ceafdeaf23e84537336664ac419b5d07611675c2ad3f6b7a/cryptography-50.0.2-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:241449bf940a5d27309bd317e6f9a2af6932113818bb2b8f5c59ddc7ef16da18", size = 4727698, upload-time = "2026-09-30T14:44:24.178Z" }, - { url = "https://files.pythonhosted.org/packages/1d/de/66bcf9244d118663b2e1aaded8990f4640e3d7b7411870a5765f252074d2/cryptography-50.0.2-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:d8947001be83df1394050758ce0e745dd74fb134eef0a4b5124208dfc3a68c37", size = 4354821, upload-time = "2026-09-30T14:44:26.263Z" }, - { url = "https://files.pythonhosted.org/packages/bd/e6/db28a28c7b6c676addce89136de3d8db49ea825a8c863472e36e42ead4ad/cryptography-50.0.2-cp314-cp314t-manylinux_2_34_aarch64.whl", hash = "sha256:4a20ce1e5cb4284a86692fdcba7cb8754185c6b2e5c56fcef3751cf451d3cdc2", size = 4716748, upload-time = "2026-09-30T14:44:28.447Z" }, - { url = "https://files.pythonhosted.org/packages/30/96/01546c7f69ea0e2ab790a2e4f0934a4052fb9b388147fbf83c2fd72f1e57/cryptography-50.0.2-cp314-cp314t-manylinux_2_34_ppc64le.whl", hash = "sha256:84f964e537f916e2cc85199e5a88742e964939b575ac8598b3f9d6cc416cdaf1", size = 5285085, upload-time = "2026-09-30T14:44:30.704Z" }, - { url = "https://files.pythonhosted.org/packages/6c/01/03263395f74d50b071e9e66daace3f8bef80493e5d410726f2ba8554736b/cryptography-50.0.2-cp314-cp314t-manylinux_2_34_x86_64.whl", hash = "sha256:828d49b0ff5a0e3975865571c5d91dbbdd0d38d8289b249a163e9425413a5e05", size = 4727268, upload-time = "2026-09-30T14:44:32.92Z" }, - { url = "https://files.pythonhosted.org/packages/eb/94/2bfe8f29ec0cc9c0d99359c4161adf32858e4934b72c6d100d2ac0bbe962/cryptography-50.0.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:deb9fde5c60e437ee4821bc9bc39ff31b42135c27e1dc61ef0a629389c1de62e", size = 4849503, upload-time = "2026-09-30T14:44:34.969Z" }, - { url = "https://files.pythonhosted.org/packages/54/44/e80651ecbf0e42b62e2bb5f5768916e07eea72e1297338956a61df361f88/cryptography-50.0.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8c71ba2cd31fc93748c38e1b613200ff1c2665cbfd5341fe3a61cfde35a1430e", size = 5004057, upload-time = "2026-09-30T14:44:37.064Z" }, - { url = "https://files.pythonhosted.org/packages/f8/cc/1d33befb3cd7ea7e77d2d73f43f2066471da1b21f24a6156efcaabf6d2e8/cryptography-50.0.2-cp314-cp314t-win_amd64.whl", hash = "sha256:78198641e5be9521beea5aa782bb551a58068d10e6eb04c9c680c1b69f2e7d45", size = 3795868, upload-time = "2026-09-30T14:44:39.71Z" }, - { url = "https://files.pythonhosted.org/packages/2d/49/93f6a6e7a87c9aa68d44d3e1cdb5fe8f60c90d5d2f46acae9a56892816b8/cryptography-50.0.2-cp315-abi3.abi3t-macosx_11_0_arm64.whl", hash = "sha256:edc3342adf8f697fc5f59c887a304356f147b397809440ed64e2fa6af2f50f37", size = 4133708, upload-time = "2026-09-30T14:44:41.807Z" }, - { url = "https://files.pythonhosted.org/packages/8c/75/32ac2a56243d778805c16ca6a32b8f74fb757df7e28d7ecb560afafb59cf/cryptography-50.0.2-cp315-abi3.abi3t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d370b8d1dfcdf7130178137f6fbee6140774a1acc6cacefc4b42643ec11d0a3a", size = 4956267, upload-time = "2026-09-30T14:44:43.693Z" }, - { url = "https://files.pythonhosted.org/packages/aa/a4/2c8d734e43d97f0842ee9f1b7b4bfb3d0cf5e19edebf43c2afe6675c2320/cryptography-50.0.2-cp315-abi3.abi3t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f2f9bd7f90c64fe89253f0a2c05e3c4856072660429ce8831b4235bf29403a67", size = 4966465, upload-time = "2026-09-30T14:44:45.769Z" }, - { url = "https://files.pythonhosted.org/packages/c2/58/ee288c829a6f41f6235ae9dd33d82fd19b45442b65b4c8a3da36963d9f7a/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl", hash = "sha256:e275096ea1e60cc595cda2836fd4a6c725d1125108b868be17f53684d164e2cc", size = 4959356, upload-time = "2026-09-30T14:44:48.211Z" }, - { url = "https://files.pythonhosted.org/packages/92/20/9ded6d51ddd9897f6b6e81fb9ebea7951d7cc5d6c890b0ed8abf77a51a80/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_28_ppc64le.whl", hash = "sha256:b13478603dcd0a2479ff8e87e2c19a7d525734686fe3c49542472293a204212d", size = 5548822, upload-time = "2026-09-30T14:44:50.86Z" }, - { url = "https://files.pythonhosted.org/packages/02/a8/8df951850d6b31d2a00218f19e2b3f999523437ed7a819df7fa427942fca/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl", hash = "sha256:58a0c478eeca76fe5e07993c5a0703def34a6dc6a0cda4f5564639b33112ffe7", size = 5001199, upload-time = "2026-09-30T14:44:53.379Z" }, - { url = "https://files.pythonhosted.org/packages/8b/f9/36b3022218ce75b7cdf068fb95f809f9bd0d820e4955ef43b90c255cc7ac/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_31_armv7l.whl", hash = "sha256:d38cdff612d06fa6a32840d5e1b1f7a27cee4a349aa9085d94a67789d6bfd408", size = 4629333, upload-time = "2026-09-30T14:44:55.635Z" }, - { url = "https://files.pythonhosted.org/packages/8c/72/20f99a219f6af47cdd1cbd978c243b92d71496e168a746138af44ded4f29/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_34_aarch64.whl", hash = "sha256:fdd28f912fccfec1846a94e2e1e8f9b0012f557f0c46fe4f3eb0d7a87afcf90b", size = 4958822, upload-time = "2026-09-30T14:44:59.639Z" }, - { url = "https://files.pythonhosted.org/packages/f2/20/196f112617fb08eb4d608a2a6c422373d46f9cc2857f38fc0667033c0899/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_34_ppc64le.whl", hash = "sha256:cbc8738fd8526d80f35cb3a40d41f41a2e7030bb3b18b09a6778ef63d291c2fd", size = 5506351, upload-time = "2026-09-30T14:45:02.267Z" }, - { url = "https://files.pythonhosted.org/packages/24/95/83378121ef3eaaaf71d4b781577ff794acb39b9e1b87a3f156898c8497ed/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_34_x86_64.whl", hash = "sha256:e105ab60406787da31fccc883fc0f733af1efd78f0136a4599692c4083a73d0c", size = 5000859, upload-time = "2026-09-30T14:45:05.009Z" }, - { url = "https://files.pythonhosted.org/packages/22/f7/70fd7ae4d1dbfa7ba29b02e1b9068771519a86027756510b700ce81086a8/cryptography-50.0.2-cp315-abi3.abi3t-musllinux_1_2_aarch64.whl", hash = "sha256:6f8700550aa1474a91e5dc07049c46f98b423b5b1ddd0483e0b51362eeeaf5be", size = 5092151, upload-time = "2026-09-30T15:29:15.932Z" }, - { url = "https://files.pythonhosted.org/packages/d4/be/688367b74de86984bd58d8efacfc7c9e68b89a6a22ced0fb4f38db50254a/cryptography-50.0.2-cp315-abi3.abi3t-musllinux_1_2_x86_64.whl", hash = "sha256:c71be1cbfa5cd9a41ee452acf1eccd82b2c05950358b106ec8ceb83411d1a020", size = 5286120, upload-time = "2026-09-30T15:29:18.309Z" }, - { url = "https://files.pythonhosted.org/packages/39/d1/55f8a3f2ef5d1529e16835ef10cf0fe3d559ce237b46dddc440c0bba3649/cryptography-50.0.2-cp315-abi3.abi3t-win_amd64.whl", hash = "sha256:c423ab384a46c4dff7217b2ea5ba2e11cffdeab6441acd04cf65a369caf0366c", size = 4111557, upload-time = "2026-09-30T15:29:20.155Z" }, - { url = "https://files.pythonhosted.org/packages/23/ad/ac987755d00e1e64273760228d2635ae38dae2be83e3c6e0d3289d91dec3/cryptography-50.0.2-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:0ec5f09541743261e66e291b4a0cbf0fb2997aeaab6d9e9c740b9dba1b58d1c2", size = 3943588, upload-time = "2026-09-30T15:29:22.265Z" }, - { url = "https://files.pythonhosted.org/packages/d5/8d/6d585339bedf85d45044c85d8412dac53f2bb6f918e8b7777efba1787844/cryptography-50.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c5e67125c7dca78d199ec4e116aa93dbb83494808ecbb8211a2cb09b1bf41dbd", size = 4756166, upload-time = "2026-09-30T15:29:24.58Z" }, - { url = "https://files.pythonhosted.org/packages/bf/f1/1c1f6874e8550cfddd4b688ceb38cefb6ed15ceed224d56f133f3d88c214/cryptography-50.0.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ee247f5c245c9a2fe7c8e2214e295918838e44e00a45a6718451e4004219e767", size = 4749145, upload-time = "2026-09-30T15:29:26.807Z" }, - { url = "https://files.pythonhosted.org/packages/c1/63/61b15dc1a8de03fe0adbe3fd7608b3ad5c73bf50993bbcb1faaa930afe33/cryptography-50.0.2-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:dfe9763530994147d9af1def057a5b9658b00e8f8fe8743d144d1e0911c2e454", size = 4763638, upload-time = "2026-09-30T15:29:28.588Z" }, - { url = "https://files.pythonhosted.org/packages/fc/35/b345bdfa40c9126df1a9d33236aa98418367931b8725f84fc3ae2b98dc59/cryptography-50.0.2-cp39-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:58ddb5a8e3179d12f19e4ea34d2d32e9d63a4baa142c875c1eb59f41b7243acd", size = 5382217, upload-time = "2026-09-30T15:29:30.589Z" }, - { url = "https://files.pythonhosted.org/packages/4f/87/ef344a9e616871f2519c22d6afcda79ddd5d35e9592d95eb6e677608d055/cryptography-50.0.2-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f21e8a22c8605750c7af886bab299a363721264061b4ac0a30efb73cfd58efc5", size = 4781387, upload-time = "2026-09-30T15:29:32.605Z" }, - { url = "https://files.pythonhosted.org/packages/90/5b/f2fdb13cd0b96f6f932c8627bb292a45f11c64d21620a8e120aee9a3b848/cryptography-50.0.2-cp39-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:9c8402a82ea0dc4ceeab793db05f0fafa8ca139ca34fcde5df0f596103c74107", size = 4403790, upload-time = "2026-09-30T15:29:34.374Z" }, - { url = "https://files.pythonhosted.org/packages/bc/ce/7e4f662b1e3c393513569e402cfc85ac7da0bd3d5435e122a3140219eb2d/cryptography-50.0.2-cp39-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:0ddc924c04591c2811ca024d62ecad4f7f6f08af8939c211438f48a16bd23602", size = 4764319, upload-time = "2026-09-30T15:29:36.149Z" }, - { url = "https://files.pythonhosted.org/packages/3c/3f/86ff33ce34cc0de6847fb96e035a1a760d81652e38643f617c02ad32ef7a/cryptography-50.0.2-cp39-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:a6557e5f38e065ca9fbdaf7cfc7435ecb1d113aa81a022d1b51921ee7432e227", size = 5338560, upload-time = "2026-09-30T15:29:39.053Z" }, - { url = "https://files.pythonhosted.org/packages/40/cf/6b5c8e2fd9202d98988ab7cb5cc5c991704c4ad55f492ff408e4969f83f1/cryptography-50.0.2-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:1981f1db4630889b9ef7803fadef12b056f428cb6b85c27ba57b774793b6093c", size = 4780973, upload-time = "2026-09-30T15:29:41.251Z" }, - { url = "https://files.pythonhosted.org/packages/10/bf/8d6ebc7dded797bd0f0160d52188021211f011a2b164ef0ae1dac4587465/cryptography-50.0.2-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:7a8701d6b584d76e909e3d305b7d126b41439876a5aaf76cddc67fc230eafa2e", size = 4897738, upload-time = "2026-09-30T15:29:43.106Z" }, - { url = "https://files.pythonhosted.org/packages/d4/aa/f3f6e0de7e6253b8baa8b2d8fb9d50924fa75cee3d4624bd4bc1208ee923/cryptography-50.0.2-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:ce47f66801c20ec6c6632453bb5960fe38939e9306970b48b3a5a26de7745d94", size = 5058280, upload-time = "2026-09-30T15:29:44.827Z" }, - { url = "https://files.pythonhosted.org/packages/f6/b6/a1faf3a27ae9405fb34b1713cc73b2d8a26b04d5c561578fa2e6ef3e5bb9/cryptography-50.0.2-cp39-abi3-win_amd64.whl", hash = "sha256:4e81d95e5bafc2d6e34e4bed780e53e4d5b9a2f928573428aa4d35fbec1eb0de", size = 3854095, upload-time = "2026-09-30T15:29:46.782Z" }, - { url = "https://files.pythonhosted.org/packages/1d/7a/f08d34ce09d60f89ebd391e2ebc6ba2b995e6dd7552f41820f8085f94e53/cryptography-50.0.2-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:92e665960f25fcdc73725b9cec7a3824f279ba97a98653afe9ffac2e43668f67", size = 4716035, upload-time = "2026-09-30T15:29:48.681Z" }, - { url = "https://files.pythonhosted.org/packages/45/67/e18fb65592451a2acb76e9f2fbe14e0f47a8318b4c5430f1633851d03daa/cryptography-50.0.2-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:eef4c2f3423810b3070ab391f85436d2f8bbfcb286ac15cbc73190b3563b1f1a", size = 4726917, upload-time = "2026-09-30T15:29:50.608Z" }, - { url = "https://files.pythonhosted.org/packages/83/28/38fdce17e60f6b825e69fc3b7f75e70a6612759980704697e1de4cbfaf6e/cryptography-50.0.2-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:7c6d0330c472d96f6a6afe24d80dfdf15176c33096f0a4397ae4c60f3dd3be48", size = 4715341, upload-time = "2026-09-30T15:29:52.522Z" }, - { url = "https://files.pythonhosted.org/packages/b6/b1/d9121a717e0f893c64bd6ca7702614778d7df2a5c309128a002421788516/cryptography-50.0.2-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:1ba34f04897fcdaa73f74145c25f3ec146fbd56593853e88adc2e811303c5f42", size = 4726322, upload-time = "2026-09-30T15:29:54.263Z" }, - { url = "https://files.pythonhosted.org/packages/36/8b/e6d153808bf353e152abd2fd4d8f09670d956ac78379ac46e60d7efbf04c/cryptography-50.0.2-pp311-pypy311_pp80-macosx_11_0_arm64.whl", hash = "sha256:3dc4fd8058cea1644971207d530e1a03a184a805ffc8ebdddf0599d78a331b81", size = 3873097, upload-time = "2026-09-30T15:29:56.097Z" }, - { url = "https://files.pythonhosted.org/packages/ca/1d/1271f287ff7170ddafc2aad36260c4eec20ccd2fea70f38455e9d56d427b/cryptography-50.0.2-pp311-pypy311_pp80-win_amd64.whl", hash = "sha256:7b75de3c8b3be1cdb1052747c929440c3eea46c1bc2cb8a6e3a48388e9b7b452", size = 3805376, upload-time = "2026-09-30T15:29:58.729Z" }, -] - -[[package]] -name = "distro" -version = "1.9.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/fc/f8/98eea607f65de6527f8a2e8885fc8015d3e6f5775df186e443e0964a11c3/distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed", size = 60722, upload-time = "2023-12-24T09:54:32.31Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/12/b3/231ffd4ab1fc9d679809f356cebee130ac7daa00d6d6f3206dd4fd137e9e/distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2", size = 20277, upload-time = "2023-12-24T09:54:30.421Z" }, -] - -[[package]] -name = "google-antigravity" -version = "0.1.22" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "absl-py" }, - { name = "google-genai" }, - { name = "mcp" }, - { name = "protobuf" }, - { name = "pydantic" }, - { name = "uvicorn" }, - { name = "websockets" }, -] -wheels = [ - { url = "https://files.pythonhosted.org/packages/16/2d/fd1cb2cf1f610726914087a89960a95a33ed47e9804a00e598debc0280aa/google_antigravity-0.1.22-py3-none-macosx_11_0_arm64.whl", hash = "sha256:1db8f5ef2eb3a821c7780d8a5c634c4d9b90d401a02de6d640c2fa69a2545b62", size = 39099505, upload-time = "2026-10-13T22:50:42.872Z" }, - { url = "https://files.pythonhosted.org/packages/79/50/71bbc9adabf36eb700f3a7a12ad71b35286d362c15e202b9b9b0d0830f0b/google_antigravity-0.1.22-py3-none-macosx_11_0_x86_64.whl", hash = "sha256:86a31782a68da8eabdb59a7d0c4a38412c7f034029ac4b8e4eb61606c374b99d", size = 41282858, upload-time = "2026-10-13T22:50:47.149Z" }, - { url = "https://files.pythonhosted.org/packages/d6/67/a2ccde504e1dae0dbb05d12e4e42bb96f68e39ab65c1e10e1af379ff52a6/google_antigravity-0.1.22-py3-none-manylinux_2_17_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:c9b6c028b63b2a2d76efcd0a6529fc29a39de9b02fc0b80a5b01ca6f4f225a76", size = 39917887, upload-time = "2026-10-13T22:50:51.631Z" }, - { url = "https://files.pythonhosted.org/packages/93/65/23f0fd95def63d18ea292f212f158fb4ca31aeedd97a601a9e243babd20f/google_antigravity-0.1.22-py3-none-manylinux_2_17_x86_64.musllinux_1_1_x86_64.whl", hash = "sha256:f57c82b64360c3ac9bc65744b8a4aee2dc355acb97194bad811a3a5071574861", size = 43831201, upload-time = "2026-10-13T22:50:58.573Z" }, - { url = "https://files.pythonhosted.org/packages/e5/f8/a58f98b4905e3085ce8010c03fc88b64daaf2a194eb8cc3e6f10c9153042/google_antigravity-0.1.22-py3-none-win_amd64.whl", hash = "sha256:adf95c8d91987e795b5f7fbd47f73f48ac456c03228d18ca6b540586589687c6", size = 45227258, upload-time = "2026-10-13T22:51:06.76Z" }, - { url = "https://files.pythonhosted.org/packages/97/64/21332de87da45fad082992b912786542d296b901782d5a92008420fd01e2/google_antigravity-0.1.22-py3-none-win_arm64.whl", hash = "sha256:7eca5b13bd7513ed1549345f53a64c9cd16fef3e00b6042170b88957bb0deba9", size = 41166245, upload-time = "2026-10-13T22:51:14.57Z" }, -] - -[[package]] -name = "google-api-core" -version = "2.42.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "google-auth" }, - { name = "googleapis-common-protos" }, - { name = "opentelemetry-api" }, - { name = "proto-plus" }, - { name = "protobuf" }, - { name = "requests" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ac/aa/2aa84799e6920216f8aa2866d3b43daa20f7060dcb6efc8f0449e8be0ab0/google_api_core-2.42.0.tar.gz", hash = "sha256:82cf5daa2ef1b456d4e29ff1de1a5c2995c7be3ccf4fc608184326e03390c1ee", size = 273100, upload-time = "2026-10-08T18:12:37.477Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/28/ca/fb2a5b38366bcb12990c80384b920f04b968fd834cf98be67d306c374612/google_api_core-2.42.0-py3-none-any.whl", hash = "sha256:b1bdf4f72dc4f910736ce4ba49038352effbbc309579215107649b22973a1317", size = 221364, upload-time = "2026-10-08T18:12:04.618Z" }, -] - -[package.optional-dependencies] -grpc = [ - { name = "grpcio" }, - { name = "grpcio-status" }, -] - -[[package]] -name = "google-auth" -version = "2.62.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "cryptography" }, - { name = "pyasn1-modules" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/f5/b9/4b2528f30114b106e3c3a7298ba38d85e682fd1f83fe7c4a5b77c7677082/google_auth-2.62.0.tar.gz", hash = "sha256:0bef0ce54bdf9ce226c5d66e4264413bd918141c31bbe49fb52eac882f513d69", size = 398180, upload-time = "2026-10-12T19:20:48.328Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/eb/a3/87fe9b7203ec2e56ea6a57c75e6d632eaf9487c7f7978cdad1d801bee0af/google_auth-2.62.0-py3-none-any.whl", hash = "sha256:4ff4319aeb4ad128409759d397a9fcafad126d0031d241cc0dd6b9a00b43e3f3", size = 267911, upload-time = "2026-10-12T19:20:46.355Z" }, -] - -[package.optional-dependencies] -requests = [ - { name = "requests" }, -] - -[[package]] -name = "google-cloud-core" -version = "2.8.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "google-api-core" }, - { name = "google-auth" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/55/71/d6081acadf55d4233271c39860f0d140ef61fbdb4bceb2075e9c2905d947/google_cloud_core-2.8.0.tar.gz", hash = "sha256:365f8e4518ae81c8101b8dea5fc1c32a960badedb8b511f19db2843cbbd285d2", size = 36605, upload-time = "2026-09-29T19:25:59.275Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/12/ed/1b09640a565e5d34d4e517463f65a67a11f9dcdeb6b6e8220f2d06aaf489/google_cloud_core-2.8.0-py3-none-any.whl", hash = "sha256:e235b0952f7ffe7b9c71a4cf96b506d9cfb557e22557c412f0df9b7068b5d007", size = 31048, upload-time = "2026-09-29T19:25:35.361Z" }, -] - -[[package]] -name = "google-cloud-run" -version = "0.16.2" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "google-api-core", extra = ["grpc"] }, - { name = "google-auth" }, - { name = "grpc-google-iam-v1" }, - { name = "grpcio" }, - { name = "proto-plus" }, - { name = "protobuf" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/cb/95/303555b84bc111068c1ea9bd5a792c049b09f641ecf89b8e87d6dc048f10/google_cloud_run-0.16.2.tar.gz", hash = "sha256:480ecde89b18dc99aac4584048f6477e856002af4d7a8e7a6eb894801d01190b", size = 496276, upload-time = "2026-10-01T18:17:57.468Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f2/65/61f0a0d8f61519606082f129f53769a84b8abf5298c413a0eeffd4671fc1/google_cloud_run-0.16.2-py3-none-any.whl", hash = "sha256:cf21a6ee67fb237f694b444862fb0a717f0e0dfeabfdb64b927c7d1303f18957", size = 448656, upload-time = "2026-10-01T18:12:04.178Z" }, -] - -[[package]] -name = "google-cloud-storage" -version = "2.19.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "google-api-core" }, - { name = "google-auth" }, - { name = "google-cloud-core" }, - { name = "google-crc32c" }, - { name = "google-resumable-media" }, - { name = "requests" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/36/76/4d965702e96bb67976e755bed9828fa50306dca003dbee08b67f41dd265e/google_cloud_storage-2.19.0.tar.gz", hash = "sha256:cd05e9e7191ba6cb68934d8eb76054d9be4562aa89dbc4236feee4d7d51342b2", size = 5535488, upload-time = "2024-12-05T01:35:06.49Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d5/94/6db383d8ee1adf45dc6c73477152b82731fa4c4a46d9c1932cc8757e0fd4/google_cloud_storage-2.19.0-py2.py3-none-any.whl", hash = "sha256:aeb971b5c29cf8ab98445082cbfe7b161a1f48ed275822f59ed3f1524ea54fba", size = 131787, upload-time = "2024-12-05T01:35:04.736Z" }, -] - -[[package]] -name = "google-crc32c" -version = "1.9.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/fa/25/9cb0c1c31c45b893eb8f11ae70b3f4309432d59b5acaebca5dbe791729a4/google_crc32c-1.9.0.tar.gz", hash = "sha256:7b8c84c3d159ab6817fe3f74e6e6cef099c3f95dcec3abc0d8afb1404642efbe", size = 14857, upload-time = "2026-09-24T21:39:32.067Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/0e/55/a2f07f15e624f0de79359b1a6c1deb59ec5061bd3b38744b3b2849400662/google_crc32c-1.9.0-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:457d0d9a4718fd52b1494eac5c200ad25beeadbdc91843d550a003910838589f", size = 31958, upload-time = "2026-09-24T21:19:00.994Z" }, - { url = "https://files.pythonhosted.org/packages/f8/b3/923743597b774bbcf12a7c3e00e48d745e15fd616ad7489a40a63fff8f2f/google_crc32c-1.9.0-cp311-cp311-macosx_12_0_x86_64.whl", hash = "sha256:ccfe40021fd6afe23361175cf7551e3cef5fd34dc1ebe319f14993a83579e0eb", size = 31805, upload-time = "2026-09-24T21:22:25.019Z" }, - { url = "https://files.pythonhosted.org/packages/df/a6/4d0352fe889663e0d81cea7fc664ec9158727384de4a44ab10e9967a7682/google_crc32c-1.9.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:fbef61a3794e011c65fb4396a196cf123a7f474fe5a443db8e5dd7d751b9e6d4", size = 38119, upload-time = "2026-09-24T21:38:06.634Z" }, - { url = "https://files.pythonhosted.org/packages/aa/e3/26685384e4b66ff0928d9566ef6110a7df76029175a1842329d7e3515f10/google_crc32c-1.9.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:86764b99e7a607830d93cb5b75e0ec3ff6cb06d3c274624418473cee701900d4", size = 36677, upload-time = "2026-09-24T21:38:08.082Z" }, - { url = "https://files.pythonhosted.org/packages/cb/ce/4e90102e84880e97d3cf935f2672ecd29191bdeacf57f01740f92debda00/google_crc32c-1.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:43a2dc26f9be213fbe0b4fc4a1088c5d45cbfcb3247420ccc820f0fc3edeea86", size = 35096, upload-time = "2026-09-24T21:39:28.201Z" }, - { url = "https://files.pythonhosted.org/packages/e4/5d/0730e1b3a14d054d1466f2fec88dadf978509c749a3d96d8b069cc56d38a/google_crc32c-1.9.0-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:53fdafef58e230d0c946ab5f8446d123d9f548230a73b29c8b41c9546f268bc1", size = 31961, upload-time = "2026-09-24T21:19:01.724Z" }, - { url = "https://files.pythonhosted.org/packages/dd/32/d085abaf2fd907121975b92245bb3480fb8be40c37d03f9d6c41857f84c3/google_crc32c-1.9.0-cp312-cp312-macosx_12_0_x86_64.whl", hash = "sha256:8b91f41645b15a720357183fa5716682ada441873e3c462c15f9714be36f146b", size = 31804, upload-time = "2026-09-24T21:22:25.81Z" }, - { url = "https://files.pythonhosted.org/packages/94/78/dd1935432337e5da7af391a6fc9f161c1c8e9b9002a402b9190135fe1b59/google_crc32c-1.9.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:16865b477d7941712cb0e0aad8ad4815e984fb5fc16d3fdaef7d986e26e53c95", size = 37775, upload-time = "2026-09-24T21:38:09.249Z" }, - { url = "https://files.pythonhosted.org/packages/9e/43/9db03635bb10188d93dcbab9baa2a8670a0da4e868b4370cdbd98d65fed8/google_crc32c-1.9.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3abb18297d9ef0ab120531838be0e6d68c9fa876570e11c229c48f2edac23ce7", size = 36347, upload-time = "2026-09-24T21:38:10.141Z" }, - { url = "https://files.pythonhosted.org/packages/cf/eb/94dee516c846bd9382c3f566d8f8e5fb9e90599e45afeb697f9fc2533528/google_crc32c-1.9.0-cp312-cp312-win_amd64.whl", hash = "sha256:fb63a8d7fa2e95dcff1ca16af2f4d88b526fa5ff72d1696285884ac2d49b6963", size = 35097, upload-time = "2026-09-24T21:39:28.934Z" }, - { url = "https://files.pythonhosted.org/packages/3f/34/cb484e8b6174f130f8c6dc79c733a9dd8869b410ad6511fb6104c46b973a/google_crc32c-1.9.0-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:f1dc17d987ddcc5eba12a7ce48f0eb93141dea236b170c1101151396edf2f0cf", size = 31960, upload-time = "2026-09-24T21:19:02.454Z" }, - { url = "https://files.pythonhosted.org/packages/af/25/3e8e567bd48448e225ea27318ccf2b94e05124e7b8b97b13eaec9e127199/google_crc32c-1.9.0-cp313-cp313-macosx_12_0_x86_64.whl", hash = "sha256:f894a2877650b56201d26a012a257b76d54a68834dc3913a93830ca8a047b075", size = 31803, upload-time = "2026-09-24T21:22:27.008Z" }, - { url = "https://files.pythonhosted.org/packages/f0/18/bee0dd59ae622482dc6463636c79e4bde7c954d061c859c9256362c9931a/google_crc32c-1.9.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:4488f1553a9ab7e86cdedc833374a7e904031803b995dc0bd0be48c271fa6556", size = 37776, upload-time = "2026-09-24T21:38:11.056Z" }, - { url = "https://files.pythonhosted.org/packages/fd/b6/e76e80fed5f2558273c7839e622f98095c9b36c719c7147e38e3c055cb70/google_crc32c-1.9.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0568b17ed90ac596f29400d99e243fd0cc6276766183def888d1bf8d1dc13827", size = 36350, upload-time = "2026-09-24T21:38:12.138Z" }, - { url = "https://files.pythonhosted.org/packages/87/34/165542bfa99dfef91a76471cc48cce74b8ff4e295722896087ab2b8e8611/google_crc32c-1.9.0-cp313-cp313-win_amd64.whl", hash = "sha256:8583ec21d56b565d68ab2963cc7e21b3b271247c29b04286068255ef65f221bd", size = 35090, upload-time = "2026-09-24T21:39:29.764Z" }, - { url = "https://files.pythonhosted.org/packages/8f/eb/43ea41f4061a1cad87b2b6559c98e960e45bf551fe66f83d833b98aaf0c9/google_crc32c-1.9.0-cp314-cp314-macosx_12_0_arm64.whl", hash = "sha256:6a3b2c8a343c570ed8100a7627c20badfd92c6caa2067093a86be45af27f5b1b", size = 31963, upload-time = "2026-09-24T21:19:03.208Z" }, - { url = "https://files.pythonhosted.org/packages/45/d2/a968c0c29ccd2b0c980ff4f9e3f7035cee28c23a1c57541825cc8221858c/google_crc32c-1.9.0-cp314-cp314-macosx_12_0_x86_64.whl", hash = "sha256:13179f7e3282617923e957b8e54b8f9c3968030f48640a9f47fd7c5c38c4a215", size = 31805, upload-time = "2026-09-24T21:22:27.917Z" }, - { url = "https://files.pythonhosted.org/packages/03/73/388e493d6c3e252e37165d22efe5a1361f872a24425391b999822861b23a/google_crc32c-1.9.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:265233aff33d835f5b909584fe36ab29647b598c271b661a300001099109e53e", size = 37925, upload-time = "2026-09-24T21:38:13.32Z" }, - { url = "https://files.pythonhosted.org/packages/98/36/190d32caa363ef25d685f422ed1bbf93ff1140fb22fd4d90f24cec209977/google_crc32c-1.9.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:dee799544cae42a42b17a88e38b59cf2c271051dc001da2117a8ff240ffa0548", size = 36495, upload-time = "2026-09-24T21:38:14.211Z" }, - { url = "https://files.pythonhosted.org/packages/d3/fd/81cefea6adae7bd92abb23d4567d199f6485a20ec0a305ca5fa04c52b9c5/google_crc32c-1.9.0-cp314-cp314-win_amd64.whl", hash = "sha256:af73200fa9791ccd380f3598235dba8d82b8af0905df045b3dc60b59836e8ddd", size = 35535, upload-time = "2026-09-24T21:39:30.52Z" }, - { url = "https://files.pythonhosted.org/packages/c5/18/19d4f17f3f33f8fdffcb3e1e69219d6f7ec2c359c160867b04dac1d0a64d/google_crc32c-1.9.0-cp315-cp315-macosx_12_0_arm64.whl", hash = "sha256:e6e8be8a94436079cb5340f6d495d9d7ba30124d8b952703994c739c7c06e236", size = 31977, upload-time = "2026-09-24T21:19:03.976Z" }, - { url = "https://files.pythonhosted.org/packages/81/b4/8010372c4b46f2ee2352dfdb630c397570cd85522a315df024ad2f9459aa/google_crc32c-1.9.0-cp315-cp315-macosx_12_0_x86_64.whl", hash = "sha256:f2b64641bca27497b986b9d87883014035aa904cb4fa333407c6752b3afee9ba", size = 31809, upload-time = "2026-09-24T21:22:29.1Z" }, - { url = "https://files.pythonhosted.org/packages/c5/f8/7e33845d6b90ce1cf37cfabf25cb859277c7d3533ef1b6b1e1ca58581549/google_crc32c-1.9.0-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f97c3806dcea41c29c04965347b0e12481561b75e0045dc7a4f69d75dec5d9b1", size = 38359, upload-time = "2026-09-24T21:38:14.983Z" }, - { url = "https://files.pythonhosted.org/packages/36/ff/556b2423f449a7515af6b8222a4d7833cbe09ff3e8d2f0b80471f5f6d02e/google_crc32c-1.9.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0abe7e202c25909869c35672ab0f2fe748a7acf276eb78577332a7c38999740f", size = 36858, upload-time = "2026-09-24T21:38:15.799Z" }, - { url = "https://files.pythonhosted.org/packages/40/71/4733f1b7c921d04a2bb9b9916cf66498bf7ad0860a06289413830da83192/google_crc32c-1.9.0-cp315-cp315-win_amd64.whl", hash = "sha256:5695c8b9327e040b2aba12c6659b0acb5995314ef0af0192da66e662e011103b", size = 35534, upload-time = "2026-09-24T21:39:31.337Z" }, -] - -[[package]] -name = "google-genai" -version = "2.32.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "anyio" }, - { name = "distro" }, - { name = "google-auth", extra = ["requests"] }, - { name = "httpx" }, - { name = "pydantic" }, - { name = "requests" }, - { name = "sniffio" }, - { name = "tenacity" }, - { name = "typing-extensions" }, - { name = "websockets" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/d3/f9/89c95879bd58f176f82415c1a63a9dce528ea2b7a83a155412db5b1c783b/google_genai-2.32.0.tar.gz", hash = "sha256:9e8fb72f0a878291bc20b941d5d535e249f5729290565b7d49406827a0c30152", size = 750015, upload-time = "2026-10-21T00:38:45.526Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/97/70/964baf520f36019ad4e4ce316e6dc943189f3b398654ff8277dadb764f6d/google_genai-2.32.0-py3-none-any.whl", hash = "sha256:cf71a629df18510cd837cacb4843b38a2db6834c69eb93963a0d8ee4d657b725", size = 1213907, upload-time = "2026-10-21T00:38:43.471Z" }, -] - -[[package]] -name = "google-resumable-media" -version = "2.11.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "google-crc32c" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/cf/64/df6a482d5aa39d7f7be186d892377d605cae6c88525fd851d456e8bbe9c9/google_resumable_media-2.11.0.tar.gz", hash = "sha256:febd83686752799661b4de575f0b993c5c25c349a5362556fc4d7be164056a37", size = 2164914, upload-time = "2026-09-29T19:26:13.546Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5e/2e/4f0a152f2e576e496f31ba1c3c62ed174a8878d06008916a7edc58b1bb28/google_resumable_media-2.11.0-py3-none-any.whl", hash = "sha256:f43d15e6a7f818f762eaead0f369c551f8275a4179c9d6225d0d259f49b87b5d", size = 81515, upload-time = "2026-09-29T19:25:47.31Z" }, -] - -[[package]] -name = "googleapis-common-protos" -version = "1.75.5" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "protobuf" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/8d/2b/6ce81972d5c8cab9705fddce3153be63222d9e12fd96f8baba5038a744dd/googleapis_common_protos-1.75.5.tar.gz", hash = "sha256:c7a866fc34ed29a3b10af627a4b9b1dc2433313ca6e959f0ae4feb132047ed72", size = 156513, upload-time = "2026-09-29T19:26:14.863Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/65/b9/6b29500a1c581ff4d77fd83c6568d068bee06f1b139fb6eb0a4f2d4bce8a/googleapis_common_protos-1.75.5-py3-none-any.whl", hash = "sha256:d7285525c23039db98f2463e6d5a4f9b958b94d497f03a844ece3259c4e72d5d", size = 307737, upload-time = "2026-09-29T19:25:48.735Z" }, -] - -[package.optional-dependencies] -grpc = [ - { name = "grpcio" }, -] - -[[package]] -name = "grpc-google-iam-v1" -version = "0.14.5" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "googleapis-common-protos", extra = ["grpc"] }, - { name = "grpcio" }, - { name = "protobuf" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/d2/d0/fa5bdd5f3f421bb68dc6dc162e9caaf942897ca41ce7255b524723c80f0b/grpc_google_iam_v1-0.14.5.tar.gz", hash = "sha256:07fd3a9fafb586588e771831fbfc8f6597050181d0c3b45e039d18b8fdc1aab5", size = 23736, upload-time = "2026-08-06T06:24:54.489Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/84/ab/be3ad0d46cffe35fd1e7cc3f9947edd6cb3c552229de3be2742f15f7ea47/grpc_google_iam_v1-0.14.5-py3-none-any.whl", hash = "sha256:0f5e680b20aa0a9441e68c769da04d94d70fca4e43751a82d8abb8aa6a7181ca", size = 32674, upload-time = "2026-08-06T06:23:49.467Z" }, -] - -[[package]] -name = "grpcio" -version = "1.84.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/c0/3a/5c8e0eea2af3d30cb20d33ac325a98d9b799c069d63101ca4da20bcc776a/grpcio-1.84.1.tar.gz", hash = "sha256:446e7876b9b991fa124c1d414899fa7cf95f89a3e71237ea0161863dc0b2c09f", size = 13421202, upload-time = "2026-10-22T14:59:43.986Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b6/99/8c0a3739dbc75bf509cf2a79a35ebb27e73cd7a1f9be25af842ae66e4749/grpcio-1.84.1-cp311-cp311-linux_armv7l.whl", hash = "sha256:a5ea4e8d1e9745ba6c2c9d14ed0861e9496a8051bf9fd8a17b667d9b9a0c1019", size = 6420007, upload-time = "2026-10-22T14:57:39.037Z" }, - { url = "https://files.pythonhosted.org/packages/a3/00/c8261b1d56715d09c922145d12427abc1b1be5afad031336d7b00bad7d8c/grpcio-1.84.1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:11c1d07c58922f5dad022b422d3f7998755c3e35e2f1949bac47cfd7a5eb31fd", size = 12325248, upload-time = "2026-10-22T14:57:41.384Z" }, - { url = "https://files.pythonhosted.org/packages/f0/4a/30f23e49f1b8ab11ccd24cfa146524df5478f45db7167006580cdfeaa321/grpcio-1.84.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:6a22342e59b5b2f4c5ed276ef72a3668ec84f38d2f5fad8a64af0b3618e510eb", size = 6995366, upload-time = "2026-10-22T14:57:44.399Z" }, - { url = "https://files.pythonhosted.org/packages/c1/d8/fd238758e4725f11d509c440de1b03a77c53d5f213fd45ccfb5f4f775aff/grpcio-1.84.1-cp311-cp311-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:bdd1181edaf42b6e79a457789fd43e85858db1df3861e4e5128ff4d6a49cb638", size = 7747707, upload-time = "2026-10-22T14:57:47.241Z" }, - { url = "https://files.pythonhosted.org/packages/47/54/d6544884ef836bea968d3ed7abf179c4d33a794dd8a8b1c5cf002fff9620/grpcio-1.84.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:eb881326607275ad2d2d17dce09b823472414dcc559e8f694d5607fe8af3cbc1", size = 7153395, upload-time = "2026-10-22T14:57:50.28Z" }, - { url = "https://files.pythonhosted.org/packages/06/9c/094cd0afd21348e65d5750a7fa4cfa5f8ba6ca354fe6aff9f1163f4c5d0e/grpcio-1.84.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:772ff116d0d31b2817e23fb9a1dfa52fa9fed08be0cd87b593450f034e2968b1", size = 7702992, upload-time = "2026-10-22T14:57:53.602Z" }, - { url = "https://files.pythonhosted.org/packages/7c/54/254432337e14beb08bc7f29fc10a86ef149f672124073f2e0d446dbf8538/grpcio-1.84.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:0225c1e29d1506594e75ac46fd7b327bbfd24c6306a3c479b2164c1c4e87901f", size = 8758120, upload-time = "2026-10-22T14:57:55.728Z" }, - { url = "https://files.pythonhosted.org/packages/04/29/528ccb437076233d524e09e59320625b8ca9d94f0fb0198703e7100f3bff/grpcio-1.84.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a1ce9e360d0a4a329b925ae8b0bc49d97d663bcce50822eb862873798a86eb10", size = 8110925, upload-time = "2026-10-22T14:57:58.639Z" }, - { url = "https://files.pythonhosted.org/packages/24/5a/e4005d02dd65884a525f49ba0aa0371967b7fb40f00d35818ab397d91a93/grpcio-1.84.1-cp311-cp311-win32.whl", hash = "sha256:b87f8696bb78a31328e815629d320304c3d5cca1c654d3fd7e5518685bcfb8d2", size = 4460566, upload-time = "2026-10-22T14:58:01.077Z" }, - { url = "https://files.pythonhosted.org/packages/6e/fc/fc040230b60529a5df349945eb1e4f8a201607a6e3d70f3465d80e801393/grpcio-1.84.1-cp311-cp311-win_amd64.whl", hash = "sha256:e44786d5c166944a53fb1fa3384d03f1dbade6f68007be6d0c5a1a0971cbaca6", size = 5225017, upload-time = "2026-10-22T14:58:03.113Z" }, - { url = "https://files.pythonhosted.org/packages/69/39/34a3e64818b1fdaf73b6c873f7d085969f20c2aff114c8909cc7ee0cb2b4/grpcio-1.84.1-cp312-cp312-linux_armv7l.whl", hash = "sha256:db2dbe5380dccc2f5df967f31308a744e65d46e21b473a9c3ca033c4299ec3f4", size = 6381194, upload-time = "2026-10-22T14:58:05.289Z" }, - { url = "https://files.pythonhosted.org/packages/77/bf/5f1922cafaaaa7b2b6a0f6b0614783efa8502f16c8dd9c7b8b131a3dc9d2/grpcio-1.84.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:f7533921b52ef94210437dedd3911e00b7642ca8d11eda64eb1715778630715e", size = 12304970, upload-time = "2026-10-22T14:58:07.714Z" }, - { url = "https://files.pythonhosted.org/packages/af/f9/77e9991fd5ae7d754b78b3c8e8eb028ddc886a480b86b934ece85f727f95/grpcio-1.84.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:e0dcc7b588e7b7dd3363317296983db23a26af8baa5884db15a10fc0c8534186", size = 6949905, upload-time = "2026-10-22T14:58:10.92Z" }, - { url = "https://files.pythonhosted.org/packages/a7/a2/af693a3bd3fb43cd97e4ad054ad5b117814c1a24cad048130e982a189f0f/grpcio-1.84.1-cp312-cp312-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:a92bb13dd1b31a16f631ab415710de59f404c37364c018e7486496fb449a89da", size = 7714870, upload-time = "2026-10-22T14:58:13.622Z" }, - { url = "https://files.pythonhosted.org/packages/00/98/456ef643a796ba04ad737e39a820c27291c238db87f7d168355dbdaf7b4b/grpcio-1.84.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:474408c92b27c823ea6aab2315e2ea52d5a4e0040b37ce1e65e89d9149c48205", size = 7121552, upload-time = "2026-10-22T14:58:16.454Z" }, - { url = "https://files.pythonhosted.org/packages/a9/bc/c98f29a74b772ba9025f13243dc9547807583b1d111282bdcc53bb4f8db6/grpcio-1.84.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:912694cac76adb4f45563b38ae4d06d77a2081e8ed5cb20a3918c1affba83c63", size = 7673450, upload-time = "2026-10-22T14:58:19.009Z" }, - { url = "https://files.pythonhosted.org/packages/2e/2f/713bbfaf1cd7ce3a4626b8c0e93ec3f7493d8f52ccdb1ddb02fc98fc7d7e/grpcio-1.84.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:f821954e4d89e97f7d51c03073d6964e177f2d11181550a5a22c082fac614f43", size = 8725415, upload-time = "2026-10-22T14:58:22.23Z" }, - { url = "https://files.pythonhosted.org/packages/b3/ef/21db8160edde5646a0f688c9f7e97bf6106965e4e2ae1dcfe9649fe2db01/grpcio-1.84.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:02612f3c19ed3dd885e2fff1236bf5629e5b43b5aa84c3290b0d5f62f26b0ef7", size = 8090355, upload-time = "2026-10-22T14:58:25.039Z" }, - { url = "https://files.pythonhosted.org/packages/34/0e/a762461094659b13a86a027461a6acdf4734dbbe17b19bb193191801b570/grpcio-1.84.1-cp312-cp312-win32.whl", hash = "sha256:380b58bf32707b4e3019c9567dab30375bd21f9a5c98aa24401aff1e73f3b262", size = 4444024, upload-time = "2026-10-22T14:58:27.015Z" }, - { url = "https://files.pythonhosted.org/packages/51/b5/2dbcb95b7b3622253bbb09b79dd87787dd05709303e571cc0eb150f860d1/grpcio-1.84.1-cp312-cp312-win_amd64.whl", hash = "sha256:1a221fe42e444cd0099752028810a289efafce1b5690dfe19a831d2a2fe6ea62", size = 5218662, upload-time = "2026-10-22T14:58:29.124Z" }, - { url = "https://files.pythonhosted.org/packages/0d/57/f25d35af33566daec7c9eec09c65e06f510cea2cc392bc2988af26250a4e/grpcio-1.84.1-cp313-cp313-linux_armv7l.whl", hash = "sha256:9c24b1ebbdf867b33d74868044fed5c7c5a6a6e00787140b5f582572f7a7e633", size = 6393057, upload-time = "2026-10-22T14:58:31.938Z" }, - { url = "https://files.pythonhosted.org/packages/1f/d5/68c3c5804bc7b05a0a544ac68439ff7eb493d5d394e5361bc94e60b6be0b/grpcio-1.84.1-cp313-cp313-macosx_11_0_universal2.whl", hash = "sha256:af0f0c10281c2b62c68868e0a98de24f89c31308c68dbf19320d30c3a329aba5", size = 12302330, upload-time = "2026-10-22T14:58:34.375Z" }, - { url = "https://files.pythonhosted.org/packages/ce/8f/d25a5d4d4f34e99ec31869ad3b988893f15d5965625cfc35a5faffb9889f/grpcio-1.84.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c1c04d2876ccb063507a976602bc88b5c31330982e650c620bf8e730b120c9d5", size = 6954893, upload-time = "2026-10-22T14:58:37.408Z" }, - { url = "https://files.pythonhosted.org/packages/88/f8/fae50f0e28281be328614ad772118290d0f804d9be5be2d5708e7ea8d9aa/grpcio-1.84.1-cp313-cp313-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:3cf14e9cf02d12628f20ec205d699838c47e2d3741690fbf14ae626bfa32ac0b", size = 7723209, upload-time = "2026-10-22T14:58:39.537Z" }, - { url = "https://files.pythonhosted.org/packages/59/4d/99dfd9cfab7f748d52cfb9177e8967d5cec0a50f148d4e3b9a0bf0b1220c/grpcio-1.84.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:2ce575e400e0dec9484f5d038fa12d6b3919d493c2beb897a23b9a32fa3bfd12", size = 7125010, upload-time = "2026-10-22T14:58:42.037Z" }, - { url = "https://files.pythonhosted.org/packages/0e/cc/7354ebd3d4c1bef08b062b9f07d154141c2b9043f677a219bc7943070867/grpcio-1.84.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:c6e9be93efe763bb2b12a4c0d5fc13082f24de6cbb53a9d11078c9d0c8cdb2b8", size = 7675985, upload-time = "2026-10-22T14:58:44.564Z" }, - { url = "https://files.pythonhosted.org/packages/9b/67/37ccd26e1f7a7576f53627b45e222ac89ea3465b3f02836f480ac26e4dce/grpcio-1.84.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:f216832aa84ad7e697ae1ed993c33905d27e27cd1b02016af1441be2091e287d", size = 8726955, upload-time = "2026-10-22T14:58:47.051Z" }, - { url = "https://files.pythonhosted.org/packages/88/cf/4887c033734182cecd12d3a1f6f9e7f84e9a5589a1ca2f564ff2ce8f2a29/grpcio-1.84.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6a4a06d757e7ea5ddf636a4c40914aa36fb4f7e2a03abf727a16e61822331343", size = 8086854, upload-time = "2026-10-22T14:58:49.831Z" }, - { url = "https://files.pythonhosted.org/packages/d0/2c/34aca5188055d8e5342a5a672f6d321f331c8e1e944ea7d3650ee71f4943/grpcio-1.84.1-cp313-cp313-win32.whl", hash = "sha256:4052f86fdb5105ac8b02c77d17cd9beff78790a0c3117afdd5316154cf4348a5", size = 4443070, upload-time = "2026-10-22T14:58:51.851Z" }, - { url = "https://files.pythonhosted.org/packages/68/25/5c315847ab3bd6d3b9f3caad178596eb1affd5aafd02374813b27bddf708/grpcio-1.84.1-cp313-cp313-win_amd64.whl", hash = "sha256:b7452ccc592e40e4167adec46195d85387c8036f0aadf6f96ab6ed931205d0ce", size = 5220505, upload-time = "2026-10-22T14:58:54.464Z" }, - { url = "https://files.pythonhosted.org/packages/4c/d8/bbc616bd123ddc2fd1f53f49e40cf537f7dd9c483f47bb21be61c4aa0ae1/grpcio-1.84.1-cp314-cp314-linux_armv7l.whl", hash = "sha256:42ffbbc11fe2e4b02a4b51b090f8ca6727414748cf551539665b5592372263e8", size = 6393649, upload-time = "2026-10-22T14:58:56.534Z" }, - { url = "https://files.pythonhosted.org/packages/80/25/71e0903ca23c483aad588daa7744f9b01c149db9cbfa13eb24ef5f813a2e/grpcio-1.84.1-cp314-cp314-macosx_11_0_universal2.whl", hash = "sha256:f2482ebe5e3a9c6d1f99859e135cc0ca370362e3b2a94cb6304f64943997bfcb", size = 12308221, upload-time = "2026-10-22T14:58:58.92Z" }, - { url = "https://files.pythonhosted.org/packages/28/01/a0207b967ab991bc009030763e3c7e6280cbeda1de06351e16034d34547e/grpcio-1.84.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b8fb04fe0ded6fb1c5edd4c90ed39193d7b6226214685111b25a153ccb33a52a", size = 6963837, upload-time = "2026-10-22T14:59:01.562Z" }, - { url = "https://files.pythonhosted.org/packages/38/74/a4171ad8c4b0e80371afb27503cad580d4cae2f116b56adbb9dafa7e3c76/grpcio-1.84.1-cp314-cp314-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:ffc0be893d8df55f0d23afbd3b776ede444847260a4a00ac80326a32dac91ad3", size = 7722977, upload-time = "2026-10-22T14:59:03.784Z" }, - { url = "https://files.pythonhosted.org/packages/4e/b8/73e85d67437fa4324933cc625a6a8e8e5f22fbdfe6757d949a6958b87479/grpcio-1.84.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ccd8be89a73d276336cbf223b22bd5c677d9fd15233100f208845c6a0c7cbc72", size = 7126919, upload-time = "2026-10-22T14:59:05.982Z" }, - { url = "https://files.pythonhosted.org/packages/03/60/734b781ca01f562e6e01c84ef8e762f1ebcfccd02b29be0b77513fc26da0/grpcio-1.84.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ced0c5ef2709964aca16e6af6f74f682b57872d2f7c7c553916c6b86dac64fa4", size = 7685628, upload-time = "2026-10-22T14:59:08.495Z" }, - { url = "https://files.pythonhosted.org/packages/5a/c8/03051aa012430b2dbd15fbf9af42482d945197b7886c77c557475d1bb4bb/grpcio-1.84.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:28caf3df58096e2cb06f0f7e672160e65e9df5e053f392594d93d33a15fe1ef1", size = 8728232, upload-time = "2026-10-22T14:59:10.709Z" }, - { url = "https://files.pythonhosted.org/packages/58/83/c87911b98ed766d7084d64053dc06f7855267f686b673dc0bb1ac8c07aee/grpcio-1.84.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f4b64099afaccdeeb987240af47aa1fc14f57285d3d2ff000c7327228624999a", size = 8088730, upload-time = "2026-10-22T14:59:13.431Z" }, - { url = "https://files.pythonhosted.org/packages/88/bf/6b18690790c0c4d7062749785bc8e515881a8a4058f46cb2925c86adc9e0/grpcio-1.84.1-cp314-cp314-win32.whl", hash = "sha256:116b4796da0e7fca3fdf6edf422ea7521c25d8c4be64ab7e3b5e2a77c832b0ed", size = 4527749, upload-time = "2026-10-22T14:59:15.712Z" }, - { url = "https://files.pythonhosted.org/packages/b8/d9/ee50fe67481254c45c9b709b31ba468e4c90925018f4507c424369a9abd5/grpcio-1.84.1-cp314-cp314-win_amd64.whl", hash = "sha256:3875f4c4caf0c54ac370b66322f0bf2d46e9d21414be36ea8b7f618badb3b87c", size = 5359432, upload-time = "2026-10-22T14:59:18.331Z" }, - { url = "https://files.pythonhosted.org/packages/c4/c0/fc3341990f75cba2096d07ea5e7a8f78af8cb36f6b1fd78660b8c1220e11/grpcio-1.84.1-cp315-cp315-linux_armv7l.whl", hash = "sha256:775f98cb476625936061b91e3c1da229112b212a6b2a70fefc9c87e5aaf9fba6", size = 6393689, upload-time = "2026-10-22T14:59:20.402Z" }, - { url = "https://files.pythonhosted.org/packages/c9/f4/6b9a70760bbd8e927f31452ed2ba33cc3dc1a327f1b46c44f65ddb6dbf0a/grpcio-1.84.1-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:cfdc7530e5707ab6e5c80fc624f89e26ddf8f38d3e89e5226dd7e55c080e9b65", size = 12325454, upload-time = "2026-10-22T14:59:22.805Z" }, - { url = "https://files.pythonhosted.org/packages/ea/87/e44f1c73d4c003a10a8c9b348b44296e99ec5623b70fb441ad250f4b532b/grpcio-1.84.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c61a0d5c60506b2371444716b56d6c633d3c56a17c703566bcca39604c02c12c", size = 6984778, upload-time = "2026-10-22T14:59:25.385Z" }, - { url = "https://files.pythonhosted.org/packages/19/9f/efd7828266b9e5ff0764af8420d52add5acfc13382d073596f15d7dfc183/grpcio-1.84.1-cp315-cp315-manylinux2014_i686.manylinux_2_17_i686.whl", hash = "sha256:79b3ee4683290b3cfabadc718a008c3474073b585bc450231a842c21c2ef1f27", size = 7073415, upload-time = "2026-10-22T14:59:27.503Z" }, - { url = "https://files.pythonhosted.org/packages/80/5e/de257fc887b5a4e955173fb28a76a39fdb69f12e0d99987ed723c937c419/grpcio-1.84.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c8ae49802f09cc272546592b3656207de6f719e50a6a0d1654e613aaba6336ac", size = 7165478, upload-time = "2026-10-22T14:59:30.083Z" }, - { url = "https://files.pythonhosted.org/packages/75/b0/66840129d46b06a5159277206a1f706ff755d725fdd0652e7acf6961a930/grpcio-1.84.1-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:1e25f45414b3a53bfc1fe43b980f9d0cae9e194a62541d5f6bef0846758162ac", size = 7707719, upload-time = "2026-10-22T14:59:32.284Z" }, - { url = "https://files.pythonhosted.org/packages/10/0d/92682af96b05c1d5e5ce1ea82a3969b221c9d58112a097ff637946e395c6/grpcio-1.84.1-cp315-cp315-musllinux_1_2_i686.whl", hash = "sha256:de3c31abc0d052511744a817506e03534f14e32dadab8ec19f63f2d4facd05f3", size = 8079074, upload-time = "2026-10-22T14:59:34.507Z" }, - { url = "https://files.pythonhosted.org/packages/0c/69/1e426aa52c23640430eed1728c0f7c1167bb64eb7b0a31bb5ce9a500f73c/grpcio-1.84.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:6ce0835704f30d4954aa0a68352fc9cc30242cc85f39d7b6cd20c0790e05925b", size = 8118408, upload-time = "2026-10-22T14:59:37.082Z" }, - { url = "https://files.pythonhosted.org/packages/72/66/037c29a3668a32f2dbd287ceac43286797ffe14c95e7234db75c42ea10dc/grpcio-1.84.1-cp315-cp315-win32.whl", hash = "sha256:43d8b84b3e2b7505e4902ab6288ceee699cfec5435ed879bb53f876b2966ee33", size = 4527284, upload-time = "2026-10-22T14:59:39.362Z" }, - { url = "https://files.pythonhosted.org/packages/c3/87/4dea740311428c40fa0da674e0ecfa28f572809cba4cbc9c568918c82d2e/grpcio-1.84.1-cp315-cp315-win_amd64.whl", hash = "sha256:c8e1c15e81f65efb317906754fdba4a85d2eac9cff250d8a3fb3ccb3a4e52db9", size = 5360072, upload-time = "2026-10-22T14:59:41.328Z" }, -] - -[[package]] -name = "grpcio-status" -version = "1.84.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "googleapis-common-protos" }, - { name = "grpcio" }, - { name = "protobuf" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/23/18/53459706d79cb7c144808d941cb48f099764776d483a85922129662070fc/grpcio_status-1.84.1.tar.gz", hash = "sha256:690ecf476c82d6d98703a80578cc0ec6d0b5222187f783bd0158abd28396cb42", size = 13993, upload-time = "2026-10-22T15:04:10.36Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c7/e2/b9a35118c6c231a3710a0b4f2174da87f2c09045e743c1edc221b4659900/grpcio_status-1.84.1-py3-none-any.whl", hash = "sha256:5a1455bf5b39fe2a3d09d71661e59c97622c73888ad11f13109ce82220b88218", size = 14639, upload-time = "2026-10-22T15:03:56.16Z" }, -] - -[[package]] -name = "h11" -version = "0.16.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, -] - -[[package]] -name = "httpcore" -version = "1.0.9" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "certifi" }, - { name = "h11" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, -] - -[[package]] -name = "httpcore2" -version = "2.16.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "h11", marker = "python_full_version < '3.12' or python_full_version >= '3.14' or sys_platform != 'emscripten'" }, - { name = "truststore", marker = "python_full_version < '3.12' or python_full_version >= '3.14' or sys_platform != 'emscripten'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/c0/61/afa9d6b7452f9eca73f73d45324eb0bb52f098fd5e6049bf6b8263be9b4e/httpcore2-2.16.0.tar.gz", hash = "sha256:c72cd0413563b17e1cd8354677dff887466f8ec2551679759e93126534428643", size = 69886, upload-time = "2026-10-21T07:09:45.31Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/af/c2/ce417c397afa5181f0e3c6ff01a4d01639414e1adef08730d97571297151/httpcore2-2.16.0-py3-none-any.whl", hash = "sha256:5c4358319f2602d984ad93182c9fee5160f22e9da7babdda870a5e7c4e2dc34f", size = 85070, upload-time = "2026-10-21T07:09:42.802Z" }, -] - -[[package]] -name = "httpx" -version = "0.28.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "anyio" }, - { name = "certifi" }, - { name = "httpcore" }, - { name = "idna" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, -] - -[[package]] -name = "httpx2" -version = "2.16.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "anyio", marker = "sys_platform != 'emscripten'" }, - { name = "httpcore2", marker = "sys_platform != 'emscripten'" }, - { name = "httpx2-jsfetch", marker = "python_full_version >= '3.12' and sys_platform == 'emscripten'" }, - { name = "idna" }, - { name = "truststore", marker = "sys_platform != 'emscripten'" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/43/73/5ca2cedf5e4e50423d1c258877865a6b62793633b561c58499f8aeb33b7e/httpx2-2.16.0.tar.gz", hash = "sha256:0d54c98128e8f2ff7fbbde0fca8c359e5f032edeaaaac443cdb7f31f685bcd7f", size = 103116, upload-time = "2026-10-21T07:09:46.348Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7b/3d/2e4bc4fd1ef9770871669adb348d612a6e4786b303a23f9935b81c48dd60/httpx2-2.16.0-py3-none-any.whl", hash = "sha256:fd2c5d7909e8d86fe92d53020c310ca0e4e431b838c207c5754b9bbf0308d49a", size = 97880, upload-time = "2026-10-21T07:09:44.01Z" }, -] - -[[package]] -name = "httpx2-jsfetch" -version = "1.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/cd/c4/0e5636363151a2a1795e0a77617168b9ca438e1748ec05fc9b5687f93d64/httpx2_jsfetch-1.0.tar.gz", hash = "sha256:70a0e3eabfef7cce5ad9c629f7d01ca05e418f586646f4ddf14782e4c1454c60", size = 6872, upload-time = "2026-08-07T00:13:07.492Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/9b/43/832f631d32e4f1211caa2ba368317739fe71f0b8530e4c9d15dc454bac2a/httpx2_jsfetch-1.0-py3-none-any.whl", hash = "sha256:cb916b707601e69a07721aabc8f3f6659be3a6893bc1ff5c6f9e02241df2da32", size = 6382, upload-time = "2026-08-07T00:13:06.567Z" }, -] - -[[package]] -name = "idna" -version = "3.20" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f5/08/8eea9d4b8302028f3abb2c0813953f7aec26d33b7a8960ed760e65ff29fa/idna-3.20.tar.gz", hash = "sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44", size = 216463, upload-time = "2026-09-17T14:11:04.752Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/58/a2/bb081bab032533a855d44de1d56f8e8426114ff1ba5d1f07a438a0a654f8/idna-3.20-py3-none-any.whl", hash = "sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c", size = 69583, upload-time = "2026-09-17T14:11:03.168Z" }, -] - [[package]] name = "iniconfig" version = "2.3.1" @@ -807,83 +47,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/56/43/4ca9e49d27a1fcf6bece6f6aec0ea46bb9112489b93d4b688fb415457bdb/iniconfig-2.3.1-py3-none-any.whl", hash = "sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7", size = 7552, upload-time = "2026-10-06T22:48:36.959Z" }, ] -[[package]] -name = "jsonschema" -version = "4.26.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "attrs" }, - { name = "jsonschema-specifications" }, - { name = "referencing" }, - { name = "rpds-py" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b3/fc/e067678238fa451312d4c62bf6e6cf5ec56375422aee02f9cb5f909b3047/jsonschema-4.26.0.tar.gz", hash = "sha256:0c26707e2efad8aa1bfc5b7ce170f3fccc2e4918ff85989ba9ffa9facb2be326", size = 366583, upload-time = "2026-01-07T13:41:07.246Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/69/90/f63fb5873511e014207a475e2bb4e8b2e570d655b00ac19a9a0ca0a385ee/jsonschema-4.26.0-py3-none-any.whl", hash = "sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce", size = 90630, upload-time = "2026-01-07T13:41:05.306Z" }, -] - -[[package]] -name = "jsonschema-specifications" -version = "2025.9.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "referencing" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/19/74/a633ee74eb36c44aa6d1095e7cc5569bebf04342ee146178e2d36600708b/jsonschema_specifications-2025.9.1.tar.gz", hash = "sha256:b540987f239e745613c7a9176f3edb72b832a4ac465cf02712288397832b5e8d", size = 32855, upload-time = "2025-09-08T01:34:59.186Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/41/45/1a4ed80516f02155c51f51e8cedb3c1902296743db0bbc66608a0db2814f/jsonschema_specifications-2025.9.1-py3-none-any.whl", hash = "sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe", size = 18437, upload-time = "2025-09-08T01:34:57.871Z" }, -] - -[[package]] -name = "mcp" -version = "2.3.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "anyio" }, - { name = "httpx2" }, - { name = "jsonschema" }, - { name = "mcp-types" }, - { name = "opentelemetry-api" }, - { name = "pydantic" }, - { name = "pyjwt", extra = ["crypto"] }, - { name = "python-multipart" }, - { name = "pywin32", marker = "sys_platform == 'win32'" }, - { name = "sse-starlette" }, - { name = "starlette" }, - { name = "typing-extensions" }, - { name = "typing-inspection" }, - { name = "uvicorn", marker = "sys_platform != 'emscripten'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/9d/8d/e0d339616f4810e9051d4aba6887afab289ab1f81875fe908b606cdfd0e3/mcp-2.3.0.tar.gz", hash = "sha256:8b147a50441cf059dc88c684e0aeed3687f0aa0f39c6cde7b90330effd2b34d8", size = 4171955, upload-time = "2026-10-02T22:06:56.091Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/20/d7/4a2878f128df729db3ca04e71bfce26405cc2e0c9ebe19c592feeb4c61b9/mcp-2.3.0-py3-none-any.whl", hash = "sha256:dd0c44c089d16453e8ae31a3877a0054d7a2314caaa81f5e0541b9b1734b2377", size = 368664, upload-time = "2026-10-02T22:06:52.119Z" }, -] - -[[package]] -name = "mcp-types" -version = "2.3.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "pydantic" }, - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/9e/2d/7c251e34207f6c51000312fc8839111ac45cfe02023f90b44e7f1051dd8e/mcp_types-2.3.0.tar.gz", hash = "sha256:d1e46549edb35ee19a94940fcee6d1addd7e589ab7ea92dda83f5d84781fc362", size = 65898, upload-time = "2026-10-02T22:06:57.863Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/ce/48/32583066b155bb5d4507e7887dc88ee23118cc4de8e2a12870c49719e2a8/mcp_types-2.3.0-py3-none-any.whl", hash = "sha256:968efdbdaedfab06adae40d378a34395f1090c5921d4be3c9cde283aaf76d91d", size = 69108, upload-time = "2026-10-02T22:06:54.099Z" }, -] - -[[package]] -name = "opentelemetry-api" -version = "1.45.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/2e/02/6e0ae9cc61bd3169d401077b507b3ebc344745171e1051ab430be012dcd9/opentelemetry_api-1.45.1.tar.gz", hash = "sha256:aa38ed19bcc084ba42782a73255b3582283eced7ad6dddbd6695189e69adfb75", size = 72804, upload-time = "2026-10-06T17:32:58.133Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/1e/41/f7dcf80b81ee8e71c1a2b59f14208bc723edbd89ed027a73b175abf6348e/opentelemetry_api-1.45.1-py3-none-any.whl", hash = "sha256:b31553efa588ae44bc306f863c785c5333a9ecc091248c6ee68b4b6c87fdedfb", size = 60256, upload-time = "2026-10-06T17:32:33.506Z" }, -] - [[package]] name = "packaging" version = "26.3" @@ -902,211 +65,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/40/9e/2b38731e0fc536806f16490e1a12d7f0dc2a1235aa8cc07bcc75416a7daa/pluggy-1.7.0-py3-none-any.whl", hash = "sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec", size = 27082, upload-time = "2026-10-15T09:50:56.808Z" }, ] -[[package]] -name = "proto-plus" -version = "1.29.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "protobuf" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/46/70/783e33ffbb4466cc154a94f79b869b92a451e2bd45605054e68ff68b7af6/proto_plus-1.29.0.tar.gz", hash = "sha256:cfb4e62ad7e13dd18f346cabbda00cab39930d36a05791fd81ddb074d6ee884f", size = 58592, upload-time = "2026-09-29T19:26:15.963Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b1/05/a3ef5b1161498e7b5a2a60288a9cf41b9149e94555423a43ec536737ac1a/proto_plus-1.29.0-py3-none-any.whl", hash = "sha256:8acd070469a7aaf43f440b022ef9757c8cac1a9f866e933f59ae98669ddc6c8b", size = 50786, upload-time = "2026-09-29T19:25:50.409Z" }, -] - -[[package]] -name = "protobuf" -version = "7.36.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d9/89/5b8517baa72f84a67b8a307ba953c91057af618bf40bf676f3c03551f8f0/protobuf-7.36.2.tar.gz", hash = "sha256:497d0463ff3316681da6c0b9e8d06cb465d61abce00b613ab42226175644d1bb", size = 512737, upload-time = "2026-09-17T20:07:59.326Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/32/72/98342feb672507c8f3a69e34b4fa8961f608edba5c1a48a6f47156d92cb5/protobuf-7.36.2-cp310-abi3-macosx_10_9_universal2.whl", hash = "sha256:cbc70b17ee27e28894c7fee8bb04be1abead49e936bc70eb60052531eee2079e", size = 456039, upload-time = "2026-09-17T20:07:51.542Z" }, - { url = "https://files.pythonhosted.org/packages/b6/ea/91fdf7c2b8bbd49cde056f00a9df6773532987e1c00fe2830b895af95c7e/protobuf-7.36.2-cp310-abi3-manylinux2014_aarch64.whl", hash = "sha256:e11e1f0180583a2af89db6a2ecd9e8dc40aa6d2988ca175bfd0e6d12ea72d74e", size = 344219, upload-time = "2026-09-17T20:07:52.914Z" }, - { url = "https://files.pythonhosted.org/packages/17/ab/5fd5f8ece73fad885c5a09aa849b32d70472f954ba3a92d3bb5974ea953b/protobuf-7.36.2-cp310-abi3-manylinux2014_s390x.whl", hash = "sha256:f4fee11ec330d238b34a05c9b675f693c20415d1c5bd7d5320cc2f8a798eb9cf", size = 357223, upload-time = "2026-09-17T20:07:53.985Z" }, - { url = "https://files.pythonhosted.org/packages/db/f3/3996583dd2906297a637af12114deddf7658af6e683fedb83be061983fb5/protobuf-7.36.2-cp310-abi3-manylinux2014_x86_64.whl", hash = "sha256:89f23aa53c24553a2416fd4fd1ec06f74fa42b14b546d8883128813f775bbfd2", size = 343223, upload-time = "2026-09-17T20:07:54.931Z" }, - { url = "https://files.pythonhosted.org/packages/fc/1b/dcc64f358fcb51811b58ae40b3d28f820725f116d86487cc20bd4b130701/protobuf-7.36.2-cp310-abi3-win32.whl", hash = "sha256:912c1221170e16c08d1f086762f563dd61ff83c18b5fa6652952dfaded66f728", size = 442998, upload-time = "2026-09-17T20:07:55.826Z" }, - { url = "https://files.pythonhosted.org/packages/8a/55/b77bda4e5e5f5971fb51b07663694690e9afdb9402136c16a522bd621cad/protobuf-7.36.2-cp310-abi3-win_amd64.whl", hash = "sha256:a300819d441e078a5608c0d3c709796bb548136058fda017ae51d425b44fd353", size = 456514, upload-time = "2026-09-17T20:07:57.188Z" }, - { url = "https://files.pythonhosted.org/packages/e4/04/d52c7016b04b6c5108f26691f9d33ec82a9b65d041f1a9c771137693d618/protobuf-7.36.2-py3-none-any.whl", hash = "sha256:bdb3a345d48db958e6ce1f18e508beb0cc981d64f24088427549c866cd039f1e", size = 179806, upload-time = "2026-09-17T20:07:58.211Z" }, -] - -[[package]] -name = "pyasn1" -version = "0.6.4" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a4/9a/23310166d960def5897e91fe20e5b724601b02a22e84ba1f94232c0b7f67/pyasn1-0.6.4.tar.gz", hash = "sha256:9c447d8431c947fe4c8febc4ed9e760bc29011a5b01e5c74b67025bd9fb8ce81", size = 151262, upload-time = "2026-07-09T01:12:33.988Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/9a/3b/6163796d69c3977d1e4287bea4a6979161cbbdd170ebb430511e8e1999ce/pyasn1-0.6.4-py3-none-any.whl", hash = "sha256:deda9277cfd454080ec40b207fb6df82206a3a2688735233cdcd8d3d565f088b", size = 84410, upload-time = "2026-07-09T01:12:32.92Z" }, -] - -[[package]] -name = "pyasn1-modules" -version = "0.4.2" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "pyasn1" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/e9/e6/78ebbb10a8c8e4b61a59249394a4a594c1a7af95593dc933a349c8d00964/pyasn1_modules-0.4.2.tar.gz", hash = "sha256:677091de870a80aae844b1ca6134f54652fa2c8c5a52aa396440ac3106e941e6", size = 307892, upload-time = "2025-03-28T02:41:22.17Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/47/8d/d529b5d697919ba8c11ad626e835d4039be708a35b0d22de83a269a6682c/pyasn1_modules-0.4.2-py3-none-any.whl", hash = "sha256:29253a9207ce32b64c3ac6600edc75368f98473906e8fd1043bd6b5b1de2c14a", size = 181259, upload-time = "2025-03-28T02:41:19.028Z" }, -] - -[[package]] -name = "pycparser" -version = "3.12" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/cb/27/eeb9f307bf07060f3d9f9aa0fb8c15b01bdfded0a941e4b2719c7f94cacd/pycparser-3.12.tar.gz", hash = "sha256:f03387877eab82ce01bbdfd0ba7252ee55a90b1c708d5129e2ce915475cf1db6", size = 158785, upload-time = "2026-10-22T13:40:03.56Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b6/ae/315bbeee126a769cbde43cf4908acb4b40408d8bf8bbf334dd7368d8dadf/pycparser-3.12-py3-none-any.whl", hash = "sha256:a076f3f489b39b43ed13563a1dafe42447445bec2e294154ec5c57fcdda4c85e", size = 62600, upload-time = "2026-10-22T13:40:02.021Z" }, -] - -[[package]] -name = "pydantic" -version = "2.14.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "annotated-types" }, - { name = "pydantic-core" }, - { name = "typing-extensions" }, - { name = "typing-inspection" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/7c/0b/8e10b2e693af8ec54346a14caf36221334775975a747c9ceaa3f8371d96d/pydantic-2.14.1.tar.gz", hash = "sha256:94f478203dd03404682a1ada216965651dd74b1d2d5ffd62e00e0837caab5c26", size = 900362, upload-time = "2026-10-11T18:37:55.396Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/35/ea/a56b9fe5066f3537b7882f77e9c5dfb26d8c2eefdaed9b5fc73d57b4dc22/pydantic-2.14.1-py3-none-any.whl", hash = "sha256:9195d967ec791692a04438115466764fb8b9a27b31f14a760437694f40d6b454", size = 488106, upload-time = "2026-10-11T18:37:53.437Z" }, -] - -[[package]] -name = "pydantic-core" -version = "2.50.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/a6/24/af4ec4be49fbc810f35b0bdcacc3d433b56bbfa469fd3bfd4ae116cd9bf1/pydantic_core-2.50.1.tar.gz", hash = "sha256:e50d7b94baac6c7d09927fa5ca5800a0c7ee5015c7fcff65beb3a1931b5a6e09", size = 513515, upload-time = "2026-10-11T18:35:44.82Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/45/1b/ca81811da3d2aea724fb3c4ba6b83f50ab8f210576306ccd601973142d35/pydantic_core-2.50.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:c531166c42ea7bdfecc8c50049581f05dd1993b09cc7c52bb36a14e96deaec7d", size = 2152145, upload-time = "2026-10-11T18:31:58.046Z" }, - { url = "https://files.pythonhosted.org/packages/59/20/938ef7e0541af0a314e2f9d63848dbd1656ba2ebfe5ca0469f7ebee00d5e/pydantic_core-2.50.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b6d0c2183008c188e19f4906d426b293bdc4f67ab17df8e180fe16cda208fa71", size = 2045761, upload-time = "2026-10-11T18:31:59.35Z" }, - { url = "https://files.pythonhosted.org/packages/2f/4b/456497fe2affa18f49b226e89bde31e8a204751ee343dd9beaac5438123e/pydantic_core-2.50.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94be440c03fede26969a5ce75468e0e6a9927a1b46d9b679ee8adc1b057b0350", size = 2049557, upload-time = "2026-10-11T18:32:01.121Z" }, - { url = "https://files.pythonhosted.org/packages/a5/9d/cd5dfe13928f55e236dff3a1bee06721d318ca6c955d9ca993b0a5d09f39/pydantic_core-2.50.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:36c426eac0af8d1529ff8467e612b933346caec1fdc0d774f78f67a1a11e16c1", size = 2188153, upload-time = "2026-10-11T18:32:02.442Z" }, - { url = "https://files.pythonhosted.org/packages/fb/8d/d0b25bc484f8d9136ea76ece69e0b2d24ab370cc2e7bbd1b79e61723b763/pydantic_core-2.50.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:028e2f212273d4a39b1ec1e0de8166b1165a65fc0f1111452a9d94fc7c625c63", size = 2388308, upload-time = "2026-10-11T18:32:03.767Z" }, - { url = "https://files.pythonhosted.org/packages/c5/64/6513cac7c9f78492abafa01d57a69de1d246bf3085fd7b0330bf14b025b3/pydantic_core-2.50.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e6f0cc1bb9900dc558960894adeb30b0c083366fc1d69b856209fb2ca5c36fe5", size = 2431187, upload-time = "2026-10-11T18:32:05.159Z" }, - { url = "https://files.pythonhosted.org/packages/ed/60/7f2ae89c37e69a3dc0da9ff57b0388c285542c688d05f36767770429de85/pydantic_core-2.50.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8812592c85d0edf423f10eadcef42716d71e8219085ad9e85b775057b7306133", size = 2157623, upload-time = "2026-10-11T18:32:06.616Z" }, - { url = "https://files.pythonhosted.org/packages/87/02/e3a71373b85a7973099b9a229a4302c7792262717e0b4997e41c01f7dd16/pydantic_core-2.50.1-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:bbce99252ba3167b2b6277f1829d5bf4b43b754524bddf7f944707c3db7d2253", size = 2254539, upload-time = "2026-10-11T18:32:07.968Z" }, - { url = "https://files.pythonhosted.org/packages/3f/d5/5b620aaf40dc631d911565b64d49d3fa8422027c046a7a96dc4e4921ae98/pydantic_core-2.50.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:476f6ed8e43cd1e0b460920e23571700872b284e77331cb30c4faf459cf48a4b", size = 2267344, upload-time = "2026-10-11T18:32:09.399Z" }, - { url = "https://files.pythonhosted.org/packages/e0/48/f46baf4580d8a56ca4782aa65842e16d3cf39736b29fcce8e9c0521b3422/pydantic_core-2.50.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:2cbd1b75b09e976ed0d6b6ca297675632ca35df86130088457cdc60ef36970ae", size = 2300877, upload-time = "2026-10-11T18:32:10.903Z" }, - { url = "https://files.pythonhosted.org/packages/2b/9d/e7d28505e6092c1fe075838a4f793ccbe6dd676e44ab16175815ee06cfe0/pydantic_core-2.50.1-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:5958c72adb417c39b12ac87525ac60b0d73315fcdc59e21f44ee4a5e2512c9ef", size = 2464270, upload-time = "2026-10-11T18:32:12.329Z" }, - { url = "https://files.pythonhosted.org/packages/22/b1/3bf63b82efd93ebc9968f9c12fc46037a28bcb452c88e4688f33e5ff7dca/pydantic_core-2.50.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d8f9e8a6c4ab04b78d61f78627370d834eb004b2869dcb28cfffa647b4ea1980", size = 2478653, upload-time = "2026-10-11T18:32:13.735Z" }, - { url = "https://files.pythonhosted.org/packages/28/17/26d1e4b9c2ba6a92b7dc75bbcb99ef44456b7e3af1bced868403667ea7d3/pydantic_core-2.50.1-cp311-cp311-win32.whl", hash = "sha256:4be846f55c9477f5f3ddde8f2ce941137e16862a56d018ed885d422bb6ae02f2", size = 2120246, upload-time = "2026-10-11T18:32:15.591Z" }, - { url = "https://files.pythonhosted.org/packages/24/65/3e875e7991eaecd4d70686293ff0d8a99aa8f93dc295e6a21c3d702912fb/pydantic_core-2.50.1-cp311-cp311-win_amd64.whl", hash = "sha256:0048b6dddc8ef4b64fccaad878bd143b0c3882ea9936279dc11d613f6b7dd1bc", size = 2176332, upload-time = "2026-10-11T18:32:17.153Z" }, - { url = "https://files.pythonhosted.org/packages/ab/5c/58dbd17c61f209d91c70f549eb7a3bbec7023e89ea12dead091462d6d658/pydantic_core-2.50.1-cp311-cp311-win_arm64.whl", hash = "sha256:6a733778df2f7087ec1100ed0b41533e4f3001976e99570fa34f57c66e7f8e3e", size = 2182471, upload-time = "2026-10-11T18:32:18.49Z" }, - { url = "https://files.pythonhosted.org/packages/ee/94/101b49a6c63f99586755690696eae14532772587d9e39e93f7b8d28a49da/pydantic_core-2.50.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:704075d10b74f2f3c6e15407c696d88701df35fc8953f434a431add0d0074db0", size = 2222428, upload-time = "2026-10-11T18:32:20.228Z" }, - { url = "https://files.pythonhosted.org/packages/db/a3/f8b1b39349c33037c73d7a1b794c9c29d8f07d5bd2b74399c1375a529cc6/pydantic_core-2.50.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e8e1d6ce820aa23317e8209a86bd65a540973c12dc7552b48a4f6c8e9926815e", size = 2025779, upload-time = "2026-10-11T18:32:21.723Z" }, - { url = "https://files.pythonhosted.org/packages/d2/2d/862a7d115305cc621358e51ba13f296e0ffdf4fbd984be9f63bc7862730b/pydantic_core-2.50.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c18db21573bd2c6489f9a544b7499f0df2853958c568e5e783536ee1f690af41", size = 2048429, upload-time = "2026-10-11T18:32:23.3Z" }, - { url = "https://files.pythonhosted.org/packages/c0/7d/fed95d18bf2b5abe2d5ab2bbec4184bfc22b6805994a33ccdae8edffd25a/pydantic_core-2.50.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cb57f304525a5e3c13333b772bf9a473f36326e9c821b2e8e1b2fd36f80ae2c3", size = 2173274, upload-time = "2026-10-11T18:32:24.697Z" }, - { url = "https://files.pythonhosted.org/packages/93/1e/c6f22ceac65dc3d291ff79bea0eb74cbd1de8b128f01fee48af03bcea1e1/pydantic_core-2.50.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a27c09d86600f1bf2fe3f37e1ae697faf3143931c09322cd799da94deee923b5", size = 2360403, upload-time = "2026-10-11T18:32:26.281Z" }, - { url = "https://files.pythonhosted.org/packages/2c/97/190b5b6bfe4c72f265feb657913eb30749193927a5ad7b83cfa7866a25a2/pydantic_core-2.50.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:46b3301d3b5c886f77de7546e47274a5842c622ea2020b8c6524c6b66913b4a6", size = 2439799, upload-time = "2026-10-11T18:32:27.844Z" }, - { url = "https://files.pythonhosted.org/packages/90/24/48cd98388e4ac2c08d0800af36d15413db15e20387f1038123a2c86cb2f6/pydantic_core-2.50.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:93ba4e9d8210d941c200431a56b2c0400b131865947903937ed3ec5404307d2e", size = 2160157, upload-time = "2026-10-11T18:32:29.553Z" }, - { url = "https://files.pythonhosted.org/packages/00/86/d909133d0b9979ed14c20f110f21124a0e346caf071bd66ac5af3009062b/pydantic_core-2.50.1-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:e5faeaee74a57d32b3ab3aebad2e348f06d3ba946fc5d28c1728455f00a3d13a", size = 2229523, upload-time = "2026-10-11T18:32:31.027Z" }, - { url = "https://files.pythonhosted.org/packages/90/31/4b43f08131b2098e73a852fd932063385f3103b33839fd9d1abdb89e673d/pydantic_core-2.50.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a3cda0e538208e5d722bbf3698b24f19c0a7d05bc8d5f8a7f9b121ea7fa243d9", size = 2242700, upload-time = "2026-10-11T18:32:32.622Z" }, - { url = "https://files.pythonhosted.org/packages/88/77/de39658569dc7a4c293d110a89629f61145e7538f00d1e4280c28debefd3/pydantic_core-2.50.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:57f51b31ff826e2859120cf4737c5a758a48d96f3e97da40ccee1796d58078ff", size = 2278452, upload-time = "2026-10-11T18:32:34.165Z" }, - { url = "https://files.pythonhosted.org/packages/46/bd/1eeb9e4e791e81210ef9096f58080b32ba15b5b13c108d50aaa3f8ce9f73/pydantic_core-2.50.1-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:8daa7ee75245d43ad7d747e5c9ecc1b1d06552f72b14887e9276f787d57375f4", size = 2450098, upload-time = "2026-10-11T18:32:35.547Z" }, - { url = "https://files.pythonhosted.org/packages/1c/e6/b2accfdff17e5a88d6358536702146de00f9339adaa4d5bbe1ee93cb4832/pydantic_core-2.50.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:acbf31f37c53a5ac0c34706c80b4f5107ba20b05fdd3816124bf236ef0c57dd2", size = 2476839, upload-time = "2026-10-11T18:32:37.119Z" }, - { url = "https://files.pythonhosted.org/packages/3b/7e/c8a83eb5d2cd42c2e13507150fb777b1edea5a018adc9cbf2858a1d08285/pydantic_core-2.50.1-cp312-cp312-win32.whl", hash = "sha256:45b11cac094aa25725581d9304eee93c9028516b9ea80dd9e175e13a5a2c840e", size = 2101425, upload-time = "2026-10-11T18:32:38.593Z" }, - { url = "https://files.pythonhosted.org/packages/c5/17/8bbd530b8659e9d963f5b16f6cb8e159f4cd174b4d6304e48969ab12dba8/pydantic_core-2.50.1-cp312-cp312-win_amd64.whl", hash = "sha256:132529c83901437ff642f585216831bf5fd7a91df66829907e155192ead62498", size = 2172522, upload-time = "2026-10-11T18:32:40.112Z" }, - { url = "https://files.pythonhosted.org/packages/af/9f/a79d690b127e4e3cff143d031538ab9aa715f6b2fbeecbd07cd6f2bf9fb7/pydantic_core-2.50.1-cp312-cp312-win_arm64.whl", hash = "sha256:4e834f6a8e4ff772dcc34f58ef5504147a3ea5b0f4eeb13b0f8eb2ca75ac57f1", size = 2161366, upload-time = "2026-10-11T18:32:41.606Z" }, - { url = "https://files.pythonhosted.org/packages/ae/57/0e237d7091d2cd44a35d243b7344227f90440166860469cd036afc23a04d/pydantic_core-2.50.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:d5e062c01286d861fd6a1c4ff6e063547b3e713067f2df033c0ff97ac2ca006b", size = 2222774, upload-time = "2026-10-11T18:32:43.103Z" }, - { url = "https://files.pythonhosted.org/packages/f7/b9/c720e56858d4e1539503297ed37063e0c08e0f3541c41b777f6a800f75fa/pydantic_core-2.50.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0c003c3b7f49debb893d2d85ae099ac5959c9839e2f330fadb1fcdf7a6594482", size = 2024738, upload-time = "2026-10-11T18:32:44.587Z" }, - { url = "https://files.pythonhosted.org/packages/4d/b8/fbfc25875219cc060e613170ff10e850c6d8924beb4910da57c2ee3ba1d2/pydantic_core-2.50.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:409e0ea40ec30d9158f33574fd758e689f6045a0f2596701828c27816ca9687d", size = 2047049, upload-time = "2026-10-11T18:32:46.164Z" }, - { url = "https://files.pythonhosted.org/packages/d7/43/34210124d504c553688f2f04b48500b131237528ac545b445e0d6d30e0d5/pydantic_core-2.50.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:131059670f1d2444269b8585cb888963994871932447c08b39ac6a51fcfef658", size = 2173415, upload-time = "2026-10-11T18:32:47.722Z" }, - { url = "https://files.pythonhosted.org/packages/65/cf/6e178e8fdc11da5965bef980983bf46326a42f436871dd51ba0a57f39df1/pydantic_core-2.50.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6dbcbee53bf17196a7f745aa9bf5a9603953a1e365b1f020be3207c676a3e7c4", size = 2361719, upload-time = "2026-10-11T18:32:49.217Z" }, - { url = "https://files.pythonhosted.org/packages/11/14/bd5169d356aa91bf777e28ba0b281c192d286d03c2812c9c9db023a2f00e/pydantic_core-2.50.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:325c23f3e35cfbf0fe3486fa5f7260d1e45885173002d30a28ca019994124255", size = 2439803, upload-time = "2026-10-11T18:32:51.025Z" }, - { url = "https://files.pythonhosted.org/packages/1c/bc/d79d000e5203ebef39af839f2ce77a777fcad6e08ad26af9a2fcd114ffc8/pydantic_core-2.50.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17e722e156d0444ecaefbe640bdb60928752bf2013e2b7a11cdb099aaae19bec", size = 2158402, upload-time = "2026-10-11T18:32:52.714Z" }, - { url = "https://files.pythonhosted.org/packages/1b/a5/4902cb5fd599422c130bd3124ab31ee8b771199bd56662702eed07d3fec7/pydantic_core-2.50.1-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:aa8224f10880d9bf1b5993988ba153d42a8b4f3f4f511f93b1f09c93ff613c72", size = 2229755, upload-time = "2026-10-11T18:32:54.126Z" }, - { url = "https://files.pythonhosted.org/packages/1a/f5/c1481f8669f6060d89110c9b1374173fc8767ca276b84f4870bd8acd5e3f/pydantic_core-2.50.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:41bc8237121bd8dc8d888dfd6279fc166ffc88c1f1bf3a8bf00869680533ca4c", size = 2242303, upload-time = "2026-10-11T18:32:55.641Z" }, - { url = "https://files.pythonhosted.org/packages/04/f9/77fc3c7653ba9b6e42049e17e96b25388187d4a7c274ab1cb07f58ac8419/pydantic_core-2.50.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:45c6266d071c241f2a168d45bf8c54344f0effce35e7e6b73afdec11f3687568", size = 2278345, upload-time = "2026-10-11T18:32:57.38Z" }, - { url = "https://files.pythonhosted.org/packages/95/9b/0579c5d12e7f2b16b27e6782427987341fcce07b0725e02ddb0b74add0c4/pydantic_core-2.50.1-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:1deeacb112d14d3f4fcb16b165f7dbaf76c70ba6e82f37ba042bdab51970a0b8", size = 2449947, upload-time = "2026-10-11T18:32:58.896Z" }, - { url = "https://files.pythonhosted.org/packages/a8/ac/1b677db91eba54cc5922f4de6edc46ba45c2bd712dfdc0130382d158e214/pydantic_core-2.50.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:1c96fd793b73d1b92e65570132505498fe7b21eaef73cdf74e67e5dfba7ac9e4", size = 2476889, upload-time = "2026-10-11T18:33:00.665Z" }, - { url = "https://files.pythonhosted.org/packages/4d/2a/3a9f6624ee3ea9ccba5249dde11418bb4c35780a7a92608f8768bd3fea39/pydantic_core-2.50.1-cp313-cp313-win32.whl", hash = "sha256:06ead20d39ffd6f2f6f2a8f8a6de67ff8bb1b4f14a8a30e058502514ee2ac685", size = 2101118, upload-time = "2026-10-11T18:33:02.329Z" }, - { url = "https://files.pythonhosted.org/packages/2d/1f/323f78ddd9d9938aac420c1abb4e8ba799fc8bdab0acc67c0593b837c979/pydantic_core-2.50.1-cp313-cp313-win_amd64.whl", hash = "sha256:7816e98acc08119dc0f340ab167048ecc54126316330c1f0caf7c6756c88e28f", size = 2170840, upload-time = "2026-10-11T18:33:03.919Z" }, - { url = "https://files.pythonhosted.org/packages/cb/09/8497c52a739ae425c3ac2f7f56414cbc711c67d374346174f40fe2062644/pydantic_core-2.50.1-cp313-cp313-win_arm64.whl", hash = "sha256:c17799a62c142d61b8a3c51752a7cbc87fe2ad4ccfab10e628a77b405075c662", size = 2161633, upload-time = "2026-10-11T18:33:05.518Z" }, - { url = "https://files.pythonhosted.org/packages/49/33/28b96e81677153715e3eafb9f26663a80841e859fde282a380359b0d3fa1/pydantic_core-2.50.1-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:1cf41f1ae3fa155cf167a72689ad044bcc1e3c97e064123677149bdfb5dafc4a", size = 2224428, upload-time = "2026-10-11T18:33:07.153Z" }, - { url = "https://files.pythonhosted.org/packages/94/40/15c06410c9b7b8da5805d27b64e09bd3f900e986728106db2689dbc51513/pydantic_core-2.50.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4df197990c15b5a37c5a277d131d9f2c67de6133f2e5dafd80d9bba4b99f46f9", size = 2023740, upload-time = "2026-10-11T18:33:08.763Z" }, - { url = "https://files.pythonhosted.org/packages/a1/4e/5eb629f6efc2a27e421d789dd4bfacbb5f6d09c80c28b13d1e87d73163d5/pydantic_core-2.50.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0036473f5583e6a60e50b8b21651511564277a3f05cc5dab8cf579f552cd5f6c", size = 2049435, upload-time = "2026-10-11T18:33:10.366Z" }, - { url = "https://files.pythonhosted.org/packages/ba/8e/f195aebec49ad12318876ac2368c197a7939f5d52f8e156d2238ef8a4588/pydantic_core-2.50.1-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:992c3514ec891fa7858099183e4d64e6bd5a5d4ff452fae29df22faa77a006bb", size = 2172975, upload-time = "2026-10-11T18:33:12.368Z" }, - { url = "https://files.pythonhosted.org/packages/e0/f5/7ad9fb83010cd5ea0948409db105676ed779c4e709e2d3d89b9fe2558794/pydantic_core-2.50.1-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:739dc730e6be3bd5ec2f4ab5cfc7eb047cc45fc1497b3bafec74ff2ed07df597", size = 2364197, upload-time = "2026-10-11T18:33:14.244Z" }, - { url = "https://files.pythonhosted.org/packages/ca/fb/bf0aab3e78301d202b82a0322ec968cd703b11fc0623fde9a28708936f62/pydantic_core-2.50.1-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:32fad3a91e51b6d2039c572db04a5a873260b399f6bd62c3552671fa7a4a2899", size = 2444259, upload-time = "2026-10-11T18:33:15.79Z" }, - { url = "https://files.pythonhosted.org/packages/45/35/38f6d6564fae57d9b12e5676dfa947e0e7d5c46dbeaa7eb3352261d6d299/pydantic_core-2.50.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42b54c2c90ad348b5e3a85e03e715d572c1fde357ef104cdfe3b03b697a404ea", size = 2159857, upload-time = "2026-10-11T18:33:17.51Z" }, - { url = "https://files.pythonhosted.org/packages/65/a0/fb0a3ca10f139dcf765b2d312d10cf0f65c57c59993229d00ad12b14ceff/pydantic_core-2.50.1-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:2df1ff41884de2bc4b307bafd7c40a691094fad2ff8e767e5b45a319257bcf4e", size = 2233954, upload-time = "2026-10-11T18:33:19.591Z" }, - { url = "https://files.pythonhosted.org/packages/8c/6a/e63842252702aa4ec6e6b7178ca85e541a77459076592c23ebe2d9840b33/pydantic_core-2.50.1-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fe90228920fd8ff2be62622b6bb8a2b11acd65046d50c6b130614b5879605a20", size = 2243876, upload-time = "2026-10-11T18:33:21.393Z" }, - { url = "https://files.pythonhosted.org/packages/39/25/5991cf8318b37e0dfab47b87541619a1df8501a793cba0d978846cba37a7/pydantic_core-2.50.1-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:844b869f118e22a41a091bdcedda8a71bc1b0f62c38d1a0c3211cece47e1d8fc", size = 2277908, upload-time = "2026-10-11T18:33:23.324Z" }, - { url = "https://files.pythonhosted.org/packages/a7/3e/3ee8baaa6cc25a6961c69168cf9ff0f002d56f4e0d541ad6724c18fb61f3/pydantic_core-2.50.1-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:2eb75304506894a281d346220a4f7481a1b8729577c5ed2a05395991966a8396", size = 2449285, upload-time = "2026-10-11T18:33:24.942Z" }, - { url = "https://files.pythonhosted.org/packages/c0/c7/acbec6deac13fe697a80c275a9b6661db62c4d323bac8a47347b1f39c7cd/pydantic_core-2.50.1-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:6b20a4bffabdad0db2927ac034ae3b8a681b1f7a0182f3e60b479ad2fde21ebb", size = 2479013, upload-time = "2026-10-11T18:33:26.925Z" }, - { url = "https://files.pythonhosted.org/packages/10/08/21a3f237b264389f6219d053ee78fc1b5c2fd402c1b1cb2b6cb8b85f9834/pydantic_core-2.50.1-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:99ba9bc2b8062ea0c326a990f7f00e6530c23579de66dd246e72c4cafef950a5", size = 1484400, upload-time = "2026-10-11T18:33:28.693Z" }, - { url = "https://files.pythonhosted.org/packages/09/ce/077a6d262d12ef09108377ac0717f029f420d773ace63cafd6143af75568/pydantic_core-2.50.1-cp314-cp314-win32.whl", hash = "sha256:cf356f70551d40374eaffb1aa63f1eb6d2006681cbd7a9faea173ce0f4dd7cd2", size = 2103222, upload-time = "2026-10-11T18:33:30.326Z" }, - { url = "https://files.pythonhosted.org/packages/14/4c/350a2415209c43d670eb71d3c040f332c04a30583d39e311b05c7ac15762/pydantic_core-2.50.1-cp314-cp314-win_amd64.whl", hash = "sha256:d32f3acc081cc3923386d88f422cde8892335e95f034e0104bb4cf9310d9915f", size = 2171586, upload-time = "2026-10-11T18:33:32.139Z" }, - { url = "https://files.pythonhosted.org/packages/bf/92/9bea6ca96580a0902fed366f064f0829e404f41889b34543279a1162b888/pydantic_core-2.50.1-cp314-cp314-win_arm64.whl", hash = "sha256:bed5163e03b98bc1fa2eb05d74c63d9c5c95d8ed6254985481640fbf5e237dea", size = 2155773, upload-time = "2026-10-11T18:33:33.896Z" }, - { url = "https://files.pythonhosted.org/packages/86/8c/f121f073cf32bdd5cba7e6230b1ce0ac845b0cf43e44dd597d95af272db2/pydantic_core-2.50.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:9572c1369e9c9da2d64a7b7992c786d90ff295abc93964cfe3125e4290768070", size = 2234017, upload-time = "2026-10-11T18:33:35.588Z" }, - { url = "https://files.pythonhosted.org/packages/a4/69/2bb2bcd6146cffe98d760a46c42ae71efd5151d9b2f9c9bf6619a3b32083/pydantic_core-2.50.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:2005207aafe1231315718bf6ed5d064a7300fb4772754af35ee72fc68159492e", size = 2001016, upload-time = "2026-10-11T18:33:37.57Z" }, - { url = "https://files.pythonhosted.org/packages/20/b3/fbf854c7d07ec114260c26e9e2071a4381740f9ae09641dbfcbdf2a18c45/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64f6047f62a6c5ae08d0a6afb035667aa2d97c3d20d69762e034c5ea144d92a5", size = 2023015, upload-time = "2026-10-11T18:33:39.433Z" }, - { url = "https://files.pythonhosted.org/packages/65/20/6de55b2f92cdb614b745c6e9ced639fc4fd7e1e77604825a88bdece6fcbd/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1ef800dd7d85bcdadf4c3076e4c94e43939493558a3b69a1ea830c706d4617bb", size = 2192543, upload-time = "2026-10-11T18:33:41.381Z" }, - { url = "https://files.pythonhosted.org/packages/0c/d9/19e91c94bd5c405945ce2f15526808aea37e162c253160de8ed7bf70b406/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b0135bcdcaa0f23573f286e4cb5e0fd2962700964ed13df085b85f2b97aeab9e", size = 2388704, upload-time = "2026-10-11T18:33:43.167Z" }, - { url = "https://files.pythonhosted.org/packages/b6/bc/2e24c8415eae1a25ee5a5484946a917123bad2e9d01689a759236928175a/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0b3a6f334c6a2345ca15318ff894502a90012536404b37c844a976c76c846e0b", size = 2464118, upload-time = "2026-10-11T18:33:44.856Z" }, - { url = "https://files.pythonhosted.org/packages/bd/1f/945b8053cb061c64e102bcaf7bfb9ed740c0bd4349f9bb978a7d4ddff4ab/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:06e01fbbfdb9be777b316a71b6c49efaf4a08b615d0a98d678cda3023f79d019", size = 2150142, upload-time = "2026-10-11T18:33:46.661Z" }, - { url = "https://files.pythonhosted.org/packages/2b/78/96a3e50bf0d64aaae781107eb9335b7529d05a85793ed6e7241c4cd1d931/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:a29a061fec0b4e2d714f277e70a3a18125ecff803f2fea6eade2f2e53711d112", size = 2245577, upload-time = "2026-10-11T18:33:48.574Z" }, - { url = "https://files.pythonhosted.org/packages/7a/5d/a6038a0322232758a6ebfa709f4ca14a60bf5b93940cd0b345056a557da4/pydantic_core-2.50.1-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f5187624823423e1d1b82b1072ac41dc837389e18d3d0572cc19bbee46cd550a", size = 2263728, upload-time = "2026-10-11T18:33:50.527Z" }, - { url = "https://files.pythonhosted.org/packages/0d/4b/76ded3333a457a9344c4f2d63f2d82d0101654b05178fa4ddfe7d3627674/pydantic_core-2.50.1-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:3e46a9eb0a0901dd6275e6b06ac3a464885ef350ec4121fe486869de8053e4bb", size = 2293630, upload-time = "2026-10-11T18:33:52.362Z" }, - { url = "https://files.pythonhosted.org/packages/a9/00/9eca378335c9c1b72bc779bf6e4c2a82ce784f14ec48a0e87102c9870e05/pydantic_core-2.50.1-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:756d669f04e62ec4148ecfe22be6a4484d9b1181a6ef32e205ebfd200540858b", size = 2468048, upload-time = "2026-10-11T18:33:54.118Z" }, - { url = "https://files.pythonhosted.org/packages/35/ca/e3832e9cf93651251de43c8c5c029ed680a3c1a0a1b17ee26c81bed08cbd/pydantic_core-2.50.1-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:c516cc5367ca3448995d42cb994bf3f4c9002d2a7c22eac9622551269ad1b807", size = 2512159, upload-time = "2026-10-11T18:33:55.99Z" }, - { url = "https://files.pythonhosted.org/packages/4b/f2/773469b5a10a39116a2cb17edaf6d722f017dd8da07161b371465311c542/pydantic_core-2.50.1-cp314-cp314t-win32.whl", hash = "sha256:9d1bed94af6a63835461f3cf7502058eb166c58c4778e11d0f433cfb1bd69e19", size = 2098406, upload-time = "2026-10-11T18:33:58.043Z" }, - { url = "https://files.pythonhosted.org/packages/ee/42/0bb74f8f25204b259b11ab7c12dc7f180893b6bd706118b385147fb6efd5/pydantic_core-2.50.1-cp314-cp314t-win_amd64.whl", hash = "sha256:c8dce1f1e0e5358b682a6ad3fa5e31b31d4560997b8e61417e9217c8d60f8a0c", size = 2148481, upload-time = "2026-10-11T18:33:59.913Z" }, - { url = "https://files.pythonhosted.org/packages/47/0d/d801646c9679a4e630e15cf521d4108b93854b42a6e6e02391bd4c6b1095/pydantic_core-2.50.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ceff0acc940be2715bd6ad17b24c0e5304abf44f6efd0f81ee8499e640f9dc86", size = 2174972, upload-time = "2026-10-11T18:34:01.875Z" }, - { url = "https://files.pythonhosted.org/packages/b2/84/23984b763d8862a02a13d27a44b6e8169428fd85ecfed88f54c29108604d/pydantic_core-2.50.1-cp315-cp315-macosx_10_12_x86_64.whl", hash = "sha256:8a6791afa2245e6c6b180122d105941644f5bd410bb18623b408808cc41a3102", size = 2224599, upload-time = "2026-10-11T18:34:04.016Z" }, - { url = "https://files.pythonhosted.org/packages/4d/90/a63cf8586abc1d1a3f6d9b18f0224789ebf003851f092ebda3c7c863fd32/pydantic_core-2.50.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:84f34323a61a365b4e9295de6028474754829aaddd59c7bf1a040e7487ef8f3c", size = 2024191, upload-time = "2026-10-11T18:34:05.901Z" }, - { url = "https://files.pythonhosted.org/packages/a6/6a/f34bff9808ffb4907fbf5f5040457d253cacf2da7fce9efbc99ca1b1a44d/pydantic_core-2.50.1-cp315-cp315-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23edad659e8dbd8ca7e4e877fe6c81573abbdf215bd25a68b53e1272f58b80c7", size = 2048252, upload-time = "2026-10-11T18:34:07.757Z" }, - { url = "https://files.pythonhosted.org/packages/b2/54/13f419bf1eb59852003818e25935aaf175687d978f4c4bca70e08fe40a3b/pydantic_core-2.50.1-cp315-cp315-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3a5fce22f1e87d181e924e12da7d81cfe031fb3881a5ddf26ad28f141756ca43", size = 2173376, upload-time = "2026-10-11T18:34:09.592Z" }, - { url = "https://files.pythonhosted.org/packages/6d/6c/b5a34d24cd0c81669d8f8339d74e6815abcf2f8fb48ab4b49b84c09be1d5/pydantic_core-2.50.1-cp315-cp315-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c73622ef819328873b53109ee4f77ceb598bffedd02daf916102be3228866b78", size = 2364559, upload-time = "2026-10-11T18:34:11.534Z" }, - { url = "https://files.pythonhosted.org/packages/eb/8d/d64d6216a8df365082665927ff923f183056f9049fee08e9777c9ac05296/pydantic_core-2.50.1-cp315-cp315-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ce8c25ca38cc0e3d7753ba180808de2c0c8cb24eae0df64491e40921454e9831", size = 2444697, upload-time = "2026-10-11T18:34:13.535Z" }, - { url = "https://files.pythonhosted.org/packages/b8/0d/1b1149f60a00ea21ba5f70e28acbd40feb4598af414f80f53c921fac07c9/pydantic_core-2.50.1-cp315-cp315-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7689580e72a642ab5ec64d5f55b2e33636fa43b4ebe63c0c2c965ef307c7d1aa", size = 2159961, upload-time = "2026-10-11T18:34:15.56Z" }, - { url = "https://files.pythonhosted.org/packages/1e/35/f236549299dcc78e71e945495d7ec67e78d20844d0999c60601685003031/pydantic_core-2.50.1-cp315-cp315-manylinux_2_31_riscv64.whl", hash = "sha256:d5c0e32fdbce7f1e8ef4d11f655694bf5f4175c757a9f1dc2be09b8864e5bcf5", size = 2234581, upload-time = "2026-10-11T18:34:17.502Z" }, - { url = "https://files.pythonhosted.org/packages/6a/85/26901a490522b7f75ef9bb9a7afb73e5bb550f0e1cb5b99a0069183e2eb9/pydantic_core-2.50.1-cp315-cp315-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:40f523349960fa30f3ea51404308ff50f9997a90df639590f47a057c1f32b415", size = 2244090, upload-time = "2026-10-11T18:34:19.402Z" }, - { url = "https://files.pythonhosted.org/packages/ca/2c/481bcfc70ceeb77a778ca6e5b705fe592cb64735c108157f81b7dd9c280e/pydantic_core-2.50.1-cp315-cp315-musllinux_1_1_aarch64.whl", hash = "sha256:d4193206b6587047437f6f11d7e776df23e1c1e23af2a54d9347275614791e10", size = 2277948, upload-time = "2026-10-11T18:34:21.317Z" }, - { url = "https://files.pythonhosted.org/packages/24/eb/f1e09333faa7ba447cde967310f758430cc7c5e987bdab5228816c70030d/pydantic_core-2.50.1-cp315-cp315-musllinux_1_1_armv7l.whl", hash = "sha256:84bc765b282a9d5b7fe0348b8648904f25a6a04b2139da52b1dd30c8ac3a2c8f", size = 2449688, upload-time = "2026-10-11T18:34:23.321Z" }, - { url = "https://files.pythonhosted.org/packages/d1/b3/036bde636db8f76d92996e81aefc75678ab5cec4a07eea1ad0c72a893fc3/pydantic_core-2.50.1-cp315-cp315-musllinux_1_1_x86_64.whl", hash = "sha256:ed1e728b39a383c81035b2459cfcb35d99dfb01f7d6ebe3a913bc1cc5b81e459", size = 2479286, upload-time = "2026-10-11T18:34:25.214Z" }, - { url = "https://files.pythonhosted.org/packages/d0/a3/07f018294ee18d144afeb6df1a47d9e92960f014be45c5ed13519fa5af95/pydantic_core-2.50.1-cp315-cp315-win32.whl", hash = "sha256:bc94f474417604bd383d2cd445d071b07dd55fedceed3ce33407bf1fcc107290", size = 2103683, upload-time = "2026-10-11T18:34:27.42Z" }, - { url = "https://files.pythonhosted.org/packages/5f/98/f9bd7e1f9b6709f155acb9ef826d9c3884fe925f811fd8e55b9b52280bad/pydantic_core-2.50.1-cp315-cp315-win_amd64.whl", hash = "sha256:983a662de2571cb2502fc8ff47b6770b03d025d2eb314c92f77b3f07c74720ed", size = 2171681, upload-time = "2026-10-11T18:34:29.508Z" }, - { url = "https://files.pythonhosted.org/packages/10/87/4bb3e1e7f385c076ab5af4d6dd0571b22042cd8207eb810d5b9fef15ae31/pydantic_core-2.50.1-cp315-cp315-win_arm64.whl", hash = "sha256:94845ff54dc5193f228cab81b2662a04bfbb892e95bdc15edf7399000ce57d54", size = 2156251, upload-time = "2026-10-11T18:34:31.455Z" }, - { url = "https://files.pythonhosted.org/packages/47/47/83643225b08f2aef6c8cc4bbe6e3f79c5e139c4364a6e450d0f399d87774/pydantic_core-2.50.1-cp315-cp315t-macosx_10_12_x86_64.whl", hash = "sha256:4a53d13cdfbedbfa87f08b83c1a0a5efcc767d785a4b41934fa9cb672670493a", size = 2234363, upload-time = "2026-10-11T18:34:33.65Z" }, - { url = "https://files.pythonhosted.org/packages/5e/66/127ca649ba2f2462039dc1e694c6c01e00a3689f023a617364d3507e6d97/pydantic_core-2.50.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:efbecf43d321f7b9281441f1f213f7c21c66988b0e06c2730ba13ed47a46bb08", size = 2000972, upload-time = "2026-10-11T18:34:36.037Z" }, - { url = "https://files.pythonhosted.org/packages/5e/4f/e421e0a5d653b1203b090b2e48745976988d7338a647940704b5b9c2b399/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bc1f08f68dac9f9e83845a8039880aba2ab553eb9b2259c3243a313182c253fe", size = 2022925, upload-time = "2026-10-11T18:34:37.972Z" }, - { url = "https://files.pythonhosted.org/packages/d5/4e/ea5568e2491e1a71100f15ae8c2d01ef52db42a184a2d4e716bc79e5eb8f/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5dfe41f232befddb9c4377f6cfc702b51595e2d78ed082672adf8758d2c4619f", size = 2192867, upload-time = "2026-10-11T18:34:39.921Z" }, - { url = "https://files.pythonhosted.org/packages/ae/5e/3b8c3a35acbe219909ada5defad5d7d9fed845fb2b37bd5ec518f453c119/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:adc06d218a1cadfd2ec4628424d7d79ce4eba69c2965e7e7b55106f0da5208c8", size = 2388687, upload-time = "2026-10-11T18:34:42.184Z" }, - { url = "https://files.pythonhosted.org/packages/b6/aa/7889b4e515f91a2e8c0ae6b5081fec0feb30c4398d1434e14793c60f173a/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2cf91809d0721ab81592ba67bea7694821679c10b1a2e3c3460082b286c1918a", size = 2464415, upload-time = "2026-10-11T18:34:44.384Z" }, - { url = "https://files.pythonhosted.org/packages/08/78/93449e628eb8a6fdcce3eff9043081179d1bc7ce6f1bff32dc5006f41e00/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:23923ab9292c40da026330b1ecf4dc2618c8e86e0422e5d1fbf50d94d64ca4f8", size = 2150823, upload-time = "2026-10-11T18:34:46.392Z" }, - { url = "https://files.pythonhosted.org/packages/f4/f1/72c5bc129fceb0d00f05dc1e67f518c1728de1928c55f81fc13d7690de39/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_31_riscv64.whl", hash = "sha256:f3377c8c2b3ce898423c5e5dd94c7982e30aa7717a7e6ab2470b9de364963709", size = 2245806, upload-time = "2026-10-11T18:34:48.805Z" }, - { url = "https://files.pythonhosted.org/packages/28/2a/922a0e78f3aa6ab837b59f88190233fb8dad546c17995fde9bb3ed3b9b49/pydantic_core-2.50.1-cp315-cp315t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:455a773617b5913bf5c20d0692e5787b119e52c4d40ea644ca31f5758fd31be2", size = 2264160, upload-time = "2026-10-11T18:34:50.876Z" }, - { url = "https://files.pythonhosted.org/packages/52/a8/0f1449e3e1b20941c9372faa18e7b6a092e30cdfa841902473f7989532ac/pydantic_core-2.50.1-cp315-cp315t-musllinux_1_1_aarch64.whl", hash = "sha256:1a9006395dece0e32e704c315eff8a00bede494f6108546cfc5539c89fef4f9a", size = 2294031, upload-time = "2026-10-11T18:34:52.876Z" }, - { url = "https://files.pythonhosted.org/packages/d1/d0/1031f492857de70355fb16524bbb03efce5fd34c93ed4a1ec60be07e0d4b/pydantic_core-2.50.1-cp315-cp315t-musllinux_1_1_armv7l.whl", hash = "sha256:d2d82aa62521c55ddfb000ae70f88cdd8de974078f6024e821dfe5addd0c818f", size = 2468423, upload-time = "2026-10-11T18:34:54.995Z" }, - { url = "https://files.pythonhosted.org/packages/46/52/269ffffa645b8e47906395a39cf9db1151ae9fa4bcd7f47b960bc31baf37/pydantic_core-2.50.1-cp315-cp315t-musllinux_1_1_x86_64.whl", hash = "sha256:009634b83993777ddcd69cad0ffcace43dabde692109528e35f0fde91e386a8b", size = 2512598, upload-time = "2026-10-11T18:34:57.149Z" }, - { url = "https://files.pythonhosted.org/packages/31/5c/e47e28281f20326ff6f3c31d626f0a83e615d2d94ba41bb0ad6ec237184a/pydantic_core-2.50.1-cp315-cp315t-win32.whl", hash = "sha256:3fde4fdc6487a58d944ca87cf5adc95d5f266e872c19599f5f4c0a8a1b1f9f9f", size = 2098535, upload-time = "2026-10-11T18:34:59.313Z" }, - { url = "https://files.pythonhosted.org/packages/03/ad/759e181e69c1b472c60b2049e5f61d5da1deefdd5ce1df4bb2ebcf771f25/pydantic_core-2.50.1-cp315-cp315t-win_amd64.whl", hash = "sha256:1c8632d4ac04e6f91128fca584b3a8a507d81604c24eeaaad00d4be42765c32b", size = 2148645, upload-time = "2026-10-11T18:35:01.571Z" }, - { url = "https://files.pythonhosted.org/packages/6d/56/8a702c27e5be9f47e5f19d8669227424290e4c024e7c370279cbaf244b4e/pydantic_core-2.50.1-cp315-cp315t-win_arm64.whl", hash = "sha256:c3ede305158e75510be50869b319550ab072008c13d64d4ab1e094fb286b6f44", size = 2175297, upload-time = "2026-10-11T18:35:04.079Z" }, - { url = "https://files.pythonhosted.org/packages/e7/73/a23a327237d9bb985298ce47702e196f995ce850224c12c70886bd66bb5c/pydantic_core-2.50.1-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:062e891facce5ca296a1c37098e5e466780457f86413894b399f0cf22934f769", size = 2162560, upload-time = "2026-10-11T18:35:06.274Z" }, - { url = "https://files.pythonhosted.org/packages/df/b2/33b37b5e82408f402a5e82649a43e7c95cd5dab7beaeef2c35cedbfd18f2/pydantic_core-2.50.1-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:49c2cbb2397fe4d0987e84606e691af6cb87bc0ee1bd3e7b737f7e10b4c142f9", size = 2075250, upload-time = "2026-10-11T18:35:08.455Z" }, - { url = "https://files.pythonhosted.org/packages/04/62/c7d5b9249466ccab90f3ce4790c2399dbfb8172ae9e74a7753dd295fe65a/pydantic_core-2.50.1-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9e4472072de0137ee0d8e72d6620e85939c271d2f90f6bbb4b15c24638b79f92", size = 2107891, upload-time = "2026-10-11T18:35:10.918Z" }, - { url = "https://files.pythonhosted.org/packages/d4/7e/28d29bc1657195933147f772dee0558d9e0f045bbc11db7f992f40c37bb5/pydantic_core-2.50.1-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ed4f3cef55164b026fefb41341b7754cc6b624c75dfe7142d2ecceb5ad21c87", size = 2268026, upload-time = "2026-10-11T18:35:13.336Z" }, - { url = "https://files.pythonhosted.org/packages/a5/09/1bcf160f3cd6333e2a76982fae5963e5032de0bcaaba38464223dc266bfe/pydantic_core-2.50.1-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:76e2e83fa6ec8cdc972d438dafc2522b3a47bee4ec0ae668b29cfb1977ab5242", size = 2217070, upload-time = "2026-10-11T18:35:15.688Z" }, - { url = "https://files.pythonhosted.org/packages/3d/81/f02de95eec7794dfc7a5bc69a834f0e834b31b3009014ce6de903855f775/pydantic_core-2.50.1-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:a51eee75939cf811ac09b278745a6cee7dc873ccfbc8b9af3cc88fe4b7ce25b5", size = 2039027, upload-time = "2026-10-11T18:35:18.07Z" }, - { url = "https://files.pythonhosted.org/packages/4d/16/227746ed3771d9bf2304568b55134849ece34e13b38b1d76de763015c77f/pydantic_core-2.50.1-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ae28183297fb0d2b8dc46a1f01d51f5e45825fc5afe76a835a6cb7fb34821295", size = 2109009, upload-time = "2026-10-11T18:35:20.218Z" }, - { url = "https://files.pythonhosted.org/packages/e5/b9/7664d1592a0e5a74903f357cd5b28ceb7336f3473256c5a4e8c8432f1881/pydantic_core-2.50.1-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88e492e8b9d0312e7dc13667c30222abf284dc3b79b5302b3607b41a5784ce61", size = 2269883, upload-time = "2026-10-11T18:35:22.48Z" }, - { url = "https://files.pythonhosted.org/packages/bd/35/002a378302ff91d2a7f149bc8d22363faf581ba40ac39d0123444315a32d/pydantic_core-2.50.1-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:7456d699b13954e9c0164dcb267250a10ae0dfb03e6e26d6796ab0d46e189c84", size = 2154076, upload-time = "2026-10-11T18:35:24.743Z" }, - { url = "https://files.pythonhosted.org/packages/4b/5c/7a034330082c00f3c9795052bd9b161aaaf6e1951e897ac00a094823ef7e/pydantic_core-2.50.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0d955195bbbe489ad343fcc956eacea9357b79cb22192c66cacdefcbc14b32f", size = 2085850, upload-time = "2026-10-11T18:35:27.009Z" }, - { url = "https://files.pythonhosted.org/packages/57/fa/d5b44a7d3d4eceed6ef8713a0003af56fefde6ec75915513bcdd5d730cd9/pydantic_core-2.50.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2c634642694e6a0dad2ab1d375589fa671fd442edd5caf7d9737b8f6ca22906", size = 2259754, upload-time = "2026-10-11T18:35:29.763Z" }, - { url = "https://files.pythonhosted.org/packages/b6/88/e01dd37301710bd8b3b2daf34ec9e2a6e83a333130831c0d468b0292a48c/pydantic_core-2.50.1-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ee6db2fbed51a7991302e8fac498cd67e336246026d0dfa84cf5166ce1412760", size = 2268712, upload-time = "2026-10-11T18:35:32.654Z" }, - { url = "https://files.pythonhosted.org/packages/3e/43/5bb80d4a4d2b2d84612a30205662cc521a20d209c94abc079ea48b4e0df2/pydantic_core-2.50.1-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:79490e33c4c0fcb933bbbcfc3a62184d8803b99f535863dfbb925e1bcb6945ad", size = 2305049, upload-time = "2026-10-11T18:35:35.392Z" }, - { url = "https://files.pythonhosted.org/packages/e8/7b/e3ef76b269cfe4a5bd3bdcf5d7124cf05e5a8909d443b91639307116bdae/pydantic_core-2.50.1-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:48569b0ade9edfbe065cad1d700175546592aebbb42f02adcebcc26e75b896fe", size = 2466001, upload-time = "2026-10-11T18:35:37.791Z" }, - { url = "https://files.pythonhosted.org/packages/8f/7a/ea0947aadc1d9f72d4be00d2e19939611ec17363bcb5e6eb9ec7d8221c34/pydantic_core-2.50.1-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:5f3cae32fc46121f787cb2486de9cf95a8bf72aec5cc78f64c606fa1735a6ef5", size = 2481777, upload-time = "2026-10-11T18:35:40.287Z" }, - { url = "https://files.pythonhosted.org/packages/24/f3/d15bc0b1fb0c4f1e07b3326ffb7489f7ae70da2b56a0884d22641b0eb47c/pydantic_core-2.50.1-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:7f476456ac2bb0d937f75191494a09c83a30765fea4f70f3b404942fe25f6cdf", size = 2336787, upload-time = "2026-10-11T18:35:42.558Z" }, -] - [[package]] name = "pygments" version = "2.21.0" @@ -1116,20 +74,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" }, ] -[[package]] -name = "pyjwt" -version = "2.15.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/43/ea/5194e52748b0da83d71e082d75496eaec6e58f419f5e184786ded517e6a9/pyjwt-2.15.1.tar.gz", hash = "sha256:4f259e80cdfb6b3fc18a7de51fd1ef9ec79652f25019bae68975ca2468a34df8", size = 121252, upload-time = "2026-09-28T18:40:42.598Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/50/ca/44de4e75f8aadc457f0634be3b542815078ded46dca30efb960edeecad6e/pyjwt-2.15.1-py3-none-any.whl", hash = "sha256:42d59d631f7768a1028a64c7ff581a9bf7519804daf91fc5b6c56e30eec5e193", size = 33860, upload-time = "2026-09-28T18:40:41.429Z" }, -] - -[package.optional-dependencies] -crypto = [ - { name = "cryptography" }, -] - [[package]] name = "pytest" version = "9.1.1" @@ -1170,201 +114,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/fa/b6/3127540ecdf1464a00e5a01ee60a1b09175f6913f0644ac748494d9c4b21/pytest_timeout-2.4.0-py3-none-any.whl", hash = "sha256:c42667e5cdadb151aeb5b26d114aff6bdf5a907f176a007a30b940d3d865b5c2", size = 14382, upload-time = "2025-05-05T19:44:33.502Z" }, ] -[[package]] -name = "python-multipart" -version = "0.0.32" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/5b/42/55c32bb9b12693c092ad250a0e82edb5b31ddeda6eb772de5f308b3804ad/python_multipart-0.0.32.tar.gz", hash = "sha256:be54b7f3fa167bb83e4fcd936b887b708f4e57fe75911c02aebf53efaf8d938e", size = 46881, upload-time = "2026-06-04T16:18:58.647Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e1/04/e8135ebd1ad02c56ec633277529b2602ff99ff634be76cdba5744cf554fd/python_multipart-0.0.32-py3-none-any.whl", hash = "sha256:ff6d3f776f16878c894e52e107296ffc890e913c611b1a4ec6c44e2821fe2e23", size = 30042, upload-time = "2026-06-04T16:18:57.319Z" }, -] - -[[package]] -name = "pywin32" -version = "312" -source = { registry = "https://pypi.org/simple" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/1f/f5/10a6e845a00fc5e7afd0a988b744f403d4d57162a28d160a093c4d9322f0/pywin32-312-cp311-cp311-win32.whl", hash = "sha256:17948aeadbdb091f0ced6ef0841620794e68327b94ee415571c1203594b7215c", size = 6362659, upload-time = "2026-06-04T07:49:21.349Z" }, - { url = "https://files.pythonhosted.org/packages/35/c4/dcd2d62b5944b6d5db53413a5899016ccd57ffcb7278f3f81655d25d2027/pywin32-312-cp311-cp311-win_amd64.whl", hash = "sha256:d11417d84412f859b722fad0841b3614459ed0047f7542d8362e77884f6b6e8a", size = 6928825, upload-time = "2026-06-04T07:49:23.934Z" }, - { url = "https://files.pythonhosted.org/packages/b7/56/3cbb433fe4501cdba2eb9040f56a4e1a8243faa4186b25295564d1a7a79d/pywin32-312-cp311-cp311-win_arm64.whl", hash = "sha256:b2200a054ca6d6625c4842fc56a4976a4b47f96b73dbe5538c3f813a80359f47", size = 6721875, upload-time = "2026-06-04T07:49:26.416Z" }, - { url = "https://files.pythonhosted.org/packages/83/ff/32aa7d2ed0ab12b323aaa64f9b75e6ad4f8fd09f9ccfc28c79414d46838d/pywin32-312-cp312-cp312-win32.whl", hash = "sha256:dab4f65ac9c4e48400a2a0530c46c3c579cd5905ecd11b80692373915269208b", size = 6371877, upload-time = "2026-06-04T07:49:28.836Z" }, - { url = "https://files.pythonhosted.org/packages/03/d9/77040d3b43df3f3be32ea289433d660d2727f5ba327bc73be835127d9d60/pywin32-312-cp312-cp312-win_amd64.whl", hash = "sha256:b457f6d628a47e8a7346ce22acb7e1a46a4a78b52e1d17e1af56871bd19a93bc", size = 6914841, upload-time = "2026-06-04T07:49:31.85Z" }, - { url = "https://files.pythonhosted.org/packages/e3/cc/7b1ec671775756020a0ee7f4feeaf3c568f0ab86bd3900088cf986937a92/pywin32-312-cp312-cp312-win_arm64.whl", hash = "sha256:6017c58e12f6809fbb0555b75df144c2922a9ffd18e4b9b5afa863b6c1a9d950", size = 6727901, upload-time = "2026-06-04T07:49:34.244Z" }, - { url = "https://files.pythonhosted.org/packages/2d/41/12fbfd7f36ed2146d8bc9de96c2741296bf0d490b98508496cff322e274c/pywin32-312-cp313-cp313-win32.whl", hash = "sha256:7a27df850933d16a8eabfbaeb73d52b273e2da667f80d70b01a89d1f6828d02c", size = 6370184, upload-time = "2026-06-04T07:49:36.253Z" }, - { url = "https://files.pythonhosted.org/packages/ba/db/36a78e3403099d31d9746d13fdcde5accc43c1155f375a34d15983a479a7/pywin32-312-cp313-cp313-win_amd64.whl", hash = "sha256:c53e878d15a1c44788082bfe712a905433473aa38f86375b7cf8b45e3acbaaf9", size = 6914298, upload-time = "2026-06-04T07:49:38.876Z" }, - { url = "https://files.pythonhosted.org/packages/84/37/c1697194092b76de9ed47ca124323f02c57ffc8a45c06f88a3d5acaf01eb/pywin32-312-cp313-cp313-win_arm64.whl", hash = "sha256:59aba5d5940842075343a5ddc6b11f1cdf0d1567fe745290359dfbcc7c2eb831", size = 6727640, upload-time = "2026-06-04T07:49:41.083Z" }, - { url = "https://files.pythonhosted.org/packages/fc/2b/1f3cded5822fd49c02f40544cbb5f58c7cfd6b1694869fd476cb6170ee97/pywin32-312-cp314-cp314-win32.whl", hash = "sha256:a77a90fbb6881238d2ca9c6fd797b25817f3768fe78d214a90137ff055a75f5b", size = 6468928, upload-time = "2026-06-04T07:49:43.188Z" }, - { url = "https://files.pythonhosted.org/packages/21/82/3bf86d2e2808902013132e1ce905a7da0da53790f3836c64bf44d55e24f3/pywin32-312-cp314-cp314-win_amd64.whl", hash = "sha256:a4dd3a848290ef724347b19f301045831d8e802fa4464f491b98b1e0a081432e", size = 7024157, upload-time = "2026-06-04T07:49:45.34Z" }, - { url = "https://files.pythonhosted.org/packages/a4/0e/73f6d6800b4f27655abd9e9f6aaeaefcddb2b946e4674efa2bab184a7f7b/pywin32-312-cp314-cp314-win_arm64.whl", hash = "sha256:9fce94568364e0155e6dfb781ac5d95903be8baf28670632beab1b523f300daa", size = 6839598, upload-time = "2026-06-04T07:49:47.613Z" }, - { url = "https://files.pythonhosted.org/packages/eb/61/caa39686032d2ebdd04ff0ab5cbe163126c0066d98e00c9018646e42393b/pywin32-312-cp315-cp315-win32.whl", hash = "sha256:5c1fbe4a937a73ae9297384a3da38518cbc694c68ad8a809b2e19acd350f03ed", size = 6471159, upload-time = "2026-06-04T07:49:50.035Z" }, - { url = "https://files.pythonhosted.org/packages/0f/cd/7e1de64a4a6f69c04214169657ccab0d93a670ea50e35eb8f489d7378249/pywin32-312-cp315-cp315-win_amd64.whl", hash = "sha256:c2f03a0f73f804a13c2735b99392b0cd426bb4f2c4d0178e5ac966a0f21618d5", size = 7025293, upload-time = "2026-06-04T07:49:54.857Z" }, - { url = "https://files.pythonhosted.org/packages/23/ed/4532e9388e65fa16b46776ef47ad631a64eda1631884488af707666350ed/pywin32-312-cp315-cp315-win_arm64.whl", hash = "sha256:a8597d28f267b39074aef51fa593530082b39cbe5a074226096857b1fed2dfb9", size = 6840337, upload-time = "2026-06-04T07:49:57.531Z" }, -] - -[[package]] -name = "referencing" -version = "0.37.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "attrs" }, - { name = "rpds-py" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/22/f5/df4e9027acead3ecc63e50fe1e36aca1523e1719559c499951bb4b53188f/referencing-0.37.0.tar.gz", hash = "sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8", size = 78036, upload-time = "2025-10-13T15:30:48.871Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2c/58/ca301544e1fa93ed4f80d724bf5b194f6e4b945841c5bfd555878eea9fcb/referencing-0.37.0-py3-none-any.whl", hash = "sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231", size = 26766, upload-time = "2025-10-13T15:30:47.625Z" }, -] - -[[package]] -name = "requests" -version = "2.34.2" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "certifi" }, - { name = "charset-normalizer" }, - { name = "idna" }, - { name = "urllib3" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz", hash = "sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed", size = 142856, upload-time = "2026-05-14T19:25:27.735Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" }, -] - -[[package]] -name = "rpds-py" -version = "2026.9.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/42/68/3bd46b8a5e01d3c2ebdf9c5e9497912e3fe0cde02bac21a7130ca866e403/rpds_py-2026.9.1.tar.gz", hash = "sha256:4793ef7f78268b124b73fa933440f01d258bbae01de9fa53e9080c9ab0425a12", size = 63948, upload-time = "2026-10-04T16:32:36.469Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f5/6d/ddb8dfcf41892ba9c672d27988592c038d30db61708230313831b6780a1b/rpds_py-2026.9.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:2711d29b653b3bce48a63d18b9c6b53274669e6d6c4094dddeb4d9a0e45128b2", size = 344947, upload-time = "2026-10-04T16:28:55.207Z" }, - { url = "https://files.pythonhosted.org/packages/9e/b2/632c3d034961149eff606e3e357547620a9ab37b849ae5815f67838753fd/rpds_py-2026.9.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3231c4c0e521dafa5be0c9f114ee2c2ad46650836f2d72caa86801950c3e7044", size = 346770, upload-time = "2026-10-04T16:28:56.884Z" }, - { url = "https://files.pythonhosted.org/packages/6d/45/4df346410bb873d03ec60c3b891d1fceb8cabde1971d29844bbb625cc296/rpds_py-2026.9.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e01b3c878c8641913e688edd1b3f08658c6783d29cf6b826bd3c0d1ae7a1ffaa", size = 377795, upload-time = "2026-10-04T16:28:58.193Z" }, - { url = "https://files.pythonhosted.org/packages/ba/b8/a70f302207e4f29f873c01a986fcac5def49b9c8224328cef1ad7da6b7a9/rpds_py-2026.9.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3e524c7874ac72884d28e16dd5b8d839fd09e0fe76b020d3fbca23212a7b8c52", size = 383137, upload-time = "2026-10-04T16:28:59.411Z" }, - { url = "https://files.pythonhosted.org/packages/13/e3/3aa28a48a01169d0e20728bf0e5ebbea3ae2774285b40853ae49b3ef332a/rpds_py-2026.9.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:761fdae6728ceb99ab182fad2f0cc1e262f610834dc891aea1d1a2a2e634776f", size = 496789, upload-time = "2026-10-04T16:29:01.011Z" }, - { url = "https://files.pythonhosted.org/packages/3e/a7/414e8d088602d66ad6f47c65bf07fe5090992a8574cdd4571c1a83b647ed/rpds_py-2026.9.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6b723eb406dec5bc9ec516c73ab9c3239a3284e017f7eb89ee2b3258bd504fb7", size = 395929, upload-time = "2026-10-04T16:29:02.465Z" }, - { url = "https://files.pythonhosted.org/packages/2d/5c/aac3b960fd55d37b49f77c0eebbe043eaf36762ebd48e7b46951e59c1c05/rpds_py-2026.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:136a1c3fe4402b7008bc81cb62ee538481795b61a7e83df88dff3b3f02b726ff", size = 375426, upload-time = "2026-10-04T16:29:03.944Z" }, - { url = "https://files.pythonhosted.org/packages/d3/80/77987a41c40be7202a78d9aed4a650bfb05792237cfd3b9e22638d990fe5/rpds_py-2026.9.1-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:839dde845559254f34885267c6878f60d61d5205180226d976fe488d45fa128e", size = 381497, upload-time = "2026-10-04T16:29:05.308Z" }, - { url = "https://files.pythonhosted.org/packages/b8/d0/640b02eb1ecd71a913c1178b6235287b31006266bca9a26862e80e497b54/rpds_py-2026.9.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:56cd8b3f77d7b6812f533b662186a1f28316931166ddc00fb893b1b0db7e9888", size = 405740, upload-time = "2026-10-04T16:29:06.578Z" }, - { url = "https://files.pythonhosted.org/packages/3e/8c/d034195d45d215625a23f2ae85dbbdb86a49a93a51272061c97c80b9d316/rpds_py-2026.9.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:074a4d198bc34d9a8ea425114fc3ded6d11ec01f6a314a8db67454a5152d8834", size = 555850, upload-time = "2026-10-04T16:29:08.115Z" }, - { url = "https://files.pythonhosted.org/packages/de/f8/532f1addfc86207bc3cf23749638bb0d457bce891595012ed8a08d0543b8/rpds_py-2026.9.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:6beb738155fe8ab8091afdfa5a3226b21c2b1593f1e50ebb90eb25b44dbc0391", size = 618661, upload-time = "2026-10-04T16:29:09.554Z" }, - { url = "https://files.pythonhosted.org/packages/50/5b/b0f2c9833a36a5b1f6ac5cb0e635fabacf713266f46ceefba2102da0bf51/rpds_py-2026.9.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:57492a550a1d88d29d003247e5f78dd8cf04a701fac0e4c8db8745a6d2504e0a", size = 583530, upload-time = "2026-10-04T16:29:11.072Z" }, - { url = "https://files.pythonhosted.org/packages/bf/20/464ed4b98d3c8c6a334f3b5e24d3886de04b05658a95fc40a37e0e6e4775/rpds_py-2026.9.1-cp311-cp311-win32.whl", hash = "sha256:d95a354e02393eada6d7351184671aced9d4cce109dabf927cb7aa99624352a1", size = 208125, upload-time = "2026-10-04T16:29:12.408Z" }, - { url = "https://files.pythonhosted.org/packages/df/c9/384a9b62f8cd89c8e3e609b8c9052c140e8c01d807261e0517c904b8bf29/rpds_py-2026.9.1-cp311-cp311-win_amd64.whl", hash = "sha256:ce4d4f52e2a4324396caddbd45a97d8d7be5f42edd25d2355282a9c34f9b2f7f", size = 226045, upload-time = "2026-10-04T16:29:13.751Z" }, - { url = "https://files.pythonhosted.org/packages/4f/3b/0a691f0dcb2301fa9c736346da2d0d4991778373283301c5c12b8f952f3d/rpds_py-2026.9.1-cp311-cp311-win_arm64.whl", hash = "sha256:fdcd198979b4ecffcc1beba366a7fbcf4eb41243691a82fe52ceb0b902f09c12", size = 222636, upload-time = "2026-10-04T16:29:14.989Z" }, - { url = "https://files.pythonhosted.org/packages/5d/34/a828586ea3329fbb50895b50e9cf98ca3d924a9f41a0b26d443bff1b3794/rpds_py-2026.9.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:50906f5aea24b5a865cbd0a589698288631d9f3a54c3a937c83aefa95a0d14af", size = 346822, upload-time = "2026-10-04T16:29:16.258Z" }, - { url = "https://files.pythonhosted.org/packages/90/81/ac6a0d064982251856ce009c9e1dd51a34110b3c055aa7d1aad18b4899a3/rpds_py-2026.9.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e21c1429e205828ea886a2293a4a2c8e01f4c25d9893ca330e97a6cf73f52e7b", size = 341380, upload-time = "2026-10-04T16:29:17.706Z" }, - { url = "https://files.pythonhosted.org/packages/42/ff/bf7d54f362748fd6a49277b9d6531c394074110fedf50ad791ec59133fbb/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2693b2728bbcc48d09a981a356954b0c47c53ff25b545856f28a889ea619f69a", size = 373053, upload-time = "2026-10-04T16:29:19.063Z" }, - { url = "https://files.pythonhosted.org/packages/60/de/74b0ccdbbd28687b9b5fdb34c1cabed88352182facaced9d6f5486b8b9ed/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8601470267d938bcb7f3ab1a336100af51a4fd5b6ed030ef52461bb3ef5e7e07", size = 377742, upload-time = "2026-10-04T16:29:20.543Z" }, - { url = "https://files.pythonhosted.org/packages/c2/6d/b979775a3057b2a5c26d75ecbff60a20a24ef081db6dd76836fca3f20247/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3890a6aa36e6baa53d5258a2a25d3ef8b37ad165a6ab27a892d7c3e3a432cd69", size = 487289, upload-time = "2026-10-04T16:29:21.958Z" }, - { url = "https://files.pythonhosted.org/packages/1d/5d/7c34734ce3ece943d9d6ee0122a74a21bbc75b47acb5b7053c83f6efb1ed/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6b5b393eda5ea42cca1c1a6665f2a4882b4fd5d1777e41ce0545a107fb008c9d", size = 390710, upload-time = "2026-10-04T16:29:23.378Z" }, - { url = "https://files.pythonhosted.org/packages/1d/6d/b26eb1e75395925b3a142ed351cbed2ec8212f5c9d937aee3df32c701baa/rpds_py-2026.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:addeda51556dac7c1a2f14cda62db8b621cd12afba3091d03a96c72932387eab", size = 371261, upload-time = "2026-10-04T16:29:25.1Z" }, - { url = "https://files.pythonhosted.org/packages/7c/98/b2fdfe10301a9e27af21e634337fbba7baac0bc17fe44619a17c26bba2cb/rpds_py-2026.9.1-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:d9edf30457d74eebfd76b045535e36f1cd89062566a128a0db2145ca042d787e", size = 376075, upload-time = "2026-10-04T16:29:26.748Z" }, - { url = "https://files.pythonhosted.org/packages/c5/b1/c4b8d954e49c3c69cf8063c0c9e0919c99f3d2cecc46311606a1cbe835dc/rpds_py-2026.9.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:815d26356930846a40c7bc1366e7b1b0320ab8a063e66c11298a208bed0fd237", size = 399358, upload-time = "2026-10-04T16:29:28.282Z" }, - { url = "https://files.pythonhosted.org/packages/b3/59/9559a7293c97dff0cbb293efffbd36644103883ecc27741af8ef90c84ca8/rpds_py-2026.9.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3b5a6f40f0a1486b4b36c888123afc67acdbd9f33235927acf5ff295429a0ba3", size = 550267, upload-time = "2026-10-04T16:29:29.851Z" }, - { url = "https://files.pythonhosted.org/packages/6c/9d/6dc60e49511de4c8b00e74f9c1d43aed4d27f712cdb1ade92f2c199cbf64/rpds_py-2026.9.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b5b8b0753718d258fd454283fbd57e14545d3b40583fa672e27cb4f987626bcc", size = 614018, upload-time = "2026-10-04T16:29:31.54Z" }, - { url = "https://files.pythonhosted.org/packages/fb/bc/92a4ecf27301b886232a413360f6b348a81d55ffef654f2ebda5970ebc3d/rpds_py-2026.9.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:46d80bc76b51a6c24f9944368c28d38b8bcbcea1da4f2f8d3ebc31a67e8c6ec6", size = 578509, upload-time = "2026-10-04T16:29:33.01Z" }, - { url = "https://files.pythonhosted.org/packages/08/53/efb97f2e6589b7ab8394385a73870e0b2ab2a195281c117b21fd6d7d4855/rpds_py-2026.9.1-cp312-cp312-win32.whl", hash = "sha256:befc2d6a953e563f8a7bfd87a42c22ebf8a3e980dcb7b6a4d17b70b0e914e8a3", size = 205401, upload-time = "2026-10-04T16:29:34.451Z" }, - { url = "https://files.pythonhosted.org/packages/1c/84/1700cc748d0eaa747486e4e82882d2575224e6e9a3148df583058850c629/rpds_py-2026.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:5ce8943f79c2210f7abcc28e86367b03b28d95027fd01c46d2472373ae70c86f", size = 222923, upload-time = "2026-10-04T16:29:35.709Z" }, - { url = "https://files.pythonhosted.org/packages/c3/89/0302215373c2f8b4408b0fdfee955368cc378a98ff59508d47a7e0dc2dbf/rpds_py-2026.9.1-cp312-cp312-win_arm64.whl", hash = "sha256:501909f2e4a1e2dee528ef766fe3c469060ebc17e54a8383d404ba07a81a6f02", size = 218415, upload-time = "2026-10-04T16:29:37.263Z" }, - { url = "https://files.pythonhosted.org/packages/83/ea/ee88fd9e756ff93fb6b1182a47ec09504a242620e33ce1d20679efefe841/rpds_py-2026.9.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:a36b70596407634ca82d4b989a3729074a008537a0522e4c8046a67c729103e9", size = 346229, upload-time = "2026-10-04T16:29:38.82Z" }, - { url = "https://files.pythonhosted.org/packages/57/71/a097d6552f837500fc36e6b23d09cfb9890c3cc47531f9ca64e149799615/rpds_py-2026.9.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:eba5d173f7d5708b22a93815017a4611873ed54db9f268077c0dd1ed99cfc858", size = 340514, upload-time = "2026-10-04T16:29:40.405Z" }, - { url = "https://files.pythonhosted.org/packages/bd/b7/497e85768bf4e0d8ddbaa096a4cac31d1509251dee2728a8490aa367e0b5/rpds_py-2026.9.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:457866b85daf5034296666168b84a69e0b2e89dc4f1af102b46f6448a60b9063", size = 372611, upload-time = "2026-10-04T16:29:41.778Z" }, - { url = "https://files.pythonhosted.org/packages/52/4b/74ab4108916250b6e198e0d3af05bc6835eb046315f22f7a0ceb49667c5a/rpds_py-2026.9.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a3a52a3ba86436ab3aef510fbe21512abc2ddd1993005dfe50514bd2284ef025", size = 377712, upload-time = "2026-10-04T16:29:43.242Z" }, - { url = "https://files.pythonhosted.org/packages/0c/8e/067e77d9d7b3cc793c9d909b7e97e7aadbbb1fb094093b6876902cc96d38/rpds_py-2026.9.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d7841166b7fa64c9c56404617ae4341448847482d45933b13135d26c130519e5", size = 488106, upload-time = "2026-10-04T16:29:44.692Z" }, - { url = "https://files.pythonhosted.org/packages/3c/b4/c5aae6c2dde269bf955f6b7d35065c655a57e47750d9668052ad67e74dda/rpds_py-2026.9.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:926bdd3e3b5998ddf70cc64bc8cf57209571f9044542913afb673799fec77dd0", size = 390795, upload-time = "2026-10-04T16:29:46.129Z" }, - { url = "https://files.pythonhosted.org/packages/a0/36/76fab39973ee11e7f9f357c55138197bb01c86f6502cb76487e3b4f42db0/rpds_py-2026.9.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7868b85224291c6cb6759f9b5adb9745f486d226f62b16a614dd5a2a5ab2b35b", size = 370794, upload-time = "2026-10-04T16:29:47.603Z" }, - { url = "https://files.pythonhosted.org/packages/3d/fe/cd2a80e6d7b871937a60e935c5d507aa390d143f4ff3636f640b9733d5df/rpds_py-2026.9.1-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:3cd182d7291d29b92c521a0069d9c01ba6193628a9a105531d11b40a6d731a33", size = 375673, upload-time = "2026-10-04T16:29:49.223Z" }, - { url = "https://files.pythonhosted.org/packages/6c/18/7464a9953724e55a3b3206062fa0ffdeaa519584c6aabf65d3956d94f131/rpds_py-2026.9.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e6ea1cda8d8c688278430e4268a42f5e5da3bdd74578dfadc0820c3f1766ce83", size = 398758, upload-time = "2026-10-04T16:29:50.601Z" }, - { url = "https://files.pythonhosted.org/packages/c0/86/1534b436700fd49ff411063b7c4d7e938adfabf90895b6cf1622d5a7d1f6/rpds_py-2026.9.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:5943980471829f6de242a20b109de3111ba6b77e3af0ffc587028ac854b05e6c", size = 550370, upload-time = "2026-10-04T16:29:52.002Z" }, - { url = "https://files.pythonhosted.org/packages/57/1c/e1fa82a8a01e3c5820f3ba98a8b2673f642128eb368fa88871b01dd2c909/rpds_py-2026.9.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:76d3af9732d2dab69f28179b40ba2d87e2f1d5824b4a694780aa787d685e8f36", size = 613106, upload-time = "2026-10-04T16:29:53.655Z" }, - { url = "https://files.pythonhosted.org/packages/29/55/b20b8c4c3dde8755bfcd5b08492a02d0cd2e26929aedf6199ca2a377d42a/rpds_py-2026.9.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:78326f4cb4427a56ba4996c0762b63be45f06b85f086526420d2b3a66e40f84d", size = 578235, upload-time = "2026-10-04T16:29:55.157Z" }, - { url = "https://files.pythonhosted.org/packages/55/42/df3f7bbc3f7ab37a8a9db8d6c2ff2c985422899f1f7926afbf7ec3c0b8b4/rpds_py-2026.9.1-cp313-cp313-win32.whl", hash = "sha256:172e47169583f46ce118cbec68e6795d0da0f4606b488b6434f8276bca0a058c", size = 205293, upload-time = "2026-10-04T16:29:56.669Z" }, - { url = "https://files.pythonhosted.org/packages/31/9c/ba5a9569d719bfdd6ce863df4133ac6a1658cf1b07cc3534c31db729fbbc/rpds_py-2026.9.1-cp313-cp313-win_amd64.whl", hash = "sha256:3e93b2cd69a9830be33e03945cd7cda940a0a8bfcfbff41d6144f0cb0d3d8bd9", size = 222409, upload-time = "2026-10-04T16:29:58.049Z" }, - { url = "https://files.pythonhosted.org/packages/35/72/f28ca566f6c23c35bbf7445f65eb0364577b25a026305995e24f78b83d94/rpds_py-2026.9.1-cp313-cp313-win_arm64.whl", hash = "sha256:d151e148117294133bf8af7eeace085e7e87432db15ab6adf640330298a47f6f", size = 217681, upload-time = "2026-10-04T16:29:59.449Z" }, - { url = "https://files.pythonhosted.org/packages/8a/f2/67b94be1532767803415c1c5a1fd88ea487643d74a673cec1ba140af77bb/rpds_py-2026.9.1-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:c9d1aca01f49170fdcf5c92761b1fafe97f554b721ca4570c5949fff778f0d4b", size = 347178, upload-time = "2026-10-04T16:30:00.865Z" }, - { url = "https://files.pythonhosted.org/packages/04/37/b751de2b59b0197a1d92a5dd491de88e8a5e928c2e6562581974f1e85263/rpds_py-2026.9.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:3f0e9ac28fc067d4d34b88ae43c48e9489455c97fee9633d851f7eeed5a05d35", size = 341878, upload-time = "2026-10-04T16:30:02.564Z" }, - { url = "https://files.pythonhosted.org/packages/72/e2/5873bc4643c250db9e05d48dc0c93763d4aa68bc3b81164cb1af3b45b284/rpds_py-2026.9.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:07deecbfce94c78473018bc7d10b337cc651d12df87a1eb2cb3e4024bc9c33d0", size = 373963, upload-time = "2026-10-04T16:30:04.026Z" }, - { url = "https://files.pythonhosted.org/packages/51/03/5acf7632158247f3f6386ff0af3a1ee48167d575037e8d0920594b76d92b/rpds_py-2026.9.1-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:821b2755db9194409254012f429c56643416fb96ef9be090be82ec8826b7f477", size = 377975, upload-time = "2026-10-04T16:30:05.555Z" }, - { url = "https://files.pythonhosted.org/packages/e6/00/63fda451b8bffa5808fc8bb311ee7c073b340974b09f273c7b2a145d3d62/rpds_py-2026.9.1-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3c91c210ae7645626c608400e3519b4a642f837cce09ca830db3beb2e9f274d4", size = 490347, upload-time = "2026-10-04T16:30:07.156Z" }, - { url = "https://files.pythonhosted.org/packages/a1/ae/c093ffd070ba0fb02f76c565d06fecc65ad6e4afdbae78f7031076d3cdac/rpds_py-2026.9.1-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:54ac2158a6f96cfbabff0b2eedaf94b90c5ec7ca8317fcadc61e1c2b2e0ff6ef", size = 392962, upload-time = "2026-10-04T16:30:08.77Z" }, - { url = "https://files.pythonhosted.org/packages/22/9d/d08a1128ab199b2f0cf25bfeb0639bd05119fff4b7c47bec24ef9a8ec23f/rpds_py-2026.9.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eac2f5dbafd585dfe31f86a23ebf0d3ba480a9d49ebc87947267b5608d4ea0cd", size = 371623, upload-time = "2026-10-04T16:30:10.501Z" }, - { url = "https://files.pythonhosted.org/packages/53/c7/4758ddcbb75609414bbccfcb11d612436f9b3ee821bd2f33f0f1604ee648/rpds_py-2026.9.1-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:8aa5dda18d39b6143eb24809d158f9252c88f402749b6f1b62a506cc7d96cc35", size = 376997, upload-time = "2026-10-04T16:30:12.124Z" }, - { url = "https://files.pythonhosted.org/packages/87/e4/947bd7f608ff60faf46dc9d389c3dffd0e3d767d78a0be19978448ef0ce7/rpds_py-2026.9.1-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5c90e7fa02e8f5de0d10c17595c568ada48c5302e749462c0ea1a4c362111a86", size = 400169, upload-time = "2026-10-04T16:30:13.804Z" }, - { url = "https://files.pythonhosted.org/packages/4b/35/fe93e020a0543b5670472c18d7e6af3197c08da571240ce1965c84f85c0f/rpds_py-2026.9.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:e6d198bad4e49dd6732fbd636e2fc5c082f45c8cad0b4acb756b00c82c76072e", size = 551615, upload-time = "2026-10-04T16:30:15.332Z" }, - { url = "https://files.pythonhosted.org/packages/0d/4f/5d2a0136bb03b2a56a39dc6ff92d58a6e3e53a2e17079238b86228882f16/rpds_py-2026.9.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:96beca19ec79de272e8668585380ff9092c47077c1d7a1e098e00bbd921f4785", size = 614655, upload-time = "2026-10-04T16:30:16.92Z" }, - { url = "https://files.pythonhosted.org/packages/09/1c/3f1025aaf70d9bf7272cc41f8b64ee76b48bf01726248138430e16f23b38/rpds_py-2026.9.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a5cf77eb04f20b720be95265a3e00eb2a14814074255cc27069c551b2db53118", size = 579602, upload-time = "2026-10-04T16:30:18.555Z" }, - { url = "https://files.pythonhosted.org/packages/53/0d/5c72e6204f76610608706da32b6b7e11ef7e10317558a7bb15a122e008dc/rpds_py-2026.9.1-cp314-cp314-win32.whl", hash = "sha256:a03d57b86d2a51d0a66c92177e2be154ad015f357791d306e714569999cdb4cc", size = 206315, upload-time = "2026-10-04T16:30:20.05Z" }, - { url = "https://files.pythonhosted.org/packages/a4/0b/489d48abbcc7d70cf3fbf662d9d22abf1f4650761c0a9ae05260800800d3/rpds_py-2026.9.1-cp314-cp314-win_amd64.whl", hash = "sha256:837c6b305e26fe0f75b15c92cf3b2ba29e0ae19dc40b1c557b026cb426347d0c", size = 222852, upload-time = "2026-10-04T16:30:21.604Z" }, - { url = "https://files.pythonhosted.org/packages/91/16/bbb05a7e6a10cf79ba639be7f799d770ee15f64175cc61d081b218dd402a/rpds_py-2026.9.1-cp314-cp314-win_arm64.whl", hash = "sha256:fce4b85234a0cbad67bf8e6e1201ee815d172c9aebad75f25645bc4d834f8e31", size = 218709, upload-time = "2026-10-04T16:30:23.036Z" }, - { url = "https://files.pythonhosted.org/packages/22/ac/ac507a0a4ec478ca470440a09583db4be5259ba7670aeba0620822f1e57a/rpds_py-2026.9.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:3a72c11530d71abfb66c8d7696a2f86c43e63fca8b948f1a784ac490f4ec688e", size = 349596, upload-time = "2026-10-04T16:30:24.558Z" }, - { url = "https://files.pythonhosted.org/packages/e9/f2/817a46b658d5070f477f722c298ee9a24525b0e4017347964146ef5fdd0e/rpds_py-2026.9.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:068c37bba854ec2fe42f7365c640af11dd9895890ccbf2df5070d0c059bd7f96", size = 343114, upload-time = "2026-10-04T16:30:26.048Z" }, - { url = "https://files.pythonhosted.org/packages/6c/42/6ade976b13ac1b4cb3bf2eb603f1be2fe74df19a29988d4c2b386be59d6f/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7fca4eb6df565e2a928f1c7dad92d27db8f9df0f449e76423ed5d7e713ed445", size = 374197, upload-time = "2026-10-04T16:30:27.699Z" }, - { url = "https://files.pythonhosted.org/packages/d9/70/77cdf1d3f1a07faabe936016ae623aec7981f73108a8fe7a203ed2e21998/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c933c6678c6f116ff8af47a4c6db0868b8ace74af0343016c0ef00f00272ea69", size = 378025, upload-time = "2026-10-04T16:30:29.451Z" }, - { url = "https://files.pythonhosted.org/packages/3f/6b/18a44a3beaa9b7931acb04af7bd9539836477c630a794452d4826d6185d4/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:028ad274ea951dac64491b5d1e65712a4aeabfdbdb9fccf797b57bd899b0c495", size = 491969, upload-time = "2026-10-04T16:30:30.995Z" }, - { url = "https://files.pythonhosted.org/packages/73/27/fb39cfd6bddaf741b024f813890374578ff8ac1f1adc473659c048b03b05/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:740d0a99cf9de0b17a3943388e9294a59becf75e7c43421f387bd3c7a9901f7c", size = 393905, upload-time = "2026-10-04T16:30:32.628Z" }, - { url = "https://files.pythonhosted.org/packages/ed/71/0fa7bb77b57af0d710273964180d11b503f62b8a5c358eb2d8c3f62feff6/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0da298fb372dc192610a4b9ecbc68a0cd8b675bbbd1fc519d01b41cfd658333e", size = 374569, upload-time = "2026-10-04T16:30:34.257Z" }, - { url = "https://files.pythonhosted.org/packages/54/22/f41cfac269af3b449513ef1bc3d7f32fde52abbbd2d01c7e76b47743acd9/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:eb61be926bb81567c1f48bdc8aa22b9855048dc2efd53871f9f7e6e9a5632346", size = 377482, upload-time = "2026-10-04T16:30:35.997Z" }, - { url = "https://files.pythonhosted.org/packages/b4/fc/312b49006e7f8f9ca5f96647577b8aa6f3df30519c46bd448f5c425af0b2/rpds_py-2026.9.1-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:42e75466f83cd43f6026c81eab74246efb2bdadafb307b85700632d06c68f299", size = 400040, upload-time = "2026-10-04T16:30:37.76Z" }, - { url = "https://files.pythonhosted.org/packages/cf/a6/18cca7a878dc7fa95165a83343fd4d7b65643fd22e54e47340a451121d5c/rpds_py-2026.9.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:617f59cde379b4f648a09797b7f683d04b90a46344cddab85639da5aff0f5531", size = 551849, upload-time = "2026-10-04T16:30:39.443Z" }, - { url = "https://files.pythonhosted.org/packages/e4/6d/1f5685e20f39604691bdc3c05aaa6b8bd2f954e9e996477adf2376768e33/rpds_py-2026.9.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:3edae8c5ddfdb6985d49ae9d150516e5076888879022f91a26c2de9276ce0bdb", size = 614842, upload-time = "2026-10-04T16:30:41.231Z" }, - { url = "https://files.pythonhosted.org/packages/c6/25/98652109fd9f7e10268dd4571aa52b81987001b806f37ef1a18260de714a/rpds_py-2026.9.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0f045bb053c9057720d72c56dffe30dffdc05997b2897a827b9325f0ab6623fa", size = 582606, upload-time = "2026-10-04T16:30:43.345Z" }, - { url = "https://files.pythonhosted.org/packages/19/03/11ca09099bab5f53373a80a334c424ec917c13d050760a59499d2af5171e/rpds_py-2026.9.1-cp314-cp314t-win32.whl", hash = "sha256:bf35d0568abda97233239ce32896d3ad53fccc537832c104e30c94aa5fb93569", size = 203341, upload-time = "2026-10-04T16:30:44.954Z" }, - { url = "https://files.pythonhosted.org/packages/6f/8a/88909e3ffd9f47f5b58211473875d8c3c09079f0058c46fb72c55a702a26/rpds_py-2026.9.1-cp314-cp314t-win_amd64.whl", hash = "sha256:1e8d4d79d828299bf44a55db22a9388ab967b49d17132c88eab0f4360b48da8e", size = 222843, upload-time = "2026-10-04T16:30:46.486Z" }, - { url = "https://files.pythonhosted.org/packages/f6/b7/a662f367d4896dd0a10cef2fc91f10b7f08af1c10858e287e019563f338d/rpds_py-2026.9.1-cp315-cp315-macosx_10_12_x86_64.whl", hash = "sha256:1d77b649e6f7cdf12ca5c2a98dad0ad37f9ea9b6f960408a92f0cb12bb3d04d9", size = 347463, upload-time = "2026-10-04T16:30:48.203Z" }, - { url = "https://files.pythonhosted.org/packages/ae/3f/ad45d03df4f84ebae5439577ee81f3999d182711e82235c8037b6528890e/rpds_py-2026.9.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:00ba2d8c7dd4ee537978ddf4b3fbd712bef2d8751603f7f3146b3f4287768e25", size = 342051, upload-time = "2026-10-04T16:30:49.872Z" }, - { url = "https://files.pythonhosted.org/packages/7e/31/3dcd68c13d4bcc59c1f7eb33ac8e80698f06f3eb0d8a1e06419836071c20/rpds_py-2026.9.1-cp315-cp315-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ec450527cbf485e13c8d3602a54f428ab0432fdade0ede75efd74b735421c871", size = 374143, upload-time = "2026-10-04T16:30:51.508Z" }, - { url = "https://files.pythonhosted.org/packages/cf/0d/68c1f058a250fbd1380ebda9fc227cbf50117adf8ffe8161ef383ea79f68/rpds_py-2026.9.1-cp315-cp315-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:306ee1850d8105b5baf977e78d45fcadd12c1a54678d614c9baf217708446e91", size = 378604, upload-time = "2026-10-04T16:30:53.206Z" }, - { url = "https://files.pythonhosted.org/packages/d7/d6/2d4c59b85397cb4800594fadf692688ccf5ce556adc930e7a5bf21061a5e/rpds_py-2026.9.1-cp315-cp315-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ef6b65b03247c54692ad4fd9ee97cb772781927db72e3cb05e70b3db6d1ff14f", size = 490790, upload-time = "2026-10-04T16:30:54.925Z" }, - { url = "https://files.pythonhosted.org/packages/da/04/7e05dc3aebaf52f4e026766bd668fdd09a9d0e23f64a14686b36b3501892/rpds_py-2026.9.1-cp315-cp315-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a575404ebc9cf2e91edd32eaf570ec1430eb900d4f56724ba7dd4bc1fc9c176d", size = 393146, upload-time = "2026-10-04T16:30:56.625Z" }, - { url = "https://files.pythonhosted.org/packages/57/ca/e2e9a0a46a74ed51a0498ba1fe10f4ea6b2d9a155f372a2f91e51f18cf10/rpds_py-2026.9.1-cp315-cp315-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2c16ab111bc27c646ba8aa005d0527754edc538ebb636f0b1bf8e244b48d1945", size = 372022, upload-time = "2026-10-04T16:30:58.295Z" }, - { url = "https://files.pythonhosted.org/packages/ba/cb/8f8774df5134e23424372838bcc5c7ed4127d723e1ff52f7bebd4dcb2563/rpds_py-2026.9.1-cp315-cp315-manylinux_2_31_riscv64.whl", hash = "sha256:7664419f27db41d4f1c43a78dccda7dd6e8ef2428df3ee01d0c2a07a6b071297", size = 377092, upload-time = "2026-10-04T16:30:59.984Z" }, - { url = "https://files.pythonhosted.org/packages/90/02/8d7095d73bf9114219be40230baa5df00611e0a82ed9517779ff9c19f82b/rpds_py-2026.9.1-cp315-cp315-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4b26b03d9d2658ee2fa234f8f4f19f38a09773fe5261028025032e26d4d35af0", size = 400830, upload-time = "2026-10-04T16:31:01.721Z" }, - { url = "https://files.pythonhosted.org/packages/ec/02/8206856f8f363cd042a8315dc86b3912f5dcb6d3c66bbb24b69c2bfb0775/rpds_py-2026.9.1-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:be3e47e2d91aa3942ff9bf4077a505226005abfc39b6f7554a91c1b9393986b9", size = 551478, upload-time = "2026-10-04T16:31:03.472Z" }, - { url = "https://files.pythonhosted.org/packages/41/6b/36211f1bb1f0b0313f496d92f5905b74ea107f27cb16fa3355a82f04575e/rpds_py-2026.9.1-cp315-cp315-musllinux_1_2_i686.whl", hash = "sha256:6307a0da524939decb8ca4a3933b8ab62525794411d6984fca6726e732804af6", size = 615173, upload-time = "2026-10-04T16:31:05.281Z" }, - { url = "https://files.pythonhosted.org/packages/35/77/cda0c4a6f055446b692f0ed5692f73707cafd3dff82672ede31b1a9b59de/rpds_py-2026.9.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:159a7aab5c5e8b112c8830f54717ce56da1252ebdbb526f5be2df2309280b9e7", size = 579653, upload-time = "2026-10-04T16:31:07.065Z" }, - { url = "https://files.pythonhosted.org/packages/74/ec/d8385f446240aed643b9e92a5055cff3015cc04a13c61f73b2883c478ed5/rpds_py-2026.9.1-cp315-cp315-win32.whl", hash = "sha256:dbc2673f9223d420c91145599b3ba45a8a50c207d1976908e5fb5ddb0c9b9429", size = 206498, upload-time = "2026-10-04T16:31:08.989Z" }, - { url = "https://files.pythonhosted.org/packages/6d/a5/71b5cd00e0521e3b6b81828baea368c62b6b700ebdd9554cd7d41ddf12fa/rpds_py-2026.9.1-cp315-cp315-win_amd64.whl", hash = "sha256:75c38c50ab9aca840225d9a9a3810bf11d04bd5c1f186cabbb8aee56db3e9b15", size = 223121, upload-time = "2026-10-04T16:31:10.84Z" }, - { url = "https://files.pythonhosted.org/packages/33/58/dba857c3bc8221b31b62eb170a3080f4f191de79f047200389b7ed1b06a7/rpds_py-2026.9.1-cp315-cp315-win_arm64.whl", hash = "sha256:a431156bb41865fc14cd5d79bb9d7bbed83110b0159e34e62ae30951f96c0009", size = 218741, upload-time = "2026-10-04T16:31:12.592Z" }, - { url = "https://files.pythonhosted.org/packages/5b/d0/320ab28ccc1415eeb509d68682b0014fb74690cd49f1c2d29a232475af50/rpds_py-2026.9.1-cp315-cp315t-macosx_10_12_x86_64.whl", hash = "sha256:ef0d8c843e2827d6c120ab4687e9423fb1d893db1df27b7c1506615bcb9734a0", size = 349719, upload-time = "2026-10-04T16:31:14.48Z" }, - { url = "https://files.pythonhosted.org/packages/56/88/f5b12f1358f443c08b7ce3cc8391d82d335f4872580e2e097847fd36087a/rpds_py-2026.9.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:45bc6bccf78b20fd834237d18db64965d7ee68ba7f60440a26c7ab71e7b8d51a", size = 343267, upload-time = "2026-10-04T16:31:16.827Z" }, - { url = "https://files.pythonhosted.org/packages/f7/0c/c765b0059d532acb3b9c45d781ccc22f15a96dbe443d00903f643ba9df10/rpds_py-2026.9.1-cp315-cp315t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d55198263bb51f557550c6ed2e6d1cb6a6fed6eb5c9120b741c5926bef8a45d", size = 374555, upload-time = "2026-10-04T16:31:18.931Z" }, - { url = "https://files.pythonhosted.org/packages/6b/8a/cafddfda77564a10cd21184640c3bffda6a2b8d20972fb5dedd5e0166328/rpds_py-2026.9.1-cp315-cp315t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a8763f20692da7df39b0afdd1ba3042b004c50a45994f76c2d9a25641f7673db", size = 378346, upload-time = "2026-10-04T16:31:20.75Z" }, - { url = "https://files.pythonhosted.org/packages/b9/01/5e626016eff72c183bf6c96539240cace15d402468647a453ec08415b2fc/rpds_py-2026.9.1-cp315-cp315t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e43d4a1f673e8a1cbd8533e809e02b4bf9d4f2280269bb640436556312121250", size = 492373, upload-time = "2026-10-04T16:31:22.614Z" }, - { url = "https://files.pythonhosted.org/packages/3b/9c/15a2469e9389242f46896b3f0a01d68caea8a5a35c011fcb05ef333aae73/rpds_py-2026.9.1-cp315-cp315t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ea394a937f17a54c51239348bdbe2e3518124c8d4a8951ba04a311d3095bd18f", size = 394371, upload-time = "2026-10-04T16:31:24.768Z" }, - { url = "https://files.pythonhosted.org/packages/63/f5/c100ff77e1e6366e947c75969c258fdfc4b7bc5bbfe7351e62ffbf2a1228/rpds_py-2026.9.1-cp315-cp315t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cdeaa99ce822dca76cfb1b993e9120c5ea212f2eb66d48950ad63c349668a018", size = 375132, upload-time = "2026-10-04T16:31:26.588Z" }, - { url = "https://files.pythonhosted.org/packages/dd/f4/fe0269c9de253e99c81cabc12b8971a5feaa083debdaff1221e06264d9e3/rpds_py-2026.9.1-cp315-cp315t-manylinux_2_31_riscv64.whl", hash = "sha256:b4f062343e7ad3fa94f2c66e5ae667dee47ee74dd41a9057c4fbe163236a123d", size = 377642, upload-time = "2026-10-04T16:31:28.677Z" }, - { url = "https://files.pythonhosted.org/packages/05/65/b34a7b257baccff8f4a24a722933166d4941d5ebdc9c3f4bc4ffcd5ce4f4/rpds_py-2026.9.1-cp315-cp315t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:22ffd29a63d71fb1b81552c21f2c2b734949b7ac751a9be70675a939a900839b", size = 400855, upload-time = "2026-10-04T16:31:30.802Z" }, - { url = "https://files.pythonhosted.org/packages/98/32/844e54176b6071b90b38a564e6940bc6eb8f97b2890dc709c19db9dec0f4/rpds_py-2026.9.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:08dae4a4095150a7c4545a1fb40b98e1ab1744fbc2770d92c977b9dadaa49ab6", size = 552573, upload-time = "2026-10-04T16:31:32.709Z" }, - { url = "https://files.pythonhosted.org/packages/17/73/6041d20729dffbfdf155c02d65be58bc225a1c1fb548fd87c23ef306138f/rpds_py-2026.9.1-cp315-cp315t-musllinux_1_2_i686.whl", hash = "sha256:9a0460d43603d1fd9ef59c30278531e15d78581721ddb538fa560aa7817ea4ad", size = 615840, upload-time = "2026-10-04T16:31:34.565Z" }, - { url = "https://files.pythonhosted.org/packages/af/9e/418094adaee6b056ce199051b255448ed872829051e341b2294c80da0977/rpds_py-2026.9.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:1c2d1f6da5128eabf34e963d7163a818846075a52568250d006c4c953b40f903", size = 582764, upload-time = "2026-10-04T16:31:36.665Z" }, - { url = "https://files.pythonhosted.org/packages/3d/9b/1698ebf6b840ddfe8b472198abbed6ace35c6e398faeecd6c47dae742a4e/rpds_py-2026.9.1-cp315-cp315t-win32.whl", hash = "sha256:5c6ee90dee3e85e055ddfd502d611643d9b0fd94c818220bda84ec3dacd9b27b", size = 203795, upload-time = "2026-10-04T16:31:38.53Z" }, - { url = "https://files.pythonhosted.org/packages/8a/e2/91f70d804c61f8eac39a417e82aa1024f655ab9e8bdd7393b196242bc41b/rpds_py-2026.9.1-cp315-cp315t-win_amd64.whl", hash = "sha256:fe5ad0664ec772b02c45859041aa17655709cced7a31005817fbbbd988c25567", size = 223037, upload-time = "2026-10-04T16:31:40.468Z" }, - { url = "https://files.pythonhosted.org/packages/f3/ad/f0eba548e297987964ef8088403db875b333963bf8189f3f563b6936b20e/rpds_py-2026.9.1-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4c0d2cb595a420b34d5086db0add011e26e2c09d6a024afbac4228bf8f863a30", size = 384112, upload-time = "2026-10-04T16:31:42.643Z" }, - { url = "https://files.pythonhosted.org/packages/33/89/891fa4d81f1eae7fe262ecd0aba2c51de94a116c7f3ccfb034fa75f4c537/rpds_py-2026.9.1-pp311-pypy311_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f3d6ed6a98cfd19155996605474982cc470d7601746a6439078f1a5a3fa8b050", size = 389662, upload-time = "2026-10-04T16:31:44.642Z" }, - { url = "https://files.pythonhosted.org/packages/4f/46/912cf623b2263f9c9c2d04e8508fc38dbe89983faeba5fb36ca4558ae550/rpds_py-2026.9.1-pp311-pypy311_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8171b44a054e5c67fd748ada04187f1250bf35b95f85e52ab64bcf3331a923bb", size = 504637, upload-time = "2026-10-04T16:31:46.667Z" }, - { url = "https://files.pythonhosted.org/packages/9b/5c/7f3cfa7c5f01765c9f47c8398210ed0c1eb686c0e99c223cb1c6776d3fb9/rpds_py-2026.9.1-pp311-pypy311_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fda1d96e542c37b6c804547dbf489c129fe7c97183a76a5ec275909ba1a063df", size = 402607, upload-time = "2026-10-04T16:31:49.068Z" }, - { url = "https://files.pythonhosted.org/packages/f0/76/2e915d4115ee453c33e6af17bc1df7e22ddc52974e178eeeb92a78c09983/rpds_py-2026.9.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:270bdcdaac5d5b6f73c5e22e7e135c7f2a50e789f71d9e241d5be8d90026e19a", size = 382762, upload-time = "2026-10-04T16:31:51.24Z" }, - { url = "https://files.pythonhosted.org/packages/0d/e5/844382925d7b84a4074ad79fc2b9d05eb6231ea243b34f247e68e519b606/rpds_py-2026.9.1-pp311-pypy311_pp73-manylinux_2_31_riscv64.whl", hash = "sha256:84a6ecc0c940169190d2c23bd969debd48c94dbc855acd60188a68d71d421608", size = 389563, upload-time = "2026-10-04T16:31:53.549Z" }, - { url = "https://files.pythonhosted.org/packages/81/82/d6e3951602dc2e24790ef9d299aa24bf5e2493df5043f2c6da00480cc447/rpds_py-2026.9.1-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ab4b2fda7c2b542f7f9d886cc6a838c5079d2b76f72e6081411faba11adde2c9", size = 416842, upload-time = "2026-10-04T16:31:55.76Z" }, - { url = "https://files.pythonhosted.org/packages/ea/1c/8d248e4ea671d525ab7daa0703ad81cc2175076fa0ccd7ef088facbd2b01/rpds_py-2026.9.1-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:44b32a7c4f0da3d28af31c259e38ddcff096f855e205ed0671d02fcf44f1ea1c", size = 562434, upload-time = "2026-10-04T16:31:57.874Z" }, - { url = "https://files.pythonhosted.org/packages/ad/38/e7ac0db898120d15dea25e3661b1242a40cb3b23d1f4db86c15a01fe0ba1/rpds_py-2026.9.1-pp311-pypy311_pp73-musllinux_1_2_i686.whl", hash = "sha256:a3dbc5ed9514908d5046107d7b1346bde71eea61de6e0e4919c19354f97e769f", size = 627909, upload-time = "2026-10-04T16:31:59.977Z" }, - { url = "https://files.pythonhosted.org/packages/03/c8/37e555514932cb1ee36c75349187aa882a98dee5d5654c761699ed8a0d27/rpds_py-2026.9.1-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:6eae33003518fd4cb4f83a218d5371469dd3001aa3b87128c005b07762f7fe5e", size = 593658, upload-time = "2026-10-04T16:32:02.14Z" }, - { url = "https://files.pythonhosted.org/packages/12/5c/5f69a91add94a8a33acea68a2b034a464946a654ff7296af9d957ef0d6a5/rpds_py-2026.9.1-pp311-pypy311_pp80-macosx_10_12_x86_64.whl", hash = "sha256:0483515261947e4e8b8e1375bf7463e7eb6ccfb3d86e7b554d90cd5285f20f32", size = 351769, upload-time = "2026-10-04T16:32:04.675Z" }, - { url = "https://files.pythonhosted.org/packages/41/22/35ea8bf3b2682b90ab687c74e4828418ff12298a5b0b0a0c033f61c86a30/rpds_py-2026.9.1-pp311-pypy311_pp80-macosx_11_0_arm64.whl", hash = "sha256:4cfaf02209061880210819934de2f4f6aa83dc04dafe6770276acc240a56da31", size = 351719, upload-time = "2026-10-04T16:32:06.834Z" }, - { url = "https://files.pythonhosted.org/packages/a3/90/a9ba81408369d34c1aca73319c15adc91ed45c1d21e9e8ee4832ffb7fe0b/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6cdc537c8633d7fd92a82e2e0d2ab74320a3f63d5e59fb9cf08711e08fe151c4", size = 381109, upload-time = "2026-10-04T16:32:08.994Z" }, - { url = "https://files.pythonhosted.org/packages/b3/44/5192a0bed94cec86bd2a5e1cc5a1bb8f7eec3aec907eacd2deb13e87e326/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:10e208f2425d973938afcd56e28a7c4be32e27b6a60b5d381f49fb9d8acf9759", size = 388222, upload-time = "2026-10-04T16:32:11.321Z" }, - { url = "https://files.pythonhosted.org/packages/92/cd/5356549711448f18b52f7a11ffbe90f1228774996fbf3c6cd1b18d22abaf/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6c0dbbcc19735fe5f8b0a54c07659d154a9e69f47e15d0a6ab7299215daf62cb", size = 500384, upload-time = "2026-10-04T16:32:13.478Z" }, - { url = "https://files.pythonhosted.org/packages/7a/88/ddda9d28adfe33119c75b2e733d4ba7e326f41d7e1b1093951771768ca48/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:684fd492fff4fead00587544e059be2bbcb6f93454f21fa2a91b66fc7508be82", size = 401661, upload-time = "2026-10-04T16:32:15.653Z" }, - { url = "https://files.pythonhosted.org/packages/32/c3/bb59ba16a6b4a57995d15b8c04c00f28df3b938c4dcdde48fbe0f73edb0c/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1028417bb44037eb3069c1009bd7b7277212876cda22fbe565b0bca9fab6d2c", size = 380748, upload-time = "2026-10-04T16:32:17.727Z" }, - { url = "https://files.pythonhosted.org/packages/f5/b8/0580faa1c5a32ddc160130dd7ae54d2d007272a89a40a6b5db3e50f9f585/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_31_riscv64.whl", hash = "sha256:492e5e428cbe126221611f47e068f01660352feec4ad18bc0f5ea9b2ae88fb14", size = 385731, upload-time = "2026-10-04T16:32:19.855Z" }, - { url = "https://files.pythonhosted.org/packages/bf/70/f73564642bbe3322c7eeef2c2f258cf040b71c41a430b532e59d04a1b838/rpds_py-2026.9.1-pp312-pypy312_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:88b5268892fde430d5531f95bc560b6efbbd67c929662c586afd729a96e7461c", size = 412131, upload-time = "2026-10-04T16:32:22.285Z" }, - { url = "https://files.pythonhosted.org/packages/8c/5d/17fff2e1f8f68721a2afb5cb48f7e442c751bb6b4883157c5abaf618cd08/rpds_py-2026.9.1-pp312-pypy312_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:01445c8d194aa032a08e944f16567672da1c62dbdbefd8b6d0693032e290cf68", size = 558193, upload-time = "2026-10-04T16:32:24.4Z" }, - { url = "https://files.pythonhosted.org/packages/2a/d0/869ab6fb08531f97aae4a780b4d61b4190d8aef48fe054ee28bcf7114466/rpds_py-2026.9.1-pp312-pypy312_pp73-musllinux_1_2_i686.whl", hash = "sha256:eef6a03b0b6d08d0835ccfa8ec8d1bc70525e3801387567137b50c557695e6da", size = 622448, upload-time = "2026-10-04T16:32:26.844Z" }, - { url = "https://files.pythonhosted.org/packages/ba/a5/9672e532fe02cd3b92c78cfd8743abca939d96853006c63835009a1ecb6f/rpds_py-2026.9.1-pp312-pypy312_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:6b9bf3135b4ad5981df9a73d71a35272d650a2985ae9c2746357b24d59de2448", size = 591126, upload-time = "2026-10-04T16:32:29.274Z" }, - { url = "https://files.pythonhosted.org/packages/80/ef/3a9f8e4279c7920af561deed4cb7ebebed2794a8f608cf404d5eef14a105/rpds_py-2026.9.1-pp312-pypy312_pp80-macosx_10_12_x86_64.whl", hash = "sha256:56c6952a9b15047466d0c2347c446a761d4527f89976156341e68f0ce5cc08b0", size = 357108, upload-time = "2026-10-04T16:32:31.641Z" }, - { url = "https://files.pythonhosted.org/packages/b7/55/4b2fa381a583760aea5c92841e4e928a358e1c6511b129219e9c2826a226/rpds_py-2026.9.1-pp312-pypy312_pp80-macosx_11_0_arm64.whl", hash = "sha256:b242c27c8f836305a4a72df9cdd564386ac57b807bd252a063223331c9316b37", size = 346877, upload-time = "2026-10-04T16:32:34.061Z" }, -] - [[package]] name = "ruff" version = "0.17.2" @@ -1389,198 +138,3 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/1c/9a/c7da96c2c96d20704cf9027f7a5121da272a8c05f1d1531ba949e3b3df04/ruff-0.17.2-py3-none-win_amd64.whl", hash = "sha256:1b59d447f197bef9ef48a22ba1a6016137753c6099e9bac9c36eb566e422424c", size = 10282826, upload-time = "2026-10-22T18:37:55.2Z" }, { url = "https://files.pythonhosted.org/packages/81/60/a3604c79cb02777b6cb84da894104021986f06c4bc41375102cc95049a32/ruff-0.17.2-py3-none-win_arm64.whl", hash = "sha256:195ad918027f817c119310ca89a42d347887dfc28934aaa869325e9c5dc9d962", size = 9827036, upload-time = "2026-10-22T18:37:58.031Z" }, ] - -[[package]] -name = "sniffio" -version = "1.3.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc", size = 20372, upload-time = "2024-02-25T23:20:04.057Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235, upload-time = "2024-02-25T23:20:01.196Z" }, -] - -[[package]] -name = "sse-starlette" -version = "3.5.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "anyio" }, - { name = "starlette" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/e4/be/0123026f719d1a7936f214a88b553bb5701e04ff2511147c1dab0c5035eb/sse_starlette-3.5.0.tar.gz", hash = "sha256:75de713aa8a9441513cc283220826da079d982770965b951e9437720e8bafdb2", size = 36794, upload-time = "2026-09-28T17:48:14.7Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/be/e4/cdda14023c316d71493bc54fdffc3dd006631b88866145c9d3cc33e0f1df/sse_starlette-3.5.0-py3-none-any.whl", hash = "sha256:3e6e1070df3f0f5d9cea81496de92dbb72f6721871d99748ece67441dd8b7997", size = 17407, upload-time = "2026-09-28T17:48:13.228Z" }, -] - -[[package]] -name = "starlette" -version = "1.9.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "anyio" }, - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ad/eb/4e197bf26b023abafc5e9043ec8710d7de0fcb032d0969045236d72aa0b1/starlette-1.9.0.tar.gz", hash = "sha256:3d931de246ed870e35ce605974440816ef895e592f255d1396cfdf191d4c4318", size = 2732466, upload-time = "2026-10-18T15:50:33.189Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f3/93/181df62699d9b5aca1d87e5cfda131dac87e3cdaebf668662f7206ca3470/starlette-1.9.0-py3-none-any.whl", hash = "sha256:fd3f159936e882d06c1108f84688f7cda2cf85fc6a592a50edbd175e882c2ddc", size = 80335, upload-time = "2026-10-18T15:50:31.526Z" }, -] - -[[package]] -name = "tenacity" -version = "9.1.4" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/47/c6/ee486fd809e357697ee8a44d3d69222b344920433d3b6666ccd9b374630c/tenacity-9.1.4.tar.gz", hash = "sha256:adb31d4c263f2bd041081ab33b498309a57c77f9acf2db65aadf0898179cf93a", size = 49413, upload-time = "2026-02-07T10:45:33.841Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d7/c1/eb8f9debc45d3b7918a32ab756658a0904732f75e555402972246b0b8e71/tenacity-9.1.4-py3-none-any.whl", hash = "sha256:6095a360c919085f28c6527de529e76a06ad89b23659fa881ae0649b867a9d55", size = 28926, upload-time = "2026-02-07T10:45:32.24Z" }, -] - -[[package]] -name = "truststore" -version = "0.10.5" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ee/9f/c5201d42a484c061e528825fc8e2d565f5abd50a4ced6fb7d29c4ec99b2b/truststore-0.10.5.tar.gz", hash = "sha256:30d36967ccaded5cbb38d602c433f53600036c79d502f4533a49b60a03bbefcd", size = 28091, upload-time = "2026-10-12T22:27:31.808Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/51/e9/3a7820be2bb0fe53b6bc9c3be26d3d1158004e4c3ab953aa6840b955b1e9/truststore-0.10.5-py3-none-any.whl", hash = "sha256:9aaaedaefaf06d8b206278cf8b5012bc897f485a874503501e12d776df78951c", size = 19017, upload-time = "2026-10-12T22:27:30.377Z" }, -] - -[[package]] -name = "typing-extensions" -version = "4.16.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" }, -] - -[[package]] -name = "typing-inspection" -version = "0.4.4" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "typing-extensions" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/a3/26/b09b8010994eccc3c09092e6b34058f36a460eea2d4c3e8b910c695975a0/typing_inspection-0.4.4.tar.gz", hash = "sha256:547274fa6b0a561ccf549cc9524b999a578e737d015d8709d021f9d0d13bea47", size = 76928, upload-time = "2026-08-12T12:37:25.997Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/67/81/4add07e5172b7ac40d8ed5ff580409a7801a4fe26d529bdd915401dabfbe/typing_inspection-0.4.4-py3-none-any.whl", hash = "sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147", size = 14750, upload-time = "2026-08-12T12:37:24.648Z" }, -] - -[[package]] -name = "urllib3" -version = "2.8.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/e3/05/b17359e1cefb4f909b5e40b1b90a496d987258916dbbf88e842c729f510e/urllib3-2.8.0.tar.gz", hash = "sha256:63bf2ead4c879426ebf22ef2a781eeb4aa3b4ae798a0435506f8687fd5bb9b63", size = 458972, upload-time = "2026-09-15T19:29:36.253Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/92/9d/c4e665119135114480843e7ab388fa94d8480650450e6f8e26b70d323a4c/urllib3-2.8.0-py3-none-any.whl", hash = "sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3", size = 135717, upload-time = "2026-09-15T19:29:34.577Z" }, -] - -[[package]] -name = "uvicorn" -version = "0.54.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "click" }, - { name = "h11" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/da/34/30e9280707135d2cfc589dfff3cb796bd07a3aeb1a3e415ba09dd89d7bb4/uvicorn-0.54.0.tar.gz", hash = "sha256:a2e33cbfaa0306f8e6b0c13e0cb89d7d7a2da3e62b90c66e18c33d9807b28620", size = 112283, upload-time = "2026-09-25T06:52:37.601Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/38/0c/b54a4fdd7f90a3af8b02ebc9ce6712c2c208b7926a2f7bad95c33ebbe943/uvicorn-0.54.0-py3-none-any.whl", hash = "sha256:505bdb0f318731d45f1f712071fc781a8981f6847a31c902c9f5e652d4f67faf", size = 87427, upload-time = "2026-09-25T06:52:35.829Z" }, -] - -[[package]] -name = "websockets" -version = "16.1.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/21/f7/bc3a25c5ec26ce62ce487690becc2f3710bbc7b33338f005ad390db0b986/websockets-16.1.1.tar.gz", hash = "sha256:db234eda965dcce15df96bb9709f587cd87d4d52aaf0e80e2f34ec04c7670c57", size = 182204, upload-time = "2026-07-17T22:51:05.858Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2b/03/47debfe28e9d6d354be5d777b67fd44c359b9eb299a5d103500bd7cc3e37/websockets-16.1.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:d0fcf657e9f13ff4b177960ab2200237b12994232dfb6df16f1cfe1d4339f93c", size = 179566, upload-time = "2026-07-17T22:48:49.596Z" }, - { url = "https://files.pythonhosted.org/packages/72/93/31efa1ed78c17e5cfc229fd449e3966e1b9cc15753204cd585cc8dd01f4a/websockets-16.1.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b852788aa51764e2d8e4cf5493d559326bcae5e38d16ba25ffa322b034df272a", size = 177250, upload-time = "2026-07-17T22:48:50.942Z" }, - { url = "https://files.pythonhosted.org/packages/01/4a/542378ab3972b0c1cf1df3df3eff9591cea0d30c58c3aa3c4ddbc244e787/websockets-16.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1427fb4cf0d72f66333e2cacc3ff5f575bf2d7008166ce991a4a470b21d51a22", size = 177528, upload-time = "2026-07-17T22:48:52.59Z" }, - { url = "https://files.pythonhosted.org/packages/33/d9/162321f63c7eed558e9e1798ed7a1e34a4f6dab51f35419e4ed7a4907979/websockets-16.1.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:da4ca1a9d72f9030b3146b8d7022719a9f3d478f61efe6f7dd51d243f61c51b2", size = 186859, upload-time = "2026-07-17T22:48:53.915Z" }, - { url = "https://files.pythonhosted.org/packages/de/09/87df740f7430ce564bd52402e9c9458d4d0459cc7d2ee29e530c8204851b/websockets-16.1.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:86d7f0f8bdb25d2c632b72527325e4776430fd5bc61b9118de4e2b8ddb5f5b01", size = 188095, upload-time = "2026-07-17T22:48:55.384Z" }, - { url = "https://files.pythonhosted.org/packages/d2/12/3d2703af7cc095f3c81904c92208cc1ae79affbc67376944b50ee9301f73/websockets-16.1.1-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:7dfcad78ea1492ee3a9ec765cb7f51bbc17d477107aaf6b22abf7b2558d1c5a0", size = 191385, upload-time = "2026-07-17T22:48:56.742Z" }, - { url = "https://files.pythonhosted.org/packages/1d/69/986aa0234a964a00f5149cfc46e136e96c8faad1c783474550f40d31aef4/websockets-16.1.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:fb9a0a6dc3d1b3986cb88091b6899f0396651e0f74e2c9766ab8d6ffc3842e29", size = 188653, upload-time = "2026-07-17T22:48:58.134Z" }, - { url = "https://files.pythonhosted.org/packages/35/6b/10f9d03e3970a69ba67bd3b46b87a929b586d0300fadbfe14f57c1f85490/websockets-16.1.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:29dfa8114c4a620c69591c5973860f768eac29d3fd6904f37f34266cb219c512", size = 187426, upload-time = "2026-07-17T22:48:59.515Z" }, - { url = "https://files.pythonhosted.org/packages/56/db/bb3aad62bf63d8bb3f0634b2eabffcfb3677a34bd19492110ff6869cf703/websockets-16.1.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6ff9417c0ada4d0f7d212f928303e5579bdf3ace4c802fa4afabb30995da58c3", size = 184882, upload-time = "2026-07-17T22:49:00.916Z" }, - { url = "https://files.pythonhosted.org/packages/6c/4c/c09a2ea9bfbeccce52fdc383e5f28af4bc8843338aabac28c81489af6120/websockets-16.1.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8fe0b50da2d84535fb4f7b4bfa951280f97ce3d558a0443b541166d609e67b57", size = 187584, upload-time = "2026-07-17T22:49:02.283Z" }, - { url = "https://files.pythonhosted.org/packages/c7/8b/31bb4eb4d9eaacf1fdd39d115772a8aeaedfc19b5dc262e57ffbc8a9d42c/websockets-16.1.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:34420aaa64440ebd51ac72ca8a45ef4626429438c9b02e633ae412ed43f925d3", size = 186174, upload-time = "2026-07-17T22:49:03.973Z" }, - { url = "https://files.pythonhosted.org/packages/2f/e4/dc02d725610a1ad49e193ef91a548194d71bdc6cdf27da83067dd1f73995/websockets-16.1.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:a6a61aff018180c9c50b7b0da33bfd29d378af3497429c95006c589a23a11648", size = 187986, upload-time = "2026-07-17T22:49:05.553Z" }, - { url = "https://files.pythonhosted.org/packages/e0/73/30ed84c8bfd14c73d4af29d5ed9323c3073b48e0b7b23b67070f4e7fd59b/websockets-16.1.1-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:04fd29a0e2fe9414a95b00e92c67ae51bf900c50c0f8a4b2dafdad621f49ea1d", size = 185565, upload-time = "2026-07-17T22:49:06.959Z" }, - { url = "https://files.pythonhosted.org/packages/7d/d3/4be8d4959f51e31b4f8fc0ece12b45bd3b6c0d15ea23b9990d9c11fc805f/websockets-16.1.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:5c31aa7e39ee3e8a358573257f1c0bb5c52430d1b637030dd9c8cc2c282926be", size = 186598, upload-time = "2026-07-17T22:49:08.293Z" }, - { url = "https://files.pythonhosted.org/packages/26/fa/abb38597a52d84ed9cfacadc7a0c6f2db282c0ab23cdf72b58a666a21227/websockets-16.1.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:d14bfb217eb4701e850f1525c9d29d79c44794cdf1c299ead25f39f8c78dea81", size = 186834, upload-time = "2026-07-17T22:49:09.766Z" }, - { url = "https://files.pythonhosted.org/packages/59/80/1119ad08a228b90c4eb77fbe48df7836731a605f5f881ba701ca826a4a65/websockets-16.1.1-cp311-cp311-win32.whl", hash = "sha256:2e28e602bb13da44fbe518c1781a88e3b9d4c3d48d02c9bad83e546164336f57", size = 179940, upload-time = "2026-07-17T22:49:11.196Z" }, - { url = "https://files.pythonhosted.org/packages/71/b2/e511c1c6f64a95c2f3fc54bffda0e14eaa7e9442be605c29270f7589b918/websockets-16.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:7421fad442de870a8cbf2287d1cad7e706ece0dbfeba5e911df132cbdc1cb56a", size = 180239, upload-time = "2026-07-17T22:49:12.519Z" }, - { url = "https://files.pythonhosted.org/packages/17/9d/681cda21c9eee743203a6cb79b9d3d05adad9aa60ec660c6c9bf4dd619ca/websockets-16.1.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:cc97814dfb786a83b6e2dc2e79351e1b83e6d715647d6887fcabd83026417a00", size = 179600, upload-time = "2026-07-17T22:49:13.92Z" }, - { url = "https://files.pythonhosted.org/packages/fb/8d/6195a88b45e8d2a8f745fc2046e36f885a3c9763e6767d2c46229bf9510c/websockets-16.1.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:e047dc87ef7ca50f4d309bf775ad4a71711c58556d75d7bd0604b2317f43e94b", size = 177272, upload-time = "2026-07-17T22:49:15.453Z" }, - { url = "https://files.pythonhosted.org/packages/73/e3/fe2d498c64dea0095c9a9f9a351af4cd6eef31b618395582bc1f38ba45ff/websockets-16.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:01fbdcbac298efe19360b94bc0039c8f746f0220ba570f327577bfee81059175", size = 177542, upload-time = "2026-07-17T22:49:16.875Z" }, - { url = "https://files.pythonhosted.org/packages/fe/ed/f1831681fce0e3242346e5458486003c5f124ed69e5e0b847fd029db4973/websockets-16.1.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:0f62863e8a00a6d33c3d6566ec0b89f23787b747ffe0c3bc71ec0e76b82c94b1", size = 187137, upload-time = "2026-07-17T22:49:18.323Z" }, - { url = "https://files.pythonhosted.org/packages/6f/79/4ff9dcc1bb46f6b4c536936dde1fd60f9b564f3304307274db97f4c9496d/websockets-16.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8087e82f842609734c9b5a1330464f8e94e346ba0e18c832c08bafa4b0d63c15", size = 188374, upload-time = "2026-07-17T22:49:19.65Z" }, - { url = "https://files.pythonhosted.org/packages/62/c3/5c49b6efb36cab733d23773f6de575e1dba65736ead17d5d2b2a1daef779/websockets-16.1.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2bb5d041a8307d2e18782e7ce777f6fdb1e8c2f5d09291484b18c294b789d9aa", size = 191155, upload-time = "2026-07-17T22:49:21.331Z" }, - { url = "https://files.pythonhosted.org/packages/6e/f6/56ccceda3a4838d18f1d40821480da4775397e8b1eecf4031e20c50e2e90/websockets-16.1.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1db4de4a0e95673f7545d393c49eeb0c2f18ac1ef93073218c79d5cdb2ee75ab", size = 189011, upload-time = "2026-07-17T22:49:22.889Z" }, - { url = "https://files.pythonhosted.org/packages/86/d6/ad5286241a2bce1107e2798d3bfbd62cf79aee167bdb654f8cb1e9dbf949/websockets-16.1.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f17dbe07eb3ea7f99e4df9b7e0efefe80fbf30d37a8cc4d561a0aed310bc8847", size = 187766, upload-time = "2026-07-17T22:49:24.339Z" }, - { url = "https://files.pythonhosted.org/packages/bc/67/d65c970b7e347fdca69479beb7811c2060529956730a7a4e3ae7c66b0e31/websockets-16.1.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4b57693728576d84ede0a77987ab16881b783d2cd9f1dc180a8fbbc3f79c4428", size = 185173, upload-time = "2026-07-17T22:49:25.743Z" }, - { url = "https://files.pythonhosted.org/packages/1d/5b/14af3cd4ee69d8ea9baca58f3dc3cfb1ba78332a347fd478cb096549d60e/websockets-16.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2a636ff1e7a5c4edf71ef0e79adae7f25dba93b4fcbe3dc958733477ffeb0eaf", size = 187809, upload-time = "2026-07-17T22:49:27.147Z" }, - { url = "https://files.pythonhosted.org/packages/7b/11/be301710d70de97e3e7b3586e6d492c9c06d6a61bf1c2202c36cf0c75607/websockets-16.1.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:d6bec75c290fe484a8ba4cacdf838501e17c06ecfbbf31eede81a9e431bd7751", size = 186412, upload-time = "2026-07-17T22:49:28.611Z" }, - { url = "https://files.pythonhosted.org/packages/db/07/fe1435bf6fe738a3d3b54dbe0c18dabf12cba4d909ac8b58b539ce27c1f4/websockets-16.1.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:54509b8e92fee4453e152b7558ddef37ce9705a044922f2095a6105e3f80c96f", size = 188290, upload-time = "2026-07-17T22:49:29.965Z" }, - { url = "https://files.pythonhosted.org/packages/8a/0a/81f394aff8efcbb01208c1ced77df0a3c7fcce584a88c7273663697946c2/websockets-16.1.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:f0aa4aad3b1b69ad3fd85a0fd0952ec64331c762bd77ec51cc814170873890b2", size = 185844, upload-time = "2026-07-17T22:49:31.447Z" }, - { url = "https://files.pythonhosted.org/packages/39/5c/dd485b995473f415510251fe9bd708f2d24458f439fce958daf8d66dc7c6/websockets-16.1.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:42290eb6db4ccaca7012656738214f8514082fb6fa40cdeb61bb9a471b52e383", size = 186823, upload-time = "2026-07-17T22:49:33.104Z" }, - { url = "https://files.pythonhosted.org/packages/9d/0b/f78de76ff446f1e66af12b43c48a35f31744de93cfdec2f4ea67d5d7bbf1/websockets-16.1.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:53260c8930da5771cec89439bff99c20c8cb03ddb9588b980697355a83cd4bd3", size = 187102, upload-time = "2026-07-17T22:49:34.616Z" }, - { url = "https://files.pythonhosted.org/packages/37/a1/4cf892007778eaf84ad162bfc98046e0ed89b63ac55949e3236626b2a23f/websockets-16.1.1-cp312-cp312-win32.whl", hash = "sha256:1d27fa8462ad6a1cb36206a3d0640b2333340def181fae11ed7f9adeaa5c0747", size = 179943, upload-time = "2026-07-17T22:49:36.213Z" }, - { url = "https://files.pythonhosted.org/packages/d9/de/6abe251d28c3a3f217096575400b27750b18e0b1d2fff3a2a239960fea07/websockets-16.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:b436f6ec4fc3a6b4237c84d3f83170ed2b40bb584222f0ac47a0c8a5921980c7", size = 180243, upload-time = "2026-07-17T22:49:37.626Z" }, - { url = "https://files.pythonhosted.org/packages/ce/fd/6ec6c6d2850aea25b1b2aa9901a016980bb87d01e89b3eb00470b1b5d471/websockets-16.1.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ab59169ace05dcb49a1d4118f0bde139557adf45091bd85747e36bf5de984dd1", size = 179587, upload-time = "2026-07-17T22:49:38.959Z" }, - { url = "https://files.pythonhosted.org/packages/5f/d8/1d299d2dd34087db39831a34cc645ef8a6f89d78efada6983093513cd81c/websockets-16.1.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5e3b7d601f6f84156b08cc4a5e541c2b50ad7b36cfc302b657a12477c904a5df", size = 177272, upload-time = "2026-07-17T22:49:40.293Z" }, - { url = "https://files.pythonhosted.org/packages/3d/86/0a70d3ae2f0f2256bb41302d9804dbca65d4360281e7feb3e1f94102ac46/websockets-16.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cd2ca96a082a36964aca83e992f72abeb61b7306c1a6cba4c7d06a7b93750cac", size = 177530, upload-time = "2026-07-17T22:49:41.786Z" }, - { url = "https://files.pythonhosted.org/packages/b5/c2/c676c69444d9db448b3f0a55a98dcc534affce0bce961d9d2f0b8499b10a/websockets-16.1.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f5d497865f05bb222cab7016c6034542e84e5f29f49c6fd3f4939cda7197b5b8", size = 187197, upload-time = "2026-07-17T22:49:43.658Z" }, - { url = "https://files.pythonhosted.org/packages/0b/13/88137fbaf726ebe29d62c1117fa11fa2bbb6209dc79d4ad738efbe36a2aa/websockets-16.1.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bae954c382e013d5ea5b190d2830526bfa45ad121c326da0049b8c769f185db6", size = 188433, upload-time = "2026-07-17T22:49:45.147Z" }, - { url = "https://files.pythonhosted.org/packages/01/6d/46c2f2ce6751cb26f39293e1ecbf8544cb01321397cd476c2756b98c216d/websockets-16.1.1-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e09f753a169951eb4f28c2c774f71069304f66e7277e0f5a2892423599cfa854", size = 189868, upload-time = "2026-07-17T22:49:46.581Z" }, - { url = "https://files.pythonhosted.org/packages/29/2b/170a9e8097636cfde4dc3c592b6e00b18a44a2f5407606d96ca542dd5838/websockets-16.1.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:024193f8551a2b0eafbdd160911012c4e6c228c28430c84433253299a9e42d6a", size = 189059, upload-time = "2026-07-17T22:49:47.972Z" }, - { url = "https://files.pythonhosted.org/packages/a7/48/f0d4ebc9ab4b473b8861b9e20fdb663d515d42f7befdf62cdb60fee7a1ec/websockets-16.1.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:aabe464bfd13bd25f4821faf111da6fefdc389f870265a53105580e45b0a2e49", size = 187814, upload-time = "2026-07-17T22:49:49.344Z" }, - { url = "https://files.pythonhosted.org/packages/d5/ba/39a41d3ae8e72696a9492581900611c5a91e2b07563b0bcd2523adea9854/websockets-16.1.1-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a28fcbc9b6baf54a2e23f8655f308e4ccc6afdd7266f8fe7954f320dcda0f785", size = 185229, upload-time = "2026-07-17T22:49:50.787Z" }, - { url = "https://files.pythonhosted.org/packages/3c/36/ac15b604f850d1907f0a85ed721cefe47cd45034b3620069b829746cccbe/websockets-16.1.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:79eace538c6a97e96d0d03d4f9d314f9677f5ed85a8a984992ffd90b13cb8a56", size = 187874, upload-time = "2026-07-17T22:49:52.228Z" }, - { url = "https://files.pythonhosted.org/packages/a8/f3/3fbd5d71d59299c3770faa5884d4f45070236ca5a35ab3a61830812c409a/websockets-16.1.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:496af849a472b531f758dbd4d61338f5000538cb1a7b3d20d9d32a264517f509", size = 186469, upload-time = "2026-07-17T22:49:53.776Z" }, - { url = "https://files.pythonhosted.org/packages/b4/fc/dd90349bba58af2a53ef2ddd9c32716c81eb6d59a0687939fff561860878/websockets-16.1.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:5283810d2646741a0d8da2aa733d6aefa0545809afccb2a5d105a26bc45125f1", size = 188347, upload-time = "2026-07-17T22:49:55.202Z" }, - { url = "https://files.pythonhosted.org/packages/4c/f3/f73ba86427682da59b78c11d77ba56d5b801c32e84afe79b274bbd6a9bb2/websockets-16.1.1-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:4e3b680b1e0a27457e727a0d572fd81dffa87b6dbf8b228ab57da64f7d85aead", size = 185903, upload-time = "2026-07-17T22:49:56.75Z" }, - { url = "https://files.pythonhosted.org/packages/34/7c/f95eb20e80104173b3a0a092291f89ea4047ef6e608e0a57ca06eb14eecb/websockets-16.1.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:69159730a823dde3ea8d08783e8d47ef135a6d7e8d44eb127e32b321c9db8e3e", size = 186855, upload-time = "2026-07-17T22:49:58.467Z" }, - { url = "https://files.pythonhosted.org/packages/b0/35/dd875b3e050ff232d60fa377707f890e369f74d134f1be32e8f68879747c/websockets-16.1.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ed5bb271084b46530ee2ddc0410537a9961152c5ccba2fc98c5276d992ccba87", size = 187140, upload-time = "2026-07-17T22:50:00.016Z" }, - { url = "https://files.pythonhosted.org/packages/e8/dc/5cbfcb41824502f6af93b8f3943a4d06c67c23c7d2e31eb18748c4a5b2a7/websockets-16.1.1-cp313-cp313-win32.whl", hash = "sha256:cfb70b4eb56cac4da0a83588f3ad50d46beb0690391082f3d4e2d488c70b68ea", size = 179928, upload-time = "2026-07-17T22:50:01.685Z" }, - { url = "https://files.pythonhosted.org/packages/b0/c1/71e5deb5b7f8f226997ab64908c184ac3105c0155ce2d486f318e5dd08a8/websockets-16.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:d9531d9cbeac99af6f038fb1bc351403531f7d634a2c2e10e2f7c854c6ed5b68", size = 180242, upload-time = "2026-07-17T22:50:03.117Z" }, - { url = "https://files.pythonhosted.org/packages/73/a2/ba78a164eeea4620df4a4df4bd2ed6017438c4655cc0f36f2c0bc0432355/websockets-16.1.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:443aefe96b7fdb132e2a70806cca1f2af49bb3f28e47abcd7c2e9dcf4d8fa1b8", size = 179635, upload-time = "2026-07-17T22:50:05.001Z" }, - { url = "https://files.pythonhosted.org/packages/b9/08/d26d7a7628cd4ac34cbbdb63ac80914ca842ed8e42938c40a53567806df3/websockets-16.1.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:6456ff333092d509127d75a638cb411afae8ff17f092635015d1902efec8a293", size = 177320, upload-time = "2026-07-17T22:50:06.427Z" }, - { url = "https://files.pythonhosted.org/packages/0f/45/ebec83e6269536aa5932533c67b0af5c781f3e73fdbcd68672dcf43f4f44/websockets-16.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:fce6c48559c86d1ac3632ccb1bebc7d5442fbe79bd9bb0e40379ee54be2a4051", size = 177544, upload-time = "2026-07-17T22:50:07.834Z" }, - { url = "https://files.pythonhosted.org/packages/c9/d5/abc614d2297f6c1c3e01e61260364457a47c25cc1cf6a879038902bc6aa8/websockets-16.1.1-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:92b820d345f7a3fc7b8163949ee92df910f290c3fc517b3d5301c78065adafe1", size = 187270, upload-time = "2026-07-17T22:50:09.275Z" }, - { url = "https://files.pythonhosted.org/packages/52/71/4c99af3b87dff1b2927981f6876607d4acb45338c665242168d3982f7758/websockets-16.1.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2a606d9c24035242a3e256e9d5b77ed9cd6bccfcb7cf993e5ca3c0f6f68fb6a7", size = 188509, upload-time = "2026-07-17T22:50:10.722Z" }, - { url = "https://files.pythonhosted.org/packages/9b/b4/5c8ca14b0df7eb84ed0524165c5359150210140817a3312aee57bf62a1cf/websockets-16.1.1-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:414e596c75f74e0994084694189d7dc9229fb278e33064d6784b73ffbba3ca31", size = 189882, upload-time = "2026-07-17T22:50:12.293Z" }, - { url = "https://files.pythonhosted.org/packages/25/c1/bedfba9e70557129cb8083748d167bdcc01483dedf0f0df143676df05cbe/websockets-16.1.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:536676848fc5961aca9d20389951f59169508f765637a172403dc5434d722fa0", size = 189114, upload-time = "2026-07-17T22:50:13.789Z" }, - { url = "https://files.pythonhosted.org/packages/df/09/aa835b2787835aebd839114be5de51b797cb480b63ba42b26d34dfe147cb/websockets-16.1.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:97fd3a0e8b53efa41970ac1dff3d8cf0d2884cadeb4caaf95db7ad1526926ee3", size = 187861, upload-time = "2026-07-17T22:50:15.179Z" }, - { url = "https://files.pythonhosted.org/packages/20/26/f6408330694dbc9830857d9d23bc14ac4f6875127a480cfdda8d5ca21198/websockets-16.1.1-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7b1b19636af86a3c7995d4d028dbe376f39b4bf31541146f9c123582a6c94562", size = 185286, upload-time = "2026-07-17T22:50:16.741Z" }, - { url = "https://files.pythonhosted.org/packages/17/9a/e0675e70dd8a80762cf35bb18799d3f290a4890ffe6439bc51d222796083/websockets-16.1.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:41c8e77f17294c0ac18008a7309b99b34ee72247ef10b6dff4c3f8b5ac29896b", size = 187935, upload-time = "2026-07-17T22:50:18.213Z" }, - { url = "https://files.pythonhosted.org/packages/33/c1/3234cfb86afde01b81e9bddcc6e534c440975d60a13991259e833069ab3e/websockets-16.1.1-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:9f63bcef7f4b02b06b35fc01c93b96c43b5e88e1e8868676caacf493d5a31f3a", size = 186444, upload-time = "2026-07-17T22:50:19.67Z" }, - { url = "https://files.pythonhosted.org/packages/89/87/9c15206e1d778923d8daa9657de07aa62ea815e13448319c98458c37b281/websockets-16.1.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:dab9eb87869da2d6ed3af3f3adf28414baae6ec9d4df355ffc18889132f3436c", size = 188409, upload-time = "2026-07-17T22:50:21.28Z" }, - { url = "https://files.pythonhosted.org/packages/f2/00/cf5de5c67676de2d3eef8b2a518f168f6796595447a5b7161ba0d012915c/websockets-16.1.1-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:43e3a9fdd7cbf7ba6040c31fae0faf84ca1474fef777c4e37912f1540f854499", size = 185958, upload-time = "2026-07-17T22:50:22.719Z" }, - { url = "https://files.pythonhosted.org/packages/62/c0/731b6ddede2e4136912ec4cff2cffbda35af73546be4762c3d7bd3bd79af/websockets-16.1.1-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:056ae37939ed7e9974f364f5864e76e49182622d8f9751ac1903c0d09b013985", size = 186911, upload-time = "2026-07-17T22:50:24.108Z" }, - { url = "https://files.pythonhosted.org/packages/8c/7f/39c634472c4469a24a7c09cecddffb08fac6d0e74f73881a94ee8a40a196/websockets-16.1.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a0eadbbf2c30f01efa58e1f110eb6fa293261f6b0b1aa38f7f48707107690af9", size = 187204, upload-time = "2026-07-17T22:50:25.548Z" }, - { url = "https://files.pythonhosted.org/packages/26/89/9667c256c256dafcc62d21328ce7a40067da857969b68ee9af375b0aaf72/websockets-16.1.1-cp314-cp314-win32.whl", hash = "sha256:195c978b065fa40910582464f99d6b15c8b314c68e0546549a55ed83f4735328", size = 179603, upload-time = "2026-07-17T22:50:27.086Z" }, - { url = "https://files.pythonhosted.org/packages/bd/dd/1c099d6c0fc5deb6b46ccdbb6981fdb4b12c917869cb3952408409dc18db/websockets-16.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:4e8d01cc3bcae7bbf8167f944aeafefed590fae5693552bba9794a9df68371cc", size = 179948, upload-time = "2026-07-17T22:50:28.521Z" }, - { url = "https://files.pythonhosted.org/packages/35/25/9956b2d5e0529d5d23924f21bba1440d4c5c88a562e4f08550871ffa97a7/websockets-16.1.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:0ffd3031ea8bda8d61762e84220186105ba3b748b3c8da2ae4f7816fac03e573", size = 179963, upload-time = "2026-07-17T22:50:29.982Z" }, - { url = "https://files.pythonhosted.org/packages/17/06/55ffc976c488b6aee9ea05761ff7c4e88e7c1fd82818c8ca7b556ad2f90c/websockets-16.1.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:84a2cef8deffbd9ab8ee0ea546a2a6a7030c28f44e6cdd4547dbfeb489eb8999", size = 177497, upload-time = "2026-07-17T22:50:31.396Z" }, - { url = "https://files.pythonhosted.org/packages/0c/e8/f7dac2e980bacc92bdc26cebae4ae4d50cae5380732c50980598fc0bbae4/websockets-16.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:3df13f73af9b3b38ab1195eb299ecb67a4330c911c97ae04043ff74085728abe", size = 177698, upload-time = "2026-07-17T22:50:32.829Z" }, - { url = "https://files.pythonhosted.org/packages/b2/39/26762f734113e22da2b942c3aca85798e0c0405d64c256549540ff31e5a1/websockets-16.1.1-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:23253dd5bcae3f9aaee0a1d30967a8dbd52e5d3cff93a2e5b84df57b77d4750d", size = 187561, upload-time = "2026-07-17T22:50:34.24Z" }, - { url = "https://files.pythonhosted.org/packages/11/94/c3f330851806b9b02138b774d593478323e73c99238681b4b93efe64e02d/websockets-16.1.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9c1c5705e314449e3308872fe084b8571ce078ee4fc55a98a769bdefe5917392", size = 188732, upload-time = "2026-07-17T22:50:36.088Z" }, - { url = "https://files.pythonhosted.org/packages/d1/f2/eb2c450f052de334ae33cf200ece6e87b0e14d186807074e4eb1cd2cdea2/websockets-16.1.1-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:69e52d175a0a7d1e13b4b67ad41c560b7d98e8c6f6126eb0bda496c784faf8c7", size = 190872, upload-time = "2026-07-17T22:50:38.008Z" }, - { url = "https://files.pythonhosted.org/packages/70/31/2ac8cecf3a74f7fed9132129fc3d90b3998a1554570c11a69b2a8c20332d/websockets-16.1.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1f79c89b5eb034d1722938a891916582f8f7f503f58ca22518a63c3f2cd18499", size = 189305, upload-time = "2026-07-17T22:50:39.53Z" }, - { url = "https://files.pythonhosted.org/packages/6a/cf/8ab19650d3c0d4562c92e70ab47c257c4aa5c6a713ed87fe63766b31fefc/websockets-16.1.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:39f2a024af5c345ffe8fcf1ee18c049c024c94df393bb09b044a6917c77bde43", size = 188033, upload-time = "2026-07-17T22:50:40.912Z" }, - { url = "https://files.pythonhosted.org/packages/66/d7/a49a38a6127a4acb134fb1912b215d900cc657605cff32445bf519f3acc4/websockets-16.1.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:952303a7318d4cbe1011400839bb2051c9f84fa0a35923267f5daba34b15d458", size = 185748, upload-time = "2026-07-17T22:50:42.559Z" }, - { url = "https://files.pythonhosted.org/packages/95/3e/ad1fa40388c7f2e0bb2c7930d0090b6c5498594bd1cdaec18864df3d9e97/websockets-16.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:249116b4a76063d930a46391ad56e135c286e4562a18309029fc2c73f4ed4c62", size = 188285, upload-time = "2026-07-17T22:50:43.974Z" }, - { url = "https://files.pythonhosted.org/packages/35/b8/d5db28ca264b9104f82196f92dc8843e35fd391f763d42e4ad358f5bc97e/websockets-16.1.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:61922544a0587a13fd3f53e4c0e5e606510c7b0d9d22c8444e5fae22a06b38cb", size = 186777, upload-time = "2026-07-17T22:50:45.474Z" }, - { url = "https://files.pythonhosted.org/packages/42/9c/726cb39d0cc43ae848dce4aa2acb04eecc6738b1264ec6d700bf6bcfb9f8/websockets-16.1.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:46dcaa042cd1de6c59e7d9269fa63ff7572b6df40510600b678f0826b3c7af51", size = 188682, upload-time = "2026-07-17T22:50:46.973Z" }, - { url = "https://files.pythonhosted.org/packages/be/c7/1168704de8c2dd483edabe4a22cbe4465dd8be8dd95561d214f9fe092871/websockets-16.1.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:38565aca3e01ea8734e578fb2118dade0ecb0250533f29e22b8d1a7a196cf4d0", size = 186377, upload-time = "2026-07-17T22:50:48.413Z" }, - { url = "https://files.pythonhosted.org/packages/ca/40/f9ff2d630ffce4e7dfea0b2288e1caf9ebbf9ff8a9ec9396136ce8b94935/websockets-16.1.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:42f599f4d48c7e1a3338fdaac3acd075be3b3cf02d4b274f3bf2767aedd3d217", size = 187148, upload-time = "2026-07-17T22:50:49.845Z" }, - { url = "https://files.pythonhosted.org/packages/b5/71/e177c8299f78d7cbe2d14df228643c10c70c0e86e108e092056bbcc16e46/websockets-16.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:dcc04fedf83effaeb9cce98abc9469bb1b42ef85f03e01c8c1f4438ef7555737", size = 187578, upload-time = "2026-07-17T22:50:51.619Z" }, - { url = "https://files.pythonhosted.org/packages/49/b2/b6987faf330f5af5c787a2610124c2e8403d51724f9001ec4fff6311fe7a/websockets-16.1.1-cp314-cp314t-win32.whl", hash = "sha256:8483c2096363120eea8b07c06ae7304d520f686665fffd4811fad423930a65d7", size = 179729, upload-time = "2026-07-17T22:50:53.269Z" }, - { url = "https://files.pythonhosted.org/packages/a2/6e/fbac6ed878dd362fbad7d415fa4f84d38e3e33fed8cde45c64e783acf826/websockets-16.1.1-cp314-cp314t-win_amd64.whl", hash = "sha256:bcce07e23e5769375158f5efdcdafa8d5cd014b93c6683865b840ed65b96f231", size = 180072, upload-time = "2026-07-17T22:50:54.969Z" }, - { url = "https://files.pythonhosted.org/packages/e1/ed/71fea6e141590cafc40b14dc5943b0845606bee87bdb52a21b6a73eb4311/websockets-16.1.1-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:820fb8450edddae3812fd58cbc08e2bf22812cb248ecb5f06dbb82119a56e869", size = 177185, upload-time = "2026-07-17T22:50:56.665Z" }, - { url = "https://files.pythonhosted.org/packages/01/ec/00e7eeca200facf9266a83e4cbbf1bed0e67fba1d4d45031d3e5b3d81b5c/websockets-16.1.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:125f22dbefaf1554fea66fc83851490edb284ce4f501d37ffed2752f418332d9", size = 177459, upload-time = "2026-07-17T22:50:58.197Z" }, - { url = "https://files.pythonhosted.org/packages/75/fd/5774c4b33f7c0d8f0c51809c8b3a93456c48e3543579262cfa64eb5f522e/websockets-16.1.1-pp311-pypy311_pp73-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:30bbe120437b5648a77d3519b7024ea09530e0b5b18d3698c5a0ae536fe0cc2e", size = 178294, upload-time = "2026-07-17T22:50:59.641Z" }, - { url = "https://files.pythonhosted.org/packages/37/c3/48e2c03d2bd79bb45948841c592d24156312dd5f58cdf8f549febe652fb6/websockets-16.1.1-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b6b9dadbef0cccd9f4c4ee96b08898afa73e26803bbe0f6aeb5bb12b0074206d", size = 179190, upload-time = "2026-07-17T22:51:01.129Z" }, - { url = "https://files.pythonhosted.org/packages/2d/3f/73e511ecf2496ceac57dd4ed8388efe2bcf0769338a2dbf242c8366ae87e/websockets-16.1.1-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:56cd5fc4f10a9ea8aa0804bddb7b42506cf9e136046f3b4c27de8fec9e2ecba5", size = 180330, upload-time = "2026-07-17T22:51:02.603Z" }, - { url = "https://files.pythonhosted.org/packages/be/4d/2d0d67834092e354d2b0498f014a41249a89556bc406cf86f3e1557bb463/websockets-16.1.1-py3-none-any.whl", hash = "sha256:6abbd3e82c731c8e531714466acd5d87b5e88ac3243465337ba71d68e23ae7e3", size = 173814, upload-time = "2026-07-17T22:51:04.184Z" }, -]